nmap编译

一、背景

​ 因某些原因接触到nmap,觉得很有意思,功能强大,并且能学习到很多网络知识,所以决定去探索下nmap。从编译、使用、再到原理,一步一步的逐渐深入的学习。

二、环境说明

​ windows10 + VMware Workstation 14 Pro + Ubuntu18.04

​ nmap-7.80.tar.bz2

三、编译

tar xf nmap-7.80.tar.bz2 -C .
cd nmap-7.80
./configure

报错

configure: error: Neither flex nor lex was found.
configure: error: ./configure failed for libpcap

安装bison

# https://mirrors.aliyun.com/gnu/bison/
tar xf bison-2.6.1.tar.xz -C .
cd bison-2.6.1/
./configure

报错

checking for GNU M4 that supports accurate traces... configure: error: no acceptable m4 could be found in $PATH.
GNU M4 1.4.6 or later is required; 1.4.16 or newer is recommended.
GNU M4 1.4.15 uses a buggy replacement strstr on some systems.
Glibc 2.9 - 2.12 and GNU M4 1.4.11 - 1.4.15 have another strstr bug.

安装m4

# http://ftp.gnu.org/gnu/m4/
tar xf 4-1.4.18.tar.xz -C .
cd m4-1.4.18/
./configure
make
sudo make install

继续编译 bison

cd bison-2.6.1/
./configure
make
sudo make install

安装flex

tar xf flex-2.6.0.tar.bz2 -C .
cd flex-2.6.0
./configure
make
sudo make install

继续编译nmap

cd nmap-7.80
./configure
make
sudo make install

四、验证

nmap -v
Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-05 13:16 CST
Read data files from: /usr/local/bin/../share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.05 seconds

猜你喜欢

转载自blog.51cto.com/happytree007/2517037