Tuesday, October 23, 2012

cisco IOS: how to compute flash filename md5 hash

One of the on going task that a network engineer will do, is to upgrade your ioscodeset on a cisco router. So if you have a file in flash or bootflash , how do you know it's valid?

Will one,  you would compute the file hash and compare it to the mfg'er link for the image. So how do yo compute the md5 hash?


Will on most linux/unix systems we used md5 or md5sum utilities, but on a cisco ios router we have the option to use the verify command, the proper syntax is the "verify filelocation:filename"

e.g  ( 3825 router )

cisco3825#verify flash:c3825-adventerprisek9-mz.151-4.M4.bin
Verifying file integrity of flash:c3825-adventerprisek9-mz.151-4.M4.bin...................................................................................................

...............................................................................................................................
...............................................................................................................................
...............................................................................................................................
...............................................................................................................................
........................................................................
( output trunacated )

................................................................................................Done!
Embedded Hash   MD5 : E2AB2AAA34FC8F5379C90FF30F7A0E5D
Computed Hash   MD5 : E2AB2AAA34FC8F5379C90FF30F7A0E5D
CCO Hash        MD5 : 7C1DA229831461F90F020C8F15562A71

Embedded hash verification successful.
cisco3825#


After completion the above hash can be compared to a known secured source.

On a unix system we can get the same output by execution of md5 "filename"

e.g
 Ken-Felixs-MacBook:~ kenfelix1$ md5  c3825-adventerprisek9-mz.151-4.M4.bin
MD5 (c3825-adventerprisek9-mz.151-4.M4.bin) = 7c1da229831461f90f020c8f15562a71


I hope you find this useful.


Ken Felix

Your freelance Security and Network Engineer
Kfelix " @ "  hyperfeed.com

No comments:

Post a Comment