Googleinurl

Capurl Googleinurl

Oct 31st, 2012
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. #!/usr/bin/php -q
  2. <?php
  3. /*
  4.  
  5. Uso ./capurl.php --site=http://alvo.com.br
  6. Permição 775 no arquivo capurl
  7. By: Googleinurl
  8. */
  9.  
  10. function argumentos($argv) {
  11.     $_ARG = array();
  12.     foreach ($argv as $arg) {
  13.         if (ereg('--[a-zA-Z0-9]*=.*',$arg)) {
  14.             $str = split("=",$arg); $arg = '';
  15.             $key = ereg_replace("--",'',$str[0]);
  16.             for ( $i = 1; $i < count($str); $i++ ) {
  17.                 $arg .= $str[$i];
  18.             }
  19.                         $_ARG[$key] = $arg;
  20.         } elseif(ereg('-[a-zA-Z0-9]',$arg)) {
  21.             $arg = ereg_replace("-",'',$arg);
  22.             $_ARG[$arg] = 'true';
  23.         }
  24.    
  25.     }
  26. return $_ARG;
  27. }
  28. ini_set("max_execution_time",0);
  29. $html=file_get_contents(argumentos($argv)['site']); // Abre a página
  30. preg_match_all("((href|src) *?= *?(\"|\')(.+?)\\2)i",$html,$array);
  31.  
  32. $abrirtxt = fopen("resultado".date("H-i-s").".txt", "a");
  33.  
  34. foreach($array[3] as $url){
  35.     echo $url."\n\r";
  36.         $escreve = fwrite($abrirtxt, $url."\n\r");
  37. }
  38.  
  39. fclose($abrirtxt);
  40. ?>
Add Comment
Please, Sign In to add comment