Monday, May 24, 2010

Decrypting Cisco Device Login Passwords

If your router or switch has been globally configured with the service password-encryption command, the passwords in the configuration will be encrypted for secrecy. In dire cases we would like to retrieve this password and that is when this procedure using the key chain command can be of great help. For this to work you have to be already logged into the device of which you are decrypting the password and you should have the authorization to execute these commands.

Key chains are typically used in EIGRP and RIPv2 routing protocols for authentication. A key chain can have number of keys and each key will have a key string associated with it.

Switch(config)#key chain CRACK
Switch(config-keychain)#do sh run | inc Admin
username Admin privilege 15 password 7 107E290A1600421908
Switch(config-keychain)#key 1
Switch(config-keychain-key)#key-string 7 107E290A1600421908
Switch(config-keychain-key)#exit
Switch#sh key chain CRACK
Key-chain CRACK:
key 1 -- text "P@ssw0rd"
accept lifetime (always valid) - (always valid) [valid now]
send lifetime (always valid) - (always valid) [valid now]

You can also decrypt the enable, line vty and console passwords using this method. However this method cannot be used to decrypt passwords which have been configured using the secret command (e.g: enable secret password or username username secret password ) as they use the more secure MD5 encryption. Considering the Security implication it is adviced to apply the enable secret password command and use TACACS+ or RADIUS for authentication. Using Cisco ACS you can block non-privileged administrators from using key chain command.

Monday, March 1, 2010

Obtaining the pre-shared key used for VPN on an ASA

Usually the pre-shared key for a VPN configuration is encrypted and can be only seen as a * when you do a show run.

tunnel-group USERVPN ipsec-attributes
pre-shared-key *

If you want to see the pre-shared key that has been configured on an ASA, type

more system:running-config

Thursday, August 13, 2009

IOS Upgrade on 3750 Switch Stack

A Switch Stack is a group of individual switches stacked together (connected together using Stack cables) to form a single larger switch. The complication of upgrading the IOS on a 3750 Switch Stack is that the IOS has to be upgraded on all the switches in the stack and the IOS has to be the same on each individual 3750 switch in the stack. Use the show stack or show switch commands to determine the Master switch and how many switches form the stack.

A telnet access to the Stack Switch will give access to only the Master Switch in the Stack, thereafter a normal copy tftp: flash: command will only copy the IOS from the TFTP to the flash on the Master switch but not the other slave switches in the stack. The flash memory on each switch in the stack can be accessed separately, for eg; flash1: is the flash of switch1, flash2: is the flash of switch2.....etc., therefore you can do

SW# copy tftp: flash1:
SW# copy tftp: flash2:
....

to copy the IOS from TFTP to the flash memory in each switch. If you have already a copy of IOS on one flash, you can use copy flash1: flash2: to copy the IOS from one flash to another. Finally to instruct the stacked switch to boot the same IOS from all the individual switches

SW(config)# boot system switch all flash:c3750e-universalk9-mz.122-44.SE2.bin

Saturday, August 8, 2009

Google Eula Launcher Issue

If you have an annoying "Google end user license agreement" window pop-up each time you log into Windows, then keep reading! This usually happens after you install a Google product and instrestingly it wont go even if you uninstall it. It is caused by Google Eula Launcher running at startup of Windows login. To get rid of this, follow these steps:

* Click on Start
* Type regedit inside the Start Search box
* Go to Computer/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/
Currentversion/Run/
* Find the RegKey that has GoogleEULALauncher.exe
* Right click and select Delete
* close regedit and reboot the system, the problem should not appear again.

PS: Before you reboot, delete any GoogleEULALauncher.exe file that might be present on your hard disk aswell.

Friday, August 7, 2009

Checking the DFC Memory on a Catalyst 6500 Line Card

For checking the available memory on a line card, for example a WS-X6704-10GE card inserted in a Catalyst 6500 switch, first you have to attach to the DFC (Distributed Forward Card) on the line card. (Use the show module command to see the sub-modules you have on your 6500 chassis, this will also show the DFC's in each slot)

CoreSW# attach 8

where 8 is the slot number in which the line card is inserted.

CoreSW-DFC8# show version

....
cisco Catalyst 6000 (SB1121) processor with 1048576K bytes of memory
....

show version will show you the memory on the DFC. This command is useful especially when you change the DFC (DFC3A, DFC3B, DFC3BXL....etc.,) on your line card. It is recommended that the memory on the DFC on any line card in the 6500 chassis should match the RP memory in Sup720.

Wednesday, August 5, 2009

Speedy Catalyst Switch IOS Crash Recovery

If your Cisco Catalyst Switch have boot errors, i.e., the switch is continuously booting or if it shows an error while booting and goes to the switch: prompt then its pretty obvious that you have an IOS crash. Catalyst Switches do not go to a rommon mode and hence TFTP upload in rommon is not possible on a switch. Therefore we have to resort to transferring the IOS image from your PC to the Switch through the console cable using Xmodem.

You can avail the Xmodem feature of Windows Hyperterminal. Open your Hyperterminal Application and set the baud rate to 9600 to access the switch console via your COM port. If your switch is already not at the switch: prompt, unplug the cord of the switch and power it back on as you press on the MODE button. Release the MODE button after the STAT LED goes out. Now you will be at the switch: prompt. Since downloading at a baud rate of 9600 is very very slow (can take more than 3 1/2 hours), therefore the best solution is to set the baud rate to 115200.

switch: set BAUD 115200

Now close your Hyperterminal Application and reopen it with a baud rate of 115200 for your COM port. Enter the command flash_init and load_helper. Issue the command to transfer the image at the prompt.

switch: copy xmodem: flash:c3750-ipbasek9-mz.122-50.SE3.bin

From the top of the Hyperterminal window, choose Transfer > Send File and from the Send File pop-up window browse the location of the correct IOS image and from the Protocol drop down list select Xmodem and click Send. Now the IOS image will start downloading to your switch which can take nearly half an hour, which is not that bad. Once the download in complete revert back to the baud rate of 9600.

switch: set BAUD 9600

Close your Hyperterminal Application again and reopen it with a baud rate of 9600. Issue the command to boot the image from flash.

switch: boot flash:c3750-ipbasek9-mz.122-50.SE3.bin

Monday, July 6, 2009

Removing crypto map set security-association lifetime from Cisco ASA

When you create a crypto map in an ASA, you will notice that most versions of IOS will create two addition lines to your crypto map:
crypto map map_name seq_no set security-association lifetime seconds 28800
crypto map map_name seq_no set security-association lifetime kilobytes 4608000

which defines when to discard the current shared key and to use a new shared key. Its either 28800 seconds after the tunnel has been established or after 4MB of data has been transferred through the tunnel.

The problem is that when you try to remove the crypto map from the ASA using no command, these two lines still remain. The method to completely remove an existing crypto map is to use the following command.

ASA(config)# clear configure crypto map map_name seq_no
or if you want to clear a dynamic-map
ASA(config)# clear configure crypto map dynamic_map_name seq_no