SHARE
TWEET

SCANNER INURL-MAIL 1.0

Googleinurl Oct 21st, 2013 3,309 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3.   ##########################################################################################
  4.  *  SCANNER INURL-MAIL     1.0
  5.  *  PHP Version         5.4.7
  6.  *  php5-curl           LIB
  7.  *  cURL support        enabled
  8.  *  cURL Information    7.24.0
  9.  *  Apache              2.4
  10.  *  allow_url_fopen =   On
  11.  *  Motor de busca      GOOGLE
  12.  *  Permição            Leitura & Escrita
  13.  *  -------------------------------------------------------------------------------------
  14.  *  BUSCA LISTMAIL
  15.  *  OBJETIVO USAR O MOTOR DE BUSCA GOOGLE PARA CAPTURAR EMAILS LIST.
  16.  *  A CADA URL ENCONTRADA PELO BUSCADOR, SERA EFETUADO UM FILTRO CAPTURANDO OS EMAILS
  17.  *  CONTIDOS NA URL.
  18.  *  -------------------------------------------------------------------------------------
  19.  *  GRUPO GOOGLEINURL BRASIL - PESQUISA AVANÇADA.
  20.  *  fb.com/GoogleINURL
  21.  *  twitter.com/GoogleINURL
  22.  *  blog.inurl.com.br
  23.   ##########################################################################################
  24.  */
  25.  
  26. error_reporting(0);
  27. set_time_limit(0);
  28. ini_set('display_errors', 0);
  29. ini_set('max_execution_time', 0);
  30. ini_set('allow_url_fopen', 1);
  31.  
  32. $GLOBALS['cont'] = 0;
  33. $GLOBALS['resultado'] = NULL;
  34. #FORMATAÇÃO DE ARGUMENTOS#######################################################
  35.  
  36.     system("command clear");
  37.     $menu = "-----------------------------------------------------------------------------\n";
  38.     $menu.= "\033[01;31m                       [ SCANNER INURL-MAIL ] \n\033[0m";
  39.     $menu.= "-----------------------------------------------------------------------------\r\n";
  40.  
  41.     $menu.= "-------------------------------AJUDA-----------------------------------------\n";
  42.     $menu.= "\033[01;33mphp inurlmail.php \033[01;31m --dork=\033[01;33m'site:.com.br hotmail ext:txt'\033[01;31m --arquivo=\033[01;33m'mails.txt'\n";
  43.     $menu.= "Exemplo de dorks: http://blog.inurl.com.br/search/label/email\n";
  44.     $menu.= "Ajuda: php inurlmail.php \033[01;31majuda \n\033[0m";             
  45.     $menu.= "-----------------------------------------------------------------------------\r\n";
  46.     echo $menu;
  47.  
  48.  
  49.  
  50.  
  51. function argumentos($argv, $campo) {
  52.     $_ARG = array();
  53.     foreach ($argv as $arg) {
  54.         if (ereg('--[a-zA-Z0-9]*=.*', $arg)) {
  55.             $str = split("=", $arg);
  56.             $arg = '';
  57.             $key = ereg_replace("--", '', $str[0]);
  58.             for ($i = 1; $i < count($str); $i++) {
  59.                 $arg .= $str[$i];
  60.             }
  61.             $_ARG[$key] = $arg;
  62.         } elseif (ereg('-[a-zA-Z0-9]', $arg)) {
  63.             $arg = ereg_replace("-", '', $arg);
  64.             $_ARG[$arg] = 'true';
  65.         }
  66.     }
  67.     return $_ARG[$campo];
  68. }
  69.  
  70. ################################################################################
  71. #VALIDAÇÃO DE ARGUMENTOS########################################################
  72.  
  73. function validar($argv, $id, $campo) {
  74.  
  75.     if (isset($argv[$id]) && ereg('--[a-zA-Z0-9]*=.*', $argv[$id]) && !empty($argv[$id])) {
  76.  
  77.         $validacao = argumentos($argv, $campo);
  78.     }
  79.     return $validacao;
  80. }
  81.  
  82. ################################################################################
  83. #EXTRAÇÃO DE EMAIL##############################################################
  84.  
  85. function extrairMail($html) {
  86.     preg_match_all('/([\w\d\.\-\_]+)@([\w\d\.\_\-]+)/mi', $html, $matches);
  87.  
  88.     foreach ($matches['0'] as $valor) {
  89.         echo "[\033[01;31m {$GLOBALS['cont']} \033[0m]- {$valor}\r\n";
  90.         $GLOBALS['resultado'].="{$valor}\r\n";
  91.         $GLOBALS['cont']++;
  92.     }
  93. }
  94.  
  95. ################################################################################
  96. #ENVIAR INFORMAÇÕES PARA GOOGLE#################################################
  97.  
  98. function eviarPacote($packet, $config) {
  99.  
  100.     if (isset($config['ipProxy'])) {
  101.         $ock = fsockopen($config['ipProxy'], $config['porta']);
  102.         if (!$ock) {
  103.             echo "\033[01;31m Proxy não responde {$config['ipProxy']} : {$config['porta']}\r\n\033[0m";
  104.             die;
  105.         }
  106.     } else {
  107.  
  108.         $ock = fsockopen(gethostbyname($config['host']), $config['port']);
  109.         if (!$ock) {
  110.             echo "\033[01;31m Host não responde {$config['host']} : {$config['port']}\r\n\033[0m";
  111.             die;
  112.         }
  113.     }
  114.  
  115.     fputs($ock, $packet);
  116.     $buffer = NULL;
  117.     while (!feof($ock)) {
  118.         $buffer.=fgets($ock);
  119.     }
  120.     fclose($ock);
  121.     return($buffer);
  122. }
  123.  
  124. ################################################################################
  125. #REQUEST PARA CAPTURA DE EMAILS#################################################
  126.  
  127. function requestCurl($url) {
  128.     $ch = curl_init();
  129.     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.' . date('s') . '(Windows; U; Windows NT 6.' . date('s') . '; en-US; rv:1.' . date('s') . '.1.2) Gecko/2009072' . date('s') . ' Firefox/3.' . date('s') . '.2 GTB5');
  130.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  131.     curl_setopt($ch, CURLOPT_HEADER, false);
  132.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  133.     curl_setopt($ch, CURLOPT_URL, $url);
  134.     curl_setopt($ch, CURLOPT_REFERER, $url);
  135.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  136.     $result = curl_exec($ch);
  137.     if (isset($result)) {
  138.         return $result;
  139.     } else {
  140.  
  141.         return FALSE;
  142.     }
  143. }
  144.  
  145. ################################################################################
  146. #FILTRO DE URL DO RESULTADO GOOGLE##############################################
  147.  
  148. function formatarResult($html) {
  149.     preg_match_all('#\b((((ht|f)tps?://)|(www|ftp)\.)[a-zA-Z0-9\.\#\@\:%_/\?\=\~\-]+)#i', $html, $match);
  150.     $match[1] = array_unique($match[1]);
  151.     for ($i = 0; $i < count($match[1]); $i++) {
  152.         if (isset($match[1][$i]) && !strstr($match[1][$i], "google") && !strstr($match[1][$i], "youtube") && !strstr($match[1][$i], "orkut") && !strstr($match[1][$i], "schema") && !strstr($match[1][$i], "blogger")) {
  153.             extrairMail(requestCurl($match[1][$i]));
  154.         }
  155.     }
  156. }
  157.  
  158. ################################################################################
  159. #MENU AJUDA#####################################################################
  160. if (isset($argv[1]) && $argv[1] == "ajuda") {
  161.     system("command clear");
  162.     $menu = "-----------------------------------------------------------------------------\n";
  163.     $menu.= "\033[01;31m                       [ SCANNER INURL-MAIL ] \n\033[0m";
  164.     $menu.= "-----------------------------------------------------------------------------\r\n";
  165.  
  166.     $menu.= "-------------------------------AJUDA-----------------------------------------\n";
  167.     $menu.= "\033[01;31mphp inurlmail.php --dork='site:.com.br hotmail ext:txt' --arquivo='mails.txt'\n\033[0m";
  168.     $menu.= "Exemplo de dorks: http://blog.inurl.com.br/search/label/email\n\033[0m";  
  169.     $menu.= "-----------------------------------------------------------------------------\n";
  170.     echo $menu;
  171.     exit();
  172. }
  173. ################################################################################
  174. #VALIDANDO ARGUMENTOS###########################################################
  175. if (isset($_SERVER['argv'][1])) {
  176.     $dork = validar($_SERVER['argv'], 1, 'dork');
  177. } else {
  178.     print"Defina a dork de pesquisa.\r\n";
  179.     unset($dork);
  180.     exit();
  181. }
  182. if (isset($_SERVER['argv'][2])) {
  183.     $arquivo = validar($_SERVER['argv'], 2, 'arquivo');
  184. } else {
  185.     print"Defina o arquivo resultado.\r\n";
  186.     unset($arquivo);
  187.     exit();
  188. }
  189.  
  190. ################################################################################
  191. #CONFIGURAR#####################################################################
  192. $config['host'] = 'www.google.com.br';
  193. $config['dork'] = urlencode($dork);
  194. $config['url'] = "/search?q={$config['dork']}&num=1500&btnG=Search";
  195. $config['port'] = 80;
  196. $config['host'] = trim($config['host']);
  197. $packet = "GET {$config['url']} HTTP/1.0\r\n";
  198. $packet.="Host: {$config['host']}\r\n";
  199. $packet.="Connection: Close\r\n\r\n";
  200. ################################################################################
  201.  
  202. print_r(formatarResult(eviarPacote($packet, $config)));
  203.  
  204.     echo "\r\nArquivo..: {$arquivo}\r\n";
  205.     $abrirtxt = fopen($arquivo, "a");
  206.     if ($abrirtxt == false) {
  207.         die('Não foi possível criar o arquivo.');
  208.     }
  209.     fwrite($abrirtxt, $GLOBALS['resultado']);
  210.     fclose($abrirtxt);
  211.  
  212.  
  213. ?>
RAW Paste Data
Top