Advertisement
ardann

Untitled

Sep 10th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.70 KB | None | 0 0
  1. <?php
  2.     $green  = "\e[1;92m";
  3.     $cyan   = "\e[1;36m";
  4.     $normal  = "\e[0m";
  5.     $blue   = "\e[34m";
  6.     $green1 = "\e[0;92m";
  7.     $yellow = "\e[93m";
  8.     $red    = "\e[1;91m";
  9. function banner(){
  10.         $green  = "\e[1;92m";
  11.     $cyan   = "\e[1;36m";
  12.     $normal  = "\e[0m";
  13.     $blue   = "\e[1;34m";
  14.     $green1 = "\e[0;92m";
  15.     $yellow = "\e[93m";
  16.     $red    = "\e[1;91m";
  17.     $banner = $cyan."
  18.  
  19.      ▄███████▄  ▀████    ▐████▀      
  20.     ██▀     ▄██   ███▌   ████▀      
  21.           ▄███▀    ███  ▐███        
  22.      ▀█▀▄███▀▄▄    ▀███▄███▀        
  23.       ▄███▀   ▀    ████▀██▄          
  24.     ▄███▀         ▐███  ▀███        
  25.     ███▄     ▄█  ▄███     ███▄      
  26.      ▀████████▀ ████       ███▄      
  27.            
  28.              ".$normal.$red."Z0NK3X".$normal."
  29.        [".date("Y-m-d H:i:s")."]      
  30.            
  31.  ".$yellow."╔═╗╔═╗╦═╗╔╦╗  ".$normal.$red."┌─┐┌─┐┌─┐┌┐┌┌┐┌┌─┐┬─┐
  32.  ".$yellow."╠═╝║ ║╠╦╝ ║   ".$normal.$red."└─┐│  ├─┤││││││├┤ ├┬┘
  33.  ".$yellow."╩  ╚═╝╩╚═ ╩   ".$normal.$red."└─┘└─┘┴ ┴┘└┘┘└┘└─┘┴└─
  34. \n".$normal;
  35. echo $banner;
  36. }
  37. banner()."\n";
  38. echo " [+] Default Hostname : ".php_uname("n")."\n";
  39. $start = readline(" [?] Port Start       : ");
  40. $end   = readline(" [?] Port End         : ");
  41. $host  = "127.0.0.1";
  42. $packetContent = "GET / HTTP/1.1\r\n\r\n";
  43. if (!is_numeric($start) | !is_numeric($end)) {
  44.     exit();
  45. }
  46. echo "\r\n\r\n";
  47. if (ctype_xdigit($packetContent)) $packetContent = @pack("H*", $packetContent);
  48. else {
  49.     $packetContent = str_replace(array(
  50.         "\r",
  51.         "\n"
  52.     ) , "", $packetContent);
  53.     $packetContent = str_replace(array(
  54.         "\\r",
  55.         "\\n"
  56.     ) , array(
  57.         "\r",
  58.         "\n"
  59.     ) , $packetContent);
  60. }
  61. echo "---------------------------------------------------~\n";
  62. for ($i = $start; $i <= $end; $i++) {
  63.     $sock = @fsockopen($host, $i, $errno, $errstr, 3);
  64.     if ($sock) {
  65.         stream_set_timeout($sock, 5);
  66.         fwrite($sock, $packetContent . "\r\n\r\n\x00");
  67.         $counter = 0;
  68.         $maxtry = 1;
  69.         $bin = "";
  70.         do {
  71.             $line = fgets($sock, 1024);
  72.             if (trim($line) == "") $counter++;
  73.             $bin.= $line;
  74.         }
  75.         while ($counter < $maxtry);
  76.         fclose($sock);
  77.         echo $green1."Port $i Is Open!\n".$normal;
  78.         if (!empty($bin)) {
  79.         echo "$bin\n";
  80.         }else{
  81.         echo $red."Response is empty!\n".$normal;
  82.         }
  83.         echo "---------------------------------------------------~\n";
  84.     }
  85.  
  86.     flush();
  87. }
  88.  
  89. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement