inj3ctor_m4

Range iP Zip Scanner

Nov 12th, 2014
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.23 KB | None | 0 0
  1. <?php
  2. #Range Zip Scanner // By INJ3CTOR_M4
  3. #Made In Morocco
  4.  
  5. set_time_limit(0);
  6. error_reporting(0);
  7.  
  8. echo "
  9.                                            
  10. \t### ###  ## ###  ## ###  #  ##      # # # #
  11. \t #  # #   #   # #    #  # # # #     ### # #
  12. \t #  # #   #  ## #    #  # # ##      ### ###
  13. \t #  # # # #   # #    #  # # # #     # #   #
  14. \t### # #  #  ###  ##  #   #  # # ### # #   #
  15.  
  16. \t\t[+]\tRange Zip Scanner\n
  17. ";
  18.  
  19. $options = getopt('i:f:');
  20.  
  21. // Start Of Script
  22. if (isset ($options['i']) && isset ($options['f'])) {
  23.     $ip = explode('.', $options['i']);
  24.     $ip = $ip[0].'.'.$ip[1].'.'.$ip[2].'.';
  25.  
  26.     for($i = 1; $i <= 255; $i++) {
  27.         if (fsockopen ($ip.$i, 80)) {
  28.             echo "\r\n[+]\tScanning ".$ip.$i.":\r\n";
  29.             foreach(Rev($ip.$i) as $link) {
  30.                 $f = fopen($ip.$i.'-sites.txt', 'ab');
  31.                 fwrite($f, $link."\r\n");
  32.                 fclose($f);
  33.                 zip_Scanner ($link, $options['f']);
  34.             }
  35.         }elseif (fsockopen ($ip.$i, 443)) {
  36.             echo "\r\n[+]\tScanning ".$ip.$i.":\r\n";
  37.             foreach(Rev($ip.$i) as $link) {
  38.                 $f = fopen($ip.$i.'-sites.txt', 'ab');
  39.                 fwrite($f, $link."\r\n");
  40.                 fclose($f);
  41.                 zip_Scanner ($link, $options['f']);
  42.             }
  43.         }else {
  44.             echo "\n[-]\t".$ip.$i." Not Alive!";
  45.         }
  46.     }
  47. }else {
  48.     echo "\n[!] Example Usage: php ".$argv[0]." -i 127.0.0.1 -f zip.txt\n";
  49. }
  50.  
  51. // Zip Scanner Function
  52. function zip_Scanner ($link, $file) {
  53.     foreach(Get_Maillist($file) as $path) {
  54.         $headers = @get_headers($link.$path);
  55.         if (preg_match ('/200 OK/i', $headers[0])) {
  56.             echo "\t".$link.$path." ... OK!\n";
  57.         }
  58.     }
  59. }
  60.  
  61. // Reverse iP With Bing.com Function
  62. function Rev($ip) {
  63.     $i = 1;
  64.     while ($i) {
  65.         $data = Get_Source ("http://www.bing.com/search?q=ip%3A$ip&first=$i","SamsungI8910/SymbianOS/9.1 Series60/3.0");
  66.         if (preg_match_all ('#<h2 class="sb_h3 cttl"><a href="(.*?)"#i', $data, $links)){
  67.             foreach($links[1] as $link){
  68.                 $parse = parse_url ($link);
  69.                 $allLinks[] = $parse['scheme']."://".$parse['host'];
  70.             }
  71.             if (!preg_match ('#class="sb_pagN"#i', $data)) break;
  72.         }
  73.         $i += 10;
  74.     }
  75.     if(!empty ($allLinks) && is_array ($allLinks)) {
  76.         return array_filter(array_unique($allLinks));
  77.     }
  78. }
  79.  
  80. // Get Mail-List Function
  81. function Get_Maillist($maillist) {
  82.     $emails = file($maillist);
  83.     foreach($emails as $email) {
  84.         $email = trim($email);
  85.         $mailList[] = $email;
  86.     }
  87.     if(!empty ($mailList) && is_array ($mailList)) {
  88.         return array_filter(array_unique ($mailList));
  89.     }
  90. }
  91.  
  92. // Curl Http?s Requests Function
  93. function Get_Source ($url, $agent) {
  94.     $ch = curl_init();
  95.     curl_setopt ($ch, CURLOPT_URL, $url);
  96.     curl_setopt ($ch, CURLOPT_USERAGENT, $agent);
  97.     curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
  98.     curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
  99.     curl_setopt ($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  100.     curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  101.     curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  102.     curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  103.     curl_setopt ($ch, CURLOPT_ENCODING, "gzip, deflate, compress");
  104.     curl_setopt ($ch, CURLOPT_FRESH_CONNECT, 1);
  105.     curl_setopt ($ch, CURLOPT_TIMEOUT, 20);
  106.     $source = curl_exec($ch);
  107.     curl_close($ch);
  108.    
  109.     return $source;
  110. }
  111.  
  112. // Delete Cookies File
  113. if(file_exists ('cookie.txt')) {
  114.     @system ("del cookie.txt");
  115.     @system ("rm cookie.txt");
  116. }
  117.  
  118. ?>
Advertisement
Add Comment
Please, Sign In to add comment