Tr3v0r

[PHP] Drupal Checker coded by Tr3v0r & constantine

Apr 12th, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.64 KB | None | 0 0
  1. <?php
  2.  
  3.   /*
  4.   ** Coded by Tr3v0r & constantine in 19/03/2015.
  5.   ** Site: constantine.sourceforge.net
  6.   ** Domain sintaxe: www.host.com
  7.   */
  8.  
  9.   error_reporting(0);
  10.  
  11.   function main () {
  12.     if ($_SERVER['argc'] == 3) {
  13.      
  14.       $list_of_domains = $_SERVER['argv'][1];
  15.       $list_of_output = $_SERVER['argv'][2];
  16.       $counter = 0;
  17.      
  18.       show_banner();
  19.       print "\n -> Drupal Search started...\n\n";
  20.      
  21.       if (($p = fopen($list_of_domains, 'r')) != null) {
  22.         while(!feof($p)) {
  23.           $domain = fgets($p);
  24.           $domain = str_replace(array("\n", "\r"), '', $domain);  
  25.           $response = send_http_request($domain);
  26.           $array = explode("\n\r", $response);
  27.           $array = trim($array[0]);
  28.          
  29.           if (strstr($array, " 200 OK")) {
  30.             print (" [". $counter ."] -> http://". $domain ."/user/login/index.php -> 200 OK!\n");
  31.             save_domain ("http://". $domain . "/user/login/index.php", $list_of_output);
  32.           }
  33.           else
  34.             print (" [". $counter ."] -> http://". $domain ."/user/login/index.php -> 404 Not Found!\n");
  35.          
  36.           $counter ++;
  37.         }
  38.         fclose($p);
  39.       }
  40.     }
  41.     else {
  42.       show_banner();
  43.       print ("\n Use: php ". $_SERVER['argv'][0] ." list_of_domains.txt output.txt\n");
  44.     }
  45.   }
  46.  
  47.   function send_http_request ($host) {
  48.     $path = "/user/login/index.php";
  49.     $port = 80;
  50.     $response = "";
  51.    
  52.     $header  = "GET ". $path ." HTTP/1.1\r\n";
  53.     $header .= "Host: ". $host ."\r\n";
  54.     $header .= "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:33.0) Gecko/20100101 Firefox/33.0\r\n";
  55.     $header .= "Connection: close\r\n\r\n";;
  56.    
  57.     if (($fp = fsockopen($host, $port, $e, $err, 3)) != false) {
  58.       socket_set_timeout ($fp, 3);
  59.       fwrite($fp, $header);
  60.      
  61.       while (!feof($fp)) {
  62.         $response .= fgets($fp, 200);
  63.         if (strstr($response, "\r\n\r\n")) {
  64.           $response = explode("\r\n\r\n", $response);
  65.           $response = $response[0];
  66.           break;
  67.         }
  68.       }
  69.       fclose($fp);
  70.     }
  71.    
  72.     return $response;
  73.   }
  74.  
  75.   function save_domain ($domain, $list_of_output) {
  76.     if (($fp = fopen($list_of_output, "a+")) != null) {
  77.       fprintf($fp, $domain . "\n");
  78.       fclose($fp);
  79.     }
  80.   }
  81.  
  82.   function show_banner () {
  83.                                                    
  84.     print "\n                                       `s-\n";                                                    
  85.     print "                                         /:y+`\n";                                                  
  86.     print "                                        .o oyy/`\n";                                                
  87.     print "                                      `-/``oyyyy/.\n";                                              
  88.     print "                                    .::..-oyyyyyyys/-`\n";                                          
  89.     print "                                .-::.` `::yyyyyyyyyyyys+:.\n";                                      
  90.     print "                            `.-:.`    `-:oyyyyyyyyyyyyyyyys/-\n";                                    
  91.     print "                          .::.`     `.:+syyyyyyyyyyyyyyyyyyyys/`\n";                                
  92.     print "                        -:.`      `-:+syyyyyyyyyyyyyyyyyyyyyyyyy/`\n";                              
  93.     print "                      -:.      `.-/+syyyyyyyyyyyyyyyyyyyyyyyyyyyyy/`\n";                            
  94.     print "                    ./-     `.-:+oyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyys-\n";                            
  95.     print "                   -+-```.-:/+oyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhh/\n";                          
  96.     print "                  :y::::/+osyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhh+\n";                          
  97.     print "                 :yyssssyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhh/\n";                        
  98.     print "                .yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhh:\n";                        
  99.     print "                syyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhy`\n";                      
  100.     print "               -hyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhh/\n";  
  101.     print "               +yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhy\n";
  102.     print "               syyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhhhh`\n";                      
  103.     print "               yyyyyyyyyyyyyyyyyyyyssoo++osyyyyyyyyyyyyyyyyhhhhhhhhhhhhhhh`\n";                      
  104.     print "               syyyyyyyyyyyyyyyyo:.        .-+syyyyyyyyyyhhhhhhhs/-.-:shhh`\n";                      
  105.     print "               +yyyyyyyyyyyyyy+.               ./syyyyyhhhhhhs/.       ohy\n";                      
  106.     print "               -hyyyyyyyyyyyy:                    ./shhhhhs/.          .h+\n";                      
  107.     print "                syyyyyyyyyyy/                        .::-`             .h`\n";                      
  108.     print "                .hyyyyyyyyyy.                       `-//-`             //\n";                        
  109.     print "                 :hyyyyyyyyy-                    ./shhhhhho.          `+\n";                        
  110.     print "                  :hyyyyyyyys`               `:+yhhhsssshhhho.       `+\n";                          
  111.     print "                   -yhhyyyyyys/.         `-/shhhy+.`---.`/hhhho.    :/\n";                          
  112.     print "                    `ohhhhhhhhhhyo+++++oyhhhhhhy`:shhhhhs.shhhhhyooo-\n";                            
  113.     print "                      -shhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhy/`\n";                            
  114.     print "                        -ohhhhhhhhhhhhhhhy/+yhhhhhhhhhhhhs//hhhs/`\n";                              
  115.     print "                          ./shhhhhhhhhhhhy:.``-::://::-..:+yy+-`\n";                                
  116.     print "                             .:oyhhhhhhhhhhhyo+++++++osyso/-`\n";                                    
  117.     print "                                ``-/+ssyhhhhhhhhhyyso+:.`\n";                                        
  118.     print "                                      ````......````\n";                                            
  119.                                                                                                                                        
  120.     print "                                Drupal search - By Tr3v0r.\n\n";
  121.     print "                                 Contact: @MatheusTDashh\n";
  122.     print "                                https://github.com/Tr3v0r\n";
  123.   }
  124.  
  125.   main();
  126.  
  127.   /* EOF. */
  128.  
  129. ?>
Advertisement
Add Comment
Please, Sign In to add comment