我们的生活是多么美好呀!!!!
全部博文(225)
分类: 系统运维
2010-05-31 13:40:25
Cisco ASA 防火墙密码恢复
==================
1,密码恢复准备东东
A,PC机
B,ASA配置线
我们需要通过配置线把PC机的COM口与ASA的控制接口相连。
2,密码恢复程序
首先,我们打开PC机的超级终端,然后启动ASA后迅速按ESC或CTRL+BREAK 键进入Rommon状态。
You can press the Esc (Escape) key after "Use BREAK or ESC to interrupt boot" is shown. This will take you into ROMMON mode, as follows:
rommon #0>
然后我们打入命令confreg,进行配置寄存器值的修改,有两种方法,一种是通过输入ConfReg命令一步一步回答菜单如下:
rommon #1> confreg
Current Configuration Register: 0x00000011
Configuration Summary:
boot TFTP image, boot default image from Flash on netboot failure
Do you wish to change this configuration? y/n [n]: y
所有都按照默认回答,在问"disable system configuration?" 的时候,选择y.
这里将0X11启动模式转变到0X41模式.
第二种方法就是直接使用命令ConfReg 0x41修改配置寄存器的值。如下:
rommon #1> confreg 0x41
Update Config Register (0x41) in NVRAM...
修改后,就可以重启
rommon #2> boot
启动成功进入ASA以后,enable密码为空.
ciscoasa> enable
Password:
ciscoasa# copy startup-config running-config
ciscoasa# configure terminal
设置新的密码
ciscoasa(config)# password PIXPa55
ciscoasa(config)# enable password PIXp455
ciscoasa(config)# username BluShin password Goodp455
修改会原来的配置寄存器的值
ciscoasa(config)# config-register 0x11
保存配置文件,切记,否则新密码无效
ciscoasa(config)# copy running-config startup-config
后记
====================
ciscoasa(config)# no service password-recovery
WARNING: Saving "no service password-recovery" in the startup-config will disable password recovery via the PIX Password Lockout Utility. The only means of recovering from lost or forgotten passwords will be for the PIX Password Lockout Utility to erase all file systems including configuration files and images.You should make a backup of your configuration and have a mechanism to restore images from the Monitor Mode command line.
提示两点:
1、恢复的时候会清除所有配置
2、需要保存配置文件,并有一种方式从Monitor Mode command line得到恢复的IMAGES
密码恢复过程:建立物理CONSOLE连接,RELOAD(命令)设备
press the Esc (Escape) key after "Use BREAK or ESC to interrupt boot" is shown
提示:
a new image must be downloaded via ROMMON.
Erase all file systems? y/n [n]: yes
Disk1: is not present.
Enabling password recovery...
rommon #0>
rommon #0> ADDRESS=192.168.10.1
rommon #1> SERVER=192.168.10.250
rommon #3> interface GigabitEthernet0/0
GigabitEthernet0/0
MAC Address: 000f.f775.4b54
rommon #4> file asa702.bin
rommon #5> tftpdnld
tftp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Note
The security appliance downloads the system image file in memory and boots up the device. However, the downloaded system image is not stored in flash.
这里提示只在MEMORY而不保存到FLASH中。
此时可以进入:
ciscoasa> enable
ciscoasa# copy tftp: running-config
Address or name of remote host []? 192.168.10.250
Source filename []? CiscoASA.conf
需要将以前保存的配置文件载入到设备中然后重设密码,并保存即可
这里有两个安全提高:
1、IMEGE保存在TFTP、备份文件也保存在另外的位置
2、擦除了使用的配置文件
注意:如果TFTP不在同一网段,则:
rommon #2> GATEWAY 192.168.10.100
注意:TFTP的参数是需要预先配置好的,为密码恢复做准备,示例如下:是在rommon中完成的
Example 4-49. Setting Up TFTP Parameters
rommon #0> ADDRESS 192.168.10.1
rommon #1> SERVER 192.168.10.250
rommon #2> interface GigabitEthernet0/0
GigabitEthernet0/0
MAC Address: 000f.f775.4b54
rommon #3> file ASA702.bin
rommon #4> set 检查参数
rommon #5> tftpdnld
tftp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!