I am using requests in python for checking malicious headers. My code is working, but this one specific ip does not close the connection nor does it timeout.
def check():
...
r=requests.head('https://50.79.153.56',verify=False,timeout=(4,4))
...
Using curl i found out that the site keeps sending the same sequence of bytes
curl -v -k https://50.79.153.56
....
> ~▒}#▒!}!}!} }8}"}&} } } } }#}$▒#}%}&i+G}<}'}"}(}"▒▒~~▒}#▒!}!}!} }
Using this , brings success!
curl -v -k https://50.79.153.56 -m 3
...
curl: (28) Operation timed out after 3000 milliseconds with 51 bytes received
How should the timeout flag in requests look like so similar occurrences do not happen? I tried both python2.7 and 3.x but the result is the same.