T
T
TODO•SEC
Search…
HttpGo-Getter.py
HTTP resource enumeration script via GET method from Python section of PTSv4 (eLearnSecurity)
1
import http.client
2
3
print('** Check resources in WWW server and output HTTP status code via GET/HTTP **\n')
4
5
host = input('Insert the host/DST IP: ')
6
port = input('Insert the DST PORT:(default:80) ')
7
url = input('Insert the URL of the resource you want to check for ')
8
9
if(port == ''):
10
port = 80
11
12
try:
13
connection = http.client.HTTPConnection(host, port)
14
connection.request('GET', url)
15
response = connection.getresponse()
16
print('Status Code Returned: ', response.status)
17
connection.close()
18
except ConnectionRefusedError:
19
print('Connection Failed')
Copied!
Last modified 8d ago
Copy link