the hackers labs notes

From now , I’m diving into stuff that actually fires me up - no more “shoulds,” just pure curiosity.

Tortuga

靶机跳转,点击下方按钮

Tortuga image-20251012143004040

信息搜集

img

扫端口,发现22和80,简单访问下80端口

下面两个php文件,dirsearch爆破过其他路径,也失败了,接下来就看看能不能走参数

翻译了下这个mapa.php路由,感觉上是让我找文件,然后就爆破参数名的时候,不能把目标文件写我们测试的mapa.php,目前来看,index.htmltripulacion.php文件都可以

img

用burp爆破攻击就好了,发现参数名就是filename

img

look here,这是http://10.161.253.201/mapa.php?filename=tripulacion.php的结果,两个文件都显示出来了

不能执行filename=mapa.php的原因是这会导致php无限递归包含,最后达到memory_limit后触发HTTP 500 Internal Server Error给我们,对我来说这个解释应该是没问题了

img

然后我们尝试/etc/passwd,可惜失败了,但是发现双写后就没有问题,可以进行路径穿越

img

但是只能本地进行路径穿越,我也拿不到shell,回到那个mapa.php,会发现他们加粗了用户名grumete,正好这个也是/etc/passwd上面出现的用户,接下来需要考虑ssh弱密码爆破了

img

成功爆破出来,拿到了userflag

读取那个.nota.txt,拿到了capitan的登录密码mar_de_fuego123(实质上这一步可以不用

暂时回到web服务,我看看,确认了,我前面的操作都没问题

img

提权

然后想办法提权root

通过linepeas,掌握了新的技能

img

1
2
3
4
capitan@TheHackersLabs-Tortuga:~$ /sbin/getcap -r / 2>/dev/null
/usr/bin/ping cap_net_raw=ep
/usr/bin/python3.11 cap_setuid=ep
capitan@TheHackersLabs-Tortuga:~$

这里的cap_setuid能力集相较平时提权用的suid更厉害, 就是说它能分配setuid(),setgid(),setresuid()等特殊权限功能

1
2
3
capitan@TheHackersLabs-Tortuga:~$ /usr/bin/python3.11 -c 'import os; os.setuid(0); os.system("/bin/bash")'
root@TheHackersLabs-Tortuga:~# cat /root/root.txt
c???????????????????????????ae

the hackers labs notes
https://yo1o.top/2025/10/12/thehackerslabs-notes/
作者
Yolo
发布于
2025年10月12日
许可协议