shodan_search default user-agent overwirte - fix #16189 and #16223

As the Shodan is checking the UserAgent to decide which content-type it
will deliver, the default user-agent is causing it to reply a html page.
This commit overwrite the default user-agent the the module shodan_search
to 'Wget' that works in on the shodan API.
This commit is contained in:
Heyder Andrade
2022-03-01 21:31:35 +01:00
parent 239308824a
commit bb2a2e458b
+9 -1
View File
@@ -41,7 +41,15 @@ class MetasploitModule < Msf::Auxiliary
OptInt.new('MAXPAGE', [true, 'Max amount of pages to collect', 1]),
OptRegexp.new('REGEX', [true, 'Regex search for a specific IP/City/Country/Hostname', '.*'])
])
]
)
# overwriting the default user-agent. Shodan is checking it and delivering a html response when using the default ua (see #16189 and #16223)
register_advanced_options(
[
OptString.new('UserAgent', [false, 'The User-Agent header to use for all requests', 'Wget/1.21.2 (linux-gnu)' ])
]
)
deregister_http_client_options
end