| 热门文章 |
 |
|
| 编辑推荐 |
 |
|
|
|
|
|
作者:佚名
来源:不详 点击: 更新:2006-12-20
|
|
protocol 或 Named Pipes协议来为你的SQL Server提供服务的话,你就 需要要使用标准模式。标准模式运行在任何一种SQL Server支持的协议上。使用标准模式的 SQL Server 不必考虑太多的网络因素,如域,Windows NT 帐号等等。
假如你的应用程序是IIS,那么标准模式是一个最好的选择。这是因为标准模式不管你配置里 使用的是那种协议。
值得注意的是,从7.0开始,不再单独提供这样的验证模式。要使用这种模式就只能选择下面 介绍的混合模式。
l 仅Windows 使用仅Windows的验证模式,, SQL Server 使用Windows NT 的身份验证去验证一个用户的身 份。 这种方式,用户不需要提供User ID和密码就可以访问数据库,这是因为SQL Server使 用了Windows NT的验证来代替自标准模式的验证方法。
仅Windows的模式工作在Named Pipes 或Multi-Protocol 协议上的信任连接。信任的连接可 以是来自Windows NT, Windows 95, 或 Windows for Workgroups 工作站, 和运行在DOS的M icrosoft LAN Manager或 Microsoft Windows 客户。
SQL Server 应用程序会从l仅Windows 模式中得到很多好处。例如,域范围的帐号,加密的 密码,密码同步,登录审核和简单的用户管理。
注意:假如你的应用程序是IIS,我想你是不会使用此验证模式的。
l 混合模式(SQL Server 和 Windows) 这种模式允许用户使用两种模式中的任意一种方式去验证自己的身份。
2、 选择合适的网络协议 为了要使用SQL Server's 的仅Windows 模式,你必须使用Named Pipes 或Multi-Protocol( Named Pipes)协议
l TCP/IP Sockets TCP/IP Sockets 是一种无身份验证的协议。意思就是连接是没有实时验证过的。只在开始建 立连接时做身份的验证。另外在SQL Server 中定义/设置每个用户的访问权限,TCP/IP Soc kets比Named Pipes 需要更多的管理。
如果你不需要SQL Server的仅Windows模式, TCP/IP Sockets 是一个好的选择。
l Named Pipes Named Pipes 是一种可***的协议。每当用户使用Named Pipes访问SQL Server ,这个连接都 会被确认身份。这也是为什么它在SQL Server 默认安装里被安装的重要原因。另外一个重要 的原因是Named Pipes的连接速度最快。
l Multi-Protocol Multi-Protocol一个重要的好处是它有加密的功能。
3、 以普通NT帐号启动服务 建议使用“Enterprise Manager”修改。 1. 帐号需要以下权限: 2. 替换进程级记号; 3. 添加配额; 4. 以操作系统方式操作; 5. 以服务登录; 6. 读写以下注册表; HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer. 或:HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server.
HKEY_LOCAL_MACHINE\System\CurrentControlset\Services\MSSQLServer. 或(只用于SQL 2000): HKEY_LOCAL_MACHINE\System\CurrentControlset\Services\MSSQL$Instancename.
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Perflib 7. 读取、更改SQL Server 目录 ; SQL 2000 \Program Files\Microsoft SQL Server\Mssql SQL 7.0 MSSQL7. 8. 读取、更改 .mdf, .ndf, 和.ldf 数据文件;
4、 设置审核级别 a) Failure b) Success c) ALL
5、 删除master..xp_cmdshell 存储过程 a) 删除存储过程 ============================ use master go execute sp_dropextendedproc 'xp_cmdshell' go
b) 添加存储过程 ============================
use master go execute sp_addextendedproc 'xp_cmdshell' ,'xpsql70.dll' go
c) 查找存储过程对应的Dll文件 ============================ select o.name,c.text from dbo.syscomments c, dbo.sysobjects o where c.id = o.id and o.name = 'xp_cmdshell'
d) 查找Dll文件对应的存储过程 ============================ select o.name,c.text from dbo.syscomments c, dbo.sysobjects o where c.id = o.id and c.text = 'xplog70.dll'
6、 删除OLE automation存储过程(会导致管理器一些功能不能使用) l Sp_OACreate l Sp_OADestroy l Sp_OAGetErrorInfo l Sp_OAGetProperty l Sp_OAMethod l Sp_OASetProperty l Sp_OAStop
7、 删除访问注册表的存储过程 l Xp_regaddmultistring l Xp_regdeletekey l Xp_regdeletevalue l Xp_regenumvalues l Xp_regread l Xp_regremovemultistring l Xp_regwrite
如:读取注册表SAM数据: xp_regread 'HKEY_LOCAL_MACHINE', 'SECURITY\SAM\Domains\Account', 'F'
8、 删除其他有威胁的存储过程 sp_sdidebugxp_availablemediaxp_deletemailxp_dirtreexp_dropwebtaskxp_dsninfoxp_en umdsnxp_enumerrorlogsxp_enumgroupsxp_enumqueuedtasksxp_eventlogxp_findnextmsgxp_ fixeddrivesxp_getfiledetailsxp_getnetnamexp_grantloginxp_logeventxp_loginconfigx p_logininfoxp_makewebtaskxp_msver xp_perfend xp_perfmonitorxp_perfsamplexp_perfs tartxp_readerrorlogxp_readmailxp_revokeloginxp_runwebtaskxp_schedulersignalxp_se ndmailxp_servicecontrolxp_snmp_getstatexp_snmp_raisetrapxp_sprintfxp_sqlinventor yxp_sqlregisterxp_sqltracexp_sscanfxp_startmailxp_stopmailxp_subdirsxp_unc_to_dr ive
附录一:服务/应用对应端口
服务名/应用 UDP TCP Browsing datagram responses of NetBIOS over TCP/IP 138 Browsing requests of NetBIOS over TCP/IP 137 Client/Server Communication 135 Common Internet File System (CIFS) 445 139, 445 Content Replication Service 560 Cybercash Administration 8001 Cybercash Coin Gateway 8002 Cybercash Credit Gateway 8000 DCOM (SCM uses udp/tcp to dynamically assign ports for DCOM) 135 135 DHCP client 67 DHCP server 68 DHCP Manager 135 DNS Administration 139 DNS client to server lookup (varies) 53 53 Exchange Server 5.0 Client Server Communication 135 Exchange Administrator 135 IMAP 143 IMAP (SSL) 993 LDAP 389 LDAP (SSL) 636 MTA - X.400 over TCP/IP 102 POP3 110 POP3 (SSL) 995 RPC 135 SMTP 25 NNTP 119 NNTP (SSL) 563 File shares name lookup 137 File shares session 139 FTP 21 FTP-data 20 HTTP 80 HTTP-Secure Sockets Layer (SSL) 443 Internet Information Services (IIS) 80 IMAP 143 IMAP (SSL) 993 IKE (For more information, see Table C.4) 500 IPSec Authentication Header (AH) (For more information, see Table C.4) IPSec Encapsulation Security Payload (ESP) (For more information, see Table C.4)
IRC 531 ISPMOD (SBS 2nd tier DNS registration wizard) 1234 Kerberos de-multiplexer 2053 Kerberos klogin 543 Kerberos kpasswd (v5) 464 464 Kerberos krb5 88 88 Kerberos kshell 544 L2TP 1701 LDAP 389 LDAP (SSL) 636 Login Sequence 137, 138 139 Macintosh, File Services (AFP/IP) 548 Membership DPA 568 Membership MSN 569 Microsoft Chat client to server 6667 Microsoft Chat server to server 6665 Microsoft Message Queue Server 1801 1801 Microsoft Message Queue Server 3527 135, 2101 Microsoft Message Queue Server 2103, 2105 MTA - X.400 over TCP/IP 102 NetBT datagrams 138 NetBT name lookups 137 NetBT service sessions 139 NetLogon 138 NetMeeting Audio Call Control 1731 NetMeeting H.323 call setup 1720 NetMeeting H.323 streaming RTP over UDP Dynamic NetMeeting Internet Locator Server ILS 389 NetMeeting RTP audio stream Dynamic NetMeeting T.120 1503 NetMeeting User Location Service 522 NetMeeting user location service ULS 522 Network Load Balancing 2504 NNTP 119 NNTP (SSL) 563 Outlook (see for ports) Pass Through Verification 137, 138 139 POP3 110 POP3 (SSL) 995 PPTP control 1723 PPTP data (see Table C.4) Printer sharing name lookup 137 Printer sharing session 139 Radius accounting (Routing and Remote Access) 1646 or 1813 Radius authentication (Routing and Remote Access) 1645 or 1812 Remote Install TFTP 69 RPC client fixed port session queries 1500 RPC client using a fixed port session replication 2500 RPC session ports Dynamic RPC user manager, service manager, port mapper 135 SCM used by DCOM 135 135 SMTP 25 SNMP 161 SNMP Trap 162 SQL Named Pipes encryption over other protocols name lookup 137 SQL RPC encryption over other protocols name lookup 137 SQL session 139 SQL session 1433 SQL session 1024 - 5000 SQL session mapper 135 SQL TCP client name lookup 53 53 Telnet 23 Terminal Server 3389 UNIX Printing 515 WINS Manager 135 WINS NetBios over TCP/IP name service 137 WINS Proxy 137 WINS Registration 137 WINS Replication 42 X400 102
附录二:检查Microsoft SQL版本脚本程序 SET NOCOUNT ON SELECT CONVERT(CHAR(25),@@SERVERNAME) AS 'SQL SERVER', SUBSTRING(@@VERSION,23,4) AS 'PRODUCT VERSION', SUBSTRING(@@VERSION,35,3) AS 'BUILD NUMBER', CASE SUBSTRING(@@VERSION,35, 3) -- 6.5 WHEN '121' THEN 'NO SP' WHEN '124' THEN 'SP1' WHEN '139' THEN 'SP2' WHEN '151' THEN 'SP3' WHEN '201' THEN 'NO SP' WHEN '213' THEN 'SP1' WHEN '240' THEN 'SP2' WHEN '252' THEN 'SP3 ** BAD **' WHEN '258' THEN 'SP3' WHEN '259' THEN 'SP3 + SBS' WHEN '281' THEN 'SP4' WHEN '297' THEN 'SP4 + SBS' WHEN '339' THEN 'SP4 + Y2K' WHEN '415' THEN 'SP5 ** BAD **' WHEN '416' THEN 'SP5a' -- 7.0 WHEN '198' THEN 'Beta 1' WHEN '517' THEN 'Beta 3' WHEN '583' THEN 'RC1' WHEN '623' THEN 'NO SP' WHEN '689' THEN 'SP1 Beta' WHEN '699' THEN 'SP1' WHEN '835' THEN 'SP2 Beta' WHEN '842' THEN 'SP2' WHEN '961' THEN 'SP3' -- 2000 WHEN '194' THEN 'NO SP' ELSE 'Unknown - may be a Hot-Fix version or script out of date' END AS 'SERVICE PACK' set nocount off
附录三:SYN攻击
xxx.xx.xxx.xxx机器上用netstat –n –p tcp命令查看,可以发现很多SYN_RECEIVED连接。 而且都是发生在80端口上,而且无法正常访问80端口上的服务。其他的网络连接、服务都是 正常的。正常情况下不应该出现大量SYN_RECEIVED状态的TCP连接。例外这些连接的来源地址 都是有一定的规律。根据经验可以确定是有恶意者对xxx.xx.xxx.xxx进行D.o.S(Denial of Service)攻击。
执行netstat命令结果如下:
Active Connections
Proto Local Address Foreign Address State TCP 127.0.0.1:1025 127.0.0.1:1033 ESTABLISHED TCP 127.0.0.1:1033 127.0.0.1:1025 ESTABLISHED TCP xxx.xx.xxx.xxx:80 1.129.155.213:56048 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 8.71.96.232:18544 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 17.95.29.168:33072 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 33.212.238.226:29024 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 33.250.131.21:46336 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 41.254.157.63:26688 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 44.6.143.72:14352 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 44.233.0.83:2368 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 46.172.194.36:60560 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 52.141.107.180:34048 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 58.92.189.37:59680 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 147.24.54.140:42160 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 150.41.8.196:50864 SYN_RECEIVED ........................ ........................ TCP xxx.xx.xxx.xxx:80 157.176.98.17:49712 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 165.217.228.103:18416 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 171.191.13.61:64656 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 174.45.224.245:30896 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 181.118.121.182:23984 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 191.3.0.46:2864 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 196.235.126.62:57024 SYN_RECEIVED TCP xxx.xx.xxx.xxx:80 208.104.144.7:50912 SYN_RECEIVED
上一页 [1] [2] [3] 下一页
|
|
|