Skip to main content

Determine if a Cisco switch or router is vulnerable

To patch or not to patch, that is the question.... Well, it is when it come to switches and routers. 


With Cisco (and other vendors) devices it is not so simple. There are various configurations and various feature sets. For example You may be running version of IOS that has known security vulnerabilities but your device may be not vulnerable. 


For example if there is a vulnerability in http server but your device doesn't have it enabled (no ip http server) you are not vulnerable. Obviously an http server may be enabled and some point and this would render the device vulnerable. That's where configuration management and change control come in. 


Furthermore there are different feature sets of the same IOS version. You may be running "IP Base" set  which doesn't support MPLS but Nessus will show MPLS vulnerability.


So in order to determine if our device is vulnerable we need to look at both Cisco advisory and configuration file. Understanding various feature sets is also helpful, this link can help here:


http://tools.cisco.com/ITDIT/CFN/jsp/index.jsp


First we need to find out what version of IOS we run. We can do it using CiscoWorks LMS RME reporting feature. Here we can create an CSV report listing our devices and IOS versions. 


Alternately we can  connect to the device and execute: "show version" command which will give us both feature set (i.e xxx-IPBASEK9) and IOS version (I.E. 12.2(50)SE).


We will also need the config file which again we can get from CiscoWorks or directly from the switch by executing "show running-config" or "show startup-config". They generally should be the same, as a best practice you can compare them using CiscoWorks or manually using CSDIF for example. This will ensure that potentially vulnerable configuration are not be enabled upon reload.


Once we have that we can go to "Cisco IOS Software Checker" 


http://tools.cisco.com/security/center/selectIOSVersion.x


We paste in the version ID and hit submit:






Then we select "All previously published Cisco Security Advisories" and hit continue.


Once we are presented with the list of published vulns the fun begins. 








Knowing that are feature set is IPBASE we can straight away discard MPLS, IKE and Software Tunnels vulnerabilities as these are not support in this set. 


Now we need to analyse all remaining advisories.


Open relevant advisory and have a read. In most cases either "Vulnerable Product" or "Details" sections specify configurations that are.


In our example first advisory requires that http(s) server is enabled.  My sample switch is not vulnerable as my config file contains:


!
no ip http server
no ip https server
!


This should give you an idea of how it works.

Comments

Popular posts from this blog

x.509 Certificates - Critical vs non-critical extensions

Extensions are used to associate additional information with the user or the key.  Each certificate extension has three attributes - extnID, critical, extnValue extnID - Extension ID - an OID that specifies the format and definitions of the extension critical - Critical flag - Boolean value extnValue - Extension value  Criticality flag specifies whether the information in an extension is important. If an application doesn't recognize the extension marked as critical, the certificate cannot be accepted. If an extension is not marked as critical (critical value False) it can be ignored by an application. In Windows, critical extensions are marked with a yellow exclamation mark,  View certificate extensions using OpenSSL: # openssl x509 -inform pem -in cert.pem -text -noout (output abbreviated)         X509v3 extensions:             X509v3 Key Usage: critical                 Digital Signature, Key Encipherment             X509v3 Subject Key Identifier

Count number of lines - 'findstr'

How do I count number of lines in a command output? findstr /r/n "^" | find /c ":" Above commands will display number of lines output by whatever command (well, nearly whatever) you specify in the front.  For example:  C:\>ping localhost | findstr /r/n "^" | find /c ":" FINDSTR: // ignored 12 This comes handy if you want to find out how many OUs you have in Active Directory: dsquery ou  -limit 0 | findstr /r/n "^" | find /c ":" How many user accounts there are: dsquery user -limit 0 | findstr /r/n "^" | find /c ":" Computers: dsquery computer -limit | findstr /r/n "^" | find /c ":"

Cisco ASA Certificate Revocation Checking

ASA supports status verification using CRLs and OCSP. CRL can be retrieved using HTTP, LDAP or SCEP. Revocation checking using CRL: Over HTTP: ciscoasa(config)# crypto ca trustpoint ASDM_TrustPoint2 ciscoasa(config-ca-trustpoint)# revocation-check crl ciscoasa(config-ca-crl)# protocol http By default ASA will use address listed in CDP extension of the certificate that is being validated.  To override default behaviour we need to add the following in the CRL configuration context. ciscoasa(config-ca-crl)# policy static ciscoasa(config-ca-crl)# url 1 http://cdpurl.kp.local/crl.crl Over LDAP: Certificate I'm using for this lab, doesn't have LDAP address in its CDP extension. Therefore I'm using "policy static"  to specify LDAP URL where CRL can be retrieved.  ciscoasa(config)# crypto ca trustpoint ASDM_TrustPoint2 ciscoasa(config-ca-trustpoint)# revocation-check crl ciscoasa(config-ca-trustpoint)# crl configure ciscoasa