xJesterino

GoAhead Exploit - ZMAP List Filter

May 6th, 2018
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.41 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. *************************************
  6. * GoAhead IP Camera  Exploit Filter *
  7. *************************************
  8. * THIS IS A PRIVATE FILE.           *
  9. * YOU SHOULD NOT HAVE THIS.         *
  10. * IF YOU LEAK THIS, AT LEAST LEAVE  *
  11. * CREDIT TO THE AUTHOR IN THE       *
  12. * COMMENTS BELOW.                   *
  13. *************************************
  14. * EXPLOIT FOUNDER:                  *
  15. * * Pierre Kim                      *
  16. *************************************
  17. * SCRIPT AUTHOR:                    *
  18. * * Jester                          *
  19. * INSTAGRAM:                        *
  20. * * thejesterino                    *
  21. * TWITTER:                          *
  22. * * @xJesterino                     *
  23. * HACKFORUMS UID:                   *
  24. * * 2978478                         *
  25. *************************************
  26. * * Backdoors removed!              *
  27. *************************************
  28. * * #OstrichGang                    *
  29. * * #CanadianGang$                  *
  30. * ***********************************
  31.  
  32. */
  33.  
  34. $list = "poop.txt";
  35. $port = "8081";
  36. $output = "GoAhead-Filtered.txt";
  37.  
  38. function in_array_r($item, $array) {
  39.     return preg_match('/"' . $item . '"/i', json_encode($array));
  40. }
  41.  
  42.  file($list);
  43.     ForEach ($file as $line) {
  44.         $ip = $line;
  45.         $ip = trim($ip);
  46.         $url = 'http://' . $ip . ':' . $port;
  47.         $ch = curl_init();
  48.         $headers = [];
  49.         curl_setopt($ch, CURLOPT_URL, $url);
  50.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  51.         curl_setopt($ch, CURLOPT_TIMEOUT, 1);
  52.         // this function is called by curl for each header received
  53.         curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$headers) {
  54.             $len = strlen($header);
  55.             $header = explode(':', $header, 2);
  56.             if (count($header) < 2) // ignore invalid headers
  57.             return $len;
  58.             $name = strtolower(trim($header[0]));
  59.             if (!array_key_exists($name, $headers)) $headers[$name] = [trim($header[1]) ];
  60.             else $headers[$name][] = trim($header[1]);
  61.             return $len;
  62.         });
  63.         $data = curl_exec($ch);
  64.         if (in_array_r("GoAhead-Webs", $headers)) {
  65.             echo "GoAhead Found";
  66.             $data = $ip . ":" . $port . "";
  67.             file_put_contents($output, $data, FILE_APPEND | LOCK_EX);
  68.         } else {
  69.             echo "Not A GoAhead Device or Dead....";
  70.         }
  71.     }
  72.  
  73. ?>
Advertisement
Add Comment
Please, Sign In to add comment