hack the box之doctor靶场练习

admin 2024年11月10日21:58:51评论7 views字数 816阅读2分43秒阅读模式

练习笔记

连接vpn获取ip:
hack the box之doctor靶场练习
扫一下端口:
hack the box之doctor靶场练习
发现目标机器开启了22、80、8089三个端口。
看一下80端口:

hack the box之doctor靶场练习
应该是个诊所之类的官网。扫一下目录:
hack the box之doctor靶场练习
about.html:
hack the box之doctor靶场练习
知道了域名可能为doctor.htb
contact.html页面内容同上。
images:
hack the box之doctor靶场练习
应该是网页的图片,没啥用处。
js:
hack the box之doctor靶场练习
详细阅读后也没发现可利用的点,网站主页也没有利用价值。
看看8089端口:
hack the box之doctor靶场练习
连接被重置。改一下hosts文件试试:
hack the box之doctor靶场练习
还是有问题,只好先放一放。
直接访问域名看看:
hack the box之doctor靶场练习
好像有点不一样。看看网页信息:

hack the box之doctor靶场练习

随手注册一个账号看看:
hack the box之doctor靶场练习
搞个abcd/abcd账号密码组合。登陆看看:
hack the box之doctor靶场练习
好像可以发帖子。因为flask有一个ssti注入,所以尝试创建一个新帖子,试试ssti注入:
hack the box之doctor靶场练习
hack the box之doctor靶场练习
好像并没有效果。但是查看了源码后我发现了如下内容
hack the box之doctor靶场练习
说是这个目录还在测试中,尝试访问一下这个目录:
hack the box之doctor靶场练习
空白页,看一下源码:
hack the box之doctor靶场练习
确实是执行了1+1,也就是说这边应该是存在一个ssti注入。
尝试直接让他反弹shell:
hack the box之doctor靶场练习
hack the box之doctor靶场练习
访问archive后确实直接弹shell了
查看权限:
hack the box之doctor靶场练习
尝试提权:
查看用户信息:
hack the box之doctor靶场练习
发现该机器上存在splunk、shaun、web、root四个账户。
尝试直接读取shaun账户中的flag:
hack the box之doctor靶场练习
权限不允许。
先搞一个tty:
hack the box之doctor靶场练习
然后尝试sudo -l:
hack the box之doctor靶场练习
没密码,g。
找找有suid的程序、文件:
hack the box之doctor靶场练习
没发现可利用内容。
看看文件:
hack the box之doctor靶场练习
备份日志里出现了这样的内容。由于此处是重置密码页面的日志信息,所以猜测此处所显示的Guitar123是一个密码。
尝试用这个密码去切换到shaun用户:
hack the box之doctor靶场练习
成功切换。
获取第一个flag:
hack the box之doctor靶场练习
进一步提权。
我记得之前扫端口的时候扫到过splunk,这玩意好像可以提权:
试试这个脚本:
脚本

开启监听:
hack the box之doctor靶场练习
执行脚本:
hack the box之doctor靶场练习
hack the box之doctor靶场练习
成功getshell,权限为root。查看第二个flag:
hack the box之doctor靶场练习
搞定。
hack the box之doctor靶场练习

本文作者:Thelion, 转载请注明来自FreeBuf.COM

原文始发于微信公众号(白帽子程序员):hack the box之doctor靶场练习

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年11月10日21:58:51
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   hack the box之doctor靶场练习https://cn-sec.com/archives/1817360.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息