DBA做壞事之盜用Oracle使用者身份

來源:互聯網
上載者:User

DBA管理著資料庫所有的資料,但對某些資料的操作,因為審計或其它原因,用管理員身份可能並不方便,但你又不知道方便的那個Oracle使用者的使用者密碼是多少,因為Oracle的使用者密碼是加密了的。那有沒辦法不用知道密碼的情況下,借用下別的Oracle使用者身份來玩玩,弄完了再還回去呢?當然有法子的。 看我來怎麼弄。

例子用8i測的,但11g版本後有個新變化,密碼加密字串放user$了,需要去user$中查出: 

SQL> select * from v$version;
/c clsBANNER
----------------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
PL/SQL Release 8.1.7.0.0 - Production
CORE    8.1.7.0.0      Production
TNS for 32-bit Windows: Version 8.1.7.0.0 - Production
NLSRTL Version 3.4.1.0.0 - Production

SQL> create user test identified by test;

使用者已建立

SQL> SELECT password FROM dba_users WHERE username='TEST';
/c clsPASSWORD
------------------------------
7A0F2B316C212D67

SQL> alter user test identified by newpwd;

使用者已更改。

SQL> SELECT password FROM dba_users WHERE username='TEST';
/c clsPASSWORD
------------------------------
39797952BFEE21C3

SQL> grant connect,resource to test;

授權成功。

上面建了個test使用者,原來的密碼是test,後改成了newpwd. 這裡注意下,密碼test加密後的字串為"7A0F2B316C212D67".

再開另一個會話測試連接:

C:\>sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on 星期四 3月 13 15:37:54 2014

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

SQL> connect test/test@xcldb
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> connect test/newpwd@xcldb
ERROR:
ORA-01045: user TEST lacks CREATE SESSION privilege; logon denied


SQL> connect test/newpwd@xcldb
已串連。
SQL> disconnect;

證明新密碼是生效的。

嘗試把密碼改回為舊的"test",看下面怎麼弄的。

有木有,神奇的密碼字串又回來了。

再測試下:

SQL> disconnect;
從Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production中斷開
SQL> connect test/newpwd@xcldb
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> connect test/test@xcldb
已串連。
SQL>

嗯,又可以用舊的密碼test登入了。

這技巧純玩玩,別亂搞。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.