今天向同事借了一台Cisco2960交换机做实验,结果连接上发现有密码,于是自己第一时间想到的是自己破解一把,以下是破解过程: 1、通过SecureCRT连接交换机 ,出现连接界面 2、拔掉交换机电源 ,按下交换机前面板上的Mode按钮不要放,与此同时重新插上交换机的电源线,这时交换机左边的sys指示灯会慢慢闪烁,直到sys指示灯不闪烁(常亮状态)松开Mode按钮 3、SecureCRT界面出现一些提示信息,如下图:
通过信息显示系统初始化优先级被打断,下面的命令将初始化Flash文件系统,结束重新加载操作系统
flash_init /--初始化flash文件系统--/ load_helper /--加载帮助文件--/ boot /--启动设备进入正常的模式--/
操作步骤如下图 : Switch:flash_init /--初始化系统--/
Switch:dir flash: /--查看Flash的文件名,确定文件名为config.text--/
Switch:Rename flash:config.text flash:oldconfig.text /--把配置文件重命名--/
Switch:boot /--手动启动交换机--/
配置文件名被改过了,交换机找不到默认的config.text而出现配置对话向导,选择N然后回车后我们就会绕过原来的password
进入系统后恢复配置文件
Switch> Switch>en /--可以进入特权模式--/ Switch#rename flash:oldconfig.text flash:config.text /--恢复交换机配置文件--/ Switch#copy flash:config.text system:running-config /--保存配置到DRAM里--/ Switch# config t /--进入全局配置模式修改密码--/ Switch(config)#enale password cisco
Switch(config)#enale secure openlab
Switch(config)#line console 0
Switch(config-line)#password openlab Switch(config-line)#login Switch(config-line)#loggin synchronous Switch(config-line)#exec-timeout 0
Switch(config-line)#end Switch#copy running-config startup-config
用这个方法修改密码不会把原来的配置文件内容清掉。特别是网络里已经在运行的交换机,这样比较保险点。
|