Last active
June 16, 2022 08:12
-
-
Save narbehaj/de492b4eaaff4b6a02818d2e5b6542c1 to your computer and use it in GitHub Desktop.
Python scapy to sniff HTTP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
def packet_callback(packet): | |
if packet[TCP].payload: | |
if packet[IP].dport == 80: | |
print("\n{} ----HTTP----> {}:{}:\n{}".format(packet[IP].src, | |
packet[IP].dst, | |
packet[IP].dport, | |
str(bytes(packet[TCP].payload)))) | |
sniff(filter='tcp', prn=packet_callback, store=0, count=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http response body is unknow_code :
'(\x00\x00\x00\xaa\x00\x00\x000\x08\x04"\x95\x01\x08\x9b\x80\xa5\xa9\x06\x10\xff\r\x18\x94\n
this why?please!