centOS 编译tcpflow

来源:互联网 发布:单片机检测高低电平 编辑:程序博客网 时间:2024/04/30 07:25

本次是在10.9.18.110上做实验:

1 下载源码包到/data/aiquan.yuan目录:

    wget http://www.circlemud.org/pub/jelson/tcpflow/tcpflow-0.21.tar.gz

2 解压:

    gzip -d tcpflow-0.21.tar.gz

    tar xvf tcpflow-0.21.tar

3 编译:

    cd tcpflow-0.21:

    ./configure

    make

    make install

4 注意,3中./configure有可能出错:

configure: error: 
Can't find the pcap library (libpcap.a); install the pcap library (from
ftp://ftp.ee.lbl.gov/libpcap.tar.Z ) and/or use
--with-pcap to specify the path to it on your system

When installing libpcap do both 'make install' and 'make install-incl'
此时说明需要安装libpcap,安装过程如下:
wget http://www.tcpdump.org/release/libpcap-1.3.0.tar.gz
解压进入目录,./configure   make    make install 
5 tcpflow编译完毕,执行tcpflow命令时出错:
error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory

在/usr/local/lib目录下, libpcap.so.1文件就躺在这里,为什么找不到呢。

解决方法:打开 /etc目录下的文件ld.so.conf ,添加两行

/usr/local/lib

/usr/lib

然后在终端下执行从新加载配置的命令:

ldconfig

6 最后,执行 tcpflow -cp 命令查看

 

 

抓包工具wireshark:

1 sudo apt-get install wireshark-common

2 sudo wireshark

原创粉丝点击