tldr/pages/common/tcpdump.md

30 lines
654 B
Markdown
Raw Normal View History

2014-03-01 04:25:34 +00:00
# tcpdump
> Dump traffic on a network
- capture the traffic of a specific interface
`tcpdump -i {{eth0}}`
- capture all TCP traffic showing contents (ASCII) in console
`tcpdump -A tcp`
- capture the traffic from or to a host
2014-03-02 07:20:23 +00:00
`tcpdump host {{www.example.com}}`
2014-03-01 04:25:34 +00:00
- capture the traffic from a specific interface, source, destination and port
`tcpdump -i {{eth0}} src {{192.168.1.1}} dest {{192.168.1.2}} and port 80`
- capture the traffic of a network
`tcpdump net {{192.168.1.0/24}}`
- capture all traffic except traffic over port 22 and save to a dump file with today's date
```
tcpdump -w dumpfile.`date +%Y.%m.%d-%H.%M`.pcap not port 22
```