> 文章列表 > HTB-Bastard

HTB-Bastard

HTB-Bastard

HTB-Bastard

  • 信息收集
    • 80端口
  • 立足
  • 提权

HTB-Bastard

信息收集

HTB-Bastard
HTB-Bastard

80端口

一个欢迎界面以及一个登录功能。底部有Powered by Drupal
HTB-Bastard
创建一个用户aster:aster@aster.com,会看到无法发送邮件的错误信息。

HTB-Bastard
返回查看nmap结果

HTB-Bastard
查看CHANGELOG.txt文件,获得Drupal版本为7.54。
HTB-Bastard

INSTALL.mysql.txt也能访问不过只是安装使用mysql的文档,INSTALL.pgsql.txt则是pgsql的帮助文档。我们只选择需要的来列举出来。
HTB-Bastard
robots.txt文件内容如下。

HTB-Bastard

大部分内容都无法访问,去看看drupal 7.54有什么可以利用的呢。

HTB-Bastard
虽然可以是易受攻击版本,但是攻击会失败。查看一下此利用的需要条件。
HTB-Bastard
逐步排查,有问题的部分就是PHP_FUNC和TARGETURI两个地方。再次对目标进行目录扫描。
HTB-Bastard

HTB-Bastard
行吧,没有什么新的发现。继续查找利用的时候,看到了一个drupal的endpoint。
HTB-Bastard

drupal的endpoint

HTB-Bastard

下面我们需要找到endpoint的路径,但是扫描器貌似扫描不出来。尝试几个可能的搭配:/rest_endpoint、/endpoint、/rest。
HTB-Bastard
运行会出现问题。

HTB-Bastard
安装php-curl,sudo apt install php-curl
HTB-Bastard
先看看能不能通过sql写入phpinfo。

HTB-Bastard
可以。
HTB-Bastard

那就写一个webshell吧。
HTB-Bastard

HTB-Bastard
此外他还给了我们session.json和user.json两个json文件。
HTB-Bastard

HTB-Bastard
user.json里面有sql注入出来的admin的信息。
HTB-Bastardhashcat wiki上能找到对应的hash类型。
HTB-Bastard

立足

不过我们都有webshell了,所以用不上admin的密码。上传nc.exe并运行获得shell。
HTB-Bastard

提权

systeminfo查看操作系统有关信息。
HTB-Bastard
搜索相关内核漏洞。CVE-2019-1458
HTB-Bastard
配合上前面的nc.exe反弹system的shell。
HTB-Bastard