声明:请勿利用文章内的相关技术从事非法测试,由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,海底生残月及文章作者不为此承担任何责任。
现在只对常读和星标的公众号才展示大图推送,建议大家能把海底生残月“设为星标”,否则可能就看不到了啦!
欢迎师傅们加群一起交流
0x01 漏洞描述
Nuclei是一款基于YAML语法模板的开发的定制化快速漏洞扫描器。它使用Go语言开发,具有很强的可配置性、可扩展性和易用性。
官网:https://nuclei.projectdiscovery.io
Nuclei项目地址:https://github.com/projectdiscovery/nuclei
Nuclei-Templates项目地址:https://github.com/projectdiscovery/nuclei-templates
0x02 脚本编写
基本组成:
1、编号 id
2、信息 info
3、请求 http file tcp...
4、匹配 matchers Interactsh
5、提取 extractors
ID
#模版的唯一ID,必要字段。
id: CVE-2016-3088
Info
信息模块提供:名称、作者、严重性、描述、参考和标签等
info:
name: Apache ActiveMQ Fileserver - Arbitrary File Write #脚本的名字
author: fq_hsu #作者
severity: critical #安全等级
description: Apache ActiveMQ 5.x before 5.14.0 allows remote attackers to upload and execute arbitrary files via an HTTP PUT followed by an HTTP MOVE request via the Fileserver web application. # 描述,加个|可以进行换行
reference: # 链接来源,参考链接
- https://nvd.nist.gov/vuln/detail/CVE-2016-3088
tags: fileupload,cve,cve2016,apache,activemq # 标签,nuclei可以根据标签来打poc
Requests
这一块是核心,nuclei全部的请求都是基于这一块
# 方式一:原始(raw)请求
- raw:
- |
GET /index.php HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
- |
POST /index.php HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Accept-Language: en
Content-type: application/x-www-form-urlencoded
...
# 方式二:GET, POST, PUT, DELETE 请求
- method: GET
path:
- "{{BaseURL}}/login.php"
- "{{BaseURL}}/index.php"
headers:
User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
cmd: "test123"
请求中会包含{{变量名或表达式}}的动态值,变量命名由 variables、payloads、extractors 解压出来的值、目标url等一起提供
重定向
有些登录需要重定向、如果有需要,可以添加redirects: true在请求详细信息中启用。然后使用max-redirects字段,后面的数字是允许重定向的次数,最多遵循 10 个重定向。
requests:
- raw:
- |
GET /zentao/api-getModel-editor-save-filePath=bote HTTP/1.1
redirects: true
max-redirects: 3
保留字
{{Hostname}} # 最常用的主机名变量被替换为主机名,包括运行时目标的端口
{{randstr}} # 随机字符串
{{BaseURL}} # https://example.com:443/foo/bar.php
{{RootURL}} # https://example.com:443
{{Hostname}} # example.com:443
{{Host}} # example.com
{{Port}} # 443
{{Path}} # /foo
{{File}} # bar.php
{{Scheme}} # https
匹配器
matchers
POC的触发规则
1、status,匹配http 响应状态码;
matchers:
- type: status
status: #状态码之间默认是or的关系
- 200
- 302
condition: and #将默认的 or 的关系改为 and
2. word,字符串匹配
matchers:
- type: word
words:
- "[core]"
- "[config]"
condition: and
part: body
3. regex,正则匹配;
matchers:
- type: regex
part: body
regex:
- 'SSH-([0-9.-A-Za-z_ ]+)'
4. binary,二进制数据匹配;
matchers:
- type: binary
binary:
- "504B0304" # zip格式
- "526172211A070100" # RAR格式
- "FD377A585A0000" # xz tar.xz 格式
condition: or
part: body
5. dsl,使用表达式进行匹配;请求条件允许检查多个请求之间的条件,以编写复杂的检查和涉及多个HTTP 请求的漏洞利用以完成漏洞利用链。使用 DSL 匹配器,可以通过添加req-condition: true和 作为后缀的数字来使用相应的属性
info:
name: Apache ActiveMQ Fileserver - Arbitrary File Write #脚本的名字
author: fq_hsu #作者
severity: critical #安全等级
description: Apache ActiveMQ 5.x before 5.14.0 allows remote attackers to upload and execute arbitrary files via an HTTP PUT followed by an HTTP MOVE request via the Fileserver web application. # 描述,加个|可以进行换行
reference: # 链接来源,参考链接
- https://nvd.nist.gov/vuln/detail/CVE-2016-3088
tags: fileupload,cve,cve2016,apache,activemq # 标签,nuclei可以根据标签来打poc
0
常用dome
info:
name: Apache ActiveMQ Fileserver - Arbitrary File Write #脚本的名字
author: fq_hsu #作者
severity: critical #安全等级
description: Apache ActiveMQ 5.x before 5.14.0 allows remote attackers to upload and execute arbitrary files via an HTTP PUT followed by an HTTP MOVE request via the Fileserver web application. # 描述,加个|可以进行换行
reference: # 链接来源,参考链接
- https://nvd.nist.gov/vuln/detail/CVE-2016-3088
tags: fileupload,cve,cve2016,apache,activemq # 标签,nuclei可以根据标签来打poc
1
参考
https://www.cnblogs.com/haidragon/p/16852363.html
https://blog.csdn.net/qq_35607078/article/details/131648901
0x04 星球介绍
推荐站内搜索:最好用的开发软件、免费开源系统、渗透测试工具云盘下载、最新渗透测试资料、最新黑客工具下载……
还没有评论,来说两句吧...