Jump to content

[Version 1] Better Cmd.exe Run Command In Windows For Ducky


Recommended Posts

instead of Win+R and running "Cmd"

you should run

cmd /Q /D /T:7F /F:OFF /V:OFF /K "@echo off && mode con:RATE=31 DELAY=0 && mode con:COLS=15 LINES=1 && title . && cls"

(Or if you're like me & you use Psychosis's PsyDuk Framework you can replace the PDOpenWindowsTerminal() in your code with this instead:

PDRunWindowsCommand(PSTR("cmd /Q /D /T:7F /F:OFF /V:OFF /K \"@echo off && mode con:RATE=31 DELAY=0 && mode con:COLS=15 LINES=1 && title . && cls\" "));

What it does is: It disables the registry reads cmd.exe runs on start which might slow it down, it turns autocompletion off, changes the background/foreground text color to grey on white which is hard to read and not as easily recognizable as an msdos command box, It also runs cmd.exe with the @echo off command, it uses mode.exe to change the msdos window to have low typing delay from the keyboard and it uses mode once again to change the window size of the msdos box to a small window that is only 1 command line length in height. the last commands it runs are titlebar "." to change it to just an empty titlebar (You could change it to something else, Windows Update for example) .. and then it runs 'cls' to clear the buffer.

Edited by Vile
Link to comment
Share on other sites

Also you could add this code (Only if you use psychosis's PsyDuk framework) :

void PDMoveOffScreen(uint8_t amountOfMoves)
{

PDKeypressWithModifier(KEY_SPACE, KEY_ALT);
PDDelay(10);

PDTypeString(PSTR("M"));
PDDelay(10);
    PDKeypressRepeated_Alt(KEY_LEFT,amountOfMoves);
    PDDelay(10);
    PDKeypress(KEY_ENTER);     


}

void PDKeypressRepeated_Alt(uint8_t key, uint8_t amountOfTimes)
{
    for(uint8_t i=0; i < amountOfTimes; i++)
    {
        PDKeypress(key);
        PDDelay(2);
    }
}

Then in your Main() function after calling the cmd.exe use:

PDMoveOffScreen(50);

The only problem is if they move their mouse while it is moving.. they can essentially just drag the window back. In my code i use devcon.exe to disable the mouse device while it is moving & reenable it once the commands are finished.

Edited by Vile
Link to comment
Share on other sites

Also you could add this code (Only if you use psychosis's PsyDuk framework) :

void PDMoveOffScreen(uint8_t amountOfMoves)
{

PDKeypressWithModifier(KEY_SPACE, KEY_ALT);
PDDelay(10);

PDTypeString(PSTR("M"));
PDDelay(10);
    PDKeypressRepeated_Alt(KEY_LEFT,amountOfMoves);
    PDDelay(10);
    PDKeypress(KEY_ENTER);     


}

void PDKeypressRepeated_Alt(uint8_t key, uint8_t amountOfTimes)
{
    for(uint8_t i=0; i < amountOfTimes; i++)
    {
        PDKeypress(key);
        PDDelay(2);
    }
}

Then in your Main() function after calling the cmd.exe use:

PDMoveOffScreen(50);

The only problem is if they move their mouse while it is moving.. they can essentially just drag the window back. In my code i use devcon.exe to disable the mouse device while it is moving & reenable it once the commands are finished.

That's just what I was working on :D ,I'm using arduino not c but it's not too hard to translate between them them. Also i like the devcon idea, time to make a full on payload :P

--Edit--

I just came across this, don't know if it will be any good http://www.apps4apps.filetap.com/nomousy.html

Edited by benownzu93
Link to comment
Share on other sites

  • 3 weeks later...

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...