zerobyte-id

[PHP CLI] Unlimited Reverse IP

Jun 29th, 2021 (edited)
753
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. error_reporting(0);
  4.  
  5. # Name     : Unlimited Reverse IP
  6. # Vendor   : Zerobyte.ID
  7. # Coded by : @Cepotdotid
  8. # Issued June 29th, 2021
  9. # Tested on Ubuntu 20.04.1 LTS
  10. # Recoded? only changed and delete copyright? Don't be a bastardd dude!
  11.  
  12. Class ReverseIP
  13. {
  14.    
  15.     public function __construct()
  16.     {
  17.         $this->Banner();
  18.         $this->MASK();
  19.         $this->Rev();
  20.     }
  21.    
  22.     public function color($color = "random", $text)
  23.     {
  24.         if (true == true) {
  25.             $arrayColor = array(
  26.                 'grey' => '1;30',
  27.                 'red' => '1;31',
  28.                 'green' => '1;32',
  29.                 'yellow' => '1;33',
  30.                 'blue' => '1;34',
  31.                 'purple' => '1;35',
  32.                 'nevy' => '1;36',
  33.                 'white' => '1;1',
  34.                 'bgred' => '1;41',
  35.                 'bggreen' => '1;42',
  36.                 'bgyellow' => '1;43',
  37.                 'bgblue' => '1;44',
  38.                 'bgpurple' => '1;45',
  39.                 'bgnavy' => '1;46',
  40.                 'bgwhite' => '1;47'
  41.             );
  42.             if ($color == 'random') {
  43.                 $arrayColor         = array(
  44.                     'red' => '1;31',
  45.                     'green' => '1;32',
  46.                     'yellow' => '1;33',
  47.                     'nevy' => '1;36',
  48.                     'white' => '1;1'
  49.                 );
  50.                 $arrayColor[$color] = $arrayColor[array_rand($arrayColor)];
  51.                 $res .= "\033[" . $arrayColor[$color] . "m" . $text . "\033[0m";
  52.                
  53.             } else if ($color == 'string') {
  54.                 $arrayColor = array(
  55.                     'grey' => '1;30',
  56.                     'red' => '1;31',
  57.                     'green' => '1;32',
  58.                     'yellow' => '1;33',
  59.                     'blue' => '1;34',
  60.                     'purple' => '1;35',
  61.                     'nevy' => '1;36',
  62.                     'white' => '1;1'
  63.                 );
  64.                 foreach (str_split($text) as $key => $value) {
  65.                     $arrayColor[$color] = $arrayColor[array_rand($arrayColor)];
  66.                     $res .= "\033[" . $arrayColor[$color] . "m" . $value . "\033[0m";
  67.                 }
  68.                
  69.             } else {
  70.                
  71.                 $res .= "\033[" . $arrayColor[$color] . "m" . $text . "\033[0m";
  72.                
  73.             }
  74.             return $res;
  75.         } else {
  76.             return $text;
  77.         }
  78.        
  79.     }
  80.  
  81.     public function RemoveSubdomain($urls)
  82.     {
  83.         $url = "http://";
  84.         $url .= $urls;
  85.         $pieces = parse_url($url);
  86.         $domain = isset($pieces['host']) ? $pieces['host'] : '';
  87.         if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs))
  88.         {
  89.             return $regs['domain'];
  90.         }
  91.         return false;
  92.     }
  93.  
  94.     public function Banner()
  95.     {
  96.         echo "
  97.        _..._
  98.      .'     '.      _  
  99.     /    .-\"\"-\   _/ \  ┌──────────────────────────────────────────────┐
  100.  .-|   /:.    |  |   |  │  HELLO," . $this->color("green", " Zerobyte.ID") . " Wuz here!                │
  101.  |  \  |:.    /.-'-./   │  Dont forget, still autis on cyberspace!     │
  102.  | .-'-;:__ .'    =/    │                                              │
  103.  .'=  *=|     _.='      │  " . $this->color("green", "© Zerobyte.ID 2021 All rights reserved. ") . "    │
  104.  /   _.  |    ;         └──────────────────────────────────────────────┘
  105. ;-.-'|    \   |
  106. /   | \    _\  _\
  107. \__/'._;.  ==' ==\
  108.         \    \   |
  109.         /    /   /
  110.         /-._/-._/
  111.         \   `\  \
  112.          `-._/._/ " . PHP_EOL . PHP_EOL;
  113.         $this->iplist = readline("# Enter ur IP list => ");
  114.         if (!file_exists($this->iplist))
  115.             die("file " . $this->color("red", $this->iplist) . " not available!" . PHP_EOL);
  116.         $this->list = preg_split('/\r\n|\r|\n/', file_get_contents($this->iplist));
  117.         system('clear');
  118.     }
  119.    
  120.     public function MASK()
  121.     {
  122.         echo "┌─────────────────────────┬───────────────────────────┬────────────────────────────┐
  123. │     " . $this->color("blue", "MASK") . " 30 = " . $this->color("green", "4") . "  IP     │     " . $this->color("blue", "MASK") . " 25 = " . $this->color("green", "127") . "  IP     │     " . $this->color("blue", "MASK") . " 20 = " . $this->color("green", "4061") . "  IP     │
  124. │     " . $this->color("blue", "MASK") . " 29 = " . $this->color("green", "8") . "  IP     │     " . $this->color("blue", "MASK") . " 24 = " . $this->color("green", "253") . "  IP     │     " . $this->color("blue", "MASK") . " 19 = " . $this->color("green", "8116") . "  IP     │
  125. │     " . $this->color("blue", "MASK") . " 28 = " . $this->color("green", "16") . " IP     │     " . $this->color("blue", "MASK") . " 23 = " . $this->color("green", "506") . "  IP     │     " . $this->color("blue", "MASK") . " 18 = " . $this->color("green", "16244") . " IP     │
  126. │     " . $this->color("blue", "MASK") . " 27 = " . $this->color("green", "32") . " IP     │     " . $this->color("blue", "MASK") . " 22 = " . $this->color("green", "1016") . " IP     │     " . $this->color("blue", "MASK") . " 17 = " . $this->color("green", "32411") . " IP     │
  127. │     " . $this->color("blue", "MASK") . " 26 = " . $this->color("green", "64") . " IP     │     " . $this->color("blue", "MASK") . " 21 = " . $this->color("green", "2036") . " IP     │     " . $this->color("blue", "MASK") . " 16 = " . $this->color("green", "49802") . " IP     │" . PHP_EOL . "├─────────────────────────┴───────────────────────────┴────────────────────────────┤" . PHP_EOL;
  128.         echo "│    NOTE: [ " . $this->color("red", "the bigger number you choosing will take more time per request !") . "]     │" . PHP_EOL;
  129.         echo "└──────────────────────────────────────────────────────────────────────────────────┘" . PHP_EOL;
  130.         $this->mask = readline("# Enter ur MASK => ");
  131.         if ($this->mask > 30 || $this->mask < 16) {
  132.             die(PHP_EOL . $this->color("red", "the number option you put is incorrect!") . PHP_EOL . PHP_EOL);
  133.         }
  134.     }
  135.    
  136.     public function Rev()
  137.     {
  138.         foreach ($this->list as $key => $ip) {
  139.            
  140.             $ch = curl_init();
  141.            
  142.             curl_setopt($ch, CURLOPT_URL, "https://sonar.omnisint.io/reverse/" . $ip . "/" . $this->mask);
  143.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  144.             curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  145.            
  146.             curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  147.            
  148.             $headers   = array();
  149.             $headers[] = 'Authority: sonar.omnisint.io';
  150.             $headers[] = 'Cache-Control: max-age=0';
  151.             $headers[] = 'Connection: keep-alive';
  152.             $headers[] = 'Sec-Ch-Ua: \"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"';
  153.             $headers[] = 'Sec-Ch-Ua-Mobile: ?0';
  154.             $headers[] = 'Upgrade-Insecure-Requests: 1';
  155.             $headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36';
  156.             $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9';
  157.             $headers[] = 'Sec-Fetch-Site: none';
  158.             $headers[] = 'Sec-Fetch-Mode: navigate';
  159.             $headers[] = 'Sec-Fetch-User: ?1';
  160.             $headers[] = 'Sec-Fetch-Dest: document';
  161.             $headers[] = 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8';
  162.             $headers[] = 'Cookie: _ga=GA1.2.1243590311.1615035294; _gid=GA1.2.1342632335.1615035294';
  163.             curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  164.            
  165.             $result = curl_exec($ch);
  166.             if (preg_match('/"Message": "invalid CIDR address:/', $result)) {
  167.                 echo "IP => " . $this->color("green", $ip) . $this->color("red", " INVALID!") . " => [ " . $this->color("red", "0"). " DOMAIN ] REASON: ". $this->color("red", "invalid CIDR address") . ": ".$ip."/".$this->mask.PHP_EOL;
  168.             } else {
  169.                 $grabbed = json_decode($result, true);
  170.             }
  171.             foreach ($grabbed as $key => $value) {
  172.                 if (count($value) > 10) {
  173.                     echo PHP_EOL . "FROM IP " . $this->color("green", $ip) . " RANGE TO IP " . $this->color("green", $key) . " SUCCESS! => [ " . $this->color("green", count($value)) . " DOMAIN ] |" . $this->color("yellow", " Zerobyte.ID REVERSE IP");
  174.                 }
  175.             foreach ($value as $save)
  176.                 {
  177.                     $delete = $this->RemoveSubdomain($save) . PHP_EOL;
  178.                     $save = @fopen(".tmp", "a+");
  179.                     fwrite($save, $delete . "\n");
  180.                     fclose($save);
  181.                 }
  182.             }
  183.         }
  184.     }
  185.    
  186.     public function __destruct()
  187.     {
  188.         if ($this->mask > 30 || $this->mask < 16) {
  189.             die();
  190.         }
  191.         echo "Please wait. delete duplicate line!".PHP_EOL;
  192.         sleep(5);
  193.         $lines = file(".tmp");
  194.         $lines = array_unique($lines);
  195.        
  196.         $file = fopen("ZB-REV.txt", "a+");
  197.         fwrite($file, implode("", $lines));
  198.         fclose($file);
  199.         unlink('.tmp');
  200.         echo "All Done! you got ".$this->color("green", count(file('ZB-REV.txt'))). " Domain list".PHP_EOL;
  201.     }
  202. }
  203.  
  204. $ini = new ReverseIP();
  205. $ini->Rev();
RAW Paste Data