[![Build Status](https://travis-ci.org/robertdavidgraham/masscan.svg?branch=master)](https://travis-ci.org/robertdavidgraham/masscan.svg)
# MASSCAN: Mass IP port scanner
This is an Internet-scale port scanner. It can scan the entire Internet
in under 6 minutes, transmitting 10 million packets per second,
from a single machine.
It's input/output is similar to `nmap`, the most famous port scanner.
When in doubt, try one of those features.
Internally, it uses asynchronous tranmissions, similar to port scanners
like `scanrand`, `unicornscan`, and `ZMap`. It's more flexible, allowing
arbitrary port and address ranges.
NOTE: masscan uses a its own **custom TCP/IP stack**. Anything other than
simple port scans may cause conflict with the local TCP/IP stack. This means you
need to either the `--src-ip` option to run from a different IP address, or
use `--src-port` to configure which source ports masscan uses, then also
configure the internal firewall (like `pf` or `iptables`) to firewall those ports
from the rest of the operating system.
This tool is free, but consider contributing money to its developement:
Bitcoin wallet address: 1MASSCANaHUiyTtR3bJ2sLGuMw5kDBaj4T
# Building
On Debian/Ubuntu, it goes something like this:
$ sudo apt-get install git gcc make libpcap-dev
$ git clone https://github.com/robertdavidgraham/masscan
$ cd masscan
$ make
This puts the program in the `masscan/bin` subdirectory. You'll have to
manually copy it to something like `/usr/local/bin` if you want to
install it elsewhere on the system.
The source consists of a lot of small files, so building goes a lot faster
by using the multi-threaded build:
$ make -j
While Linux is the primary target platform, the code runs well on many other
systems. Here's some additional build info:
* Windows w/ Visual Studio: use the VS10 project
* Windows w/ MingGW: just type `make`
* Windows w/ cygwin: won't work
* Mac OS X /w XCode: use the XCode4 project
* Mac OS X /w cmdline: just type `make`
* FreeBSD: type `gmake`
* other: try just compiling all the files together
## PF_RING
To get beyond 2 million packets/second, you need an Intel 10-gbps Ethernet
adapter and a special driver known as ["PF_RING ZC" from ntop](http://www.ntop.org/products/packet-capture/pf_ring/pf_ring-zc-zero-copy/). Masscan doesn't need to be rebuilt in order to use PF_RING. To use PF_RING,
you need to build the following components:
* `libpfring.so` (installed in /usr/lib/libpfring.so)
* `pf_ring.ko` (their kernel driver)
* `ixgbe.ko` (their version of the Intel 10-gbps Ethernet driver)
You don't need to build their version of `libpcap.so`.
When Masscan detects that an adapter is named something like `zc:enp1s0` instead
of something like `enp1s0`, it'll automatically switch to PF_RING ZC mode.
## Regression testing
The project contains a built-in self-test:
$ make regress
bin/masscan --regress
selftest: success!
This tests a lot of tricky bits of the code. You should do this after building.
## Performance testing
To test performance, run something like the following:
$ bin/masscan 0.0.0.0/4 -p80 --rate 100000000 --router-mac 66-55-44-33-22-11
The bogus `--router-mac` keeps packets on the local network segments so that
they won't go out to the Internet.
You can also test in "offline" mode, which is how fast the program runs
without the transmit overhead:
$ bin/masscan 0.0.0.0/4 -p80 --rate 100000000 --offline
This second benchmark shows roughly how fast the program would run if it were
using PF_RING, which has near zero overhead.
# Usage
Usage is similar to `nmap`. To scan a network segment for some ports:
# masscan -p80,8000-8100 10.0.0.0/8
This will:
* scan the 10.x.x.x subnet, all 16 million addresses
* scans port 80 and the range 8000 to 8100, or 102 addresses total
* print output to `<stdout>` that can be redirected to a file
To see the complete list of options, use the `--echo` feature. This
dumps the current configuration and exits. This output can be used as input back
into the program:
# masscan -p80,8000-8100 10.0.0.0/8 --echo > xxx.conf
# masscan -c xxx.conf --rate 1000
## Banner checking
Masscan can do more than just detect whether ports are open. It can also
complete the TCP connection and interaction with the application at that
port in order to grab simple "banner" information.
The problem with this is that masscan contains its own TCP/IP stack
separate from the system you run it on. When the local system receives
a SYN-ACK from the probed target, it responds with a RST packet that kills
the connection before masscan can grab the banner.
The easiest way to prevent this is to assign masscan a separate IP
address. This would look like the following:
# masscan 10.0.0.0/8 -p80 --banners --source-ip 192.168.1.200
The address you choose has to be on the local subnet and not otherwise
be used by another system.
In some cases, such as WiFi, this isn't possible. In those cases, you can
firewall the port that masscan uses. This prevents the local TCP/IP stack
from seeing the packet, but masscan still sees it since it bypasses the
local stack. For Linux, this would look like:
# iptables -A INPUT -p tcp --dport 61000 -j DROP
# masscan 10.0.0.0/8 -p80 --banners --source-port 61000
You probably want to pick ports that don't conflict with ports Linux might otherwise
choose for source-ports. You can see the range Linux uses, and reconfigure
that range, by looking in the file:
/proc/sys/net/ipv4/ip_local_port_range
On the latest version of Kali Linux (2018-August), that range is 32768 to 60999, so
you should choose ports either below 32768 or 61000 and above.
Setting an `iptables` rule only lasts until the next reboot. You need to lookup how to
save the configuration depending upon your distro, such as using `iptables-save`
and/or `iptables-persistant`.
On Mac OS X and BSD, there are similar steps. To find out the ranges to avoid,
use a command like the following:
# sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last
On FreeBSD and older MacOS, use an `ipfw` command:
# sudo ipfw add 1 deny tcp from any to any 40000 in
# masscan 10.0.0.0/8 -p80 --banners --source-port 40000
On newer MacOS and OpenBSD, use the `pf` packet-filter utility.
Edit the file `/etc/pf.conf` to add a line like the following:
block in proto tcp from any to any port 40000
Then to enable the firewall, run the command:
# pfctrl -E
If the firewall is already running, then either reboot or reload the rules
with the following command:
# pfctl -f /etc/pf.conf
Windows doesn't respond with RST packets, so neither of these techniques
are necessary. However, masscan is still designed to work best using its
own IP address, so you should run that way when possible, even when its
not strictly necessary.
The same thing is needed for other checks, such as the `--heartbleed` check,
which is just a form of banner checking.
## How to scan the entire Internet
While useful for smaller, internal networks, the program is really designed
with the entire Internet in mind. It might look something like this:
# masscan 0.0.0.0/0 -p0-65535
Scanning the entire Internet is bad. For one thing, parts of the Internet react
badly to being scanned. For another thing, some sites track scans and add you
to a ban list, which will get you firewalled from useful parts of the Internet.
Therefore, you want to exclude a lot of ranges. To blacklist or exclude ranges,
you want to use the following syntax:
# masscan 0.0.0.0/0 -p0-65535 --excludefile exclude.txt
This just prints the results to the command-line. You probably want them
saved to a file instead. Therefore, you want something like:
# masscan 0.0.0.0/0 -p0-65535 -oX scan.xml
没有合适的资源?快使用搜索试试~ 我知道了~
IP信息收集工具.zip
共1126个文件
nse:598个
lua:144个
c:103个
0 下载量 116 浏览量
2023-12-22
16:10:04
上传
评论
收藏 73.03MB ZIP 举报
温馨提示
网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具 网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具网络安全ip信息收集工具
资源推荐
资源详情
资源评论
收起资源包目录
IP信息收集工具.zip (1126个子文件)
0022a4e8a8c7e0aaf912ff4dbcca612b030ac2 54B
06a7751a3ee05f35baf9762dd98ed21f637d8e 222B
LGPL-2.1 26KB
MPL-1.1 25KB
1207bbd425c9ed66def65496135670d4b9c223 154B
2289b0b762ea721812431acc777dacda5978df 54B
38185b1b3bf137c9206f18cd3721928d7da1d7 4KB
41719249adb6dd42eb7c56b1999a2d0a290caa 158B
42de6c19a8fd49302a29230c841b5159ad20d3 129B
4aa73d575ab07eae64cfaef835d55cfd72e4cc 52B
53e48d28429b7667df8e7bfb33cfe5bd6c18ff 543B
5f21375ea352b3670609bf5a7cc4bcdf6fb7cc 54B
6913962ef90fae2ba1740bde418436ebf54e9a 547B
7f8a2ee76dc4aac1e91659fc6f098243de44d9 5KB
masscan.8 18KB
a822428b019e6a1f3443f948267e10655f5448 54B
mysql-cis.audit 10KB
ndiff.bat 1021B
BSD-simplified 1KB
proto-ssl-test.c 146KB
main-conf.c 105KB
proto-smb.c 78KB
main.c 58KB
proto-tcp.c 53KB
smack1.c 52KB
proto-x509.c 49KB
proto-ssl.c 45KB
read-service-probes.c 39KB
ranges.c 38KB
templ-pkt.c 38KB
output.c 30KB
rawsock-pcapfile.c 29KB
rawsock.c 29KB
ranges6.c 27KB
range-file.c 27KB
templ-payloads.c 27KB
proto-coap.c 25KB
proto-snmp.c 21KB
proto-banner1.c 19KB
rand-primegen.c 19KB
crypto-blackrock2.c 18KB
proto-dns.c 15KB
proto-banout.c 15KB
proto-tcp-telnet.c 14KB
proto-preprocess.c 14KB
in-binary.c 14KB
rawsock-getroute.c 14KB
proto-memcached.c 14KB
proto-http.c 13KB
proto-tcp-rdp.c 13KB
proto-vnc.c 13KB
stub-pcap.c 12KB
rawsock-getif.c 12KB
rte-ring.c 12KB
rand-lcg.c 12KB
rand-blackrock.c 12KB
rawsock-arp.c 11KB
proto-zeroaccess.c 11KB
in-report.c 11KB
nmap_service.c 11KB
proto-ntlmssp.c 9KB
siphash24.c 8KB
out-redis.c 8KB
proto-ntp.c 8KB
proto-sctp.c 7KB
crypto-base64.c 7KB
out-grepable.c 7KB
main-initadapter.c 7KB
proto-imap4.c 7KB
proto-smtp.c 6KB
proto-icmp.c 6KB
pixie-backtrace.c 6KB
pixie-timer.c 6KB
main-throttle.c 6KB
ranges-avl.c 6KB
main-status.c 6KB
pixie-threads.c 6KB
out-json.c 6KB
out-ndjson.c 6KB
event-timeout.c 5KB
proto-netbios.c 5KB
proto-pop3.c 5KB
rawsock-getmac.c 5KB
scripting-banner.c 5KB
out-binary.c 5KB
xring.c 5KB
proto-ftp.c 5KB
main-ptrace.c 5KB
out-xml.c 5KB
rawsock-getip.c 5KB
proto-udp.c 4KB
misc-rstfilter.c 4KB
masscan-app.c 3KB
vulncheck-heartbleed.c 3KB
main-dedup.c 3KB
util-malloc.c 3KB
syn-cookie.c 3KB
stub-lua.c 3KB
out-null.c 3KB
vulncheck-ntp-monlist.c 3KB
共 1126 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
十年人间~
- 粉丝: 1002
- 资源: 219
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功