Skip to main content

Attacking HSRP

Hot Standby Router Protocol (HSRP) is a Cisco proprietary redundancy protocol for establishing a fault-tolerant default gateway, and has been described in detail in RFC 2281

HSRP is used in enterprise networks to provide default gateway redundancy in access layer. Enabling HSRP is as simple as executing two commands. The problem is that by default it uses clear text authentication with password of "cisco".  This can be captured as seen below and used to inject malicious HSRP packets.

We will use "Yersinia" to capture and inject our own packets (this is always fun).

Our network topology looks as follows:

Let's ping the  two "real" addresses .2 & .3 and the vitual IP .1 to confirm everything is working:

Now let's fire up Yersinia in GUI mode (the GUI is a bit buggy and sometimes crashes):

# yersinia -G 

Let's go to "HSRP" tab and select "Edit Interaces"  (in my case it's eth1).
Once correct interface is selected Yersinia autmatically starts capturing interesting packets.

Here we go to "Launch attack" and pick what we want to do. For the purpose of this lab I selected option "becoming active router" and hit "OK" (first option crashes the GUI)
Yersinia starts sending HSRP "Hello (state Active)" packets, which basically say that I'm now taking over the virtual IP address. At this point both "R2" and "R4" become "stand by" routers and all traffic bound for the gateway flows to the attacker.

There two implications, firtsly it can be used for Man in the middle (MITM) attack (the same thing can be accomplished with ARP poisoining)  or cause a denial of service (DoS) condition where clients on the VLAN using this gateway wouldn't be able to connect to anything outside of the local network.
As seen below the virtual address didn't respond to ping while bogus HSRP packets were being injected.

This is not a great scenario to have to deal with during business hours, specially on a crowded access VLAN. 


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

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 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

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 ":"