HTTP resource enumeration script via GET method from Python section of PTSv4 (eLearnSecurity)
import http.clientprint('** Check resources in WWW server and output HTTP status code via GET/HTTP **\n')host =input('Insert the host/DST IP: ')port =input('Insert the DST PORT:(default:80) ')url =input('Insert the URL of the resource you want to check for ')if(port ==''): port =80try: connection = http.client.HTTPConnection(host, port) connection.request('GET', url) response = connection.getresponse()print('Status Code Returned: ', response.status) connection.close()exceptConnectionRefusedError:print('Connection Failed')