-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathzmap.1
269 lines (269 loc) · 9.42 KB
/
zmap.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ZMAP" "1" "June 2017" "ZMap" "zmap"
.
.SH "NAME"
\fBzmap\fR \- The Fast Internet Scanner
.
.SH "SYNOPSIS"
zmap [ \-p <port> ] [ \-o <outfile> ] [ OPTIONS\.\.\. ] [ ip/hostname/range ]
.
.SH "DESCRIPTION"
\fIZMap\fR is a network tool for scanning the entire IPv4 address space (or large samples)\. ZMap is capable of scanning the entire Internet in around 45 minutes on a gigabit network connection, reaching ~98% theoretical line speed\.
.
.SH "OPTIONS"
.
.SS "BASIC OPTIONS"
.
.TP
\fBip\fR/\fBhostname\fR/\fBrange\fR
IP addresses or DNS hostnames to scan\. Accepts IP ranges in CIDR block notation\. Defaults to 0\.0\.0/8
.
.TP
\fB\-p\fR, \fB\-\-target\-port=port\fR
TCP or UDP port number to scan (for SYN scans and basic UDP scans)
.
.TP
\fB\-o\fR, \fB\-\-output\-file=name\fR
When using an output module that uses a file, write results to this file\. Use \- for stdout\.
.
.TP
\fB\-b\fR, \fB\-\-blocklist\-file=path\fR
File of subnets to exclude, in CIDR notation, one\-per line\. It is recommended you use this to exclude RFC 1918 addresses, multicast, IANA reserved space, and other IANA special\-purpose addresses\. An example blocklist file \fBblocklist\.conf\fR for this purpose\.
.
.TP
\fB\-w\fR, \fB\-\-allowlist\-file=path\fR
File of subnets to scan, in CIDR notation, one\-per line\. Specifying a allowlist file is equivalent to specifying to ranges directly on the command line interface, but allows specifying a large number of subnets\. Note: if you are specifying a large number of individual IP addresses (more than 10 million), you should instead use \fB\-\-list\-of\-ips\-file\fR\.
.
.TP
\fB\-I\fR, \fB\-\-list\-of\-ips\-file=path\fR
File of individual IP addresses to scan, one\-per line\. This feature allows you to scan a large number of unrelated addresses\. If you have a small number of IPs, it is faster to specify these on the command line or by using \fB\-\-allowlist\-file\fR\. This should only be used when scanning more than 10 million addresses\. When used in with \-\-allowlist\-path, only hosts in the intersection of both sets will be scanned\. Hosts specified here, but included in the blocklist will be excluded\.
.
.SS "SCAN OPTIONS"
.
.TP
\fB\-r\fR, \fB\-\-rate=pps\fR
Set the send rate in packets/sec\. Note: when combined with \-\-probes, this is total packets per second, not IPs per second\.
.
.TP
\fB\-B\fR, \fB\-\-bandwidth=bps\fR
Set the send rate in bits/second (supports suffixes G, M, and K (e\.g\. \-B 10M for 10 mbps)\. This overrides the \-\-rate flag\.
.
.TP
\fB\-n\fR, \fB\-\-max\-targets=n\fR
Cap the number of targets to probe\. This can either be a number (e\.g\. \-n 1000) or a percentage (e\.g\. \-n 0\.1%) of the scannable address space (after excluding blocklist)
.
.TP
\fB\-N\fR, \fB\-\-max\-results=n\fR
Exit after receiving this many results
.
.TP
\fB\-t\fR, \fB\-\-max\-runtime=secs\fR
Cap the length of time for sending packets
.
.TP
\fB\-c\fR, \fB\-\-cooldown\-time=secs\fR
How long to continue receiving after sending has completed (default=8)
.
.TP
\fB\-e\fR, \fB\-\-seed=n\fR
Seed used to select address permutation\. Use this if you want to scan addresses in the same order for multiple ZMap runs\.
.
.TP
\fB\-\-shards=N\fR
Split the scan up into N shards/partitions among different instances of zmap (default=1)\. When sharding, \fB\-\-seed\fR is required\.
.
.TP
\fB\-\-shard=n\fR
Set which shard to scan (default=0)\. Shards are 0\-indexed in the range [0, N), where N is the total number of shards\. When sharding \fB\-\-seed\fR is required\.
.
.TP
\fB\-P\fR, \fB\-\-probes=n\fR
Number of probes to send to each IP (default=1)
.
.TP
\fB\-\-retries=n\fR
Number of times to try resending a packet if the sendto call fails (default=10)
.
.SS "NETWORK OPTIONS"
.
.TP
\fB\-s\fR, \fB\-\-source\-port=port|range\fR
Source port(s) to send packets from
.
.TP
\fB\-S\fR, \fB\-\-source\-ip=ip|range\fR
Source address(es) to send packets from\. Either single IP or range (e\.g\. 10\.0\.0\.1\-10\.0\.0\.9)
.
.TP
\fB\-G\fR, \fB\-\-gateway\-mac=addr\fR
Gateway MAC address to send packets to (in case auto\-detection fails)
.
.TP
\fB\-\-source\-mac=addr\fR
Source MAC address to send packets from (in case auto\-detection fails)
.
.TP
\fB\-i\fR, \fB\-\-interface=name\fR
Network interface to use
.
.TP
\fB\-X\fR, \fB\-\-iplayer\fR
Send IP layer packets instead of ethernet packets (for non\-Ethernet interface)
.
.SS "PROBE OPTIONS"
ZMap allows users to specify and write their own probe modules\. Probe modules are responsible for generating probe packets to send, and processing responses from hosts\.
.
.TP
\fB\-\-list\-probe\-modules\fR
List available probe modules (e\.g\. tcp_synscan)
.
.TP
\fB\-M\fR, \fB\-\-probe\-module=name\fR
Select probe module (default=tcp_synscan)
.
.TP
\fB\-\-probe\-args=args\fR
Arguments to pass to probe module
.
.TP
\fB\-\-list\-output\-fields\fR
List the fields the selected probe module can send to the output module
.
.SS "OUTPUT OPTIONS"
ZMap allows users to specify and write their own output modules for use with ZMap\. Output modules are responsible for processing the fieldsets returned by the probe module, and outputting them to the user\. Users can specify output fields, and write filters over the output fields\.
.
.TP
\fB\-\-list\-output\-modules\fR
List available output modules (e\.g\. tcp_synscan)
.
.TP
\fB\-O\fR, \fB\-\-output\-module=name\fR
Select output module (default=csv)
.
.TP
\fB\-\-output\-args=args\fR
Arguments to pass to output module
.
.TP
\fB\-f\fR, \fB\-\-output\-fields=fields\fR
Comma\-separated list of fields to output
.
.TP
\fB\-\-output\-filter\fR
Specify an output filter over the fields defined by the probe module\. See the output filter section for more details\.
.
.SS "LOGGING AND METADATA OPTIONS"
.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Do not print status updates once per second
.
.TP
\fB\-v\fR, \fB\-\-verbosity=n\fR
Level of log detail (0\-5, default=3)
.
.TP
\fB\-l\fR, \fB\-\-log\-file=filename\fR
Output file for log messages\. By default, stderr\.
.
.TP
\fB\-m\fR, \fB\-\-metadata\-file=filename\fR
Output file for scan metadata (JSON)
.
.TP
\fB\-L\fR, \fB\-\-log\-directory\fR
Write log entries to a timestamped file in this directory
.
.TP
\fB\-u\fR, \fB\-\-status\-updates\-file\fR
Write scan progress updates to CSV file"
.
.TP
\fB\-\-disable\-syslog\fR
Disables logging messages to syslog
.
.TP
\fB\-\-notes\fR
Inject user\-specified notes into scan metadata
.
.TP
\fB\-\-user\-metadata\fR
Inject user\-specified JSON metadata into scan metadata
.
.SS "ADDITIONAL OPTIONS"
.
.TP
\fB\-T\fR, \fB\-\-sender\-threads=n\fR
Threads used to send packets\. ZMap will attempt to detect the optimal number of send threads based on the number of processor cores\.
.
.TP
\fB\-C\fR, \fB\-\-config=filename\fR
Read a configuration file, which can specify any other options\.
.
.TP
\fB\-d\fR, \fB\-\-dryrun\fR
Print out each packet to stdout instead of sending it (useful for debugging)
.
.TP
\fB\-\-max\-sendto\-failures\fR
Maximum NIC sendto failures before scan is aborted
.
.TP
\fB\-\-min\-hitrate\fR
Minimum hitrate that scan can hit before scan is aborted
.
.TP
\fB\-\-cores\fR
Comma\-separated list of cores to pin to
.
.TP
\fB\-\-ignore\-blocklist\-errors\fR
Ignore invalid, malformed, or unresolvable entries in allowlist/blocklist file\. Replaces the pre\-v3\.x \fB\-\-ignore\-invalid\-hosts\fR option\.
.
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help and exit
.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print version and exit
.
.SS "OUTPUT FILTERS"
Results generated by a probe module can be filtered before being passed to the output module\. Filters are defined over the output fields of a probe module\. Filters are written in a simple filtering language, similar to SQL, and are passed to ZMap using the \fB\-\-output\-filter\fR option\. Output filters are commonly used to filter out duplicate results, or to only pass only successful responses to the output module\.
.
.P
Filter expressions are of the form \fB<fieldname> <operation> <value>\fR\. The type of \fB<value>\fR must be either a string or unsigned integer literal, and match the type of \fB<fieldname>\fR\. The valid operations for integer comparisons are = !=, \fI,\fR, \fI=,\fR=\. The operations for string comparisons are =, !=\. The \fB\-\-list\-output\-fields\fR flag will print what fields and types are available for the selected probe module, and then exit\.
.
.P
Compound filter expressions may be constructed by combining filter expressions using parenthesis to specify order of operations, the && (logical AND) and || (logical OR) operators\.
.
.P
For example, a filter for only successful, non\-duplicate responses would be written as: \fB\-\-output\-filter="success = 1 && repeat = 0"\fR
.
.SS "UDP PROBE MODULE OPTIONS"
These arguments are all passed using the \fB\-\-probe\-args=args\fR option\. Only one argument may be passed at a time\.
.
.TP
\fBfile:/path/to/file\fR
Path to payload file to send to each host over UDP\.
.
.TP
\fBtemplate:/path/to/template\fR
Path to template file\. For each destination host, the template file is populated, set as the UDP payload, and sent\.
.
.TP
\fBtext:<text>\fR
ASCII text to send to each destination host
.
.TP
\fBhex:<hex>\fR
Hex\-encoded binary to send to each destination host
.
.TP
\fBtemplate\-fields\fR
Print information about the allowed template fields and exit\.
.
.SS "MID\-SCAN CHANGES"
You can change the rate at which ZMap is scanning mid\-scan by sending SIGUSR1 (increase) and SIGUSR2 (decrease) signals to ZMap\. These will result in the scan rate increasing or decreasing by 5%\.