zoukankan      html  css  js  c++  java
  • Tcpdump usage examples

    In most cases you will need root permission to be able to capture packets on an interface. Using tcpdump (with root) to capture the packets and saving them to a file to analyze with Wireshark (using a regular account) is recommended over using Wireshark with a root account to capture packets on an "untrusted" interface. See theWireshark security advisories for reasons why.

    ========================================================================================================

    See the list of interfaces on which tcpdump can listen:

    tcpdump -D

    Listen on interface eth0:

    tcpdump -i eth0

    Listen on any available interface (cannot be done in promiscuous mode. Requires Linux kernel 2.2 or greater):

    tcpdump -i any

    Be verbose while capturing packets:

    tcpdump -v

    Be more verbose while capturing packets:

    tcpdump -vv

    Be very verbose while capturing packets:

    tcpdump -vvv

    Be less verbose (than the default) while capturing packets:

    tcpdump -q

    Limit the capture to 100 packets:

    tcpdump -c 100

    Record the packet capture to a file called capture.cap:

    tcpdump -w capture.cap

    Record the packet capture to a file called capture.cap but display on-screen how many packets have been captured in real-time:

    tcpdump -v -w capture.cap

    Display the packets of a file called capture.cap:

    tcpdump -r capture.cap

    Display the packets using maximum detail of a file called capture.cap:

    tcpdump -vvv -r capture.cap

    Display IP addresses and port numbers instead of domain and service names when capturing packets:

    tcpdump -n

    Capture any packets where the destination host is 192.168.1.1. Display IP addresses and port numbers:

    tcpdump -n dst host 192.168.1.1

    Capture any packets where the source host is 192.168.1.1. Display IP addresses and port numbers:

    tcpdump -n src host 192.168.1.1

    Capture any packets where the source or destination host is 192.168.1.1. Display IP addresses and port numbers:

    tcpdump -n host 192.168.1.1

    Capture any packets where the destination network is 192.168.1.0/24. Display IP addresses and port numbers:

    tcpdump -n dst net 192.168.1.0/24

    Capture any packets where the source network is 192.168.1.0/24. Display IP addresses and port numbers:

    tcpdump -n src net 192.168.1.0/24

    Capture any packets where the source or destination network is 192.168.1.0/24. Display IP addresses and port numbers:

    tcpdump -n net 192.168.1.0/24

    Capture any packets where the destination port is 23. Display IP addresses and port numbers:

    tcpdump -n dst port 23

    Capture any packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:

    tcpdump -n dst portrange 1-1023

    Capture only TCP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:

    tcpdump -n tcp dst portrange 1-1023

    Capture only UDP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:

    tcpdump -n udp dst portrange 1-1023

    Capture any packets with destination IP 192.168.1.1 and destination port 23. Display IP addresses and port numbers:

    tcpdump -n "dst host 192.168.1.1 and dst port 23"

    Capture any packets with destination IP 192.168.1.1 and destination port 80 or 443. Display IP addresses and port numbers:

    tcpdump -n "dst host 192.168.1.1 and (dst port 80 or dst port 443)"

    Capture any ICMP packets:

    tcpdump -v icmp

    Capture any ARP packets:

    tcpdump -v arp

    Capture either ICMP or ARP packets:

    tcpdump -v "icmp or arp"

    Capture any packets that are broadcast or multicast:

    tcpdump -n "broadcast or multicast"

    Capture 500 bytes of data for each packet rather than the default of 68 bytes:

    tcpdump -s 500

    Capture all bytes of data within the packet:

    tcpdump -s 0

  • 相关阅读:
    Selenium2Library系列 keywords 之 _SelectElementKeywords 之 _get_labels_for_options(self, options)
    Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list_options(self, select_list_or_locator)
    Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list(self, locator)
    Selenium2Library中的Get Alert Message
    selenium+testNG+Ant
    Maven安装testNG
    在FOR中使用close window,循环次数大于1就会报异常
    时间格式去‘0’
    序列化和反序列化组件 基表的使用 多表断关联关系分析 多表序列化组件 自定义子序列化深度连表 多表反序列化 序列化与反序列化整合 群增接口实现 单删群删接口实现 单整体改 单与群局部改
    drf安装与封装风格 drf请求生命周期 drf五大模块(请求模块,渲染模块,解析模块,异常处理模块,响应模块)
  • 原文地址:https://www.cnblogs.com/oskb/p/3785891.html
Copyright © 2011-2022 走看看