Skip to content

Commit 3a28df6

Browse files
Apply suggestions from code review
Co-authored-by: Diego Ledda <[email protected]>
1 parent bbc282e commit 3a28df6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/exploits/linux/http/selenium_greed_chrome_rce_cve_2022_28108.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def initialize(info = {})
3030
['URL', 'https://www.gabriel.urdhr.fr/2022/02/07/selenium-standalone-server-csrf-dns-rebinding-rce/'],
3131
],
3232
'Payload' => {
33-
'DisableNops' => true
3433
},
3534
'Platform' => %w[linux],
3635
'Targets' => [
@@ -83,10 +82,14 @@ def check
8382
end
8483

8584
js_code = res.get_html_document.css('script').find { |script| script.text.match(/var json = Object.freeze\('(.*?)'\);/) }
86-
return Exploit::CheckCode::Unknown unless js_code
85+
return Exploit::CheckCode::Unknown('Unable to determine the version.') unless js_code
8786

8887
json_str = js_code.text.match(/var json = Object.freeze\('(.*?)'\);/)[1]
89-
json_data = JSON.parse(json_str)
88+
begin
89+
json_data = JSON.parse(json_str)
90+
rescue JSON::ParserError
91+
return Exploit::CheckCode::Unknown('Unable to determine the version.')
92+
end
9093
return Exploit::CheckCode::Unknown unless json_data && json_data.include?('version') && json_data['version']
9194

9295
# Extract the version

0 commit comments

Comments
 (0)