vulnhub靶场hacksudo: FOG
0x000 靶场描述
This box should be easy . This machine was created for the InfoSec Prep Discord Server (https://discord.gg/7ujQrt393b)
The box was created with Virtualbox. Upon booting up use netdiscover tool to find IP address. This is the target address based on whatever settings you have. You should verify the address just incase.
Find the user.txt and root.txt flag submit it to the mybox channel on Discord and get chance to get hacksudo machine hacking course free .
Do publish write ups for this box if you can and email me copy on vishal@hacksudo.com
Box created by vishal Waghmare only
0x001 靶场下载
https://www.vulnhub.com/entry/hacksudo-fog,697/
0x002 信息收集
探测存活主机
netdiscover -r 192.168.1.0/24
端口扫描
nmap -sS -sV -A -p 1-65535 192.168.1.107
21 ftp
22 ssh
80 http
443 http
3306 mysql
访问80端口,点击页面链接会跳转到index1.html页面
查看网页源代码
发现提示:凯撒密码,github地址:https://github.com/hacksudo/SoundStegno
发现是一个音频文件加密/解密脚本,先下载下来
目录扫描
gobuster dir -u http://192.168.1.107 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html
发现cms页面以及字典文件,猜测是密码文件
访问cms页面,发现了后台登陆地址以及用户名hacksudo
,burpsuite抓包尝试爆破,没有爆破出来
由于前面扫到21端口,尝试爆破一下,成功破解密码:hacksudo:hackme
hydra -l hacksudo -P passwd.txt ftp://192.168.1.107
ftp登陆
ftp登陆,发现fog目录下存在三个文件,下载到本地查看
fcrackzip破解压缩包密码
其他两个文件没什么信息,查看压缩包,解压发现需要密码,使用fcrackzip进行破解。
fcrackzip -D -p /usr/share/wordlists/rockyou.txt -u secr3tSteg.zip
音频隐写
解压之后发现音频文件:hacksudoSTEGNO.wav
python3 ExWave.py -f hacksudoSTEGNO.wav
凯撒解密
http://www.atoolbox.net/Tool.php?Id=778
0x003 漏洞利用
登陆后台
文件上传漏洞
尝试上传php木马文件,发现被重命名为cmsmsrce.txt
burpsuite抓包修改后缀名再次尝试上传
上传成功
kali监听9999端口,成功获取到shell
python3 -c 'import pty;pty.spawn("/bin/bash")' #切换shell
查看/home目录下,发现用户isro,尝试爆破密码
hydra -l isro -P /usr/share/wordlists/rockyou.txt ssh://192.168.1.107
0x004 提权
查看当前用户权限,发现ls命令具有root权限,尝试提权,但是失败了
查找具有suid权限的文件,也没有可以利用的
find / -perm -u=s -exec ls -al {} \; 2>/dev/null
查看fog目录下,发现fog文件会调用python
运行fog文件,查看当前权限,发现以root权限运行,os.system("/bin/bash -i")
切换到root