Post

healthcare:1 Walkthrough

cms-sqli获得账号密码进入后台打点,env-hijack提权

healthcare:1 Walkthrough

Recon

这台机器开放标准端口的ftp、web,需要注意的是其ftp使用的是ProFTPD而不是更常见的Vsftpd

image-20250927210512749

21/tcp

80/tcp

网页前端是一个发布页,不存在交互点

image-20250927221308143

目录扫描发现robots.txt但路径基本不存在,无有效攻击向量

image-20250928200212781

gobuster使用directory-list-2.3-big.txt扫描得到/openemr路径

这里测试了feroxbuster使用同样的字典扫不出来,可能是timeout原因

image-20250928224939520

访问后发现指纹OpenMer v4.1.0,searchhsploit openemr发现存在大量漏洞

image-20250928225104377

使用exp49742.py,sqli获得账号和密码hash

image-20250929165609306

crackstation得到admin:ackbar和medical:medical

image-20250929165654498

Error

打到这里发现机器运行有问题,由于mysqld服务未启动导致OpenEMR异常,做到这里就没法往下了

未完的部分如下

  • 使用破解得到的账号密码登录OpenEMR后台,通过类似wordpress后台getshell的方式反弹shell(编辑.php文件加入反弹shell代码)
  • find / -perm -4000 2>/dev/null发现/usr/bin/healthcare存在suid,strings查看可打印字符,发现它运行了fdisk -l
  • 通过env hijack,写入恶意fdisk,export环境变量后执行healthcare提权
This post is licensed under CC BY 4.0 by the author.