Advertisement
shor7cut

extracktor ip_str shodan.io

Dec 30th, 2015
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. Name    : IP_STR EXTRACKTOR (shodan.io)
  5. Author  : Shor7cut
  6. Link    : http://facebook.com/bug7sec
  7. */
  8.  
  9. function save($name,$data){
  10.         $myfile = fopen($name, "a+") or die("Unable to open file!");
  11.         fwrite($myfile, $data);
  12.         fclose($myfile);
  13.         if($myfile){
  14.                 return true;
  15.         }else{
  16.                 return false;
  17.         }
  18. }
  19.  
  20. if(isset($argv[1]) && isset($argv[2])){
  21.     $x = 1;
  22.     $re = "/\"ip_str\": \"(.*?)\"/";
  23.     preg_match_all($re, file_get_contents($argv[1]) , $matches);
  24.     foreach ($matches[1] as $key => $value) {
  25.         $data = $value."\r\n";
  26.         save($argv[2],$data);
  27.         $x++;
  28.         echo "$x ";
  29.     }
  30.     echo "\r\n total : ".$x." Target";
  31. }else{
  32.     echo "php ".$argv[0]." [file] [output]\r\n";
  33. }
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement