zmap在阿里云主机上的编译

环境:

cat /etc/issue
Ubuntu 14.04.2 LTS \n \l

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz
stepping : 7
microcode : 0x70d
cpu MHz : 2200.044
cache size : 15360 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush mmx fxsr sse sse2 ht nx rdtscp lm constant_tsc pni ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm
bogomips : 4400.08
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion=‘Ubuntu 4.8.2-19ubuntu1‘ --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

已经有一个编译过的源码包了,解压后

apt-get update(不然装不了cmake)

apt-get install cmake

# make
[ 2%] Generating parser.c
/bin/sh: 1: byacc: not found
make[2]: *** [src/parser.c] Error 127
make[1]: *** [src/CMakeFiles/zmap.dir/all] Error 2

apt-get install byacc

# make
[ 2%] Generating parser.c
[ 5%] Generating zopt.h
/bin/sh: 1: gengetopt: not found

apt-get install gengetopt

make
[ 2%] Generating zopt.h
[ 5%] Generating lexer.c
/bin/sh: 1: flex: not found

apt-get install flex

make
[ 2%] Generating lexer.c
Scanning dependencies of target zmap
[ 5%] Building C object src/CMakeFiles/zmap.dir/aesrand.c.o
[ 8%] Building C object src/CMakeFiles/zmap.dir/cyclic.c.o
/root/source/zmap-1.2.1/src/cyclic.c:47:17: fatal error: gmp.h: No such file or directory

apt-get install gmp-devel

make
[ 2%] Building C object src/CMakeFiles/zmap.dir/cyclic.c.o
[ 5%] Building C object src/CMakeFiles/zmap.dir/expression.c.o
[ 8%] Building C object src/CMakeFiles/zmap.dir/fieldset.c.o
[ 11%] Building C object src/CMakeFiles/zmap.dir/filter.c.o
[ 14%] Building C object src/CMakeFiles/zmap.dir/get_gateway.c.o
/root/source/zmap-1.2.1/src/get_gateway.c:17:23: fatal error: pcap/pcap.h: No such file or directory
#include <pcap/pcap.h>

apt-get install libpcap-dev

make
[ 2%] Building C object src/CMakeFiles/zmap.dir/get_gateway.c.o
[ 5%] Building C object src/CMakeFiles/zmap.dir/iterator.c.o
[ 8%] Building C object src/CMakeFiles/zmap.dir/monitor.c.o
[ 11%] Building C object src/CMakeFiles/zmap.dir/recv.c.o
[ 14%] Building C object src/CMakeFiles/zmap.dir/send.c.o
[ 17%] Building C object src/CMakeFiles/zmap.dir/shard.c.o
[ 20%] Building C object src/CMakeFiles/zmap.dir/state.c.o
[ 23%] Building C object src/CMakeFiles/zmap.dir/validate.c.o
[ 26%] Building C object src/CMakeFiles/zmap.dir/zmap.c.o
[ 29%] Building C object src/CMakeFiles/zmap.dir/zopt_compat.c.o
[ 32%] Building C object src/CMakeFiles/zmap.dir/lexer.c.o
[ 35%] Building C object src/CMakeFiles/zmap.dir/parser.c.o
[ 38%] Building C object src/CMakeFiles/zmap.dir/probe_modules/module_icmp_echo.c.o
[ 41%] Building C object src/CMakeFiles/zmap.dir/probe_modules/module_tcp_synscan.c.o
[ 44%] Building C object src/CMakeFiles/zmap.dir/probe_modules/module_udp.c.o
[ 47%] Building C object src/CMakeFiles/zmap.dir/probe_modules/packet.c.o
[ 50%] Building C object src/CMakeFiles/zmap.dir/probe_modules/probe_modules.c.o
[ 52%] Building C object src/CMakeFiles/zmap.dir/output_modules/module_csv.c.o
[ 55%] Building C object src/CMakeFiles/zmap.dir/output_modules/output_modules.c.o
[ 58%] Building C object src/CMakeFiles/zmap.dir/__/lib/blacklist.c.o
[ 61%] Building C object src/CMakeFiles/zmap.dir/__/lib/constraint.c.o
[ 64%] Building C object src/CMakeFiles/zmap.dir/__/lib/logger.c.o
[ 67%] Building C object src/CMakeFiles/zmap.dir/__/lib/pbm.c.o
[ 70%] Building C object src/CMakeFiles/zmap.dir/__/lib/random.c.o
[ 73%] Building C object src/CMakeFiles/zmap.dir/__/lib/rijndael-alg-fst.c.o
[ 76%] Building C object src/CMakeFiles/zmap.dir/__/lib/xalloc.c.o
Linking C executable zmap
[100%] Built target zmap

好了,这就编译好了zmap

再编译examples

~/source/zmap-1.2.1/examples/banner-grab# make
cc -I../../lib/ -Wall -g -O2 -fstack-protector-all --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -c -o banner-grab-tcp.o banner-grab-tcp.c
banner-grab-tcp.c:14:26: fatal error: event2/event.h: No such file or directory
#include <event2/event.h>
^
compilation terminated.
make: *** [banner-grab-tcp.o] Error 1

apt-get install libevent-dev

再编译就好了

~/source/zmap-1.2.1/examples/banner-grab# make
cc -I../../lib/ -Wall -g -O2 -fstack-protector-all --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -c -o banner-grab-tcp.o banner-grab-tcp.c
cc -I../../lib/ -Wall -g -O2 -fstack-protector-all --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -c -o logger.o ../../lib/logger.c
cc -I../../lib/ -Wall -g -O2 -fstack-protector-all --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -c -o xalloc.o ../../lib/xalloc.c
cc -I../../lib/ -Wall -g -O2 -fstack-protector-all --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC banner-grab-tcp.o logger.o xalloc.o -o banner-grab-tcp -lpcap -levent -levent_extra -lm -Wl,-Bsymbolic-functions -Wl,-z,relro,-z,now
[email protected]:~/source/zmap-1.2.1/examples/banner-grab#

时间: 2024-08-28 23:54:02

zmap在阿里云主机上的编译的相关文章

阿里云主机上安装jdk

今天继续安装jdk到阿里云服务上,大家要看一下阿里云是32位还是64位的,如果是32位下载32位的包,如果是64位的下载64位的包 我的就是64位的,开始我还不知道是怎么区分32/64位的,原来X64就是64位的,我还跑去ORACAL官网下载了32位的X86的包,弄了一个下午都说有个库出现问题 .现在我把这个包的名称列出来,jdk-7u25-linux-x64.rpm.X64表示的就是64位系统的. 首先下载JDK包,我现在是下载jdk-7u25-linux-x64.rpm这个包,然后通过XFT

在阿里云主机上基于CentOS用vsftpd搭建FTP服务器

最近需要在一台阿里云的云服务器上搭建FTP服务器,在这篇博文中分享一下我们根据实际需求进行的一些配置. ftp软件用的是vsftpd. vsftpd是一款在Linux发行版中最受推崇的FTP服务器程序.特点是小巧轻快,安全易用. vsftpd 的名字代表"very secure FTP daemon",安全是它的开发者 Chris Evans 考虑的首要问题之一.在这个 FTP 服务器设计开发的最开始的时候,高安全性就是一个目标. 准备工作 安装vsftpd yum install v

[FTP]通过FileZilla在阿里云主机上搭建ftp服务器

前一阵子租了一台服务器主机来玩,正好周末有时间研究了一下怎么搭建ftp server. 准备.首先要下载filezilla client和filezilla server, 下载地址: server: https://filezilla-project.org/download.php?type=server client: https://filezilla-project.org/download.php?type=client 安装和配置 1. 在服务器上安装filezilla serve

阿里云主机实战应用之centos7上的防火墙设置

最近公司又上了一台服务器,以前都是用centos 6系统,这次选择使用了centos 7系统的安装镜像,因为现在程序版本在centos 7上一般php默认就是5.4以上的,mysql也变成了mariadb,但使用都一样而已,apache安装的httpd程序也是2.4的版本,所以就算yum安装基本服务也是比较新一些的版本吧. 公司拨款后就在阿里云后台买了台主机,直接yum装的lamp,添加虚拟主机的配置文件这里就不说了,网上一堆的配置文档,只记录下,在centos7上遇到的坑. lamp环境都搭好

【阿里云产品评测】阿里云主机带来不一样的感受

阿里云用户:论坛昵称-安尔宝贝 前言:  我们本身不是专业做网站的,弄弄网站完全是学习和兴趣.使用阿里云之前用过很多主机,虚拟主机也好,VPS也好都有过,并且现在也在多家运营商使用中,所以对主机体验还是能发表一下看法的.多了就不废话了,结合自己跟身边朋友的经验,总而言之,免费的基本不能用,虚拟主机的话如果你只是玩玩的可以考虑几个有长期口碑运营商的产品,如果是要靠网站来吃饭或者忍受不了虚拟主机那种种限制的,绝对要选云主机啦. 为何选阿里云:  之前用过好几个知名运营商,大多数都是不好用的,目前我们

关于阿里云ESC上go语言项目编译6l: running gcc failed: Cannot allocate memory

前段时间将自己的阿里云服务器上的系统由centos 6.5换为了ubuntu 14,其他的硬件配置都没有发生改变,将服务器上的数据恢复并且重新安装了golang的编译环境后,发现使用go build编译稍微大一点的golang项目就会报错: /usr/local/go/pkg/tool/linux_amd64/6l: running gcc failed: Cannot allocate memory 一直想不通为啥换了个系统就会报这个错,字面意思是gcc分配内存失败,应该是内存不够用,机器配置

阿里云主机安装Memcached

http://www.zyuns.com/?page_id=354 前言最近发现阿里云主机在使用中,并发访问量稍大,页面加载速度就很慢.于是学习了一些服务器优化的文章,决定安装Memcached,优化页面查询,提高Wordpress的响应速度.这里记录下阿里云主机Centos6.3的Memcached安装的过程. Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提供动态.数据 库驱动网站的速度.

阿里云主机 CentOS6.5 安装Mysql php Apache

真正的勇士感觉面对操蛋的人生.之前申请了一个香港的虚拟主机,各种问题各种慢,有时候就无缘无故的打不开了,中途还经历了一次他们更换服务器,还好我有网站备份,要不我只能蹲在墙角哭了.最近在做微信的开发,咱们也与时俱进一把,使用一下thinkphp的3.2版本!刚想愉快的搞一把,what?告诉我php版本小于5.3.0?什么鬼?看了看thinkphp的入口文件,大大的写着下面这句! // 检测PHP环境 if(version_compare(PHP_VERSION,'5.3.0','<')) die(

阿里云主机免费申请级网站配置

前阵子看到阿里云主机和邮箱免费申请,当然吸引到了我,倒弄了一番送上我的简单操作如下,域名绑定部分请见我前面的文章. 1.云主机和企业邮箱免费申请 申请网址:http://wanwang.aliyun.com/hosting/free/ 1. 企业邮申请: 这个申请主要要求就是你得有个域名,这个域名是用来解析你的邮件地址的. 企业邮申请不需要抢. 2. 云主机申请: 申请主机的主要条件是手速快!!!手速快!!!手速快!!! 收到会有邮件通知,按找步骤来就行 2. 给云主机配置wordpress: