Advertisement
shor7cut

Reverse ip (all services) - CLI

Nov 24th, 2015
805
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Nama Tools              : Reverse ip (all services) - CLI
  4. Author                  : SHOR7CUT
  5. Api Developers by ShodaN.IO
  6. http://facebook.com/bug7sec
  7. */
  8. error_reporting(0);
  9. function scan($ip){
  10. $get = file_get_contents("https://api.shodan.io/shodan/host/$ip?key=z3cBefrV3bmRx2rNZ0E1opuZxXNPrbIR");
  11. $json = json_decode($get,true);
  12. return $json;
  13. }
  14.  
  15.  
  16. if(isset($argv[1])){
  17.     if (filter_var($argv[1], FILTER_VALIDATE_IP)) {
  18.     $data = scan($argv[1]);
  19.     }else{
  20.     $data = scan(gethostbyname($argv[1]));
  21.     }
  22.  
  23.     if(isset($data['ip_str'])){
  24.     echo "---------------------------\r\n";
  25.     echo "# Informasi : ".$data['ip_str'];
  26.     echo "\r\n---------------------------\r\n";
  27.     echo "+ IP : ".$data['ip_str']."\r\n";
  28.     if(isset($data['country_name'])){
  29.     echo "+ CN : ".$data['country_name']."\r\n";
  30.     }
  31.     if(isset($json['os'])){
  32.     echo "+ OS : ".$data['os']."\r\n";
  33.     }
  34.     if(isset($data['ports'])){
  35.     echo "+ Port : ";
  36.     foreach ($data['ports'] as $key => $value) {
  37.     echo $value." ";
  38.     }
  39.     echo "\r\n";
  40.     }
  41.     if(isset($data['vulns'])){
  42.     echo "+ Vuln : \n";
  43.     foreach ($data['vulns'] as $key => $value) {
  44.     echo "-".$value."\n";
  45.     }
  46.     }
  47.     if(isset($data['last_update'])){
  48.     echo "+ L.Update : ".$data['last_update']."\r\n";
  49.     }
  50.     if($data['data']){
  51.     echo "\r\n";
  52.         foreach ($data['data'] as $key => $value) {
  53.     echo "-------------------------------------\r\n";
  54.     echo "# Informasi : ".$data['ip_str']." Port : ".$value['port'];
  55.     echo "\r\n-------------------------------------\r\n";
  56.     if(isset($value['ip_str'])){
  57.         echo "+ IP : ".$value['ip_str']."\r\n";
  58.     }
  59.     if(isset($value['port'])){
  60.         echo "+ Port : ".$value['port']."\r\n";
  61.     }
  62.     if(isset($value['product'])){
  63.         echo "+ Product : ".$value['product']."\r\n";
  64.     }
  65.     if(isset($value['version'])){
  66.         echo "+ Version : ".$value['version']."\r\n";
  67.     }
  68.     if(isset($value['cpe'])){
  69.     echo "+ CPE : \n";
  70.     foreach ($value['cpe'] as $key => $cpe) {
  71.     echo "- ".$cpe."\n";
  72.     }
  73.     }
  74.  
  75.     if(isset($value['opts']['vulns'])){
  76.     echo "+ Vuln : \n";
  77.     foreach ($value['opts']['vulns'] as $key => $values) {
  78.         echo "- ".$values."\n";
  79.     }
  80.     }
  81.  
  82.  
  83.     if(isset($value['data'])){
  84.         echo "\r\n~~~~~~~~~~~[ DATA ]~~~~~~~~~~~\r\n";
  85.         echo $value['data'];
  86.     }
  87.  
  88.     }
  89.     }
  90.  
  91.  
  92. }else{
  93.     echo "\r\n[x] tidak ada result\r\n";
  94. }
  95. }else{
  96.     echo "\r\nphp ".$argv[0]." 127.0.0.1\n";
  97.     echo "php ".$argv[0]." www.localhost\r\n";
  98. }
  99. ?>
Advertisement
RAW Paste Data Copied
Advertisement