mirror of
https://github.com/The-Art-of-Hacking/h4cker
synced 2024-11-22 02:43:02 +00:00
94aac3bb33
Fixing TCP max packet size 65535
24 lines
485 B
Python
24 lines
485 B
Python
#!/usr/bin/python
|
|
|
|
from __future__ import print_function
|
|
import socket
|
|
|
|
s=socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.ntohs(0x0800))
|
|
|
|
while True:
|
|
data=s.recvfrom(65535)
|
|
try:
|
|
if "HTTP" in data[0][54:]:
|
|
print("[","="*30,']')
|
|
raw=data[0][54:]
|
|
if "\r\n\r\n" in raw:
|
|
line=raw.split('\r\n\r\n')[0]
|
|
print("[*] Header Captured ")
|
|
print(line[line.find('HTTP'):])
|
|
else:
|
|
print(raw)
|
|
else:
|
|
#print '[{}]'.format(data)
|
|
pass
|
|
except:
|
|
pass
|