Skip to content

Commit e52e9c1

Browse files
committed
First commit for Cisco Smart Install Scanner
1 parent 6793dd2 commit e52e9c1

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
##
2+
# This module requires Metasploit: http://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' => 'Identify Cisco Smart Install endpoints',
16+
'Description' => %q(
17+
This module attempts to connect to the specified Cisco Smart Install port
18+
and determines if it speaks the Smart Install Protocol.
19+
),
20+
'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',
21+
'References' =>
22+
[
23+
['URL', 'https://blog.talosintelligence.com/2017/02/cisco-coverage-for-smart-install-client.html'],
24+
['URL', 'https://blogs.cisco.com/security/cisco-psirt-mitigating-and-detecting-potential-abuse-of-cisco-smart-install-feature'],
25+
['URL', 'https://tools.cisco.com/security/center/content/CiscoSecurityResponse/cisco-sr-20170214-smi'],
26+
['URL', 'https://github.com/Cisco-Talos/smi_check']
27+
],
28+
'License' => MSF_LICENSE
29+
)
30+
)
31+
32+
register_options(
33+
[
34+
Opt::RPORT(4786)
35+
]
36+
)
37+
end
38+
39+
# thanks to https://github.com/Cisco-Talos/smi_check/blob/master/smi_check.py#L52-L53
40+
SMI_PROBE = "\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00"
41+
SMI_RE = /^\x00{3}\x04\x00{7}\x03\x00{3}\x08\x00{3}\x01\x00{4}$/
42+
def smi?
43+
sock.puts(SMI_PROBE)
44+
response = sock.get_once(-1)
45+
if response
46+
if SMI_RE.match?(response)
47+
print_good("Fingerprinted the Cisco Smart Install protocol")
48+
return true
49+
else
50+
vprint_status("No match for '#{response}'")
51+
end
52+
else
53+
vprint_status("No response")
54+
end
55+
end
56+
57+
def run_host(_ip)
58+
begin
59+
connect
60+
return unless smi?
61+
rescue Rex::AddressInUse, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionRefused, \
62+
::Errno::ETIMEDOUT, ::Timeout::Error, ::EOFError => e
63+
vprint_error("error while connecting and negotiating Cisco Smart Install: #{e}")
64+
return
65+
ensure
66+
disconnect
67+
end
68+
69+
service = report_service(
70+
host: rhost,
71+
port: rport,
72+
proto: 'tcp',
73+
name: 'Smart Install'
74+
)
75+
76+
report_vuln(
77+
host: rhost,
78+
service: service,
79+
name: name,
80+
info: "Fingerprinted the Cisco Smart Install Protocol",
81+
refs: references,
82+
exploited_at: Time.now.utc
83+
)
84+
end
85+
end

0 commit comments

Comments
 (0)