Linux常用网络工具:hping高级主机扫描

之前介绍了主机扫描工具fping,可以参考我写的《Linux常用网络工具:fping主机扫描》。

hping是一款更高级的主机扫描工具,它支持TCP/IP数据包构造、分析,在某些防火墙配置或运营商拦截ICMP数据包时,可用来扫描存活主机。

hping还可以伪造源IP,用来发起DDos攻击。

hping官方网站:http://www.hping.org/

hping的源代码编译安装


hping的源代码托管在GitHub,地址:https://github.com/antirez/hping。

编译及安装命令:

wget https://github.com/antirez/hping/archive/master.zip
unzip master
cd hping-master
yum install libpcap-devel
./configure
make
make install

hping依赖libpcap-devel,所以需要先进行安装,make过程中还可能出现以下两个问题:

出现问题:libpcap_stuff.c:20:21: 错误:net/bpf.h:没有那个文件或目录

解决办法:ln -sf /usr/include/pcap-bpf.h /usr/include/net/bpf.h;

出现问题:/usr/bin/ld: cannot find -ltcl

解决办法:yum -y install tcl     yum -y install tcl-devel;

然后输入:

make strip

make install

hping常用参数介绍


如果防火墙或运营商屏蔽ICMP的话,hping可以对指定目标端口发起TCP探测,常用的参数:

-p 端口号

-S 发送TCP的SYN包

-A 发送TCP的ACK包

-a 伪造源IP

--flood 尽可能快的发送,慎用

输入示例:

hping 192.168.2.224 -p 80 -S
hping 192.168.2.224 -p 80 -A
hping 192.168.2.224 -p 80 -S -a 192.168.0.91

记录,为更好的自己!

posted @ 2015-06-04 21:33  全栈工程狮  阅读(2693)  评论(0编辑  收藏  举报