zmap源码编译安装流程及错误解决方案
[Misc]
参考官方给出的方案在这里,事实上针对ubuntu我们要进行一些调整。
注意:以下命令均进行在root权限下
我的安装环境:ubuntu12.04+zmap2.1.0
安装依赖包
apt-get install -y build-essential cmake libgmp3-dev libpcap-dev gengetopt byacc flex dwarfdump libtool autoconf git
安装json-c依赖包
git clone https://github.com/json-c/json-c.git
cd json-c
sh ./autogen.sh
./configure
make
make install
ldconfig
安装zmap
-
wget https://github.com/zmap/zmap/archive/v2.1.0.tar.gz && tar -xzvf v2.1.0.tar.gz
-
vim CMakeLists.txt
修改配置文件中第一行的Cmake的版本号。因为apt-get到的是2.08,配置文件写的是2.12,检查不通过。改为:cmake_minimum_required (VERSION 2.8.0)
即可否则会报如下错误:
root@cdxy:~/Tools/zmap-2.1.0# cmake -DENABLE_DEVELOPMENT=OFF CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 2.8.12 or higher is required. You are running version 2.8.7
-
vim ./lib/CMakeLists.txt
注释或者删除这一行
target_include_directories (zmaplib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
否则报错:
CMake Error at lib/CMakeLists.txt:21 (target_include_directories): Unknown CMake command "target_include_directories".
cmake -DENABLE_DEVELOPMENT=OFF
make
-
make install
如果在这一步报错:
CMake Error at InstallConfFiles.cmake:6 (file): file COPY cannot find "/conf/zmap.conf". Call Stack (most recent call first): cmake_install.cmake:36 (INCLUDE)
vim InstallConfFiles.cmake
把${PROJECT_SOURCE_DIR}
替换成当前的zmap源码路径即可
-
安装完成后
zmap -h
查看使用说明