
Python製のエクスプロイトスクリプトで、CVE-2023-1874(WP Data Access WordPressプラグインの権限昇格の脆弱性)に対応します。認証済みの低権限ユーザーが自身のロールを昇格させることが可能になります。
このスクリプトは、ホワイトハットおよび教育目的専用に設計されています。テストする権限のないデバイス、または所有していないデバイスに対してこれを使用する行為は、すべて自己責任です。このスクリプトの作者は、このスクリプトを使用してあなたが行う一切の行為について責任を負いません。あなたの行動はあなた自身のものです。
CVE-2023-1874 は、WP Data Access プラグインのバージョン 5.3.7 以前における脆弱性です。攻撃者はプロフィール更新時に wpda_role[] オプションを指定することで、権限を昇格させることができます。
NIST より:
The WP Data Access plugin for WordPress is vulnerable to privilege escalation in versions up to, and including, 5.3.7. This is due to a lack of authorization checks on the multiple_roles_update function. This makes it possible for authenticated attackers, with minimal permissions such as a subscriber, to modify their user role by supplying the 'wpda_role[]' parameter during a profile update. This requires the 'Enable role management' setting to be enabled for the site.
# not necessary.
#
# these can be manually input as arguments to the script.
#
# theses exports are for ease-of-use.
export TARGETIP=localhost
export TARGETPORT=80
export WPPATH=wordpress
export WPUSERNAME=myuser
export WPPASSWORD=mypass
python3 cve20231874.py $TARGETIP $TARGETPORT -u $WPUSERNAME -p $WPPASSWORD --path $WPPATH