Git Product home page Git Product logo

zmap's Introduction

ZMap: The Internet Scanner

Build Status

ZMap is a fast single packet network scanner designed for Internet-wide network surveys. On a typical desktop computer with a gigabit Ethernet connection, ZMap is capable scanning the entire public IPv4 address space on a single port in under 45 minutes. With a 10gigE connection and netmap or PF_RING, ZMap can scan the IPv4 address space in under 5 minutes.

ZMap operates on GNU/Linux, Mac OS, and BSD. ZMap currently has fully implemented probe modules for TCP SYN scans, ICMP, DNS queries, UPnP, BACNET, and can send a large number of UDP probes. If you are looking to do more involved scans (e.g., banner grab or TLS handshake), take a look at ZGrab 2, ZMap's sister project that performs stateful application-layer handshakes.

Using ZMap

If you haven't used ZMap before, we have a step-by-step Getting Started Guide that details how to perform basic scans. Documentation about all of ZMap's options and more advanced functionality can be found in our GitHub Wiki.

If you have questions, please first check our FAQ. Still have questions? Ask the community in Github Discussions. Please do not create an Issue for usage or support questions.

Installation

The latest stable release of ZMap is version 4.1.1 and supports Linux, macOS, and BSD.

Instructions on building ZMap from source can be found in INSTALL.

Architecture

More information about ZMap's architecture and a comparison with other tools can be found in these two research papers:

If you use ZMap for published research, please cite the original research paper:

@inproceedings{durumeric2013zmap,
  title={{ZMap}: Fast Internet-wide scanning and its security applications},
  author={Durumeric, Zakir and Wustrow, Eric and Halderman, J Alex},
  booktitle={22nd USENIX Security Symposium},
  year={2013}
}

Citing the ZMap paper helps us to track ZMap usage within the research community and to pursue funding for continued development.

License and Copyright

ZMap Copyright 2023 Regents of the University of Michigan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See LICENSE for the specific language governing permissions and limitations under the License.

zmap's People

Contributors

amirian28 avatar azet avatar cclauss avatar cdzombak avatar ciccio-87 avatar cicku avatar dadrian avatar droe avatar ewust avatar gescheit avatar h1994st avatar headlesszeke avatar jhart-r7 avatar jlec avatar jonasbb avatar justinbastress avatar livioso avatar mrpumo avatar mschoenlaub avatar ogasser avatar pablohn26 avatar paul-pearce avatar phillip-stephens avatar ronnychevalier avatar saghevli avatar tdi avatar tim--- avatar toomuchio avatar wangyihang avatar zakird avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zmap's Issues

place into package management system?

I think more people would be interested if it were added to the typical package management systems out there. homebrew (mac), aptitude(ubuntu/debian), yum (redhat/centos),

problem making banner-grab-tcp

While trying to make the banner-grab-tcp I receive the following errors

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:15:36: error: event2/bufferevent_ssl.h: No such file or directory
banner-grab-tcp.c:59: error: expected ‘)’ before ‘fd’
banner-grab-tcp.c: In function ‘decrement_cur_running’:
banner-grab-tcp.c:82: warning: implicit declaration of function ‘evbuffer_get_length’
banner-grab-tcp.c:82: warning: implicit declaration of function ‘bufferevent_get_input’
banner-grab-tcp.c:90: warning: implicit declaration of function ‘print_status’
banner-grab-tcp.c: In function ‘connect_cb’:
banner-grab-tcp.c:102: error: ‘BEV_EVENT_CONNECTED’ undeclared (first use in this function)
banner-grab-tcp.c:102: error: (Each undeclared identifier is reported only once
banner-grab-tcp.c:102: error: for each function it appears in.)
banner-grab-tcp.c:108: warning: implicit declaration of function ‘bufferevent_get_output’
banner-grab-tcp.c:108: warning: initialization makes pointer from integer without a cast
banner-grab-tcp.c:116: warning: implicit declaration of function ‘bufferevent_set_timeouts’
banner-grab-tcp.c: In function ‘read_cb’:
banner-grab-tcp.c:145: warning: initialization makes pointer from integer without a cast
banner-grab-tcp.c: In function ‘grab_banner’:
banner-grab-tcp.c:232: warning: implicit declaration of function ‘bufferevent_socket_new’
banner-grab-tcp.c:232: error: ‘BEV_OPT_CLOSE_ON_FREE’ undeclared (first use in this function)
banner-grab-tcp.c:243: warning: implicit declaration of function ‘bufferevent_socket_connect’
banner-grab-tcp.c:246: warning: implicit declaration of function ‘bufferevent_getfd’
banner-grab-tcp.c: In function ‘stdin_eventcb’:
banner-grab-tcp.c:259: error: ‘BEV_EVENT_EOF’ undeclared (first use in this function)
banner-grab-tcp.c: In function ‘stdin_readcb’:
banner-grab-tcp.c:273: warning: initialization makes pointer from integer without a cast
banner-grab-tcp.c:283: warning: implicit declaration of function ‘evbuffer_readln’
banner-grab-tcp.c:283: error: ‘EVBUFFER_EOL_LF’ undeclared (first use in this function)
banner-grab-tcp.c: In function ‘main’:
banner-grab-tcp.c:343: error: ‘BEV_OPT_DEFER_CALLBACKS’ undeclared (first use in this function)
banner-grab-tcp.c:348: warning: implicit declaration of function ‘evtimer_new’
banner-grab-tcp.c:348: error: ‘print_status’ undeclared (first use in this function)
make: *** [banner-grab-tcp.o] Error 1

and obviously the make fails. Any idea what I am doing wrong?

Drop privileges

ZMap should drop privileges before it processes any incoming packets.

make clean

make clean doesn't delete redis.o and module_redis.o when using "make REDIS=true".

Makefile has no uninstall target

Quick install, testing, and uninstall is the default way to test new software.

Please provide an uninstall target in src/Makefile.

Thanks,
Richard

make: error: "_FORTIFY_SOURCE" redefined

I get an error while trying to build zmap:

% make
gcc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall  -g -O2  -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -Werror   -c -o constraint.o ../lib/constraint.c
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
../lib/constraint.c:1:0: note: this is the location of the previous definition
cc1: all warnings being treated as errors
make: *** [constraint.o] Error 1

The following patch solves the problem:

diff --git a/src/Makefile b/src/Makefile
index 72eb0d5..e35c4ab 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -24,7 +24,7 @@ GCCWARNINGS = -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef      \
 -Waddress -Wmissing-noreturn -Wnormalized=id    \
 -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds             \
 -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k
-GCCHARDENING=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1
+GCCHARDENING=-fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1
 LDHARDENING=-z relro -z now

 EXTRACFLAGS=-g -O2 $(EXTRA_CFLAGS) $(GCCHARDENING) $(GCCWARNINGS) -Werror

I have gcc version 4.7.3 and x86_64 arch.

Missing 'Make' file

It appears that the 'Make' file is now missing from the src directory.

Regards,

Carl

Improve performance for small whitelists

The address generation method we currently use is very inefficient if you have a narrow whitelist. We cycle through every IP address and discard ones that aren't whitelisted. This isn't a problem if you want to scan random addresses from most of the address space, but it becomes the dominant cost when scanning small networks.

Proposed fix is to select a smaller group size and redesign constraint.c to efficiently return allowed IP addresses given their indices.

Does not compile on ARM

I am not sure if this is made for x86 architecture only, but it won't compile on Debian on ARM (Sheevaplug).

Output is:
[..]
cc1: warnings being treated as errors
output_modules/module_csv.c: In function ‘csv_process’:
output_modules/module_csv.c:81: error: cast to pointer from integer of different size
output_modules/module_csv.c:83: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
output_modules/module_csv.c:85: error: cast to pointer from integer of different size
make: *** [module_csv.o] Error 1

Hardware-Info:
sheeva :/zmap/zmap-master/src# uname -a
Linux sheeva 2.6.32-5-kirkwood #1 Tue Jan 17 05:11:52 UTC 2012 armv5tel GNU/Linux
sheeva :
/zmap/zmap-master/src# cat /proc/cpuinfo
Processor : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS : 1192.75
Features : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant : 0x2
CPU part : 0x131
CPU revision : 1

Hardware : Marvell SheevaPlug Reference Board
Revision : 0000
Serial : 0000000000000000
sheeva :~/zmap/zmap-master/src#

Memory Requirement

Problem: ZMap currently requires 512 MB of memory to run out-of-the-box. However, this functionality is only used in order to ensure that duplicate packets are not output.

Proposed Solution: Add advanced flag that allows you to skip the duplication-prevention and use a minimal amount of memory.

Specify the redis output list on the CLI

It would be very helpful to be able to specify the redis output list on the CLI.

This will allow us to separate data from different scans (and different ports) that go into the same redis database.

This functionality is probably more useful in the short-term than the larger request in #16

"zmap: could not detect default gateway address for 0." on VPS with strange interfaces

(git version of zmap, which BTW reports "zmap 1.0.0".)

Summary:
On a VPS, with a non-normal ifconfig, I get strange results from zmap which I cannot solve with -i nor -G

Long story:

On a VPS, I get:

root@superdoos:# zmap -p 80 -N 10 -B 1M -o -
Aug 20 18:22:20.820 [INFO] zmap: started
Aug 20 18:22:20.899 [FATAL] zmap: could not detect default gateway address for 0. Try setting default gateway mac address (-G).
root@superdoos:
#

My ifconfig shows:

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:5.2.2.1 P-t-P:5.2.2.3 Bcast:0.0.0.0 Mask:255.255.255.255

(public IPv4 address a bit altered)

Specifying "-i venet0:0" or "-i venet0:0" results in the same problem.

Additionally specifying -G results in another error message, a high ETA and no useful ports found:

zmap -p 80 -N 10 -B 1M -o - -i venet0 -G 00:00:00:00:00:00

Aug 20 18:27:12.031 [INFO] zmap: started
SIOCGIFADDR: Invalid argument
0:01 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:02 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:03 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:04 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:05 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:06 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:07 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%

The whitelist-file option does nothing.

In the most recent version from git, the --whitelist-file and -w options don't appear to do anything. No IP addresses are whitelisted. I believe this is because at some point in the past, the line:

SET_IF_GIVEN(zconf.whitelist_filename, whitelist_file);

was removed from zmap.c. When I put this line back in, the option starts working again. Is this intentional?

error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination

Dear, can't compile for this error:

zmap.c: En la función ‘split_string’:
zmap.c:52:33: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
memset(fields, 0, sizeof(fields));
^
cc1: todos los avisos se tratan como errores
make: *** [zmap.o] Error 1

I got Fedora 19 an cc 4.8.1-1

my solution not use sizeof like an arg of memset.

unable to make banner-grab-tcp

While trying to make abnner-grab-tcp I get the messges below and it fails.

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:15:36: error: event2/bufferevent_ssl.h: No such file or directory
banner-grab-tcp.c:59: error: expected ‘)’ before ‘fd’
banner-grab-tcp.c: In function ‘decrement_cur_running’:
banner-grab-tcp.c:82: warning: implicit declaration of function ‘evbuffer_get_length’
banner-grab-tcp.c:82: warning: implicit declaration of function ‘bufferevent_get_input’
banner-grab-tcp.c:90: warning: implicit declaration of function ‘print_status’
banner-grab-tcp.c: In function ‘connect_cb’:
banner-grab-tcp.c:102: error: ‘BEV_EVENT_CONNECTED’ undeclared (first use in this function)
banner-grab-tcp.c:102: error: (Each undeclared identifier is reported only once
banner-grab-tcp.c:102: error: for each function it appears in.)
banner-grab-tcp.c:108: warning: implicit declaration of function ‘bufferevent_get_output’
banner-grab-tcp.c:108: warning: initialization makes pointer from integer without a cast
banner-grab-tcp.c:116: warning: implicit declaration of function ‘bufferevent_set_timeouts’
banner-grab-tcp.c: In function ‘read_cb’:
banner-grab-tcp.c:145: warning: initialization makes pointer from integer without a cast
banner-grab-tcp.c: In function ‘grab_banner’:
banner-grab-tcp.c:232: warning: implicit declaration of function ‘bufferevent_socket_new’
banner-grab-tcp.c:232: error: ‘BEV_OPT_CLOSE_ON_FREE’ undeclared (first use in this function)
banner-grab-tcp.c:243: warning: implicit declaration of function ‘bufferevent_socket_connect’
banner-grab-tcp.c:246: warning: implicit declaration of function ‘bufferevent_getfd’
banner-grab-tcp.c: In function ‘stdin_eventcb’:
banner-grab-tcp.c:259: error: ‘BEV_EVENT_EOF’ undeclared (first use in this function)
banner-grab-tcp.c: In function ‘stdin_readcb’:
banner-grab-tcp.c:273: warning: initialization makes pointer from integer without a cast
banner-grab-tcp.c:283: warning: implicit declaration of function ‘evbuffer_readln’
banner-grab-tcp.c:283: error: ‘EVBUFFER_EOL_LF’ undeclared (first use in this function)
banner-grab-tcp.c: In function ‘main’:
banner-grab-tcp.c:343: error: ‘BEV_OPT_DEFER_CALLBACKS’ undeclared (first use in this function)
banner-grab-tcp.c:348: warning: implicit declaration of function ‘evtimer_new’
banner-grab-tcp.c:348: error: ‘print_status’ undeclared (first use in this function)
make: *** [banner-grab-tcp.o] Error 1

Any help would be great!! love zmap!

Failure at calloc for 'ip_seen' on KVM VPSs?

Compiled on a KVM based VPS for Ubuntu LTS and Centos 6.4, and have zmap die at the same point every time. Problems with calloc?

root@networkresearchnotabotnet:~/zmap/src# zmap -p 80 --dryrun --verbosity=5
Aug 16 21:42:18.256 [INFO] zmap: started
Aug 16 21:42:18.379 [DEBUG] zmap: no interface provided. will use eth0
Aug 16 21:42:18.380 [DEBUG] zmap: no source IP address given. will use 176.56.238.77
Aug 16 21:42:18.380 [DEBUG] cyclic: primitive root: 977842311
Aug 16 21:42:18.381 [DEBUG] cyclic: starting point: 24354
Aug 16 21:42:18.381 [TRACE] constraint: Initializing
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 0.0.0.0/8
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 10.0.0.0/8
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 100.64.0.0/10
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 127.0.0.0/8
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 169.254.0.0/16
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 172.16.0.0/12
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 192.0.0.0/24
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 192.0.2.0/24
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 192.88.99.0/24
Aug 16 21:42:18.381 [TRACE] blacklist: blacklisting 192.168.0.0/16
Aug 16 21:42:18.382 [TRACE] blacklist: blacklisting 192.18.0.0/15
Aug 16 21:42:18.382 [TRACE] blacklist: blacklisting 198.51.100.0/24
Aug 16 21:42:18.382 [TRACE] blacklist: blacklisting 203.0.113.0/24
Aug 16 21:42:18.382 [TRACE] blacklist: blacklisting 240.0.0.0/4
Aug 16 21:42:18.382 [TRACE] blacklist: blacklisting 255.255.255.255/32
Aug 16 21:42:18.382 [TRACE] blacklist: blacklisting 224.0.0.0/4
Aug 16 21:42:18.382 [TRACE] constraint: Optimizing constraints
Aug 16 21:42:18.383 [DEBUG] blacklist: 3702258432 addresses allowed to be scanned (86% of address space)
Aug 16 21:42:18.383 [DEBUG] send: will send from 1 address on 28233 source ports
Aug 16 21:42:18.383 [INFO] send: dryrun mode -- won't actually send packets
Aug 16 21:42:18.390 [TRACE] zmap: set thread 3124864768 affinity to core 0
Aug 16 21:42:18.390 [DEBUG] recv: thread started
Aug 16 21:42:18.390 [FATAL] recv: couldn't allocate address bitmap

Missing module_ssldb? Redis module won't compile.

I'm trying to compile with Redis support. I'm on Ubuntu 13.04, installed the recommended deps via apt, installed Hiredis from source.

When I make REDIS=true, it compiles for a while then stops with the error:

make: *** No rule to make target `module_ssldb.o', needed by `zmap'.  Stop.

Is there supposed to be a module_ssldb somewhere?

ARP Issue

Seems like zmap has some issues when determing the default gateway mac adress. When issuing a manual arp command, this issue disappears for some time. The default gateway in this example is 10.211.55.1, System is kali Linux running in Parallels Desktop on OSX.

root@kali:~/zmap# zmap -p 445 -N 10 -B 100M -w whitelist -b blacklist -o - --verbosity 100
Aug 18 23:34:25.126 [INFO] zmap: started
Aug 18 23:34:25.129 [DEBUG] zmap: no interface provided. will use eth0
Aug 18 23:34:25.129 [DEBUG] zmap: no source IP address given. will use 10.211.55.27
Aug 18 23:34:25.130 [DEBUG] zmap: found gateway IP 10.211.55.1 on eth0
Aug 18 23:34:25.130 [FATAL] zmap: could not detect GW MAC address for 10.211.55.1 on eth0. Try setting default gateway mac address (-G).

root@kali:~/zmap# arp
Address                  HWtype  HWaddress           Flags Mask            Iface
10.211.55.2              ether   00:1c:42:00:00:08   C                     eth0
10.211.55.1              ether   00:1c:42:00:00:18   C                     eth0

root@kali:~/zmap# zmap -p 445 -N 10 -B 100M -w whitelist -b blacklist -o - --verbosity 100
Aug 18 23:34:32.309 [INFO] zmap: started
Aug 18 23:34:32.312 [DEBUG] zmap: no interface provided. will use eth0
Aug 18 23:34:32.313 [DEBUG] zmap: no source IP address given. will use 10.211.55.27
Aug 18 23:34:32.313 [DEBUG] zmap: found gateway IP 10.211.55.1 on eth0
Aug 18 23:34:32.314 [DEBUG] zmap: using default gateway MAC 00:1c:42:00:00:18
Aug 18 23:34:32.315 [DEBUG] cyclic: primitive root: 1946548661
Aug 18 23:34:32.315 [DEBUG] cyclic: starting point: 26750
Aug 18 23:34:32.316 [TRACE] constraint: Initializing
Aug 18 23:34:32.316 [TRACE] whitelist: blacklisting 0.0.0.0/0
Aug 18 23:34:32.317 [TRACE] whitelist: whitelisting 10.211.55.4/32
Aug 18 23:34:32.317 [TRACE] constraint: Optimizing constraints
Aug 18 23:34:32.318 [DEBUG] blacklist: 1 addresses allowed to be scanned (0% of address space)

Limited fields in JSON output reduces usability

The refactored JSON output module drops nearly all output fields from the results. The original pull request would spit out the timestamp and TCP header fields. The new code does not, which prevents the use of things like forge-socket with the output.

Possible malloc error in get_gateway.c

I got this error on my Fedora 19 64bit:

gcc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -Werror -c -o get_gateway.o get_gateway.c
get_gateway.c: In function ‘send_nl_req’:
get_gateway.c:75:25: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
memset(nlmsg, 0, sizeof(nlmsg));
^
cc1: all warnings being treated as errors

I think line 75 of get_gateway.c should be changed from
memset(nlmsg, 0, sizeof(nlmsg));
to
memset(nlmsg, 0, sizeof(*nlmsg));

All the best
AndreaS

Black and Whitelist

When a Whitelist without a Blacklist is specified, the "default" Blacklist is applied.
When trying to scan a private ip range, this results in 0 addresses beeing scanned due that the default blacklist blacklists private ip ranges.

Example:
whitelist:
10.0.0.0/8

Command:

root@kali:~/zmap# zmap -p 80 -N 10 -B 1M -w whitelist -o - --verbosity 100
Aug 18 23:21:48.313 [INFO] zmap: started
Aug 18 23:21:48.316 [DEBUG] zmap: no interface provided. will use eth0
Aug 18 23:21:48.316 [DEBUG] zmap: no source IP address given. will use 10.211.55.27
Aug 18 23:21:48.316 [DEBUG] zmap: found gateway IP 10.211.55.1 on eth0
Aug 18 23:21:48.317 [DEBUG] zmap: using default gateway MAC 00:1c:42:00:00:18
Aug 18 23:21:48.318 [DEBUG] cyclic: primitive root: 3340260133
Aug 18 23:21:48.318 [DEBUG] cyclic: starting point: 60913
Aug 18 23:21:48.318 [TRACE] constraint: Initializing
Aug 18 23:21:48.318 [TRACE] whitelist: blacklisting 0.0.0.0/0
Aug 18 23:21:48.319 [TRACE] whitelist: whitelisting 10.0.0.0/8
Aug 18 23:21:48.319 [TRACE] blacklist: blacklisting 0.0.0.0/8
Aug 18 23:21:48.319 [TRACE] blacklist: blacklisting 10.0.0.0/8
Aug 18 23:21:48.320 [TRACE] blacklist: blacklisting 100.64.0.0/10
Aug 18 23:21:48.320 [TRACE] blacklist: blacklisting 127.0.0.0/8
Aug 18 23:21:48.320 [TRACE] blacklist: blacklisting 169.254.0.0/16
Aug 18 23:21:48.321 [TRACE] blacklist: blacklisting 172.16.0.0/12
Aug 18 23:21:48.321 [TRACE] blacklist: blacklisting 192.0.0.0/24
Aug 18 23:21:48.321 [TRACE] blacklist: blacklisting 192.0.2.0/24
Aug 18 23:21:48.322 [TRACE] blacklist: blacklisting 192.88.99.0/24
Aug 18 23:21:48.322 [TRACE] blacklist: blacklisting 192.168.0.0/16
Aug 18 23:21:48.322 [TRACE] blacklist: blacklisting 192.18.0.0/15
Aug 18 23:21:48.322 [TRACE] blacklist: blacklisting 198.51.100.0/24
Aug 18 23:21:48.323 [TRACE] blacklist: blacklisting 203.0.113.0/24
Aug 18 23:21:48.323 [TRACE] blacklist: blacklisting 240.0.0.0/4
Aug 18 23:21:48.323 [TRACE] blacklist: blacklisting 255.255.255.255/32
Aug 18 23:21:48.323 [TRACE] blacklist: blacklisting 224.0.0.0/4
Aug 18 23:21:48.323 [TRACE] constraint: Optimizing constraints
Aug 18 23:21:48.323 [DEBUG] blacklist: 0 addresses allowed to be scanned (0% of address space)

When specifying an empty blacklist the scan works:

root@kali:~/zmap# zmap -p 80 -N 10 -B 1M -w whitelist -b blacklist -o - --verbosity 100
Aug 18 23:26:35.511 [INFO] zmap: started
Aug 18 23:26:35.513 [DEBUG] zmap: no interface provided. will use eth0
Aug 18 23:26:35.514 [DEBUG] zmap: no source IP address given. will use 10.211.55.27
Aug 18 23:26:35.514 [DEBUG] zmap: found gateway IP 10.211.55.1 on eth0
Aug 18 23:26:35.515 [DEBUG] zmap: using default gateway MAC 00:1c:42:00:00:18
Aug 18 23:26:35.515 [DEBUG] cyclic: primitive root: 869948540
Aug 18 23:26:35.516 [DEBUG] cyclic: starting point: 15335
Aug 18 23:26:35.516 [TRACE] constraint: Initializing
Aug 18 23:26:35.517 [TRACE] whitelist: blacklisting 0.0.0.0/0
Aug 18 23:26:35.517 [TRACE] whitelist: whitelisting 10.0.0.0/8
Aug 18 23:26:35.517 [TRACE] constraint: Optimizing constraints
Aug 18 23:26:35.518 [DEBUG] blacklist: 16777216 addresses allowed to be scanned (0% of address space)
Aug 18 23:26:35.519 [DEBUG] send: will send from 1 address on 28233 source ports
Aug 18 23:26:35.519 [DEBUG] send: using bandwidth 1000000 bits/s, rate set to 0 pkt/s
Aug 18 23:26:35.527 [TRACE] zmap: set thread 3074968432 affinity to core 0
Aug 18 23:26:35.528 [DEBUG] recv: thread started
Aug 18 23:26:35.528 [DEBUG] recv: using dev eth0
Aug 18 23:26:35.529 [DEBUG] recv: receiver ready
Aug 18 23:26:35.530 [DEBUG] zmap: using 1 sender threads
Aug 18 23:26:35.531 [TRACE] zmap: set thread 2519186288 affinity to core 0
Aug 18 23:26:35.531 [TRACE] zmap: set thread 2527578992 affinity to core 0
Aug 18 23:26:35.532 [DEBUG] send: thread started
 0:01 0%; send: 1475 1.47 Kp/s (1.46 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
 0:02 0%; send: 2962 1.49 Kp/s (1.47 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
 0:03 0%; send: 4447 1.48 Kp/s (1.48 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
 0:04 0%; send: 5935 1.49 Kp/s (1.48 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
 0:05 0% (3h08m left); send: 7423 1.49 Kp/s (1.48 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits:

This should be either fixed in code or the documentation under https://zmap.io/documentation.html#blacklisting should be updated
Current text reads

if a whitelist file is provided, only network prefixes in the whitelist file will be scanned

Bundled hiredis

HI,

Can you unbundle hiredis?

And, do I need to enable this feature for most users?

Thanks.

gcc 4.7.2 -Wunprototyped-calls error with recv_run.

recv_run is prototyped in recv.h as int recv_run();, but in recv.c is defined as int recv_run(pthread_mutex_t *recv_ready_mutex); This causes gcc 4.7.2 under OpenSuSE 12.3 to throw an error and refuse to compile.

results.txt is empty

[root@scan src]# zmap -B 10M -p 50070 -n 10000 -o results.txt
Aug 20 09:37:48.486 [INFO] zmap: started
0:01 12%; send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:02 23%; send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:03 35%; send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:04 46%; send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:05 58% (3s left); send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:06 69% (2s left); send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:07 81% (1s left); send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:08 92% (0s left); send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
0:09 104% (0s left); send: 10000 done (14.3 Kp/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 0.00%
Aug 20 09:37:58.723 [INFO] zmap: completed
[root@scan src]# cat results.txt
[root@scan src]#

Make Error

Got an error on make:

At top level:
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
make: *** [blacklist.o] Error 1

Estimated scan time is inaccurate with very small whitelists

Wanting to try the legendary zmap and also wanting to be a good internet citizen I thought it would be a good start to see if a single host was up on a port I knew it was listening on. So I ran the following:

bradjc@inductor:~$ sudo zmap -p 80 -o nuclear.online -w zmap.whitelist -r 100
Aug 17 17:22:02.149 [INFO] zmap: started
0:01 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:02 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:03 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:04 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:05 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:06 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:07 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:08 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:09 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:10 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:11 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:12 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:13 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:14 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:15 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:16 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:17 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:18 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:19 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:20 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:21 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:22 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:23 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:24 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:25 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:26 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:27 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:28 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:29 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:30 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:31 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:32 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:33 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:34 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:35 0% (68 years left); send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: -nan%
0:36 83% (7s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:37 85% (6s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:38 87% (5s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:39 90% (4s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:40 92% (3s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:41 94% (2s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:42 96% (1s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
0:43 99% (0s left); send: 1 done (0 p/s avg); recv: 1 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hits: 100.00%
Aug 17 17:22:48.701 [INFO] zmap: completed
bradjc@inductor:~$ more zmap.whitelist
101.202.101.202
bradjc@inductor:~$ more nuclear.online
101.202.101.202

To my dismay zmap told me it was going take a whopping 68 years...luckily it didn't actually take that long. So for people who may want to scan all ports on single computer or something like that it may be good to take a look at this.

Assertion failure when using VPN

I know it isn't ideal to use zmap over a VPN, but sometimes it's necessary. I get this error when connected to an OpenVPN on Ubuntu 13.04.

user@computer:~/code/zmap$ sudo zmap -p 80 -N  5 -B 500K -i wlan0 -o - -v10
Aug 19 18:02:42.849 [INFO] zmap: started
Aug 19 18:02:42.849 [DEBUG] zmap: no source IP address given. will use 10.0.0.204
Aug 19 18:02:42.849 [DEBUG] zmap: found gateway IP 10.0.2.37 on tun0
zmap: get_gateway.c:134: get_hw_addr: Assertion `((int)((rt_attr)->rta_len) - (( ((sizeof(struct rtattr))+4-1) & ~(4-1) ) + (0))) == 6' failed.

Allow sharding a scan

It should be possible to split a scan into multiple independent segments that together add to the entire internet. It is already possible to do this in a hacky fashion with blacklists or whitelists, but this bypasses the balanced distribution properties that make zmap friendly to remote networks.

Build with JSON support fails

$ cmake -DWITH_JSON=ON ./
-- Configuring done
-- Generating done
-- Build files have been written to: /work/zmap

$ make
[ 3%] Building C object src/CMakeFiles/zmap.dir/output_modules/module_json.c.o
/work/zmap/src/output_modules/module_json.c: In function 'json_output_file_ip':
/work/zmap/src/output_modules/module_json.c:152:6: error: cannot convert to a pointer type
json_object_new_string((char_) f->value));
^
/work/zmap/src/output_modules/module_json.c:155:6: error: aggregate value used where an integer was expected
json_object_new_int((int) f->value));
^
/work/zmap/src/output_modules/module_json.c:158:6: error: cannot convert to a pointer type
(const u_char_) f->value, f->len);
^
make[2]: *** [src/CMakeFiles/zmap.dir/output_modules/module_json.c.o] Error 1
make[1]: *** [src/CMakeFiles/zmap.dir/all] Error 2
make: *** [all] Error 2

scan operating system

Hi everybody
New here.
Just want to check out, can zmap find the host's os like nmap?(Is this feature will be added in, later?) Didn't find it in the doc. Anyone know?
Thanks!

Build Issue on Ubuntu 12.04 64bit

Hi,

There seems to be an issue building this latest release on Ubuntu 12.04 64bit.

Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise

sudo apt-get install libgmp3-dev gengetopt libpcap-dev
cd src
make
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o constraint.o ../lib/constraint.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o blacklist.o ../lib/blacklist.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o cyclic.o cyclic.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o logger.o ../lib/logger.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o send.o send.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o recv.o recv.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o state.o state.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o monitor.o monitor.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o zopt_compat.o zopt_compat.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o zmap.o zmap.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o random.o ../lib/random.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o output_modules.o output_modules/output_modules.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o packet.o probe_modules/packet.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o probe_modules.o probe_modules/probe_modules.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o module_tcp_synscan.o probe_modules/module_tcp_synscan.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o module_icmp_echo.o probe_modules/module_icmp_echo.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o module_udp.o probe_modules/module_udp.c
cc -I../lib -I./ -Ioutput_modules -std=gnu99 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wnormalized=id -Wstack-protector  -Werror   -c -o module_csv.o output_modules/module_csv.c
output_modules/module_csv.c: In function ‘csv_process’:
output_modules/module_csv.c:82:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
output_modules/module_csv.c:84:4: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format]
output_modules/module_csv.c:86:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
make: *** [module_csv.o] Error 1

Does not build on *BSD?

I just tested to compile Zmap with the following results on at least OpenBSD 5.3 64Bit.

cd src

make

*** Parse error in /tmp/zmap-1.0.2/src: Missing dependency operator (Makefile:40)
*** Parse error: Need an operator in 'endif' (Makefile:44)

gmake

gcc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -Werror -c -o constraint.o ../lib/constraint.c
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
cc1: error: unrecognized command line option "-Warray-bounds"
gmake: *** [constraint.o] Error 1

gcc -v

Reading specs from /usr/lib/gcc-lib/amd64-unknown-openbsd5.3/4.2.1/specs
Target: amd64-unknown-openbsd5.3
Configured with: OpenBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719

Furthermore you need GNU make but it is not declared as depency.

Kind regards,
Sebastian Rother

running error

when i running zmap -p 443 as root.errors like that:
Aug 20 15:31:31.146 [INFO] zmap: started
Aug 20 15:31:31.251 [FATAL] recv: couldn't allocate address bitmap

Build failed with hiredis

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Kon8bI

  • umask 022
  • cd /home/rpmaker/rpmbuild/BUILD
  • cd zmap-1.0.3
  • make REDIS=true 'EXTRA_CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' -j3 -C src
    make: Entering directory /home/rpmaker/rpmbuild/BUILD/zmap-1.0.3/src' cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o constraint.o ../lib/constraint.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o blacklist.o ../lib/blacklist.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o cyclic.o cyclic.c ../lib/blacklist.c: In function 'blacklist_init_from_files': ../lib/blacklist.c:127:6: warning: left shift count >= width of type [enabled by default] allowed, allowed*100./(1L << 32)); ^ ../lib/blacklist.c:127:27: warning: division by zero [-Wdiv-by-zero] allowed, allowed*100./(1L << 32)); ^ cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o logger.o ../lib/logger.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o send.o send.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o recv.o recv.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o state.o state.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o monitor.o monitor.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o zopt.o zopt.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o zmap.o zmap.c zmap.c: In function 'summary': zmap.c:112:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' [-Wformat=] SLU("cnf", "bandwidth", zconf.bandwidth); ^ zmap.c: In function 'main': zmap.c:461:4: warning: left shift count >= width of type [enabled by default] v = v * (1L << 32) / 100.; ^ zmap.c:470:3: warning: left shift count >= width of type [enabled by default] else if (v >= (1L << 32)) { ^ cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o random.o ../lib/random.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o output_modules.o output_modules/output_modules.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o module_simple_file.o output_modules/module_simple_file.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o module_extended_file.o output_modules/module_extended_file.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o packet.o probe_modules/packet.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o probe_modules.o probe_modules/probe_modules.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o module_tcp_synscan.o probe_modules/module_tcp_synscan.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o module_icmp_echo.o probe_modules/module_icmp_echo.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o module_udp.o probe_modules/module_udp.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o validate.o validate.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o rijndael-alg-fst.o ../lib/rijndael-alg-fst.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o get_gateway.o get_gateway.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o aesrand.o aesrand.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o module_redis.o output_modules/module_redis.c cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -c -o redis.o ../lib/redis.c output_modules/module_redis.c: In function 'redismodule_flush': output_modules/module_redis.c:48:4: warning: passing argument 1 of 'redis_lpush' discards 'const' qualifier from pointer target type [enabled by default] buffer_fill, sizeof(scannable_t))) { ^ In file included from output_modules/module_redis.c:19:0: output_modules/../../lib/redis.h:26:5: note: expected 'char *' but argument is of type 'const char *' int redis_lpush(char*, void*, int, size_t); ^ output_modules/module_redis.c: At top level: output_modules/module_redis.c:93:2: warning: initialization from incompatible pointer type [enabled by default] .success_ip = &redismodule_newip, ^ output_modules/module_redis.c:93:2: warning: (near initialization for 'module_redis.success_ip') [enabled by default] cc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DREDIS -g -pthread -z relro -z now constraint.o blacklist.o cyclic.o logger.o send.o recv.o state.o monitor.o zopt.o zmap.o random.o output_modules.o module_simple_file.o module_extended_file.o packet.o probe_modules.o module_tcp_synscan.o module_icmp_echo.o module_udp.o validate.o rijndael-alg-fst.o get_gateway.o aesrand.o module_redis.o redis.o -o zmap -lpcap -lgmp -lm -lhiredis output_modules.o:(.data.rel+0xc): undefined reference tomodule_ssldbfeed'
    collect2: error: ld returned 1 exit status
    make: *** [zmap] Error 1
    make: Leaving directory `/home/rpmaker/rpmbuild/BUILD/zmap-1.0.3/src'
    error: Bad exit status from /var/tmp/rpm-tmp.Kon8bI (%build)

Makefile does not respect LDFLAGS

I'm creating an ebuild for Pentoo Linux, and facing the error:

  • QA Notice: Files built without respecting LDFLAGS have been detected
  • Please include the following list of files in your report:
  • /usr/sbin/zmap

It usually means that the LDFLAGS variable is not used in the Makefile. Please fix it.

Extended output support for redis

It would be awesome to be able to send the extended output to redis, rather than just the simple output currently sent. It would be even more useful if we could specify on the command line which response types (and which fields) to send.

make error unrecognized command line option "-Wno-unused-but-set-variable"

gcc -Wall -pedantic -Wextra -std=gnu99 -I../lib -I./ -Ioutput_modules -O2 -g -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wredundant-decls -Wno-unused-but-set-variable -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-field-initializers -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds -Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wno-format-nonliteral -Wno-format-y2k -Werror -c -o constraint.o ../lib/constraint.c
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
cc1: error: unrecognized command line option "-Warray-bounds"
make: *** [constraint.o] Error 1

Error after running make

On a Ubunut 10.04.4 LTS system when I run the "make" command I get the following error:

../lib/blacklist.c: In function âblacklist_init_from_filesâ:
../lib/blacklist.c:127: error: left shift count >= width of type
../lib/blacklist.c:127: error: division by zero
At top level:
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
make: *** [blacklist.o] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.