如何使用tcpdump
1.0.0
tcpdump 指令是一個著名的網路封包分析工具,用於顯示透過安裝了 tcpdump 的系統所連接的網路傳輸的 TCPIP 和其他網路封包。 Tcpdump 使用 libpcap 函式庫來擷取網路封包,並且在幾乎所有 Linux/Unix 版本上都可用。
Linux Tcpdump:過濾 ipv6 ntp ping 封包
Tcpdump:捕獲 DHCP 和 DHCPv6 封包
Linux 上的 20 個高級 Tcpdump 範例
10 個有用的 tcpdump 命令範例
Tcpdump 是資訊安全專業人員有史以來最好的網路分析工具之一。 Tcpdump 適用於駭客和對 TCP/IP 了解較少的人。
tcpdump -X ....
tcpdump -XX
tcpdump -D
tcpdump -l
tcpdump -q
tcpdump -t :
tcpdump -tttt :
tcpdump -i eth0
tcpdump -vv
tcpdump -c
tcpdump -s
tcpdump -S
tcpdump -e
tcpdump -E
在這裡找到所有選項
Linux Tcpdump:過濾 ipv6 ntp ping 封包
Tcpdump:捕獲 DHCP 和 DHCPv6 封包
Linux 上的 20 個高級 Tcpdump 範例
10 個有用的 tcpdump 命令範例
tcpdump -D
tcpdump --list-interfaces
tcpdump -nnSX port 443
tcpdump host 1.1.1.1
tcpdump src 1.1.1.1
tcpdump dst 1.0.0.1
tcpdump net 1.2.3.0/24
tcpdump -nnvvS
tcpdump -nnvvXS
tcpdump -nnvvXSs 1514
and or &&
or or ||
not or !
tcpdump 'src 192.168.1.1 and (dst port 3389 or 22)'
tcpdump 'tcp[13] & 32 != 0'
tcpdump 'tcp[13] & 16 != 0'
tcpdump 'tcp[13] & 8 != 0'
tcpdump 'tcp[13] & 4 != 0'
tcpdump 'tcp[13] & 2 != 0'
tcpdump 'tcp[13] & 1 != 0'
tcpdump 'tcp[13] = 18'
tcpdump 'tcp[13] = 6'
tcpdump 'ip[6] & 128 != 0'
tcpdump ip6
tcpdump -A -i eth0
tcpdump -XX -i eth0
tcpdump -w 0001.pcap -i eth0
tcpdump -r 0001.pcap
tcpdump -n -i eth0
tcpdump -i eth0 tcp
tcpdump -i eth0 port 22
tcpdump -i eth0 src 192.168.0.2
tcpdump -i eth0 dst 50.116.66.139
tcpdump -n src host x.x.x.x
tcpdump -n host x.x.x.x
tcpdump -n dst host x.x.x.x
tcpdump -n src host x.x.x.x
tcpdump -n dst net x.x.x.0/24
tcpdump -n src net x.x.x.0/24
tcpdump -n dst port x
tcpdump -n src port x
tcpdump -n dst(or src) portrange x-y
tcpdump -n tcp(or udp) dst(or src) portrange x-y
tcpdump -n "dst host x.x.x.x and dst port y"
tcpdump -n "dst host x.x.x.x and (dst port x or dst port z)"
tcpdump -v icmp(or arp)
tcpdump -i eth0 -w cap.txt
tcpdump -c 1 -X icmp
tcpdump port 3389
tcpdump src port 1025
tcpdump icmp
tcpdump host 1.1.1.1
tcpdump src 1.1.1.1
tcpdump dst 1.0.0.1
tcpdump net 1.2.3.0/24
tcpdump -c 1 -X icmp
tcpdump port 3389
tcpdump src port 1025
tcpdump icmp
tcpdump ip6
tcpdump portrange 21-23
tcpdump less 32
tcpdump greater 64
tcpdump <= 128
tcpdump => 128
tcpdump port 80 -w capture_file
tcpdump -r capture_file
tcpdump -ttnnvvS
tcpdump -nnvvS src 10.5.2.3 and dst port 3389
tcpdump -nvX src net 192.168.0.0/16 and dst net 10.0.0.0/8 or 172.16.0.0/16
tcpdump dst 192.168.0.2 and src net and not icmp
tcpdump -vv src mars and not dst port 22
tcpdump 'tcp[13] & 4!=0'
tcpdump 'tcp[tcpflags] == tcp-rst'
tcpdump 'tcp[13] & 2!=0'
tcpdump 'tcp[tcpflags] == tcp-syn'
tcpdump 'tcp[13]=18'
tcpdump 'tcp[13] & 32!=0'
tcpdump 'tcp[tcpflags] == tcp-urg'
tcpdump 'tcp[13] & 16!=0'
tcpdump 'tcp[tcpflags] == tcp-ack'
tcpdump 'tcp[13] & 8!=0'
tcpdump 'tcp[tcpflags] == tcp-psh'
tcpdump 'tcp[13] & 1!=0'
tcpdump 'tcp[tcpflags] == tcp-fin'
tcpdump 'tcp[13] = 6'
tcpdump -vvAls0 | grep 'User-Agent:'
tcpdump -nn -A -s1500 -l | grep "User-Agent:"
tcpdump -nn -A -s1500 -l | egrep -i 'User-Agent:|Host:'
tcpdump -s 0 -A -vv 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'
tcpdump -s 0 -A -vv 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354'
tcpdump -s 0 -v -n -l | egrep -i "POST /|GET /|Host:"
tcpdump -s 0 -A -n -l | egrep -i "POST /|pwd=|passwd=|password=|Host:"
tcpdump -nn -A -s0 -l | egrep -i 'Set-Cookie|Host:|Cookie:'
tcpdump -n icmp
tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
tcpdump -nn -l port 25 | grep -i 'MAIL FROM|RCPT TO'
tcpdump dst port 123
tcpdump -nn -v port ftp or ftp-data
tcpdump -w /tmp/capture-%H.pcap -G 3600 -C 200
tcpdump -nn ip6 proto 6
tcpdump -nr ipv6-test.pcap ip6 proto 17
tcpdump -nn
目標:
nmap -p 80 --script=http-enum.nse targetip
在伺服器上:
tcpdump -nn port 80 | grep "GET /"
GET /w3perl/ HTTP/1.1
GET /w-agora/ HTTP/1.1
GET /way-board/ HTTP/1.1
GET /web800fo/ HTTP/1.1
GET /webaccess/ HTTP/1.1
GET /webadmin/ HTTP/1.1
GET /webAdmin/ HTTP/1.1
tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet'
使用 Tcpdump 過濾 DNS
tcpdump -i wlp58s0 -s0 port 53
tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
tcpdump -nnn -t -c 200 | cut -f 1,2,3,4 -d '.' | sort | uniq -c | sort -nr | head -n 20
tcpdump port http or port ftp or port smtp or port imap or port pop3 or port telnet -l -A | egrep -i -B5 'pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|username:|password:|login:|pass |user '
tcpdump port http or port ftp or port smtp or port imap or port pop3 or port telnet -lA | egrep -i -B5 'pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd= |password=|pass:|user:|username:|password:|login:|pass |user '
tcpdump -v -n port 67 or 68
tcpdump -vvAls0 | grep 'GET'
tcpdump -vvAls0 | grep 'Host:'
tcpdump -vvAls0 | grep 'Set-Cookie|Host:|Cookie:'
tcpdump 'tcp[(tcp[12]>>2):4] = 0x5353482D'
tcpdump -vvAs0 port 53
tcpdump -vvAs0 port ftp or ftp-data
tcpdump -vvAs0 port 123
tcpdump -nn -l port 25 | grep -i 'MAIL FROM|RCPT TO'
tcpdump -i eth0 -s0 -l port 80 | grep 'Server:'
tcpdump 'ip[6] & 128 != 0'
Tcpdump:使用 Tcp 標誌過濾封包
tcpdump -n icmp 和 'icmp[0] != 8 和 icmp[0] != 0'
tcpdump -n icmp and icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply
tcpdump -v -n ip and ip[1]!=0
tcpdump -v ip and 'ip[8]<2'
tcpdump -n tcp and port 80 and 'tcp[tcpflags] & tcp-syn == tcp-syn'
tcpdump tcp and port 80 and 'tcp[tcpflags] == tcp-syn'
tcpdump -n tcp and 'tcp[tcpflags] & (tcp-syn|tcp-ack) == (tcp-syn|tcp-ack)'
tcpdump -n tcp and 'tcp[tcpflags] & tcp-syn == tcp-syn' and 'tcp[tcpflags] & tcp-ack == tcp-ack'
tcpdump -vv -e -nn ether proto 0x0806
tcpdump -l icmp and '(ip[2:2]>50)' -w - |tcpdump -r - -v ip and '(ip[2:2]<60)'
tcpdump -v -n icmp and '(ip[2:2]>50)' and '(ip[2:2]<60)'
tcpdump -v -n icmp
tcpdump -q -i eth0
tcpdump -t -i eth0
tcpdump -A -n -q -i eth0 'port 80'
tcpdump -A -n -q -t -i eth0 'port 80'
tcpdump -A -s 0 -q -t -i eth0 'port 80 and ( ((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12:2]&0xf0)>>2)) != 0)'
tcpdump -nq -s 0 -A -vvv port 5060 and host 1.2.3.4
tcpdump -i any -c10 -nn -A port 80
sudo tcpdump -i any -c10 -nn -A port 80
使用 Tcpdump 捕獲 ICMP 封包
使用 Tcpdump 調試 SSH 封包
使用Tcpdump過濾DNS資料包
學習tcpdump快速指南
使用 Tcpdump 過濾 DNS
使用 Tcpdump 過濾 CDP LLDP 封包
Tcpdump 備忘單(基本進階範例)