如何使用APIDetector高效识别目标域名暴露的Swagger节点

admin 2024年2月26日02:32:44评论11 views字数 2641阅读8分48秒阅读模式
如何使用APIDetector高效识别目标域名暴露的Swagger节点
关于APIDetector

APIDetector是一款针对Swagger的强大安全扫描工具,该工具可以帮助广大研究人员高效扫描和识别目标Web域名及子域名中暴露的Swagger节点。该工具是一款智能化工具,专为安全专家和开发人员设计,可以有效地执行真的Swagger的API安全测试和漏洞扫描。

如何使用APIDetector高效识别目标域名暴露的Swagger节点
功能介绍

1、灵活的输入:支持输入单个域名,或以文件形式输出子域名列表;

2、多协议支持:支持测试HTTP和HTTPS节点;

3、并发支持:该工具实现了多线程机制以执行更快速的扫描;

4、自定义输出:支持将输出结果保存到文件或打印到STDOUT;

5、Verbose和静默模式:默认为Verbose模式,也支持静默模式;

6、自定义用户代理:支持为请求指定自定义用户代理;

7、智能检测假阳性:能够智能检测大多数的假阳性情况;

工具要求

Python 3.x

Pip

Requests

工具安装

由于该工具基于Python 3开发,因此我们首先需要在本地设备上安装并配置好Python 3.x环境。

接下来,广大研究人员可以直接使用下列命令将该项目源码克隆至本地:

git clone https://github.com/brinhosa/apidetector.git

(右滑查看更多)

然后切换到项目目录中,使用pip命令安装requests库:

cd apidetectorpip install requests
工具参数选项

-d, --domain:要测试的单个域名;

-i, --input:包含要测试子域名列表的输入文件路径;

-o, --output:写入有效URL的输出文件;

-t, --threads:执行扫描所使用的线程数量(默认为10);

-m, --mixed-mode:测试HTTP和HTTPS协议(混合模式)

-q, --quiet:禁用Verbose输出(默认为Verbose模式);

-ua, --user-agent:发送请求所使用的自定义用户代理;

风险分类

高危节点

'/swagger-ui.html', '/swagger-ui/', '/swagger-ui/index.html', '/api/swagger-ui.html', '/documentation/swagger-ui.html', '/swagger/index.html', '/api/docs', '/docs', '/api/swagger-ui', '/documentation/swagger-ui'

(右滑查看更多)

中高危节点

'/openapi.json', '/swagger.json', '/api/swagger.json', '/swagger.yaml', '/swagger.yml', '/api/swagger.yaml', '/api/swagger.yml', '/api.json', '/api.yaml', '/api.yml', '/documentation/swagger.json', '/documentation/swagger.yaml', '/documentation/swagger.yml'

(右滑查看更多)

中危节点

'/v2/api-docs', '/v3/api-docs', '/api/v2/swagger.json', '/api/v3/swagger.json', '/api/v1/documentation', '/api/v2/documentation', '/api/v3/documentation', '/api/v1/api-docs', '/api/v2/api-docs', '/api/v3/api-docs', '/swagger/v2/api-docs', '/swagger/v3/api-docs', '/swagger-ui.html/v2/api-docs', '/swagger-ui.html/v3/api-docs', '/api/swagger/v2/api-docs', '/api/swagger/v3/api-docs'

(右滑查看更多)

低危节点

'/swagger-resources', '/swagger-resources/configuration/ui', '/swagger-resources/configuration/security', '/api/swagger-resources', '/api.html'
(右滑查看更多)
工具使用

常规使用,使用30个线程+Chrome用户代理扫描子域名列表,并将结果存储到文件中:

python apidetector.py -i list_of_company_subdomains.txt -o results_file.txt -t 30 -ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"

(右滑查看更多)

扫描单个子域名:

python apidetector.py -d example.com

从一个输入文件中扫描多个域名:

python apidetector.py -i input_file.txt

指定一个输出文件:

python apidetector.py -i input_file.txt -o output_file.txt

指定要使用的线程数量:

python apidetector.py -i input_file.txt -t 20

同时扫描HTTP和HTTPS协议:

python apidetector.py -m -d example.com

以静默模式运行脚本:

python apidetector.py -q -d example.com

使用一个自定义代理执行脚本:

python apidetector.py -d example.com -ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
许可证协议

本项目的开发与发布遵循MIT开源许可证协议。

项目地址

APIDetector:

https://github.com/brinhosa/apidetector

原文始发于微信公众号(FreeBuf):如何使用APIDetector高效识别目标域名暴露的Swagger节点

 

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年2月26日02:32:44
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   如何使用APIDetector高效识别目标域名暴露的Swagger节点http://cn-sec.com/archives/2523667.html

发表评论

匿名网友 填写信息