跳过导览列.
首页
做最好的Linux技术文档网站

推荐一个优秀的linux下的网络监控软件!(千万不要用来干坏事哦。。)

admin's picture

去官方网站下载tcpick,然后在linux下安装!最好是下载源码文件自己编译哟。

http://tcpick.sourceforge.net

wget http://dag.wieers.com/rpm/packages/tcpick/tcpick-0.2.1-1.2.el5.rf.i386.rpm (具体看你自己的操作系统版本了)

rpm -i tcpick-0.2.1-1.2.el5.rf.i386.rpm

然后就可以运行tcpick了,更多的使用看帮助哟。

These are some screenshots of tcpick running on a xterm (with custom bash colors)

  • tcpick -i ppp0 -C -a
    tcpick running with interface, color and host lookup options

  • tcpick -i ppp0 -h -yU -C "port 22"
    tcpick sniffing a ssh connection ("port 22") displaying unprintable carachters in hexadecimal (-yU) highlighted in red color (-C). Packet headers (-h) are coloured too (-C)

  • tcpick -i ppp0
    tcpick running without options (only the interface option)

  • tcpick -ippp0 "port 6667" -S -C -h -yP
    tcpick running sniffing an IRC session, displaying a short header of the packet too

  • tcpick -ippp0 "port 6667" -yP| grep PRIVMSG
    tcpick running sniffing an IRC session, but displaying only messages!

  • tcpick -i ppp0 -yX -C
    tcpick running in "hexdump + ascii" (and color) mode, whitout displaying packet headers

  • tcpick -i ppp0 -a -C
    tcpick running with name lookup enabled

 

Trackback: http://tb.donews.net/TrackBack.aspx?PostId=248953

 

[点击此处收藏本文]  发表于2005年01月20日 4:38 PM
<!---->

jarson 发表于2005-01-20 4:44 PM  IP: 61.141.167.*
This is EXAMPLES, produced by makeinfo version 4.7 from
EXAMPLES.texinfo.

1 Examples of tcpick usage
**************************

1.1 connection status
=====================

Tcpick is a sniffer able to understand wich status has the connection
(SYN-SENT, SYN-RECEIVED and so on). To see the connection tracker in
action on eth0 simply type:

# tcpick -i eth0 -C

`-C' means "enable colors", and the output is very pretty.

You will see something like this:

23:07:42.672171 1 SYN-SENT 12.34.56.78:41599 > 123.123.123.123:http
23:07:42.822239 2 SYN-SENT 12.34.56.78:41600 > 32.13.21.32:5973
23:07:42.826634 3 SYN-SENT 12.34.56.78:41601 > 123.45.67.89:5555
23:07:42.854681 4 SYN-SENT 12.34.56.78:41602 > 1.2.3.4:56789
23:07:43.084242 1 SYN-RECEIVED 12.34.56.78:41599 > 123.123.123.123:http
23:07:43.087045 1 ESTABLISHED 12.34.56.78:41599 > 123.123.123.123:http
23:07:44.061311 5 SYN-SENT 12.34.56.78:41603 > 10.20.30.40:8888

1.2 display the payload and packet headers
==========================================

It is very easy:

# tcpick -i eth0 -C -yP -h -a

`-yP' means "payload printable", `-h' means "header" and `-a' means
names resolution. Unprintable carachters are displayed as dots.

1.3 display client data only of the first smtp connection
=========================================================

# tcpick -i eth0 -C -bCU -T1 "port 25"

`-bCU' means: display the rebuilded stream (`-b') only the client
side (`C') and unprintable carachters will be displayed as hexcode
(`U').

`T1' means: display only the first (1) connection.

"port 25" is the filter.

1.4 download a file passively
=============================

Yeah! It is very a simple job:

#tcpick -i eth0 -wR "port ftp-data"

When the file has been completely transmitted (connection displayed
as "CLOSED") check in the working directory: you will find some files
named like this:

# ls *.tcpick
client_123.45.67.89_98.76.54.32_34567.tcpick
server_123.45.67.89_98.76.54.32_34567.tcpick

Bingo! If you do `$ file *.tcpick' you will find that one of the two
is a a gzip archive or whatever you sniffed.

1.5 redirect the first connection to a software
===============================================

You must choose between client or server side, because you don't want
both stream mixed in the standard output. It is a really simple job,
just type:

# tcpick -i eth0 --pipe client "port 80" | gzip > http_response.gz
or
# tcpick -i eth0 --pipe server "port 25" | nc foobar.net 25

Now, use your imagination and let me know what crazy experiments have
you done with tcpick ;^)