Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //no backdoors on this shit
- $list = "poop.txt";
- $port = "8081";
- $output = "GoAhead-Filtered.txt";
- function in_array_r($item, $array) {
- return preg_match('/"' . $item . '"/i', json_encode($array));
- }
- if (ini_get('safe_mode')) {
- die('Please disable PHP SafeMode! Killing script...');
- } else {
- $file = file($list);
- ForEach ($file as $line) {
- $ip = $line;
- $ip = trim($ip);
- $url = 'http://' . $ip . ':' . $port;
- $ch = curl_init();
- $headers = [];
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 1);
- // this function is called by curl for each header received
- curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$headers) {
- $len = strlen($header);
- $header = explode(':', $header, 2);
- if (count($header) < 2) // ignore invalid headers
- return $len;
- $name = strtolower(trim($header[0]));
- if (!array_key_exists($name, $headers)) $headers[$name] = [trim($header[1]) ];
- else $headers[$name][] = trim($header[1]);
- return $len;
- });
- $data = curl_exec($ch);
- if (in_array_r("GoAhead-Webs", $headers)) {
- echo "GoAhead Found";
- $data = $ip . ":" . $port . "";
- file_put_contents($output, $data, FILE_APPEND | LOCK_EX);
- } else {
- echo "";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement