0x01 初步探测
靶机导入虚拟机后,先找到靶机IP,Kali下使用 netdiscover 或者 nmap -sP 192.168.1.1/24 命令即可。扫到靶机IP为192.168.56.100

继续使用nmap扫描一下靶机开放的端口
0x02后台查找
网站80端口开着,那就先从网站下手,直接访问http://192.168.1.100/,发现只是一个单纯的Bootstrap框架页面,没有任何有用的信息。

继续使用dirb扫了下网站目录,发现了一个
joomla地址, DIRECTORY: http://192.168.1.100/joomla/

访问该地址,是一个名叫TIM的博客

使用
JoomScan工具,能对Joomla项目进行漏洞扫描,看看有没有什么收获。
git clone https://github.com/rezasp/joomscan.git#安装
cd joomscan#打开
perl joomscan.pl -u http://192.168.1.100/#扫描
通过JoomScan扫描,找到了一个可用地址

打开是后台登录界面,试了下弱口令,注入都不不行,最后没想到爆破成功了...

0x03后台爆破
后台密码爆破思路如下:
1.首先利用
cewl命令,对网站进行密码字典抓取。
cewl http://192.168.1.100/joomla

2.创建一个用户名字典,根据分析,用户名字典我用了admin,tim,user,joomla。
3.创建一个密码字典,把上面抓来的字典,加上我自己的一些弱口令字典。

4.直接放到burpsuite爆破即可(社区版由于改不了爆破线程数,所以速度慢)。最后爆破出来用户名为admin密码为travel
0x04 后台拿shell
成功利用爆破出来的密码进入后台

关于joomla后台getwebshell一些基本方法:
Step:
Extensions 、 Extension Manager 、 Upload (fuck.php)
Webshell:
/tmp/fuck.php
Step:
Extensions 、 Template Manager 、 Template 、 Atomic Details and Files 、 Edit main page template(Insert PHP Trojan)
Webshell:
/templates/atomic/index.php
Step:
Content 、 Media Manager 、 Create Folder(x.asp) 、 Upload (asp.gif)
Webshell:
/images/x.asp/asp.gif
我采用了后台直接修改模板文件内容拿shell。进入后台找到Extensions、Templates、Styles,查看当前网站所用模板名称为protostar - Default

然后进入
Extensions、Templates、Templates找到对应模板进入,修改index.php文件加入一句话即可。

访问index.php页面,测试shell是否可用。

0x05 提权
连接上拿到的shell,随便看看,最后在opt/scripts/fileshare.py找到了有用的东西。username="tim",password="lulzlol"

直接登录ssh,查看权限
sudo -l #显示出自己(执行 sudo 的使用者)的权限

0x06 拿flag
sudo -i #切换到root
ls #显示目录文件
cat flag.txt #查看文件

发表评论