Created
November 11, 2020 07:25
-
-
Save An4ndita/952decd46ea0b9742c65c7922a0dad8b to your computer and use it in GitHub Desktop.
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
# to check whether a packet contains the HTTP layer or not | |
if pkt_scapy.haslayer(scapy.Raw): | |
# checking if the destination port is 80, it means that the packet is leaving from our computer and going towards the http port | |
if pkt_scapy[scapy.TCP].dport == 80: | |
print("[*] This is an HTTP REQUEST ") | |
# checking if the source port is 80, it means this packet is leaving from the http port | |
elif pkt_scapy(scapy.TCP).sport == 80: | |
print("[*] This is an HTTP Response ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment