2019-03-31 00:17:37 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2020-02-25 06:30:43 -05:00
|
|
|
from __future__ import print_function
|
2019-03-31 00:17:37 -04:00
|
|
|
import socket
|
|
|
|
|
|
|
|
s=socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.ntohs(0x0800))
|
|
|
|
|
|
|
|
while True:
|
2020-10-09 14:20:59 -04:00
|
|
|
data=s.recvfrom(65535)
|
2019-03-31 00:17:37 -04:00
|
|
|
try:
|
|
|
|
if "HTTP" in data[0][54:]:
|
2020-02-25 06:30:43 -05:00
|
|
|
print("[","="*30,']')
|
2019-03-31 00:17:37 -04:00
|
|
|
raw=data[0][54:]
|
|
|
|
if "\r\n\r\n" in raw:
|
|
|
|
line=raw.split('\r\n\r\n')[0]
|
2020-02-25 06:30:43 -05:00
|
|
|
print("[*] Header Captured ")
|
|
|
|
print(line[line.find('HTTP'):])
|
2019-03-31 00:17:37 -04:00
|
|
|
else:
|
2020-02-25 06:30:43 -05:00
|
|
|
print(raw)
|
2019-03-31 00:17:37 -04:00
|
|
|
else:
|
|
|
|
#print '[{}]'.format(data)
|
|
|
|
pass
|
|
|
|
except:
|
|
|
|
pass
|