Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Ledda <[email protected]>
  • Loading branch information
Takahiro-Yoko and dledda-r7 authored Jan 3, 2025
1 parent bbc282e commit 3a28df6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def initialize(info = {})
['URL', 'https://www.gabriel.urdhr.fr/2022/02/07/selenium-standalone-server-csrf-dns-rebinding-rce/'],
],
'Payload' => {
'DisableNops' => true
},
'Platform' => %w[linux],
'Targets' => [
Expand Down Expand Up @@ -83,10 +82,14 @@ def check
end

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

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

# Extract the version
Expand Down

0 comments on commit 3a28df6

Please sign in to comment.