forked from p34709852/monkey
Fixed collision where HTTP auto upgraded to HTTPS
This commit is contained in:
parent
bee9fc23ea
commit
dd8738a4f1
|
@ -27,11 +27,12 @@ class HTTPFinger(HostFinger):
|
|||
https = "https://" + host.ip_addr + ":" + port[1]
|
||||
|
||||
# try http, we don't optimise for 443
|
||||
for url in (http, https):
|
||||
for url in (https, http): # start with https and downgrade
|
||||
try:
|
||||
with closing(get(url, verify=False, timeout=1, stream=True)) as req:
|
||||
server = req.headers.get('Server')
|
||||
host.services['tcp-' + port[1]] = server
|
||||
ssl = True if 'https://' in url else False
|
||||
host.services['tcp-' + port[1]] = (server,ssl)
|
||||
break # https will be the same on the same port
|
||||
except Timeout:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue