I think scapy might be helpful to you.
With scapy, you can use the sniff
function to monitor all packets through some interface, from there you can easily filter the data with the lfilter
parameter.
Take a look at the docs for more help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…