Not Just Paranoid

Another site by Pete Maynard

Script to get HTTP Headers

The below script uses urllib2 to connect to the given URL(s) then prints out the HTTP headers.

import urllib2, sys

if len(sys.argv) == 1:
	print "Please feed me a URL...\n\n<3\n"

for url in sys.argv[1:]:
	r = urllib2.urlopen(url)
	print 'URL: ' + url + '\n' + str(

An example of it working is shown below. From a “security through obscurity” view, you’d want to conceal your HTTP server information.

$ python ~/
	Server: nginx/1.2.1
	Date: Mon, 05 Aug 2013 01:10:19 GMT
	Content-Type: text/html
	Content-Length: 650
	Last-Modified: Mon, 29 Jul 2013 08:46:57 GMT
	Connection: close
	Accept-Ranges: bytes

2 Aug 2013 | Tags ( Python HTTP HTTP Headers )

Website Last Updated on 15 Sep 2023 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by
for the Flickr photo feed and GoatCounter for user insights.