Skip to content

Commit

Permalink
Update check
Browse files Browse the repository at this point in the history
  • Loading branch information
Takahiro-Yoko committed Jan 6, 2025
1 parent 43294df commit 474f542
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,21 @@ def initialize(info = {})
end

def check
# Request for Selenium Grid version 3
v3res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(target_uri.path)
})
# Request for Selenium Grid version 4
v4res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(target_uri.path, 'status')
})
return Exploit::CheckCode::Detected('Selenium Grid version 4.x detected.') if v3res&.code != 200 &&
v4res && v4res.get_json_document &&
return Exploit::CheckCode::Detected('Selenium Grid version 4.x detected.') if v4res && v4res.get_json_document &&
v4res.get_json_document.include?('value') &&
v4res.get_json_document['value'].include?('message') &&
v4res.get_json_document['value']['message'].downcase.include?('selenium grid')

# Request for Selenium Grid version 3
v3res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(target_uri.path)
})
return Exploit::CheckCode::Unknown('Unexpected server reply.') unless v3res&.code == 200

js_code = v3res.get_html_document.css('script').find { |script| script.text.match(/var json = Object.freeze\('(.*?)'\);/) }
Expand Down

0 comments on commit 474f542

Please sign in to comment.