Skip to content

Comments

List packet sniffers - python version#1

Open
nfsec wants to merge 1 commit intosandflysecurity:masterfrom
nfsec:master
Open

List packet sniffers - python version#1
nfsec wants to merge 1 commit intosandflysecurity:masterfrom
nfsec:master

Conversation

@nfsec
Copy link

@nfsec nfsec commented Feb 18, 2026

This is a Python version of a Bash script, written using only built-in modules.

root@darkstar:~# time ./list.sh
Parsing inodes from /proc/net/packet and finding associated processes
---------------------------------------------------------------------
Found the following unique inodes in /proc/net/packet:
30032952
48963766

Searching for processes with packet socket inode: 30032952
  PID: 1695621 (Name: systemd-network)
    FD: 18 -> socket:[30032952]
---------------------------------------------------------------------
Searching for processes with packet socket inode: 48963766
  PID: 1170760 (Name: tcpflow)
    FD: 5 -> socket:[48963766]
---------------------------------------------------------------------
Script finished.

real	0m6.232s
user	0m1.788s
sys	0m4.785s
root@darkstar:~# time ./list.py
Parsing inodes from /proc/net/packet and finding associated processes
---------------------------------------------------------------------
Found the following unique inodes in /proc/net/packet:
30032952
48963766

Searching for processes with packet socket inode: 48963766
  PID: 1170760 (Name: tcpflow)
    FD: 5 -> socket:[48963766]
---------------------------------------------------------------------
Searching for processes with packet socket inode: 30032952
  PID: 1695621 (Name: systemd-network)
    FD: 18 -> socket:[30032952]
---------------------------------------------------------------------
Script finished.

real	0m0.071s
user	0m0.043s
sys	0m0.028s

This is a Python version of a Bash script, written using only built-in modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant