Yaping's Weblog

September 2, 2008

Change Password with BBED

Filed under: Oracle — Yaping @ 2:33 am
Tags: ,

Firstly, we prepare one user & password we want to logon, assuming we use system/system to logon database.

Then we obtain this password hash value, it can be gotten from test environment.

@>alter user system identified by system;
User altered.

@>select USERNAME,PASSWORD from dba_users where USERNAME=’SYSTEM’;
USERNAME                       PASSWORD
—————————— ——————————
SYSTEM                         970BAA5B81930A40

Or obtain this value by oracle hash create tools.

Then we need get the actual password hash value and the table’s location in data file.

@>select USERNAME,PASSWORD from dba_users where USERNAME=’SYSTEM’;
USERNAME                       PASSWORD
—————————— ——————————
SYSTEM                         292EB6812EBA50C2

@>select CLUSTER_NAME from dba_tables where TABLE_NAME=’USER$’;
CLUSTER_NAME
——————————
C_USER#

@>select EXTENT_ID,FILE_ID,BLOCK_ID,BLOCKS from dba_extents where SEGMENT_NAME=’C_USER#’;
 EXTENT_ID    FILE_ID   BLOCK_ID     BLOCKS
———- ———- ———- ———-
         0          1         89          8

Next, we use bbed to modify data file directly.

BBED> set dba 1,90
        DBA             0×0040005a (4194394 1,90)
BBED> find /c 292EB6812EBA50C2 top
 File: /u03/oradata/9204/chen/system01.dbf (1)
 Block: 90               Offsets: 5895 to 6406           Dba:0×0040005a
————————————————————————
 32393245 42363831 32454241 35304332 018002c1 0307786b 0a0b0c06 3507786b
 0c17022f 1cffff01 80ff02c1 02ffff01 80018009 5359535f 47524f55 506c0011
 1113474c 4f42414c 5f41515f 55534552 5f524f4c 45018006 474c4f42 414c0180
 01800778 6b0a0b0c 0d18ffff ff0180ff 02c102ff ff018001 80164445 4641554c
 545f434f 4e53554d 45525f47 524f5550 ac000101 00010000 40005a00 12004000
 5a001202 c1136c00 11100c41 515f5553 45525f52 4f4c4501 80ff0180 01800778
 6b0a0b0c 0d18ffff ff0180ff 02c102ff ff018001 80164445 4641554c 545f434f
 4e53554d 45525f47 524f5550 ac000101 00010000 40005a00 11004000 5a001102
 c1126c00 110f1541 515f4144 4d494e49 53545241 544f525f 524f4c45 0180ff01
 80018007 786b0a0b 0c0d17ff ffff0180 ff02c102 ffff0180 01801644 45464155
 4c545f43 4f4e5355 4d45525f 47524f55 50ac0001 01000100 0040005a 00100040
 005a0010 02c1116c 00110e16 4c4f4753 54444259 5f41444d 494e4953 54524154
 4f520180 ff018001 8007786b 0a0b0c0c 3bffffff 0180ff02 c102ffff 01800180
 16444546 41554c54 5f434f4e 53554d45 525f4752 4f5550ac 00010100 01000040
 005a000f 0040005a 000f02c1 106c0011 0d184741 54484552 5f535953 54454d5f
 53544154 49535449 43530180 ff018001 8007786b 0a0b0c0c 3bffffff 0180ff02
 <32 bytes per line>

BBED>
BBED> dump /v dba 1,90 offset 5895 count 32
 File: /u03/oradata/9204/chen/system01.dbf (1)
 Block: 90      Offsets: 5895 to 5926  Dba:0×0040005a
——————————————————-
 32393245 42363831 32454241 35304332 l 292EB6812EBA50C2
 018002c1 0307786b 0a0b0c06 3507786b l …á..xk….5.xk
 <16 bytes per line>

BBED> modify /c 970BAA5B81930A40 dba 1,90 offset 5895
BBED-00215: editing not allowed in BROWSE mode

BBED> set mode edit
        MODE            Edit
BBED> modify /c 970BAA5B81930A40 dba 1,90 offset 5895
 File: /u03/oradata/9204/chen/system01.dbf (1)
 Block: 90               Offsets: 5895 to 5926           Dba:0×0040005a
————————————————————————
 39373042 41413542 38313933 30413430 018002c1 0307786b 0a0b0c06 3507786c
 <32 bytes per line>

BBED> dump /v dba 1,90 offset 5895 count 32
 File: /u03/oradata/9204/chen/system01.dbf (1)
 Block: 90      Offsets: 5895 to 5926  Dba:0×0040005a
——————————————————-
 39373042 41413542 38313933 30413430 l 970BAA5B81930A40
 018002c1 0307786b 0a0b0c06 3507786c l …á..xk….5.xl
 <16 bytes per line>

BBED> sum dba 1,90 apply
Check value for File 1, Block 90:
current = 0xc51f, required = 0xc51f
BBED> exit

[oracle@chen data]$ sql
SQL*Plus: Release 9.2.0.4.0 – Production on Thu Jan 10 06:39:56 2008
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
@>conn system/system
Connected.

Advertisements

1 Comment »

  1. You might check this one:

    http://oraclue.wordpress.com/2008/09/18/using-bbed-to-fix-sys-password/

    Comment by Miladin — September 18, 2008 @ 11:34 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: