
脆弱な elfinder バージョンを nginx と apache サーバーの両方にセットアップするための Docker コンテナ。脆弱性の POC テストに使用できます。
このリポジトリには、CVE-2021-23394(elFinderの任意ファイル実行)の再現セットアップをDockerで提供します。脆弱なバージョンと修正済みバージョンをApacheとNginxで比較する4つの環境を構築します。
セットアップには以下が含まれます:
8080):elFinder 2.1.57 on Apache8081):elFinder 2.1.66 on Apache8082):elFinder 2.1.57 on Nginx8083):elFinder 2.1.66 on Nginxセットアップスクリプトに実行権限を付与します(まだの場合):
chmod +x setup_containers.sh
セットアップスクリプトを実行します:
./setup_containers.sh
これによりDockerイメージがビルドされ、コンテナが起動します。
ブラウザで以下のURLからelFinderインターフェースにアクセスできます:
脆弱性(または修正)を確認するには、該当テンプレートと共にNucleiを使用します。
以下のコマンドを実行します(path-to-nuclei-templates をテンプレートディレクトリの実際のパスに置き換えてください):
# Apache 脆弱版のテスト(脆弱であるべき)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8080
# Apache 修正版のテスト(脆弱ではないべき)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8081
# Nginx 脆弱版のテスト(脆弱であるべき)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8082
# Nginx 修正版のテスト(脆弱ではないべき)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8083
または、targets.txt ファイルを作成して一度にすべてテストすることもできます:
echo -e "http://localhost:8080\nhttp://localhost:8081\nhttp://localhost:8082\nhttp://localhost:8083" > targets.txt
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -l targets.txt
期待される結果:
コンテナを停止して削除するには、スクリプト内のクリーンアップコマンドを実行するか、手動で行います:
docker rm -f elfinder-apache-vuln elfinder-apache-patched elfinder-nginx-vuln elfinder-nginx-patched