Cisco ASA 防火墙密码恢复 ================== Cisco ASA的密码恢复过程很像路由器了,也是通过修改配置寄存器的值来实现。就不要密码恢复文件了。 1,密码恢复准备东东 A,PC机 B,cisco Console线 C TFTP软件,直通和交叉线各一根 我们需要通过配置线把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:<cr> 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 后记 ==================== 有时候我们为了加强安全性,打入了no service password-recovery命令。这时候进行密码恢复时,就不能通过修改配置寄存器的值来实现了,而只能删除所有文件来实现,当然删除的文件会包括配置文件和OS文件。 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连接和带外管理接口连接(Management口),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>GATEWAY=192.168.10.250 rommon #4> PORT=Management0/0
MAC Address: 000f.f775.4b54 rommon #5> file asa702.bin rommon #6> tftpdnld tftp [email protected] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 [email protected] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |