zgrab2 icon indicating copy to clipboard operation
zgrab2 copied to clipboard

HTTP Timeout doesn't work as expected

Open ajholland opened this issue 6 years ago • 3 comments

I specified the following on the command line:

echo google.com | ./zgrab2 http --port 8080 --timeout 3

(A site and port I expect to not connect but timeout after a certain point)

Rather than timing out after 3 seconds, according to the metadata at the end, it continues through for 75 seconds.

{"statuses":{"http":{"successes":0,"failures":1}},"start":"2018-05-01T11:55:54-04:00","end":"2018-05-01T11:57:10-04:00","duration":"1m15.374277319s"}

ajholland avatar May 01 '18 16:05 ajholland

I think I see the problem -- transport.DialTLS is set, but not transport.Dial / transport.DialContext. Confirmed that if I add --use-https to your example, it does time out as expected.

justinbastress avatar May 01 '18 16:05 justinbastress

Makes sense! I'm also noticing that if I specify a timeout of say 8 seconds, it actually times out after 4, this follows through if I specify a timeout of 10 seconds it times out after 5.

I can look into this and the above if you're not already on it, I've been working on #73.

ajholland avatar May 01 '18 17:05 ajholland

It seems like this is fixed, except for when applying the --use-https flag. Now applying that flag results in the above behavior where a timeout of 8 seconds ends up timing out after 4 seconds (probably rtt, didn't look much into this)

ajholland avatar May 03 '18 19:05 ajholland