安装
以下步骤用于 在 centos7 下安装 hping3。
安装依赖库
先安装以下依赖库:
yum -y install libpcap
yum -y install libpcap-devel
yum -y install tcl-devel
方式一: yum 安装
yum -y install hping3
方式二:源码安装
# 下载
wget http://www.hping.org/hping3-20051105.tar.gz
# 解压
tar xvf hping3-20051105.tar.gz
cd hping3-20051105
# 配置
./configure
# 编译
make
# 安装
make install
问题 1 (configure 时候出错):
bytesex.h:22:3: error: #error can not find the byte order for this architecture, fix bytesex.h
error can not find the byte order for this architecture, fix bytesex.h
ars.h:190:2: error: #error “Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)ENDIAN"
#error "Please, edit Makefile and add -DBYTE_ORDER(BIG|LITTLE)_ENDIAN”
原因:
没有指定 x86_64 下的大小端对齐。
解决方法:
修改 bytesex.h
,在 defined(__i386__)
后添加 defined(__x86_64__)
。
修改前:
#if defined(__i386__) \
|| defined(__alpha__) \
|| (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))