環(huán)境:Windows 2008 R2 + Oracle 10.2.0.3
應(yīng)用最新bundle patch后,掃描依然報(bào)出漏洞 Oracle Database Server 'TNS Listener'遠(yuǎn)程數(shù)據(jù)投毒漏洞(CVE-2012-1675)
•1.確定解決方案
•2.應(yīng)用解決方案
•3.驗(yàn)證修補(bǔ)情況
•4.Reference
1.確定解決方案
安全廠家給出的解決辦法:
鏈接:http://www.oracle.com/technetwork/topics/security/alert-cve-2012-1675-1608180.html
根據(jù)此鏈接得到解決方法:
Solution
Recommendations for protecting against this vulnerability can be found at:
My Oracle Support Note 1340831.1 for Oracle Database deployments that use Oracle Real Application Clusters (RAC).
My Oracle Support Note 1453883.1 for Oracle Database deployments that do not use RAC.
目前這里環(huán)境不是RAC,參考文檔1453883.1:
Using Class of Secure Transport (COST) to Restrict Instance Registration (文檔 ID 1453883.1)
找到兩種解決方案:
SOLUTION
There are two methods that can be used to protect the listener using COST "SECURE_REGISTER_listener_name =" in stand alone database installations.
1) Restricting registration to the TCP protocol (Requires the fix for BUG:12880299)
- or -
2) Restricting registration to the IPC protocol (The patch for BUG:12880299 is NOT required for the IPC method)
Either method accomplishes the same goal but it is your choice which type to implement subject to the restriction* noted below. Both methods will be discussed.
•The second method (using IPC) cannot be used if the database is a member of an Oracle Data Guard broker configuration.
我這里選擇第一種解決方案:
1) Restricting registration to the TCP protocol (Requires the fix for BUG:12880299)。
2.應(yīng)用解決方案
2.1 確定現(xiàn)狀
監(jiān)聽(tīng)配置文件:listener.ora
存放路徑:cd %ORACLE_HOME%/network/admin
內(nèi)容(保證安全,所有IP相關(guān)信息已二次處理):
# listener.ora Network Configuration File: E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.138)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ANY")
)
(SID_DESC =
(GLOBAL = orcl)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(SID_NAME = orcl)
)
)
ADR_BASE_LISTENER = E:\oracle
數(shù)據(jù)庫(kù)監(jiān)聽(tīng)信息,原始都是空值:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ---------------------------
local_listener string
SQL> show parameter remote_listener;
NAME TYPE VALUE
------------------------------------ ----------- ---------------------------
remote_listener string
SQL>
2.2 嘗試應(yīng)用解決方案
2.2.1 停止監(jiān)聽(tīng)
lsnrctl stop listener
2.2.2 修改監(jiān)聽(tīng)配置文件
Add the COST TCP protocol restriction "SECURE_REGISTER_[listener_name] = (TCP)" to the listener.ora.
Match the COST parameter variable listener_name with the name of the listener you are using in the listener.ora, e.g., If your listener name is "LISTENER_PROD" then use SECURE_REGISTER_LISTENER_PROD = (TCP)
實(shí)際修改過(guò)程:
切換到監(jiān)聽(tīng)配置文件所在路徑:
cd %ORACLE_HOME%/network/admin
直接修改listener.ora文件,在文件的末尾添加一行:
SECURE_REGISTER_LISTENER = (TCP)
2.2.3 啟動(dòng)監(jiān)聽(tīng)
啟動(dòng)監(jiān)聽(tīng):
立即注冊(cè)動(dòng)態(tài)監(jiān)聽(tīng):
SQL> alter system register;
2.2.4 設(shè)置local_listener
alter system set local_listener='(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.138)(PORT = 1521)))' scope = both;
show parameter local_listener
2.2.5 查看監(jiān)聽(tīng)服務(wù)信息
lsnrctl services listener
E:\oracle\product\10.2.0\db_1\network\ADMIN>lsnrctl services listener
LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 21-9月 -2016 10:2
2:02
Copyright (c) 1991, 2006, Oracle. All rights reserved.
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
服務(wù)摘要..
服務(wù) "PLSExtProc" 包含 1 個(gè)例程。
例程 "PLSExtProc", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已被拒絕:0
LOCAL SERVER
服務(wù) "orcl" 包含 1 個(gè)例程。
例程 "orcl", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:3 已被拒絕:0
LOCAL SERVER
命令執(zhí)行成功
3.驗(yàn)證修補(bǔ)情況
3.1 注釋COST規(guī)則驗(yàn)證監(jiān)聽(tīng)情況
3.1.1 注釋掉listener.ora文件的COST規(guī)則并重啟監(jiān)聽(tīng)
Comment the COST rule in listener.ora and restart the listener.
直接修改listener.ora文件,在之前添加的一行前面加上"#"注釋此行。
#SECURE_REGISTER_LISTENER = (TCP)
重啟監(jiān)聽(tīng):
lsnrctl stop listener
lsnrctl start listener
3.1.2 設(shè)置remote_listener后查看監(jiān)聽(tīng)服務(wù)信息
設(shè)置remote_listener:
SQL> alter system set remote_listener='(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.138)(PORT = 1521))' scope=memory;
SQL> show parameter remote_listener
快速動(dòng)態(tài)監(jiān)聽(tīng)注冊(cè):
SQL> alter system register;
查看監(jiān)聽(tīng)服務(wù)信息,發(fā)現(xiàn)有“REMOTE SERVER”字樣,說(shuō)明此時(shí)漏洞存在:
E:\oracle\product\10.2.0\db_1\network\ADMIN>lsnrctl services listener
LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 21-9月 -2016 10:4
4:18
Copyright (c) 1991, 2006, Oracle. All rights reserved.
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
服務(wù)摘要..
服務(wù) "PLSExtProc" 包含 1 個(gè)例程。
例程 "PLSExtProc", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已被拒絕:0
LOCAL SERVER
服務(wù) "orcl" 包含 2 個(gè)例程。
例程 "orcl", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已被拒絕:0
LOCAL SERVER
例程 "orcl", 狀態(tài) READY, 包含此服務(wù)的 2 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已拒絕:0 狀態(tài):ready
LOCAL SERVER
"DEDICATED" 已建立:0 已拒絕:0 狀態(tài):ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
服務(wù) "orclXDB" 包含 1 個(gè)例程。
例程 "orcl", 狀態(tài) READY, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"D000" 已建立:0 已被拒絕:0 當(dāng)前: 0 最大: 1002 狀態(tài): ready
DISPATCHER machine: INSPUR-IRMS-138, pid: 6728>
(ADDRESS=(PROTOCOL=tcp)(HOST=INSPUR-IRMS-138)(PORT=52676))
服務(wù) "orcl_XPT" 包含 1 個(gè)例程。
例程 "orcl", 狀態(tài) READY, 包含此服務(wù)的 2 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已拒絕:0 狀態(tài):ready
LOCAL SERVER
"DEDICATED" 已建立:0 已拒絕:0 狀態(tài):ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
命令執(zhí)行成功
3.2 取消注釋COST規(guī)則驗(yàn)證監(jiān)聽(tīng)情況
3.2.1 取消注釋COST規(guī)則重啟監(jiān)聽(tīng)并快速注冊(cè),驗(yàn)證監(jiān)聽(tīng)服務(wù)信息
去掉監(jiān)聽(tīng)文件末尾行前的“#”號(hào):
SECURE_REGISTER_LISTENER = (TCP)
重啟監(jiān)聽(tīng):
lsnrctl stop listener
lsnrctl start listener
快速注冊(cè)動(dòng)態(tài)監(jiān)聽(tīng):
SQL> alter system register;
驗(yàn)證監(jiān)聽(tīng)服務(wù)信息,按官檔描述,正常應(yīng)該沒(méi)有“REMOTE SERVER”字樣:
E:\oracle\product\10.2.0\db_1\network\ADMIN>lsnrctl services listener
LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 21-9月 -2016 11:0
0:23
Copyright (c) 1991, 2006, Oracle. All rights reserved.
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
服務(wù)摘要..
服務(wù) "PLSExtProc" 包含 1 個(gè)例程。
例程 "PLSExtProc", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已被拒絕:0
LOCAL SERVER
服務(wù) "orcl" 包含 2 個(gè)例程。
例程 "orcl", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:1 已被拒絕:0
LOCAL SERVER
例程 "orcl", 狀態(tài) READY, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已拒絕:0 狀態(tài):blocked
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
服務(wù) "orclXDB" 包含 1 個(gè)例程。
例程 "orcl", 狀態(tài) READY, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"D000" 已建立:0 已被拒絕:0 當(dāng)前: 0 最大: 1002 狀態(tài): ready
DISPATCHER machine: INSPUR-IRMS-138, pid: 6728>
(ADDRESS=(PROTOCOL=tcp)(HOST=INSPUR-IRMS-138)(PORT=52676))
服務(wù) "orcl_XPT" 包含 1 個(gè)例程。
例程 "orcl", 狀態(tài) READY, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已拒絕:0 狀態(tài):blocked
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
命令執(zhí)行成功
實(shí)際發(fā)現(xiàn)有“REMOTE SERVER”字樣,但是對(duì)應(yīng)的監(jiān)聽(tīng)都是blocked.
3.2.2 查看監(jiān)聽(tīng)日志
cd %ORACLE_HOME%/network/log
listener.log日志文件已經(jīng)有TNS-01194信息,跟官檔一致:
21-9月 -2016 11:00:23 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=services)(ARGUMENTS=64)(SERVICE=listener)(VERSION=169870080)) * services * 0
21-9月 -2016 11:00:54 * service_register_NSGR * 1194
TNS-01194: 監(jiān)聽(tīng)程序命令未到達(dá)安全傳輸
21-9月 -2016 11:01:54 * service_register_NSGR * 1194
TNS-01194: 監(jiān)聽(tīng)程序命令未到達(dá)安全傳輸
21-9月 -2016 11:02:54 * service_register_NSGR * 1194
TNS-01194: 監(jiān)聽(tīng)程序命令未到達(dá)安全傳輸
3.2.3 還原remote_listener設(shè)置
測(cè)試完成,還原remote_listener設(shè)置
alter system set remote_listener='' scope=memory;
SQL> alter system set remote_listener='' scope=memory;
3.2.4 查看監(jiān)聽(tīng)服務(wù)信息
E:\oracle\product\10.2.0\db_1\network\ADMIN>lsnrctl services listener
LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 21-9月 -2016 11:2
2:17
Copyright (c) 1991, 2006, Oracle. All rights reserved.
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
服務(wù)摘要..
服務(wù) "PLSExtProc" 包含 1 個(gè)例程。
例程 "PLSExtProc", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:0 已被拒絕:0
LOCAL SERVER
服務(wù) "orcl" 包含 1 個(gè)例程。
例程 "orcl", 狀態(tài) UNKNOWN, 包含此服務(wù)的 1 個(gè)處理程序...
處理程序:
"DEDICATED" 已建立:1 已被拒絕:0
LOCAL SERVER
命令執(zhí)行成功
4.Reference
•Using Class of Secure Transport (COST) to Restrict Instance Registration (文檔 ID 1453883.1)
您可能感興趣的文章:- oracle數(shù)據(jù)庫(kù)tns配置方法詳解
- oracle遠(yuǎn)程連接服務(wù)器出現(xiàn) ORA-12170 TNS:連接超時(shí) 解決辦法
- 連接Oracle數(shù)據(jù)庫(kù)時(shí)報(bào)ORA-12541:TNS:無(wú)監(jiān)聽(tīng)程序的圖文解決教程
- Oracle數(shù)據(jù)庫(kù)TNS常見(jiàn)錯(cuò)誤的解決方法匯總
- OracleOraDb10g_home1TNSListener服務(wù)無(wú)法啟動(dòng)怎么解決
- Oracle導(dǎo)dmp出現(xiàn)文件ORA-12154: TNS: 無(wú)法解析指定的連接標(biāo)識(shí)符問(wèn)題的解決方案
- Linux中Oracle啟動(dòng)偵聽(tīng)報(bào)錯(cuò)TNS:permission denied的解決方法
- Oracle dbca時(shí)報(bào):ORA-12547: TNS:lost contact錯(cuò)誤的解決