在Centos 5.9上使用GEM安装pcaprub时出错

时间:2013-08-06 05:19:09

标签: centos metasploit

我是在Centos 5.9盒子上安装metasploit的midprocess。执行捆绑安装时,我遇到安装pcaprub的错误,我尝试单独运行 gem install pcaprub 并在此处记录。已安装libpcap-devel-0.9.4-15.el5.i386.rpm。我已经潜伏了很多堆栈流,很遗憾这是我的第一篇文章。我肯定会遗漏一些关于我发布的日志问题的基石,所以请不要犹豫,点亮这一点。

gem install pcaprub
Building native extensions.  This could take a while...
ERROR:  Error installing pcaprub:
        ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb

[*] Running checks for pcaprub code...
platform is i686-linux
checking for pcap_open_live() in -lpcap... yes
checking for pcap_setnonblock() in -lpcap... yes
creating Makefile

make
compiling pcaprub.c
pcaprub.c: In function 'Init_pcaprub':
pcaprub.c:954: error: 'PCAP_ERROR' undeclared (first use in this function)
pcaprub.c:954: error: (Each undeclared identifier is reported only once
pcaprub.c:954: error: for each function it appears in.)
pcaprub.c:955: error: 'PCAP_ERROR_BREAK' undeclared (first use in this function)
pcaprub.c:956: error: 'PCAP_ERROR_NOT_ACTIVATED' undeclared (first use in this function)
pcaprub.c:957: error: 'PCAP_ERROR_ACTIVATED' undeclared (first use in this function)
pcaprub.c:958: error: 'PCAP_ERROR_NO_SUCH_DEVICE' undeclared (first use in this function)
pcaprub.c:959: error: 'PCAP_ERROR_RFMON_NOTSUP' undeclared (first use in this function)
pcaprub.c:960: error: 'PCAP_ERROR_NOT_RFMON' undeclared (first use in this function)
pcaprub.c:961: error: 'PCAP_ERROR_PERM_DENIED' undeclared (first use in this function)
pcaprub.c:962: error: 'PCAP_ERROR_IFACE_NOT_UP' undeclared (first use in this function)
pcaprub.c:969: error: 'PCAP_WARNING' undeclared (first use in this function)
pcaprub.c:970: error: 'PCAP_WARNING_PROMISC_NOTSUP' undeclared (first use in this function)
make: *** [pcaprub.o] Error 1


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/pcaprub-0.11.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/pcaprub-0.11.3/ext/pcaprub/gem_make.out

2 个答案:

答案 0 :(得分:4)

我使用了以下命令,它似乎修复了它,所以运行

apt-get install libpcap-dev

在跑完之后我就可以使用

gem install pcaprub

没有任何问题。

答案 1 :(得分:0)

我遇到了同样的问题,花了一段时间才弄清楚出了什么问题 我相信如果你使用yum安装libpcap的头文件有点旧。

所以,删除它并手动构建它。

yum remove libpcap*
wget http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz
tar -xf libpcap-1.5.3.tar.gz
cd libpcap-1.5.3
./configure
make
make install

编辑:我还必须重新安装ncap以使一切正常。