Tag: py

HEAD requests on multiple web servers, all with a one liner

by on Jan.31, 2010, under Code, Posts

If you need a quick way of getting server versions and you want to do this with a one liner here’s your solution:

for i in $(cat websites); do printf "HEAD / HTTP1/.0\n\r\n" | nc -vv ${i} 80; done

‘websites’, would be a file that contains a list of websites either by domain names or IP addresses. You could also enumerate an array of websites for cases where you have stored output into an array. i.e.

array=($(cat /var/log/apache2/access.log | awk '{print $1}' | sort | uniq));
for i in ${array[@]}; do printf "HEAD / HTTP/1.0\n\r\n" | nc -vv ${i} 80; done

Lastly, a while back, I wrote a python script that does pretty much the same thing:
Plain text:

tar archive:
MD5sum: dcb02fff9e69fb004c8e6456ed82c424

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!