Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/misc/sercomm_backdoor_scanner.rb
19778 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::Remote::Tcp
8
include Msf::Auxiliary::Scanner
9
include Msf::Auxiliary::Report
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'SerComm Network Device Backdoor Detection',
16
'Description' => %q{
17
This module can identify SerComm manufactured network devices which
18
contain a backdoor, allowing command injection or account disclosure.
19
},
20
'Author' => [
21
'Eloi Vanderbeken <eloi.vanderbeken[at]gmail.com>', # Initial discovery, poc
22
'Matt "hostess" Andreko <mandreko[at]accuvant.com>' # Msf module
23
],
24
'License' => MSF_LICENSE,
25
'References' => [
26
[ 'CVE', '2014-0659' ],
27
[ 'OSVDB', '101653' ],
28
[ 'URL', 'https://github.com/elvanderb/TCP-32764' ]
29
],
30
'DisclosureDate' => '2013-12-31',
31
'Notes' => {
32
'Reliability' => UNKNOWN_RELIABILITY,
33
'Stability' => UNKNOWN_STABILITY,
34
'SideEffects' => UNKNOWN_SIDE_EFFECTS
35
}
36
)
37
)
38
39
register_options([
40
Opt::RPORT(32764)
41
])
42
end
43
44
def do_report(ip, endianness)
45
report_vuln({
46
:host => ip,
47
:port => rport,
48
:name => "SerComm Network Device Backdoor",
49
:refs => self.references,
50
:info => "SerComm Network Device Backdoor found on a #{endianness} device"
51
})
52
end
53
54
def run_host(ip)
55
begin
56
connect
57
sock.put(Rex::Text.rand_text(5))
58
res = sock.get_once
59
disconnect
60
61
if (res && res.start_with?("MMcS"))
62
print_good("#{ip}:#{rport} - Possible backdoor detected - Big Endian")
63
do_report(ip, "Big Endian")
64
elsif (res && res.start_with?("ScMM"))
65
print_good("#{ip}:#{rport} - Possible backdoor detected - Little Endian")
66
do_report(ip, "Little Endian")
67
else
68
vprint_status("#{ip}:#{rport} - Backdoor not detected.")
69
end
70
rescue Rex::ConnectionError => e
71
vprint_error("#{ip}:#{rport} - Connection failed: #{e.class}: #{e}")
72
end
73
end
74
end
75
76