from scapy.all import * ''' Sniff frames using Python and scapy Author: Tim Pierson, Dartmouth CS55, Winter 2021 From Du: Computer and Internet Security run: sudo python3 sniff_scapy.py NOTE: Will not run without sudo (no rights to interface)! try opening Firefox to get traffic Get interfaces with ifconfig ''' def process_packet(pkt): global count print('-'*40) print("Packet number",count) pkt.show() print('-'*40) count += 1 if __name__ == '__main__': count = 0 pkt = sniff(iface='enp0s3', filter='icmp or udp', count=10, prn=process_packet)