这是一个免费的,独立于平台和体系结构的端口和应用层扫描程序。其分布式设计成为它最大的特色,一般情况下,其速度会优于 Nmap。
Nray
是一个用 Go 语言编写的高级端口扫描程序,除了常规目标(主机/网络列表)端口扫描之外,它还基于证书透明性日志或 LDAP 等来源支持动态目标选择。此外,nray 允许以分布式方式运行以加快扫描速度并从不同的有利位置执行扫描,以此加快扫描速度。然后进一步处理分析结果信息,例如,使用jq
诸如 Elasticsearch 或 Splunk 之类的工具或成熟的数据分析平台。
项目地址:https://github.com/nray-scanner/nray
扫描目标
- IP,域名和网络列表等常用的东西。
- Nray 允许观察证书透明性日志并从几乎实时发布的证书中提取域名。
- Nray 可以连接到 LDAP(例如Active Directory)并执行任意查询,例如获取所有已注册的计算机对象并提取其 FQDN。
- 已计划 DNS 区域传输。
特点
其分布式是它最大的特点,让你可以从多个主机并行扫描,这使得扫描速度明显提高。
安装&使用
建议直接下载安装编译好的版本。
下载地址:https://github.com/nray-scanner/nray/releases
适用于:Linux、Windows、苹果系统
找到适用系统的程序,然后编辑配置文件 config.yaml (以扫描本地为例)
debug: false
listen: [8601] # Port to listen
host: "127.0.0.1" # host to listen (only localhost)
pools: 1 # Only use a single pool
TLS:
enabled: false
CA: "/path/to/ca.pem"
cert: "/path/to/servercert.pem"
key: "/path/to/servercert-key.pem"
forceClientAuth: false
considerClientPoolPreference: true
allowMultipleNodesPerHost: false
internal:
nodeExpiryTime: 30
nodeExpiryCheckInterval: 10
targetgenerator:
bufferSize: 5
standard:
enabled: true
targets: ["192.168.178.1/28"] # target network to scan
tcpports: ["top25"] # which TCP ports to scan
udpports: [] # don't scan UDP
blacklist: [] # no blacklist
maxHostsPerBatch: 20
maxTcpPortsPerBatch: 25
maxUdpPortsPerBatch: 25
certificatetransparency:
enabled: false
domainRegex: '^(www[.]).*([.]com)$'
tcpports: [top25]
udpports: [top25]
blacklist: []
maxHostsPerBatch: 150
maxTcpPortsPerBatch: 25
maxUdpPortsPerBatch: 25
ldap:
enabled: false
ldapSearchString: "(objectCategory=computer)"
baseDN: "dc=contoso,dc=com"
ldapAttribute: "dNSHostName"
ldapServer: ""
ldapPort: 636
insecure: false
ldapUser: ""
ldapPass: ""
tcpports: [top25]
udpports: [top25]
blacklist: []
maxHostsPerBatch: 5
maxTcpPortsPerBatch: 25
maxUdpPortsPerBatch: 25
scannerconfig:
workers: 250 # Run with 250 workers
ratelimit: "none" # No rate limit
tcp:
timeout: 2500ms # 2.5s TCP timeout
udp:
fast: false
defaultHexPayload: "\x6e\x72\x61\x79"
timeout: 2500ms
zgrab2:
enabledModules: []
ssh:
subscribePorts: ["tcp/22"]
timeout: 2500ms
ClientID: "SSH-2.0-Go-nray"
CollectUserAuth: true
http:
subscribeHTTPPorts: ["tcp/80", "tcp/8080", "tcp/8000"]
subscribeHTTPSPorts: ["tcp/443", "tcp/8443"]
timeout: 2500ms
method: "GET"
endpoint: "/"
userAgent: "nray"
retryHTTPS: true
maxRedirects: 2
events:
terminal:
enabled: true # print events to terminal
internal:
channelsize: 1000
json-file:
enabled: true # write events to file
filename: "nray-output.json" # filename
overwriteExisting: false
internal:
channelsize: 10000
synctimer: 10s
elasticsearch:
enabled: false
server: "elasticsearch.local"
useTLS: true
port: 443
internal:
indexname: "nray"
channelsize: 10000
committimer: 3
运行服务器,这里以 Windows 系统为例,在 cmd 中执行命令:
nray.exe server -c config.yaml
再开启一个 cmd 运行一个节点:
nray.exe node
如果未指定服务器和端口,则节点将尝试连接到 localhost:8601,也可以通过 -s <server> 和 -p <port> 参数来指定。
如果当前网络中打开了端口,则可以看到找到的每个端口的事件。
扫描结果会写入 nray-output.json 文件中。