当前位置:首页 » 操作系统 » linuxtcpdump

linuxtcpdump

发布时间: 2022-05-01 04:59:43

❶ tcpmp是linux自带的吗

是的 linux的发行包里自带tcpmp

名称 :tcpmp
简介 : A network traffic monitoring tool
网址 :http://www.tcpmp.org
协议 : BSD with advertising
描述 : Tcpmp is a command-line tool for monitoring network traffic.
: Tcpmp can capture and display the packet headers on a particular
: network interface or on all interfaces. Tcpmp can display all of
: the packet headers, or just the ones that match particular criteria.

: Install tcpmp if you need a program to monitor network traffic.

❷ 关于linux tcpmp命令

用简单的话来定义tcpmp,就是:mp the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具。 tcpmp可以将网络中传送的数据包的“头”完全截获下来提供分析。它支持针对网络层、协议、主机、网络或端口的过滤,并提供and、or、not等逻辑语句来帮助你去掉无用的信息。

实用命令实例
默认启动
tcpmp
普通情况下,直接启动tcpmp将监视第一个网络接口上所有流过的数据包。

监视指定网络接口的数据包
tcpmp -i eth1
如果不指定网卡,默认tcpmp只会监视第一个网络接口,一般是eth0,下面的例子都没有指定网络接口。

监视指定主机的数据包
打印所有进入或离开sundown的数据包.
tcpmp host sundown
也可以指定ip,例如截获所有210.27.48.1 的主机收到的和发出的所有的数据包
tcpmp host 210.27.48.1
打印helios 与 hot 或者与 ace 之间通信的数据包
tcpmp host helios and \( hot or ace \)
截获主机210.27.48.1 和主机210.27.48.2 或210.27.48.3的通信
tcpmp host 210.27.48.1 and \ (210.27.48.2 or 210.27.48.3 \)
打印ace与任何其他主机之间通信的IP 数据包, 但不包括与helios之间的数据包.
tcpmp ip host ace and not helios
如果想要获取主机210.27.48.1除了和主机210.27.48.2之外所有主机通信的ip包,使用命令:
tcpmp ip host 210.27.48.1 and ! 210.27.48.2
截获主机hostname发送的所有数据
tcpmp -i eth0 src host hostname
监视所有送到主机hostname的数据包
tcpmp -i eth0 dst host hostname

监视指定主机和端口的数据包
如果想要获取主机210.27.48.1接收或发出的telnet包,使用如下命令
tcpmp tcp port 23 and host 210.27.48.1
对本机的udp 123 端口进行监视 123 为ntp的服务端口
tcpmp udp port 123

监视指定网络的数据包
打印本地主机与Berkeley网络上的主机之间的所有通信数据包(nt: ucb-ether, 此处可理解为'Berkeley网络'的网络地址,此表达式最原始的含义可表达为: 打印网络地址为ucb-ether的所有数据包)
tcpmp net ucb-ether
打印所有通过网关snup的ftp数据包(注意, 表达式被单引号括起来了, 这可以防止shell对其中的括号进行错误解析)
tcpmp 'gateway snup and (port ftp or ftp-data)'
打印所有源地址或目标地址是本地主机的IP数据包
(如果本地网络通过网关连到了另一网络, 则另一网络并不能算作本地网络.(nt: 此句翻译曲折,需补充).localnet 实际使用时要真正替换成本地网络的名字)
tcpmp ip and not net localnet

❸ linux-2.4 如何安装 tcpmp

安装过程参照以下步骤:
1、打开网址:www.tcpmp.org/ 下载 libpcap-1.0.0.tar.gz (512.0KB) 软件包,通过命令 tar zxvf libpcap-1.0.0.tar.gz 解压文件,并将其放入自定义的安装目录。
2、打开网址:flex.sourceforge.net/ 下载 flex-2.5.35.tar.gz (1.40MB) 软件包,通过 tar zxvf flex-2.5.35.tar.gz 解压文件,并将其放入上述自定义的安装目录中。
注:如果没有编译安装此文件,在编译安装libpcap时,就会出现 “configure: error: Your operating system's lex is insufficient to compile libpcap.”的错误提示。
3、打开网址:ftp.gnu.org/gnu/bison/ 下载 bison-2.4.1.tar.gz (1.9MB) 软件包,通过 tar zxvf bison-2.4.1.tar.gz 解压文件,并将其放入上述自定义的安装目录中。
注:如果没有编译安装此文件,在编译安装libpcap时,就会出现 "configure: WARNING: don't have both flex and bison; reverting to lex/yacc checking for capable lex... insufficient" 的错误提示。
4、打开网址:ftp.gnu.org/gnu/m4/ 下载 m4-1.4.13.tar.gz (1.2MB)软件包,通过 tar zxvf m4-1.4.13.tar.gz 解压文件,并将其放入上述自定义的安装目录中。
注:如果没有编译安装此文件,在编译安装bison-2.4.1时,就会出现 “configure: error: GNU M4 1.4 is required”的错误提示。
5、而后依次进入目录m4-1.4.13,bison-2.4.1,flex-2.5.35,libpcap-1.0.0 并执行以下命令:
(sudo) ./configure
(sudo) make
(sudo) make install

❹ linux上用tcpmp抓包的问题

(管理员,给人家解释一下嘛,何必呢。)。。。你确定满意答案了,搞的我只能这样回答你了,具体可以看看man tcpmp 这里-nn 是不把地址转换为域名,不把端口转换为端口名,你不加.tcpmp在抓第一个包的时候就要把地址转换成域名,端口转换成端口名,如果你的DNS没有配置好,就会延时,等待解析,,直到最后超时,才会显示出来抓到的包,而这段时间还没完,你可能已经CTRL+C中止了,所以抓不到,你多等会儿可能就出来了(这段时间可能很长的)。加了-nn,就不解析了,(就不存在DNS没配置好,等待解析直到超时了)。直接以IP地址,端口号的形式显示出来了。

❺ tcpmp在linux命令中是什么意思

你使用tcpmp抓包的话它会一直监听你需要监听的端口,如果你想退出的话输入:ctrl + c可以强制退出。

❻ linux下tcpmp抓包存在什么位置

tcpmp默认的是标准输出,一般来讲就是显示器,如果要将抓包结果保存到文件则需要使用-w参数,例如:

$tcpmp-ieth1-w/tmp/xxx.cap

抓eth1的包

❼ TCPDUMP 抓包 怎么查看 抓的包的内容

1、tcpmp检测登录linux系统输入tcpmp,如果找不到表示没有安装。也可以用rpm查询。

❽ tcpmp 怎么在linux操作系统上抓包

默认系统里边没有安装有tcpmp的,无法直接使用

这里我们可以使用yum来直接安装它
yum install -y tcpmp

如果忘记了这个的用法,我们可以使用 tcpmp --help 来查看一下使用方法

一般我们的服务器里边只有一个网卡,使用tcpmp可以直接抓取数据包,但是这样查看太麻烦了,所以都会添加参数来进行获取的。
例如我截取本机(192.168.31.147)和主机114.114.114.114之间的数据
tcpmp -n -i eth0 host 192.168.31.147 and 114.114.114.114

还有截取全部进入服务器的数据可以使用以下的格式
tcpmp -n -i eth0 dst 192.168.31.147
或者服务器有多个IP 可以使用参数
tcpmp -n -i eth0 dst 192.168.31.147 or 192.168.31.157

我们抓取全部进入服务器的TCP数据包使用以下的格式,大家可以参考下
tcpmp -n -i eth0 dst 192.168.31.147 or 192.168.31.157 and tcp
从本机出去的数据包
tcpmp -n -i eth0 src 192.168.31.147 or 192.168.31.157
tcpmp -n -i eth0 src 192.168.31.147 or 192.168.31.157 and port ! 22 and tcp

或者可以条件可以是or 和 and 配合使用即可筛选出更好的结果。

❾ 在Linux系统怎么用tcpmp命令

------------------------------------tcpmp--------------------------------
协议报文分析器:
sniffer: 商业工具

tcpmp, wireshark(GUI), tshark(CLI)

tcpmp [options] 过滤条件

获取报文的条件:

ip src host 172.16.100.1
tcp src or dst port 21

udp dst port 53

tcp src or dst port 21 AND src host 172.16.100.1

tcp port 21 AND host 172.16.100.1

tcpmp的语法:
tcpmp [options] [Protocol] [Direction] [Host(s)] [Value] [Logical Operations] [Other expression]

Protocol(协议):
Values(取值): ether, fddi, ip, arp, rarp, decnet, lat, sca, moprc, mopdl, tcp and udp.
If no protocol is specified, all the protocols are used.

Direction(流向):
Values(取值): src, dst, src and dst, src or dst
If no source or destination is specified, the "src or dst" keywords are applied. (默认是src or dst)
For example, "host 10.2.2.2" is equivalent to "src or dst host 10.2.2.2".

Host(s)(主机):
Values(替代关键字): net, port, host, portrange.
If no host(s) is specified, the "host" keyword is used. 默认如果此段没有指定关键字,默认即host。
For example, "src 10.1.1.1" is equivalent to "src host 10.1.1.1".

Logical Operations:
(1) and
and or &&
(2) or
or or ||
(3) except
not or !

常用选项:

-i any : 指定在哪个网卡进行抓包
-n : 不反解主机名
-nn : 不反解主机名与端口号
-X : 以16进制格式与ASCII格式显示报文
-XX : 除了显示X的内容还显示以太网首部
-v, -vv, -vvv : 显示更详细的信息
-c # : Only get x number of packets and then stop.
-s : Define the snaplength (size) of the capture in bytes. Use -s0 to get everything, unless you are intentionally capturing less.
-S : Print absolute sequence numbers.
-e : Get the ethernet header as well.
-q : Show less protocol information.
-E : Decrypt IPSEC traffic by providing an encryption key.
-A :Display Captured Packets in ASCII
-w /path/to/some_file : Capture the packets and write into a file
-r /path/from/some_file : Reading the packets from a saved file
-tttt : Capture packets with proper readable timestamp

eg:
tcpmp -i eth0 -X -nn -vv tcp port 100
可以在报文上面看一下有无user与pass的信息.
tcpmp -i eth0 -X -nn -vv tcp port 110 and ip src 192.168.10.1

ip host 172.16.100.1
ip src host 172.16.100.1
ip dst host 172.16.100.1
ip src and dst host 172.16.100.1

❿ linux怎么抓tcpmp的数据包

linux下有命令可直接执行抓包的,命令如下:1、tcpmp -vv -i ethN -s 10240 -w /root/abc.cap host ip
2、上述命令中,ethN,是你要抓的本机网卡,一般是eth0,可使用ifconfig查看使用的哪个网卡
-s 指定的是抓包数量 -w指定的是抓到的包写到哪个位置 host ip即为抓取哪个ip 的包

热点内容
我的世界好玩服务器拍视频 发布:2024-10-05 13:23:19 浏览:553
穿越火线挂机脚本 发布:2024-10-05 13:05:44 浏览:33
分解质因数c语言 发布:2024-10-05 12:15:53 浏览:777
mysql存储过程字符编码 发布:2024-10-05 12:05:48 浏览:182
c语言命名 发布:2024-10-05 11:56:38 浏览:617
编程哪个好学习 发布:2024-10-05 11:50:59 浏览:1000
为什么不买安卓旗舰 发布:2024-10-05 11:46:04 浏览:382
ostcb编译条件 发布:2024-10-05 11:28:24 浏览:995
win10怎么关闭登录密码 发布:2024-10-05 11:09:55 浏览:937
降温解压器 发布:2024-10-05 10:54:15 浏览:423