Skip to content

Commit c67e407

Browse files
author
Brent Cook
committed
Land rapid7#8880, added Cisco Smart Install (SMI) scanner
2 parents ee9e427 + a304df2 commit c67e407

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Vulnerable Application
2+
3+
Any system exposing the Cisco Smart Install (SMI) protocol, which typically runs on TCP port 4786.
4+
5+
## Verification Steps
6+
7+
1. Do: ```use auxiliary/scanner/misc/cisco_smart_install```
8+
2. Do: ```set [RHOSTS]```, replacing ```[RHOSTS]``` with a list of hosts to test for the presence of SMI
9+
3. Do: ```run```
10+
4. If the host is exposing an identifiable SMI instance, it will print the endpoint.
11+
12+
13+
## Scenarios
14+
15+
```
16+
msf auxiliary(cisco_smart_install) > run
17+
18+
[*] Scanned 57 of 512 hosts (11% complete)
19+
[*] Scanned 105 of 512 hosts (20% complete)
20+
[*] Scanned 157 of 512 hosts (30% complete)
21+
[*] Scanned 212 of 512 hosts (41% complete)
22+
[*] Scanned 256 of 512 hosts (50% complete)
23+
[*] Scanned 310 of 512 hosts (60% complete)
24+
[*] Scanned 368 of 512 hosts (71% complete)
25+
[*] Scanned 413 of 512 hosts (80% complete)
26+
[*] Scanned 466 of 512 hosts (91% complete)
27+
[+] a.b.c.d:4786 - Fingerprinted the Cisco Smart Install protocol
28+
[*] Scanned 512 of 512 hosts (100% complete)
29+
[*] Auxiliary module execution completed
30+
```
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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. Exposure of SMI
19+
to untrusted networks can allow complete compromise of the switch.
20+
),
21+
'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',
22+
'References' =>
23+
[
24+
['URL', 'https://blog.talosintelligence.com/2017/02/cisco-coverage-for-smart-install-client.html'],
25+
['URL', 'https://blogs.cisco.com/security/cisco-psirt-mitigating-and-detecting-potential-abuse-of-cisco-smart-install-feature'],
26+
['URL', 'https://tools.cisco.com/security/center/content/CiscoSecurityResponse/cisco-sr-20170214-smi'],
27+
['URL', 'https://github.com/Cisco-Talos/smi_check'],
28+
['URL', 'https://github.com/Sab0tag3d/SIET']
29+
30+
],
31+
'License' => MSF_LICENSE
32+
)
33+
)
34+
35+
register_options(
36+
[
37+
Opt::RPORT(4786)
38+
]
39+
)
40+
end
41+
42+
# thanks to https://github.com/Cisco-Talos/smi_check/blob/master/smi_check.py#L52-L53
43+
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".freeze
44+
SMI_RE = /^\x00{3}\x04\x00{7}\x03\x00{3}\x08\x00{3}\x01\x00{4}$/
45+
def smi?
46+
sock.puts(SMI_PROBE)
47+
response = sock.get_once(-1)
48+
if response
49+
if SMI_RE.match?(response)
50+
print_good("Fingerprinted the Cisco Smart Install protocol")
51+
return true
52+
else
53+
vprint_status("No match for '#{response}'")
54+
end
55+
else
56+
vprint_status("No response")
57+
end
58+
end
59+
60+
def run_host(_ip)
61+
begin
62+
connect
63+
return unless smi?
64+
rescue Rex::AddressInUse, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionRefused, \
65+
::Errno::ETIMEDOUT, ::Timeout::Error, ::EOFError => e
66+
vprint_error("error while connecting and negotiating Cisco Smart Install: #{e}")
67+
return
68+
ensure
69+
disconnect
70+
end
71+
72+
service = report_service(
73+
host: rhost,
74+
port: rport,
75+
proto: 'tcp',
76+
name: 'Smart Install'
77+
)
78+
79+
report_vuln(
80+
host: rhost,
81+
service: service,
82+
name: name,
83+
info: "Fingerprinted the Cisco Smart Install Protocol",
84+
refs: references,
85+
exploited_at: Time.now.utc
86+
)
87+
end
88+
end

0 commit comments

Comments
 (0)