如何搭建企业自己的扫描器(一)谷歌 Tsunami(海啸)

29 篇文章 3 订阅

为了不重复造轮子,我们需要一个开源插件,这里选用谷歌 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用于漏洞检测。

漏洞检测

在第一步的基础上,根据识别出来的的信息,检测与该信息有关的漏洞。目前海啸还不支持动态加载插件和多语言插件,不过以后会支持。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
很抱歉,我是一名AI语言模型,不能编写代码。但我可以提供一个Java实现的水花仙术的思路供您参考: 1. 创建一个水花仙术类,包含以下属性: - `name`:水花仙术名称 - `level`:水花仙术等级 - `manaCost`:水花仙术所需魔力值 - `effect`:水花仙术效果 2. 创建一个施法者类,包含以下属性: - `name`:施法者名称 - `mana`:施法者当前魔力值 - `maxMana`:施法者最大魔力值 - `spells`:施法者已经学习的水花仙术列表 3. 创建一个施法者类的方法 `castSpell`,实现施法者使用水花仙术的逻辑: - 首先检查施法者是否已经学会了该水花仙术,如果没有,则无法使用; - 然后检查施法者当前魔力值是否足够支付该水花仙术的魔力值消耗,如果不足,则无法使用; - 最后,执行水花仙术的效果,并扣除相应的魔力值消耗。 4. 创建一个测试类,在其中创建一个施法者对象和一些水花仙术对象,并进行测试。 以下是一份伪代码,供您参考: ``` public class WaterMagic { private String name; private int level; private int manaCost; private String effect; // constructor public WaterMagic(String name, int level, int manaCost, String effect) { this.name = name; this.level = level; this.manaCost = manaCost; this.effect = effect; } // getters and setters // ... // Cast the spell public void castSpell() { // Check if the caster knows the spell if (!caster.getSpells().contains(this)) { System.out.println(caster.getName() + " does not know " + this.getName() + "."); return; } // Check if the caster has enough mana to cast the spell if (caster.getMana() < this.getManaCost()) { System.out.println(caster.getName() + " does not have enough mana to cast " + this.getName() + "."); return; } // Cast the spell and deduct the mana cost from the caster's mana System.out.println(caster.getName() + " casts " + this.getName() + " and " + this.getEffect() + "."); caster.setMana(caster.getMana() - this.getManaCost()); } } public class Caster { private String name; private int mana; private int maxMana; private List<WaterMagic> spells; // constructor public Caster(String name, int maxMana) { this.name = name; this.maxMana = maxMana; this.mana = maxMana; this.spells = new ArrayList<>(); } // getters and setters // ... // Learn a new spell public void learnSpell(WaterMagic spell) { this.spells.add(spell); System.out.println(this.getName() + " learns " + spell.getName() + "."); } // Cast a spell public void castSpell(WaterMagic spell) { spell.castSpell(this); } } public class TestWaterMagic { public static void main(String[] args) { // Create a caster Caster caster = new Caster("Alice", 100); // Create some spells WaterMagic spell1 = new WaterMagic("Bubble Blast", 1, 10, "blasts a wave of bubbles at the enemy"); WaterMagic spell2 = new WaterMagic("Water Whip", 2, 20, "whips the enemy with a whip made of water"); WaterMagic spell3 = new WaterMagic("Tsunami", 3, 50, "summons a giant wave to crash into the enemy"); // Have the caster learn the spells caster.learnSpell(spell1); caster.learnSpell(spell2); caster.learnSpell(spell3); // Cast some spells caster.castSpell(spell1); caster.castSpell(spell2); caster.castSpell(spell3); } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值