首页 > 其他 > 详细

Tcpdump

时间:2019-06-01 00:17:22      阅读:101      评论:0      收藏:0      [点我收藏+]

Tcpdump

dump the traffic on a network

Install

#Arch/Manjaro
sudo pacman -S tcpdump
#CentOS
sudo yum install tcpdump
#Ubuntu
sudo apt install tcpdump

Parameters

-A: Print each packet (minus its link level header) in ASCII. Handy for capturing web pages.

-c count : Exit after receiving count packets

-D: Print the list of the network interfaces available on the system and the number can be used for -i

-n: Don't convert addresses

-N: Don't print domain name qualification of host names.

-q: Quick output. Print less protocol information so output lines are shorter.

-w file.pcap: Write the raw packets fo file

Use

  1. 经过 [eth],src或dst为 [ip] 的包

    tcpdump -i [eth] -n host [ip]
    
  2. src/dst为[ip]

    tcpdump -i [eth] [src|dst] host [ip]
    
  3. 抓取主机[h1]与主机[h2]或[h3]间的通信

    tcpdump host [h1] and \([h2] or [h3]\)
    
  4. 抓取主机[h1]除了和[h2]之外左右主机的通信

    tcpdump host [h1] and ![h2]
    
  5. 抓取指定协议的数据包

    tcpdump  [arp|ip|tcp|udp|icmp]
    
  6. 指定端口 [port]

    tcpdump -i [eth] port [port]
    
  7. 只抓SYN包

    tcpdump -i [eth] 'tcp[tcpflags]=tcp-syn'
    

References

  1. Linux下tcpdump命令的使用
  2. Linux tcpdump命令详解
  3. tcpdump命令
  4. tcpdump抓包命令
  5. Linux基础:用tcpdump抓包

Tcpdump

原文:https://www.cnblogs.com/QQ-1615160629/p/10958075.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!