Oracle监听口令及监听器安全详解
数据库  /  管理员 发布于 6年前   174
很多Oracle用户都知道,Oracle的监听器一直存在着一个安全隐患,假如对此不设置安全措施,那么能够访问的用户就可以远程关闭监听器。
相关示例如下:
D:>lsnrctl stop eygleLSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 28-11月-2007 10:02:40Copyright (c) 1991, 2006, Oracle. All rights reserved.正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.11)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=eygle)))
命令执行成功
大家可以发现,此时缺省的监听器的日志还无法记录操作地址:
No longer listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.33.11)(PORT=1521)))28-NOV-2007 09:59:20 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=stop)(ARGUMENTS=64)(SERVICE=eygle)(VERSION=169870080)) * stop * 0
有鉴于此,为了更好的保证监听器的安全,大家最好为监听设置密码:
[oracle@jumper log]$ lsnrctlLSNRCTL for Linux: Version 9.2.0.4.0 - Production on 28-NOV-2007 10:18:17Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.Welcome to LSNRCTL, type "help" for information.LSNRCTL> set current_listener listenerCurrent Listener is listenerLSNRCTL> change_passwordOld password:New password:Reenter new password:Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.11)(PORT=1521)))Password changed for listenerThe command completed successfullyLSNRCTL> set passwordPassword:The command completed successfullyLSNRCTL> save_configConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.11)(PORT=1521)))Saved LISTENER configuration parameters.Listener Parameter File /opt/oracle/product/9.2.0/network/admin/listener.oraOld Parameter File /opt/oracle/product/9.2.0/network/admin/listener.bakThe command completed successfully
在我们设置密码后,远程操作将会因缺失密码而出现失败:
D:>lsnrctl stop eygleLSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 28-11月-2007 10:22:57Copyright (c) 1991, 2006, Oracle. All rights reserved.正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.11)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=eygle)))
TNS-01169: 监听程序尚未识别口令
注意:此时在服务器端或客户端,都需要我们通过密码来起停监听器:
LSNRCTL> set passwordPassword:The command completed successfullyLSNRCTL> stopConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.11)(PORT=1521)))The command completed successfullyLSNRCTL> startStarting /opt/oracle/product/9.2.0/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 9.2.0.4.0 - ProductionSystem parameter file is /opt/oracle/product/9.2.0/network/admin/listener.oraLog messages written to /opt/oracle/product/9.2.0/network/log/listener.logTrace information written to /opt/oracle/product/9.2.0/network/trace/listener.trcListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.33.11)(PORT=1521)))Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.11)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 9.2.0.4.0 - ProductionStart Date 28-NOV-2007 10:22:23Uptime 0 days 0 hr. 0 min. 0 secTrace Level supportSecurity ONSNMP OFFListener Parameter File /opt/oracle/product/9.2.0/network/admin/listener.oraListener Log File /opt/oracle/product/9.2.0/network/log/listener.logListener Trace File /opt/oracle/product/9.2.0/network/trace/listener.trcListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.33.11)(PORT=1521)))Services Summary...Service "eygle" has 1 instance(s).Instance "eygle", status UNKNOWN, has 1 handler(s) for this service...Service "julia" has 1 instance(s).Instance "eygle", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully
另外,ADMIN_RESTRICTIONS参数也是一个重要的安全选项,大家可以在 listener.ora 文件中设置 ADMIN_RESTRICTIONS_ 为 ON,此后所有在运行时对监听器的修改都将会被阻止,所有对监听器的修改都必须通过手工修改listener.ora文件才能顺利完成。
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号