如何为Tcpdump指定主机,端口和协议?

Tcpdump is everyday tool used by system and network administrator. We generally look simple use cases like host, port and protocol filter for tcpdump . In this tutorial we will look how to filter host, port and protocol in tcpdump. But keep in mind that tcpdump will requires administrator or root privileges. We can use root account or sudo command in order to gain root privileges.

Tcpdump是系统和网络管理员使用的日常工具。 我们通常看起来很简单的用例,例如tcpdump主机,端口和协议过滤器。 在本教程中,我们将研究如何在tcpdump中过滤主机,端口和协议。 但是请记住,tcpdump将需要管理员或root特权。 我们可以使用root帐户或sudo命令来获得root特权。

指定主机名 (Specify Host Name)

Tcpdump can resolve host names like regular tools. We can specify the host name but the host name should be resolvable. In this example we will capture traffic from poftut.com. We will use host option like below.

Tcpdump可以像常规工具一样解析主机名。 我们可以指定主机名,但是主机名应该是可解析的。 在此示例中,我们将捕获来自poftut.com流量。 我们将使用如下所示的host选项。

$ tcpdump host poftut.com

指定IP地址 (Specify IP Address)

IP address of the target can be provided to the tcpdump like below. In this example we will capture packets from 192.168.122.10

可以将目标的IP地址提供给tcpdump,如下所示。 在此示例中,我们将从192.168.122.10捕获数据包

$ tcpdump host 192.168.122.10
Specify IP Address
Specify IP Address
指定IP地址

指定端口(Specify Port)

We can specify the port number with port option. This will capture all traffic related port number from target and our local system. In thi

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值