Created
February 22, 2020 19:45
-
-
Save zPrototype/f3ec06de876c9c7556dd6eba9a77935e to your computer and use it in GitHub Desktop.
Python packet sniffer with scapy
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 * | |
setInterface = input("Enter your interface: ") | |
countOfPackets = int(input("Enter amount of packets to sniff (default = 100): ") or "100") | |
setTimeout = int(input("Enter seconds before timeout (default = 5s): ") or "5") | |
print("") | |
conf.iface = setInterface | |
packets = sniff(count=countOfPackets, timeout=setTimeout) | |
print(packets.rawhexdump()) | |
print(packets) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment