2012年2月4日土曜日

Ciscoでパスワード復旧

■手順概要
・ROMモードで起動してコンフィグレーションレジスタを変更
・startup-configを使わずrunning-configだけで起動
・そのまま特権モードに入りstartup-configをrunning-configにコピーし設定を反映
・特権モードのパスワードを変更
・コンフィグレーションレジスタを元の0x2102に戻す
・シャットダウンされているインターフェースを起動
・現在のrunning-configをstartup-configに保存


■電源投入

System Bootstrap, Version 12.3(8r)YH13, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2008 by cisco Systems, Inc.
C1800 platform with 262144 Kbytes of main memory with parity disabled

Readonly ROMMON initialized
program load complete, entry point: 0x80012000, size: 0xc0c0

Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0xc0c0

Initializing ATA monitor library.......

■TeratermでAlt+Bでブレイクし、ROMモニターモードに移行

monitor: command "boot" aborted due to user interrupt
rommon 1 > confreg 0x2142

You must reset or power cycle for new config to take effect
rommon 2 > reset

■以後、startup-configを無視して起動するためパスワードなしで特権モードになれる


System Bootstrap, Version 12.3(8r)YH13, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2008 by cisco Systems, Inc.
C1800 platform with 262144 Kbytes of main memory with parity disabled

Readonly ROMMON initialized
program load complete, entry point: 0x80012000, size: 0xc0c0

Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0xc0c0

Initializing ATA monitor library.......

program load complete, entry point: 0x80012000, size: 0x1c198b8
Self decompressing the image : ############################################################################################################################################################################################################################################################################### [OK]

              Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706



Cisco IOS Software, C181X Software (C181X-ADVIPSERVICESK9-M), Version 15.1(4)M1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Tue 14-Jun-11 16:40 by prod_rel_team


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Installed image archive
Cisco 1812-J (MPC8500) processor (revision 0x400) with 236544K/25600K bytes of memory.
Processor board ID FHK131222FY, with hardware revision 0000

10 FastEthernet interfaces
1 ISDN Basic Rate interface
1 Virtual Private Network (VPN) Module
62720K bytes of ATA CompactFlash (Read/Write)


         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]: no
■セットアップモードで「no」を選択


Press RET down
*Feb  4 11:08:16.339: USB init complete.
*Feb  4 11:08:16.339: %LINK-3-UPDOWN: Interface FastEthernet0, changed state to down
*Feb  4 11:08:16.339: %LINK-3-UPDOWN: Interface FastEthernet1, changed state to down
*Feb  4 11:08:17.683: %SYS-6-STARTUP_CONFIG_IGNORED: System startup configuration is ignored based on the configuration register setting.
*Feb  4 11:08:54.639: %LINK-5-CHANGED: Interface BRI0, changed state to administratively down
*Feb  4 11:08:57.063: %LINK-5-CHANGED: Interface FastEthernet0, changed state to administratively down
*Feb  4 11:08:57.063: %LINK-5-CHANGED: Interface FastEthernet1, changed state to administratively down
*Feb  4 11:08:57.063: %LINK-3-UPDOWN: Interface FastEthernet2, changed state to up
*Feb  4 11:08:57.063: %LINK-3-UPDOWN: Interface FastEthernet3, changed state to up
*Feb  4 11:08:57.063: %LINK-3-UPDOWN: Interface FastEthernet4, changed state to up
*Feb  4 11:08:57.063: %LINK-3-UPDOWN: Interface FastEthernet5, changed state to up
*Feb  4 11:08:57.063: %LINK-3-UPDOWN: Interface FastEthernet6, changed state to up
*Feb  4 11:08:57.067: %LINK-3-UPDOWN: Interface FastEthernet7, changed state to up
*Feb  4 11:08:57.067: %LINK-3-UPDOWN: Interface FastEthernet8, changed state to up
*Feb  4 11:08:57.067: %LINK-3-UPDOWN: Interface FastEthernet9, changed state to up
*Feb  4 11:08:57.067: %SYS-5-RESTART: System restarted --
Cisco IOS Software, C181X Software (C181X-ADVIPSERVICESK9-M), Version 15.1(4)M1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Tue 14-Jun-11 16:40 by prod_rel_team
*Feb  4 11:08:57.067: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold start
*Feb  4 11:08:57.095: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Feb  4 11:08:57.095: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF
*Feb  4 11:08:58.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2, changed state to down
*Feb  4 11:08:58.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3, changed state to down
*Feb  4 11:08:58.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet4, changed state to down
*Feb  4 11:08:58.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5, changed state to down
*Feb  4 11:08:58.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet6, changed state to down
*Feb  4 11:08:58.067: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet7, changed state to down
*Feb  4 11:08:58.067: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet8, changed state to down
*Feb  4 11:08:58.067: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet9, changed state to down
Router>enable
Router#copy start run
■最初に保存しているstartup-configをrunning-configにコピーして設定を復元する
Destination filename [running-config]?

*Feb  4 11:10:40.555: %LINK-3-UPDOWN: Interface Virtual-Access1, changed state to up
*Feb  4 11:10:40.559: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access1, changed state to up
*Feb  4 11:10:41.339: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up
2123 bytes copied in 8.504 secs (250 bytes/sec)

1812j#config t
Enter configuration commands, one per line.  End with CNTL/Z.
1812j(config)#enable secret [新しいパスワード]
1812j(config)#config-register 0x2102
■コンフィグレーションレジスタを初期値にもどす
これをしないと次回起動時もstartup-configが無視される
1812j(config)#interface f0
1812j(config-if)#no shutdown
1812j(config-if)#
*Feb  4 11:12:32.591: %LINK-3-UPDOWN: Interface FastEthernet0, changed state to down
1812j(config)#end
*Feb  4 11:13:08.779: %SYS-5-CONFIG_I: Configured from console by cons
1812j#copy run start
■新しいパスワードになったrunning-configをstartup-configに保存
Destination filename [startup-config]?
Building configuration...
[OK]
1812j#

0 件のコメント:

コメントを投稿