分布式端口扫描器:Nray

这是一个免费的,独立于平台和体系结构的端口和应用层扫描程序。其分布式设计成为它最大的特色,一般情况下,其速度会优于 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 文件中。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
已知程序 import xarray as xr from collections import namedtuple import numpy as np from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter import matplotlib.ticker as mticker import cartopy.feature as cfeature import cartopy.crs as ccrs import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.colors as mcolors def region_mask(lon, lat, extents): lonmin, lonmax, latmin, latmax = extents return ( (lon >= lonmin) & (lon <= lonmax) & (lat >= latmin) & (lat <= latmax) ) Point = namedtuple('Point', ['x', 'y']) Pair = namedtuple('Pair', ['start', 'end']) time = '2023-05-04' filepath_DPR = r"C:\pythontest\zFactor\test1.nc4" extents = [110, 122, 25, 38] with xr.open_dataset(filepath_DPR) as f: lon_DPR = f['FS_Longitude'][:] lat_DPR = f['FS_Latitude'][:] zFactorFinalNearSurface = f['FS_SLV_zFactorFinalNearSurface'][:] nscan, nray = lon_DPR.shape midray = nray // 2 mask = region_mask(lon_DPR[:, midray], lat_DPR[:, midray], extents) index = np.s_[mask] lon_DPR = lon_DPR[index] lat_DPR = lat_DPR[index] zFactorFinalNearSurface = zFactorFinalNearSurface[index] for data in [ zFactorFinalNearSurface, ]: data.values[data <= -9999] = np.nan proj = ccrs.PlateCarree() fig = plt.figure(figsize=(10, 8)) ax = fig.add_subplot(111, projection=proj) ax.coastlines(resolution='50m', lw=0.5) ax.add_feature(cfeature.OCEAN.with_scale('50m')) ax.add_feature(cfeature.LAND.with_scale('50m')) ax.set_xticks(np.arange(-180, 181, 5), crs=proj) ax.set_yticks(np.arange(-90, 91, 5), crs=proj) ax.xaxis.set_minor_locator(mticker.AutoMinorLocator(2)) ax.yaxis.set_minor_locator(mticker.AutoMinorLocator(2)) ax.xaxis.set_major_formatter(LongitudeFormatter()) ax.yaxis.set_major_formatter(LatitudeFormatter()) ax.set_extent(extents, crs=proj) ax.tick_params(labelsize='large') def make_zF_cmap(levels): '''制作雷达反射率的colormap.''' nbin = len(levels) - 1 cmap = cm.get_cmap('jet', nbin) norm = mcolors.BoundaryNorm(levels, nbin) return cmap, norm levels_zF = [0, 1, 5, 10, 15, 20, 25, 30, 35, 40, 45] cmap_zF, norm_zF = make_zF_cmap(levels_zF) im = ax.contourf( lon_DPR, lat_DPR, zFactorFinalNearSurface, levels_zF, # 三个物理量为 (500, 49)就是在500*49的格点上赋予这三个物理量 cmap=cmap_zF, norm=norm_zF, extend='both', transform=proj ) cbar = fig.colorbar(im, ax=ax, ticks=levels_zF) cbar.set_label('zFactor (dBZ)', fontsize='large') cbar.ax.tick_params(labelsize='large') ax.set_title(f'DPR zFactor on {time}', fontsize='x-large') plt.show()如何将其中的zFactorFinal变量变为二维
05-26

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chosennnny

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值