I am making a banner grabber and have finally ironed out the HEAD / HTTP/1.1 request according to the guidelines, but some websites still give me '400 Bad Request'
why is that?
Here is my request:
"HEAD / HTTP/1.1\r\nHost: target:port\r\nConnection: close\r\n\r\n"
Should the
Head:
beHost:
? Apart from that, sites might block theHEAD
request, i.e. there is no requirement that they must offer it. Also, the target you give in the Host header might not match a name setup on the server. Nevertheless you might get the servers banner (I.e.Server
header I suppose) from the 400 response too, if the server sends such header at all (not required). – Steffen Ullrich