Skip to content

Instantly share code, notes, and snippets.

@janith989
janith989 / tcpdump.py
Created September 3, 2020 15:12 — forked from gteissier/tcpdump.py
Pythonic tcpdump: copy, paste, and enjoy
#!/usr/bin/env python
'''
It has been tested with either py2 or py3.
Beware ancient versions of Linux kernel which may not support SOCK_NONBLOCK
or the memory mapped ring buffer.
BPF filter listed below is compiled form of "not port 22"
if you want to change it, do something like