Difference between revisions of "Ngrep"

From Christoph's Personal Wiki
Jump to: navigation, search
 
(See also)
Line 17: Line 17:
  
 
==See also==
 
==See also==
*[[tcpdump]]
+
*[[nmap]] — network exploration tool and security scanner[http://www.insecure.org/nmap/]
*[[snoop]]
+
*[[tcpdump]] — dump traffic on a network[http://www.tcpdump.org/]
*[[netcat]] (aka <tt>nc</tt>)
+
*[[snoop]] &mdash; capture and inspect network packets
 +
*[[netcat]] (aka <tt>nc</tt>) &mdash; a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.[http://netcat.sourceforge.net/]
 
*[http://logi.cc/linux/netfilter-log-format.php3 Netfilter]
 
*[http://logi.cc/linux/netfilter-log-format.php3 Netfilter]
 
*[http://logi.cc/nw/NetCalc.php3 NetCalc]
 
*[http://logi.cc/nw/NetCalc.php3 NetCalc]

Revision as of 03:26, 24 March 2007

ngrep strives to provide most of GNU grep's common features, applying them to the network layer. ngrep is a pcap-aware tool that will allow you to specify extended regular or hexadecimal expressions to match against data payloads of packets. It currently recognizes IPv4/6, TCP, UDP, ICMPv4/6, IGMP and Raw across Ethernet, PPP, SLIP, FDDI, Token Ring and null interfaces, and understands BPF filter logic in the same fashion as more common packet sniffing tools, such as tcpdump and snoop. It was written by Jordan Ritter.

Usage

Note: See here for detailed examples.

  • Example: Basic Packet Sniffing
ngrep -d any port 25
ngrep -d any 'error' port syslog
ngrep -wi -d any 'user|pass' port 21
  • Example: Debugging HTTP interactions
ngrep port 80
ngrep -W byline port 80
  • Example: Processing PCAP dump files, looking for patterns
ngrep -O /tmp/dns.dump -d any -T port domain
ngrep -w 'm' -I /tmp/dns.dump
ngrep -tD ns3 -I /tmp/dns.dump
ngrep -I /tmp/dns.dump port 80

See also

  • nmap — network exploration tool and security scanner[1]
  • tcpdump — dump traffic on a network[2]
  • snoop — capture and inspect network packets
  • netcat (aka nc) — a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.[3]
  • Netfilter
  • NetCalc
  • Whois

External links