ngrep .Captures and displays all traffic on the default interface by matching any character.
“Network grep” — matches regular expressions against packet payloads, like grep for network traffic.
sudo apt install ngrepngrep -q GETRuns in quiet mode, suppressing the '#' hash marks for non-matching packets.
ngrep -i passSearches for 'pass' regardless of case (e.g., matching PASS, Pass, or pass).
ngrep -v HTTPDisplays only packets that do NOT contain the pattern 'HTTP'.
ngrep -w userMatches 'user' as a whole word, ignoring substrings like 'username'.
ngrep . net 192.168.1.0/24Captures traffic for the entire 192.168.1.0/24 subnet.
ngrep . 'src host 1.1.1.1 and dst port 80'Combines host and port filters to see web traffic originating from 1.1.1.1.
ngrep . 'tcp and not port 22'Captures all TCP traffic excluding traffic on port 22 (SSH).
ngrep . 'host 10.0.0.1 or host 10.0.0.2'Captures traffic involving either 10.0.0.1 or 10.0.0.2.
ngrep -W byline "^GET" port 80Captures HTTP GET requests, formatting headers cleanly.
ngrep -W byline "^POST" port 80Captures HTTP POST requests to analyze submitted form data.
ngrep -W byline "User-Agent:" port 80Inspects HTTP traffic specifically to see User-Agent strings.
ngrep -W byline "Cookie:" port 80Extracts Cookie headers from HTTP traffic for session analysis.
ngrep -W byline "USER|PASS" port 21Watches FTP control traffic for login attempts (username and password).
ngrep -q . port 23Captures cleartext Telnet traffic.
ngrep "^G.+HTTP" port 80Uses regex to match packets starting with G, followed by chars, ending with HTTP.
ngrep "[0-9]{3}-[0-9]{2}-[0-9]{4}" .Searches traffic for patterns resembling Social Security Numbers (regex).
ngrep "admin|root" port 22Looks for 'admin' OR 'root' in SSH traffic (note: SSH is encrypted, usually yields no match unless re-keying).
ngrep -i "<script>" port 80Detects Cross-Site Scripting (XSS) payloads in cleartext HTTP.
ngrep -d any "() { :;};" port 80Monitors for the specific signature of the Shellshock vulnerability.
ngrep "[0-9]{4}.[0-9]{4}.[0-9]{4}.[0-9]{4}" port 80Uses regex to hunt for cleartext credit card number patterns.
ngrep -P "SSH-" port 22Identifies the SSH version string during the initial handshake.
ngrep "" port 80Matches ALL packets on port 80 without searching for a specific string.
ngrep . vlanCaptures traffic that contains 802.1Q VLAN tags.
ngrep . broadcastMonitors network broadcast traffic.
ngrep . multicastMonitors network multicast traffic.
ngrep . 'tcp[tcpflags] & tcp-syn != 0'Captures only TCP packets with the SYN flag set (connection initiation).
ngrep . 'tcp[tcpflags] & (tcp-syn|tcp-ack) == (tcp-syn|tcp-ack)'Captures TCP SYN-ACK packets (handshake response).
ngrep . 'tcp[tcpflags] & tcp-rst != 0'Captures TCP Reset (RST) packets, useful for debugging connection drops.
ngrep -x -W byline GET port 80Combines hex dump and byline formatting for detailed HTTP inspection.
ngrep -d eth0 -q -W byline "POST" port 80 and host 10.10.10.5Quietly monitors POST requests on eth0 specifically involving host 10.10.10.5.
ngrep -i "user|pass|login" port 80Generic search for login-related terms in cleartext web traffic.
ngrep . portrange 8000-8080Captures traffic spanning a range of ports from 8000 to 8080.
ngrep . not src host 192.168.1.1Captures everything EXCEPT traffic coming from 192.168.1.1.
ngrep -T -q . icmpQuietly pings with delta timestamps to measure network latency jitter.
ngrep -X "00" port 80Searches for null bytes (0x00) which might indicate binary data or overflow attempts.
ngrep -K 1 patternAttempts to send TCP RST to kill connections matching the pattern (works on some systems).
ngrep -n 3 -W byline . host 1.2.3.4Debugging a specific host with formatting, stopping after 3 packets.
ngrep . arpMonitors Address Resolution Protocol packets for ARP spoofing detection.
ngrep . rarpMonitors Reverse ARP traffic.
ngrep . port 67 or port 68Monitors DHCP requests and responses.
ngrep . port 123Monitors Network Time Protocol traffic.
ngrep . port 161Monitors Simple Network Management Protocol traffic.
ngrep -d any -q .Quietly captures everything on every interface.
ngrep -d eth0 -n 1000 -q .Rapidly grabs a 1000 packet sample from eth0 without screen output overhead.
ngrep -W byline "application/json" port 80Filters for HTTP packets indicating JSON content type.
ngrep -W byline "Authorization: Basic" port 80Finds HTTP headers using Basic Authentication (Base64 encoded creds).
ngrep -I traffic.pcap -O filtered.pcap "GET"Reads traffic.pcap, finds packets with 'GET', and saves them to filtered.pcap.
ngrep -F patterns.txt .Reads search patterns from a file named 'patterns.txt' instead of command line.
ngrep -i "^error|^fail" .Case-insensitive regex search for error or failure at line start.
ngrep . port 143Monitors unencrypted IMAP email traffic.
ngrep . port 110Monitors unencrypted POP3 email traffic.
ngrep . port 389Monitors Lightweight Directory Access Protocol queries.
ngrep -X "4d 5a" port 80Searches for 'MZ' header (4D 5A) indicating Windows executable downloads.
ngrep -d any -t -T -W byline "Error" port 80Combines interface, timestamp, delta, formatting, and pattern for deep analysis.
The classic packet capture tool: capture and filter traffic with BPF expressions and write it to pcap files for later analysis.
Wireshark’s terminal version: capture and decode traffic with full dissectors and display filters, and extract fields to text.
A legacy packet sniffer with an interactive ncurses mode for watching TCP sessions in real time.