为了不重复造轮子,我们需要一个开源插件,这里选用谷歌 Tsunami(海啸)扫描器,Apache-2.0 License,随便你怎么造。
Tsunami介绍
背景
看看谷歌的背景介绍
When security vulnerabilities or misconfigurations are actively exploited by attackers, organizations need to react quickly in order to protect potentially vulnerable assets. As attackers increasingly invest in automation, the time window to react to a newly released, high severity vulnerability is usually measured in hours. This poses a significant challenge for large organizations with thousands or even millions of internet-connected systems. In such hyperscale environments, security vulnerabilities must be detected and ideally remediated in a fully automated fashion. To do so, information security teams need to have the ability to implement and roll out detectors for novel security issues at scale in a very short amount of time. Furthermore, it is important that the detection quality is consistently very high. To solve these challenges, we created Tsunami - an extensible network scanning engine for detecting high severity vulnerabilities with high confidence in an unauthenticated manner.
总结:Tsunami是一个可扩展的网络扫描器,以未授权方式对高危漏洞进行高可信扫描。
特点和初衷
谷歌开发Tsunami的特点和初衷如下:
1、Tsunami支持手动管理小漏洞集,即扫自己想要扫的;
2、Tsunami用来检测常常会被黑客拿来使用的高危漏洞,如rce这类漏洞;
3、Tsunami的扫描结果具有高准确性和低假阳性的特点;
4、Tsunami的扫描器很容易被实现;
5、Tsunami容易扩张,执行速度快,扫描不具侵略性。
工作机制
如上流程图,Tsunami工作流程分为两个阶段:
服务探测
探测端口、端口协议、运行在主机上的软件信息,具体如下:
- open ports
- protocols
- network services & their banners
- potential software & corresponding version
服务探测阶段又分为如下两个阶段:
1、端口扫描阶段,顾名思义,就是端口扫描,并识别相关端口协议或者基本软件服务,输出PortScanReport。扫描工具使用的是nmap或者masscan,也是以一种插件tsunami-security-scanner-plugins 的形式存在。
2、指纹识别阶段,该阶段主要是结合端口扫描阶段的信息进行二次扫描,如目标主机使用nginx反向代理在相同的TCP端口443上建立了多个web应用程序。端口扫描阶段只能识别出443端口开了nginx服务,但是指纹识别阶段就可以通过web相关指纹识别出不同的web应用,像 /blog 是 WordPress 的指纹, /forum 是 phpBB 的指纹。
服务探测阶段会生成ReconnaissanceReport用于漏洞检测。
漏洞检测
在第一步的基础上,根据识别出来的的信息,检测与该信息有关的漏洞。目前海啸还不支持动态加载插件和多语言插件,不过以后会支持。