Cisco PIX 防火墙口令恢复现场秀

Cisco PIX 防火墙口令恢复现场秀
%F%B]2k^!}n0 

 

 

前两天买了台CiscoPIX506E 防火墙,因为没有口令,不能用,PIX防火墙一旦口令丢失,要想获得防火墙的访问权限,需要删除口令再次重新设置。在网站找资料 ,做试验,经一小时后就把口令破解了。方法很简单,相信看完这篇文章后,这些问题对你来说就是小菜一碟了。(呵呵,别卖关子了, 讲吧!)

文章顺序

-Cisco关于这个问题的官方原文IZer's Blog(博客)7P1T$G/PR
-我的原文解释IZer's Blog(博客)3wn+V S ]J
-我的恢复经历IZer's Blog(博客)#d{+v2I8P&ynL3@
-其它两个实例

----------------------------------Begin--------------------- -------------------
Q To|6kf8^u0一、 这是Cisco官方关于这个问题的原文:

CISCO PIX 500 SERIES FIREWALLS  IZer's Blog(博客)9U xP.b:DN
  IZer's Blog(博客)vJ&Nl)`-x$?
Password Recovery and AAA Configuration Recovery Procedure for the PIX
TJxr!a9/ /8C0Document ID: 8529
H-xck&y&n0ContentsIZer's Blog(博客)Cs*B6z0?M
Introduction
[r n"Q4CN Q:D0Before You Begin
N n${4Lt0|f%X*m0     ConventionsIZer's Blog(博客)n$ur9CL(pF
     PrerequisitesIZer's Blog(博客)M!`/l6zkPP C
Step-by-Step ProcedureIZer's Blog(博客):^%_%C/E `.U
     PIX With a Floppy DriveIZer's Blog(博客)*{eRr r/x
     PIX Without a Floppy DriveIZer's Blog(博客)'Vb;Wyv(hD;uC
     Sample OutputIZer's Blog(博客):YMgOj!RmQ eHr
Related Information

IZer's Blog(博客) ?3b%g#z3sY
------------------------------------------------------------ --------------------

IntroductionIZer's Blog(博客)DLf F*I%c#Xdz
This document describes how to recover a PIX password for PIX software releases through 6.3. Note that performing password recovery on the PIX erases only the password, not the configuration. If there are Telnet or console aaa authentication commands in versions 6.2 and greater, the system will also prompt to remove these.

Note: If you have configured AAA on the PIX and the AAA server is down, you can access the PIX by entering the Telnet password initially, and then "pix" as the username and the enable password (enable password password) for the password. If there is no enable password in the PIX configuration, enter "pix" for the username and press ENTER. If the enable and Telnet passwords are set but not known, you will need to continue with the password recovery process.

The PIX Password Lockout Utility is based on the PIX software release you are running.

In addition to the required files listed in the next section, you will need the following items to follow the password recovery procedure:

A PC

A working serial terminal or terminal emulator

Approximately 10 minutes of PIX and network downtime

Before You Begin
&f(]$jiG0Conventions
(R d`-~:R zt0For more information on document conventions, see the Cisco Technical Tips Conventions.

PrerequisitesIZer's Blog(博客)fghH9JM
To use the password recovery procedure, you need the PIX Password Lockout Utility, which includes the following files:

One of the following files, depending on the PIX software version you are running:

np63.bin (6.3 release)

np62.bin (6.2 release)

np61.bin (6.1 release)

np60.bin (6.0 release)

np53.bin (5.3 release)

np52.bin (5.2 release)

np51.bin (5.1 release)

np50.bin (5.0 release)

np44.bin (4.4 release)

nppix.bin (4.3 and earlier releases)

rawrite.exe (needed only for PIX machines with a floppy drive)

TFTP Server Software (needed only for PIX machines without a floppy drive) — TFTP server software is no longer available from Cisco.com, but you can find many TFTP servers by searching for "tftp server" on your favorite Internet search engine. Cisco does not specifically recommend any particular TFTP implementation.

Step-by-Step Procedure
*k'Q WN/jjTs0PIX With a Floppy DriveIZer's Blog(博客)F!v3N7qnjy
To recover your password, follow the steps below:

Execute the rawrite.exe file on your PC and answer the questions on the screen using the correct password recovery file.

Install a serial terminal or a PC with terminal emulation software on the PIX console port.

Verify that you have a connection with the PIX, and that characters are going from the terminal to the PIX, and from the PIX to the terminal.

Note: Because you are locked out, you will see only a password prompt.

Insert the PIX Password Lockout Utility disk into the floppy drive of the PIX.

Push the Reset button on the front of the PIX. The PIX will reboot from the floppy and print the message below:

Erasing Flash Password. Please eject diskette and reboot.IZer's Blog(博客)&v-wo$p{K l
Eject the disk and press the Reset button. You will now be able to log in without a password. When you are prompted for a password, press ENTER.

The default Telnet password after this process is "cisco." There is no default enable password. Go into configuration mode and issue the passwd your_password command to change your Telnet password and the enable password your_enable_password command to create an enable password, and then save your configuration.

PIX Without a Floppy DriveIZer's Blog(博客)m%Gdt0T
To recover your password, follow the steps below:

Note:  Sample output from the password recovery procedure is available below.

Install a serial terminal or a PC with terminal emulation software on the PIX console port.

Verify that you have a connection with the PIX, and that characters are going from the terminal to the PIX, and from the PIX to the terminal.

Note: Because you are locked out, you will see only a password prompt.

Immediately after you power on the PIX Firewall and the startup messages appear, send a BREAK character or press the ESC key. The monitor> prompt is displayed. If needed, type ? (question mark) to list the available commands.

Use the interface command to specify which interface the ping traffic should use. For floppiless PIXes with only two interfaces, the monitor command defaults to the inside interface.

Use the address command to specify the IP address of the PIX Firewall's interface.

Use the server command to specify the IP address of the remote TFTP server containing the PIX password recovery file.

Use the file command to specify the filename of the PIX password recovery file. For example, the 5.1 release uses a file named np51.bin.

If needed, enter the gateway command to specify the IP address of a router gateway through which the server is accessible.

If needed, use the ping command to verify accessibility. If this command fails, fix access to the server before continuing.

Use the tftp command to start the download.

As the password recovery file loads, the following message is displayed:

Do you wish to erase the passwords? [yn] y
P&H }rL*}"qH0Passwords have been erased.
S1g I|{-S_5TI C5Z0Note: If there are Telnet or console aaa authentication commands in version 6.2, the system will also prompt to remove these.

The default Telnet password after this process is "cisco." There is no default enable password. Go into configuration mode and issue the passwd your_password command to change your Telnet password and the enable password your_enable_password command to create an enable password, and then save your configuration.

Sample Output
*mmO5Vg)w2}e0The following example of floppiless PIX password recovery with the TFTP server on the outside interface is taken from a lab environment.

Network Diagram

monitor> interface 0
VlB#e:KF00: i8255X @ PCI(bus:0 dev:13 irq:10)IZer's Blog(博客) [ pnd1`$_ `)Z
1: i8255X @ PCI(bus:0 dev:14 irq:7 )

Using 0: i82559 @ PCI(bus:0 dev:13 irq:10), MAC: 0050.54ff.82b9IZer's Blog(博客)%P0UsK'W8w
monitor> address 10.21.1.99IZer's Blog(博客)P%ZC5o4?B
address 10.21.1.99IZer's Blog(博客)*t9al3V&x8O)|P
monitor> server 172.18.125.3IZer's Blog(博客)hh!a~0j3T
server 172.18.125.3IZer's Blog(博客)H'vP'ELmb JZ
monitor> file np52.bin
?;E1v!PCsW~{{0file np52.bin
)h*r`6wd4C6vP0monitor> gateway 10.21.1.1
)a^Qk p~%X/0O0gateway 10.21.1.1IZer's Blog(博客)8_O/b-w(N
monitor> ping 172.18.125.3
.r+V(w j"O*Pg0Sending 5, 100-byte 0xf8d3 ICMP Echoes to 172.18.125.3, timeout is 4 seconds:
vRp]? lsYVZ*C0!!!!!
iG,j8a*BB0ZSo0Success rate is 100 percent (5/5)
5iXZ.bV[A v~d0monitor> tftp
}pZ6t8s0tftp np52.bin@172.18.125.3 via 10.21.1.1...................................IZer's Blog(博客)g `yC6N
Received 73728 bytes

Cisco Secure PIX Firewall password tool (3.0) #0: Tue Aug 22 23:22:19 PDT 2000
pZb^A3O(|"kZn0Flash=i28F640J5 @ 0x300
&T7tdt%B`0BIOS Flash=AT29C257 @ 0xd8000

Do you wish to erase the passwords? [yn] yIZer's Blog(博客)X[NH+Ug6T y)j
Passwords have been erased.

Rebooting....

************************************************************ ***********

二、我对这篇文章的解释(如有误,请执笔斧正)

介绍
&M,Kx g&I `6Gl+H0   这篇文?饕樯茉赑IX6.3软件版本下怎样恢复PIX口令。这个口令恢复程序只针对PIX的口令恢复,不能删除其配置,但是 它也可以通过提示去除控制台、telnet和AAA认证口令。

注:如果在 PIX上配置有AAA,但是这个AAA服务器“down”掉了,在这种情况下你可以用Telnet的初始密码通过telnet登 录到PIX进行口令恢复。过程如下,用pix作为用户名,再用enable password PASSWORD 恢复enable模式口令。如果在PIX上没有配置enable password,就可以只输pix再回车进入。再者设置了密码,但搞忘了,没有办法,只有按照下面程序的来了。

这个PIX口令恢复实用程序要根据当前运行PIX的软件版本来的选择。IZer's Blog(博客)IeY7|} XGU/H;K
   IZer's Blog(博客)0kN2ZTe
  下面是在后面口令恢复过程中需要具备的一些条件:

   ·一台PCIZer's Blog(博客)q~x N5p CgAj
   ·一个可以通过串口连接到PIX的终端IZer's Blog(博客)'M%a+E:c,A e0tX'L
   ·大约要把网络停个10来分钟

在开始做之前的准备工作

惯例:

上网看Cisco技术文档找相关资料

先决条件:

在恢复过程中,我们要用得下面一些PIX口令恢复实用程序:

·一个根据当前运行的PIX软件版本来确定的np**.bin(用来恢复口令的的主要文件)
KpXt OD0·一个只在有软驱PIX机子用得上的rawrite.exe写二进制文件到软盘的程序IZer's Blog(博客) eX!V:?4? hK
·另外要的是一个在没有软驱的新型PIX机子必备的TFTP服务软件,这个软件到处都可以下载。Cisco没有对这个TFTP服 务软件作特别的要求,一般的就行。
bK0F+l(^N0 
]~WuIe0U0好了,开始按步就班的来吧

首先我们来在一个带有软驱的PIX机子进行口令恢复

第一步,在一台PC机上用rawrite.exe程序,按照屏幕提示把np**.bin文件写到一张可用的软盘上。

第二步,找一条控制台的专用线(rollover线)把PC与PIX连接起来。

第三步,通过 PC超级终端建立与PIX连接,确保串口线没有问题。(由于没有正确的enable口令,我们只能看到密码提示符)   

第四步,把刚才我们用rawrite.exe写好的软盘插入PIX机子软驱。

第五步,接着按一下PIX机子的复位键,PIX这次从软盘引导,并在屏幕上显示下面一些消息:
;T1K-_,A;X2l;m u LA0        Erasing Flash Password. Please eject diskette and reboot.IZer's Blog(博客)/qRo7M:pH&}Z3g
        (口令恢复已经搞定,请把 软盘拿出来再重启机子)

第六步,当拿出软盘,按?仄艏螅颐蔷涂梢圆挥每诹罱隤IX的IOS了。如果出现提示要口令,不管它,直接按回车就对了。

第七步,当前面步骤完成之后,PIX的远程Telnet口令恢复成默认的"cisco",并且进入enable特权模式也不需要密码。要改口令的话,进入 configuration全局模式,用passwd your_password命令改远程telnet口令,用enable password your_enable_password命令建立enable特权模式口令。记着在改或创建完成保存配置,这就大功告成了。

其次我们来在一个没有带有软驱的PIX机子进行口令恢复

按照我们的步骤来,你一定会搞定的。这儿有个例子,你们可以参考:IZer's Blog(博客)B2}7W&Y&QgowB
[url]http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/produc[/url] ts_password_recovery09186a008009478b.shtml#sample

第一步,根前面第二步一样,找一条控制台的专用线(rollover线)把PC与PIX连接起来。

第二步,检查有没有连通,根前面的第三步一样。

第三步,当打开 PIX机子,看见启动消息后,按下BREAK键或ESC键。之后就进入monitor>模式。你可以输入?看当前在这个模 式下可以用哪些命令。

第四步,用interface 命令指定一个准备用的ethernet口(interface 0,0端口与远程TFTP服务器相连)。一般PIX有只两个接口。(建议用交叉线把PC的网卡与PIX的ETHERNET口连接 起来,用PC当TFTP服务器)

第五步,用address命令在PIX的ethernet口指定一个IP地址,不用输入掩码。

第六步,用server命令指定远程可以传np**.bin文件的TFTP服务器的IP地址,也不用输入掩码。

第七步,用file命令指定远程TFTP服务器上np**.bin的文件名。例如IOS版本为5.1的口令恢复文件为np51.bin。

第八步,如果有要通过网关的话,要用gateway命令指定通过的网关路由器的IP地址。

第九步,如果有必要,用ping命令验证PIX与远程TFTP服务器是否连通。如果ping不通的话,检查一下连接正不正确。

第十步,接着输入tftp命令开始从tftp传np**.bin文件到PIX。

第十一步,文件传完之后,就出现下面的询问消息,问删不删除原来的口令。如果有telnet或AAA认证口令的话,这个*作也会把他们原来成缺省或干掉。

第十二步,和上篇的第七步一样,同上,省。

sample output例子。

看不懂跟贴说!~

************************************************************ ***********

三、我的口令恢复经历(PIX506E)

由于PIX506E这个型号是没有软驱的,我采用了第二种方案。//此方案也适用于升级IOS

首要条件:IZer's Blog(博客)$H)mP7YiYZ
1,从网上下载相关PIX ios版本的np**.bin 我的为pix633.bin 自然选用下载np63.bin;IZer's Blog(博客)*c1ba"i1V?
2,在控制台PC安装TFTP服务器程序,把np63.bin放到TFTP服务目录下;   & nbsp;   IZer's Blog(博客)7xR,Of;vL,a
3,用控制台这台PC作为远程TFTP服务器,IP为192.168.1.88,找条交叉线把网卡与PIX的ehernet 0连接起来 ;
om#@7/ S Z"s wv04,准备预设PIX的ehernet 0 IP为192.168.1.1
)U2M mfpDx]P0       

步骤如下:

第一步,找一条控制台的专用线(rollover串口线)把PC与PIX连接起来。

第二步,用一条交叉线把控制台网卡与PIX的ehernet 0连接起来。

第三步,通过串口建立超级终端,开机检查是否能接入PIX。没问题,但是由于没有原来的口令,进不去特权模式。

第四步,在能够通过 console口连通的情况下,重新启动PIX,在出现启动消息后,根据屏幕提示在9秒内按键盘BREAK或ESC键进入mon itor模式。

第五步,在monitor>输入interface 0进入接口模式。

第六步,add 192.168.1.1 指定PIX端口的IP地址。

第七步,server 192.168.1.88 指定我的TFTP服务器的IP地址。

第八步,file np63.bin 指定预传送的口令恢复文件名(不知道就到TFTP目录下看一下)。

第九步,ping 192.168.1.88 测试到TFTP的三层连通性。不通的话,就得仔细检查一下网卡与PIX的连接了。

第十步,tftp 回车,开始传送文件。传送完成后,提示是否要删除口令,输入y,确认删除,系统删除口令成功后,会自动重启,enable口令默 认为空了。

第十步,照样提示输入口令,不管它,回车,OK!~~大功告成!~~

第十一步,如果要改密码的话,按照上面说的用相关命令改就OK了。

************************************************************ ***********

四、其它两个实例

PIX防火墙口令恢复 --带软驱

PIX防火墙一旦口令丢失,要想获得防火墙的访问权限,需要删除口令再次重新设置。
C ]G/k6y.?*pi&?0目前PIX防火墙分为带软驱的(例如PIX520)和不带软驱的(例如PIX525)两种。这两种防火墙口令恢复的方法不太一样 ,尤其对于带软驱的,可以使用一种比较简单的方式完成,下面具体介绍带软驱的防火墙口令恢复办法。 IZer's Blog(博客)WW5]Ug#O
前提条件: IZer's Blog(博客))`#P3U'K6x;L,bq"^
格式化好的软盘一张(Windows下格式化) IZer's Blog(博客)!Ft$C/h!f
删除口令的bin文件一个(要求下载与防火墙软件版本一致的文件),下载链接为:
g nD)t _ pop0[url]http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/produc[/url] ts_password_recovery09186a008009478b.shtml
0D /0{F3F(xr-CB[q0解压软件一个:rawrite.exe文件,可以从与bin文件相同的链接下载
vn)rhP0恢复步骤:
WR%CBdh j X0将下载的bin文件和rawrite.exe文件放在同一个目录下,如:C:/pix IZer's Blog(博客) c_^no{
将软盘放入软驱(注意使用后,软盘格式Windows将无法识别,需要彻底格式化才可使用)
5{6Ff8`-m,blOe$L,h0运行rawrite.exe,按提示输入bin文件名,软驱盘符,等待程序制作口令恢复盘 IZer's Blog(博客)8}#zJu9}&w;DI~+Z
制作完毕后,将软盘放入PIX的软驱中,按Reset按钮,系统自动重启,会从软驱启动,并提示是否要删除口令,输入y,确认删 除,系统删除口令成功后,会自动重启,取出软盘,系统启动后登录口令为cisco,enable口令默认为空 IZer's Blog(博客)7l'}8@(a)Hy9c!__
如果系统显示booting floppy,但是没有任何提示就又从flash引导系统了,可能是由于PIX内的软驱线没有连接,有人为了确保口令安全而将软 驱的线从机箱中拆除掉,通过观察启动时软驱灯是否亮就可以判断

*********************************************IZer's Blog(博客).n$g(k,Ll
PIX防火墙口令恢复 --不带软驱

主旨是要覆盖原bin文件
J4E6?3TMb:M0进入monitor状态, IZer's Blog(博客)iqT9Mm1U@5w
monitor> interface 0 IZer's Blog(博客)Mp(T&pM8Qr
0: i8255X @ PCI(bus:0 dev:13 irq:10) 1: i8255X @ PCI(bus:0 dev:14 irq:7 ) Using 0: i82559 @ PCI(bus:0 dev:13 irq:10), MAC: 0050.54ff.82b9 IZer's Blog(博客)vv gt+~f&Z
设置本端口地址 monitor>
4R;e CeQ^.K6X GA5Y0address 10.21.1.99
4e(we n ^3T2A1^/_Z4G)|i0设置服务器地址 monitor> IZer's Blog(博客)'F1E/ky)JIT+G
server 172.18.125.3 IZer's Blog(博客)ouM"h&@d
获取文件 monitor> file np52.bin
c9G-q4A"/fZ K"M0设置网关 monitor> gateway 10.21.1.1 IZer's Blog(博客)-d8/*/&X8N9_J)F$dmm(F
monitor> ping 172.18.125.3 Sending 5, 100-byte 0xf8d3 ICMP Echoes to 172.18.125.3, timeout is 4 seconds: !!!!! Success rate is 100 percent (5/5)
nZv|G`0执行下载传输命令monitor> tftp IZer's Blog(博客)(Wz`gW Z R7ly
tftp np52.bin@172.18.125.3 via 10.21.1.1............................

............................................................ ........

................................................. Received 73728 bytes Cisco Secure PIX Firewall password tool (3.0) 0: Tue Aug 22 23:22:19 PDT 2000 Flash=i28F640J5 @ 0x300 BIOS Flash=AT29C257 @ 0xd8000 Do you wish to erase the passwords? [yn] y Passwords have been erased. Rebooting.... 28.

-----------------------------End---------------------------- ----------- 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值