Cisco Passwords

Breaking different types of cisco passwords which can be obtained from the configuration file

Summary

Number

Hash type

Crack time

Hash example

0

Clear-text

No need to crack

4

SHA-256

Slow

5

MD5

Fast

7

Vigenere cipher

Very Fast

8

PBKDF2-SHA-256

Very slow

9

scrypt

Very Slow

Password types can be identified (same as in UNIX) by the first part of the hash:

$8$dsYGNam3K1SIJO$7nv/35M/qr6t.dVc7UY9zrJDWRVqncHub1PE9UlMQFs

All password in the below examples as set to 'cisco':

Hash type

Example

PBKDF2-SHA-256

$sha512$5000$XxzDxrleLEtOOaas19WXMQ==$nChvXN+NVC/GXY0J3ZkOFg==

MD5

nlM38dwgzJRcFQd6

Type 0

Password are in clear-text and no need to crack.

Command to use:

Router(config)#enable password cisco

Will results the password in clear text in the running config

Type 4

Cisco first attempt to create their own encryption and failed miserably, then they changed the encryption type to be sha256 without salt and 1 iteration and then based 64.

John:

John the Ripper recognizes this password type as Raw-SHA256. To crack it, we have to first convert it to the following john friendly format and save it in a file:

Then we can crack it like this using a dictionary, for example:

Command to encrypt:

enable secret 4 {HASH}

Note: this type is deprecated starting from IOS 15.3(3)

Type 5

Using md5 as encryption, quite quick to crack (depending on the length)

Using John

Command to encrypt:

enable secret 5 00271A5307542A02D22842 (notice above is not the password string it self but the hash of the password) or enable secret cisco123 (notice above is the password string it self)

Type 7

Encrypted using Vigenere cipher (very very weak)

Use the following script:

Python3

Perl

Decrypt

Command to encrypt:

Type 8

Encrypted using PBKDF2-SHA-256 with 10 character salt (80 bits).

starting from IOS 15.3(3) - really strong

John the Ripper recognizes this password type as pbkdf2-hmac-sha256. To crack it, we have to again first convert it to the following john friendly format and save it in a file:

Then we can crack it like this using a dictionary, for example:

Type 9

Encrypted using scrypt (very strong) starting from IOS 15.3(3)

Example:

Cracking using john:

Sources

Last updated

Was this helpful?