<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>一个程序猿 &#187; 康盛</title>
	<atom:link href="http://www.sunboyu.cn/tag/%e5%ba%b7%e7%9b%9b/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sunboyu.cn</link>
	<description>时光不会倒流,脚步总要前进</description>
	<lastBuildDate>Tue, 27 Jul 2010 06:24:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>康盛，这么做是不是有点过火了-2</title>
		<link>http://www.sunboyu.cn/2009/12/24/discuz-hole-2.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/24/discuz-hole-2.shtml#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:15:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[原创技术]]></category>
		<category><![CDATA[manyou]]></category>
		<category><![CDATA[ucenter]]></category>
		<category><![CDATA[uchome]]></category>
		<category><![CDATA[康盛]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1113</guid>
		<description><![CDATA[自打上篇文章 康盛，这么做是不是有点过火了发表后，引起很多朋友讨论。有些朋友从技术上抨击了这种做法，有些朋友从商业上去理解这种做法。当然，我们是搞技术的，单纯从程序安全和数据安全上来分析一下。
老样子，后台有个get提交：
http://u.discuz.net/customer/update.php?get=a%3A16%3A%7Bs%3A7%3A%22sitekey%22%3Bs%3A16%3A%22f270e28a8b0Qv1Y8%22%3Bs%3A7%3A%22version%22%3Bs%3A3%3A%222.0%22%3Bs%3A7%3A%22release%22%3Bs%3A8%3A%2220090825%22%3Bs%3A3%3A%22php%22%3Bs%3A5%3A%225.2.6%22%3Bs%3A5%3A%22mysql%22%3Bs%3A6%3A%225.0.22%22%3Bs%3A6%3A%22dbsize%22%3Bi%3A1298163%3Bs%3A7%3A%22charset%22%3Bs%3A5%3A%22utf-8%22%3Bs%3A8%3A%22sitename%22%3Bs%3A12%3A%22%E6%88%91%E7%9A%84%E7%A9%BA%E9%97%B4%22%3Bs%3A7%3A%22feednum%22%3Bs%3A2%3A%2210%22%3Bs%3A7%3A%22blognum%22%3Bs%3A1%3A%220%22%3Bs%3A8%3A%22albumnum%22%3Bs%3A1%3A%220%22%3Bs%3A9%3A%22threadnum%22%3Bs%3A1%3A%220%22%3Bs%3A8%3A%22sharenum%22%3Bs%3A1%3A%220%22%3Bs%3A10%3A%22commentnum%22%3Bs%3A1%3A%220%22%3Bs%3A8%3A%22myappnum%22%3Bs%3A1%3A%224%22%3Bs%3A8%3A%22spacenum%22%3Bs%3A1%3A%223%22%3B%7D&#038;h=aa380aa3
urldecode并且反序列化，得出这么一堆东西
Array
(
&#160;&#160; &#160;[sitekey] =&#62; f270e28a8b0Qv1Y8
&#160;&#160; &#160;[version] =&#62; 2.0
&#160;&#160; &#160;[release] =&#62; 20090825
&#160;&#160; &#160;[php] =&#62; 5.2.6
&#160;&#160; &#160;[mysql] =&#62; 5.0.22
&#160;&#160; &#160;[dbsize] =&#62; 1298163
&#160;&#160; &#160;[charset] =&#62; utf-8
&#160;&#160; &#160;[sitename] =&#62; 我的空间
&#160;&#160; &#160;[feednum] =&#62; 10
&#160;&#160; &#160;[blognum] =&#62; 0
&#160;&#160; &#160;[albumnum] =&#62; 0
&#160;&#160; &#160;[threadnum] =&#62; 0
&#160;&#160; &#160;[sharenum] =&#62; 0
&#160;&#160; &#160;[commentnum] =&#62; 0
&#160;&#160; &#160;[myappnum] =&#62; 4
&#160;&#160; &#160;[spacenum] =&#62; 3
)
sitekey是什么？通过阅读代码，sitekey是pre_config表里一个字段，跟以下代码配合工作
$hash = $_SCONFIG['my_siteid'].'&#124;'.$_SGLOBAL['supe_uid'].'&#124;'.$appid.'&#124;'.$current_url.'&#124;'.$extra.'&#124;'.$timestamp.'&#124;'.$_SCONFIG['my_sitekey'];
它跟manyou服务器配合，才有权从你的服务器上拉取你数据库中的某些信息。
其他字段，我们看字面意思基本也能知道是干啥用的。
继续运行程序，我们看当一个用户第一次安装应用的时候做了什么。
这个信息要从服务器上截取，我是根据nginx日志和程序中截取反馈信息获得的。
服务器日志：
124.238.249.171 - - [24/Dec/2009:20:02:40 [...]]]></description>
			<content:encoded><![CDATA[<p>自打上篇文章 <a href="http://www.sunboyu.cn/2009/12/10/discuz-hole.shtml">康盛，这么做是不是有点过火了</a>发表后，引起很多朋友讨论。有些朋友从技术上抨击了这种做法，有些朋友从商业上去理解这种做法。当然，我们是搞技术的，单纯从程序安全和数据安全上来分析一下。</p>
<p>老样子，后台有个get提交：<br />
http://u.discuz.net/customer/update.php?get=a%3A16%3A%7Bs%3A7%3A%22sitekey%22%3Bs%3A16%3A%22f270e28a8b0Qv1Y8%22%3Bs%3A7%3A%22version%22%3Bs%3A3%3A%222.0%22%3Bs%3A7%3A%22release%22%3Bs%3A8%3A%2220090825%22%3Bs%3A3%3A%22php%22%3Bs%3A5%3A%225.2.6%22%3Bs%3A5%3A%22mysql%22%3Bs%3A6%3A%225.0.22%22%3Bs%3A6%3A%22dbsize%22%3Bi%3A1298163%3Bs%3A7%3A%22charset%22%3Bs%3A5%3A%22utf-8%22%3Bs%3A8%3A%22sitename%22%3Bs%3A12%3A%22%E6%88%91%E7%9A%84%E7%A9%BA%E9%97%B4%22%3Bs%3A7%3A%22feednum%22%3Bs%3A2%3A%2210%22%3Bs%3A7%3A%22blognum%22%3Bs%3A1%3A%220%22%3Bs%3A8%3A%22albumnum%22%3Bs%3A1%3A%220%22%3Bs%3A9%3A%22threadnum%22%3Bs%3A1%3A%220%22%3Bs%3A8%3A%22sharenum%22%3Bs%3A1%3A%220%22%3Bs%3A10%3A%22commentnum%22%3Bs%3A1%3A%220%22%3Bs%3A8%3A%22myappnum%22%3Bs%3A1%3A%224%22%3Bs%3A8%3A%22spacenum%22%3Bs%3A1%3A%223%22%3B%7D&#038;h=aa380aa3</p>
<p>urldecode并且反序列化，得出这么一堆东西</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">Array</li>
<li>(</li>
<li>&nbsp;&nbsp; &nbsp;[sitekey] =&gt; f270e28a8b0Qv1Y8</li>
<li>&nbsp;&nbsp; &nbsp;[version] =&gt; 2.0</li>
<li>&nbsp;&nbsp; &nbsp;[release] =&gt; 20090825</li>
<li>&nbsp;&nbsp; &nbsp;[php] =&gt; 5.2.6</li>
<li>&nbsp;&nbsp; &nbsp;[mysql] =&gt; 5.0.22</li>
<li>&nbsp;&nbsp; &nbsp;[dbsize] =&gt; 1298163</li>
<li>&nbsp;&nbsp; &nbsp;[charset] =&gt; utf-8</li>
<li>&nbsp;&nbsp; &nbsp;[sitename] =&gt; 我的空间</li>
<li>&nbsp;&nbsp; &nbsp;[feednum] =&gt; 10</li>
<li>&nbsp;&nbsp; &nbsp;[blognum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp;[albumnum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp;[threadnum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp;[sharenum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp;[commentnum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp;[myappnum] =&gt; 4</li>
<li>&nbsp;&nbsp; &nbsp;[spacenum] =&gt; 3</li>
<li>)</li></ol></div>
<p>sitekey是什么？通过阅读代码，sitekey是pre_config表里一个字段，跟以下代码配合工作</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">$hash = $_SCONFIG['my_siteid'].'|'.$_SGLOBAL['supe_uid'].'|'.$appid.'|'.$current_url.'|'.$extra.'|'.$timestamp.'|'.$_SCONFIG['my_sitekey'];</li></ol></div>
<p>它跟manyou服务器配合，才有权从你的服务器上拉取你数据库中的某些信息。</p>
<p>其他字段，我们看字面意思基本也能知道是干啥用的。</p>
<p>继续运行程序，我们看当一个用户第一次安装应用的时候做了什么。</p>
<p>这个信息要从服务器上截取，我是根据nginx日志和程序中截取反馈信息获得的。</p>
<p>服务器日志：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">124.238.249.171 - - [24/Dec/2009:20:02:40 +0800] &quot;POST /uhome/api/my.php HTTP/1.0&quot; 200 192 &quot;-&quot; &quot;myop/1.0&quot; &quot;-&quot;</li></ol></div>
<p>manyou服务器发来post请求。post信息不会在日志里，底下是我抓取来的信息：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">[post] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[module] =&gt; Users</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[method] =&gt; getInfo</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[sign] =&gt; 271ce9942c94fc4f4d39445e133105bc</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[params] =&gt; a:1:{s:4:\&quot;uIds\&quot;;a:1:{i:0;s:1:\&quot;3\&quot;;}}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li></ol></div>
<p>做过sns网站应用开发的应该很容易看懂底大概是什么意思。<br />
看看我们的程序给manyou平台返回了什么信息：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">[result] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[0] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[uId] =&gt; 3</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[handle] =&gt; sunboyu1</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[action] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[realName] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[realNameChecked] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[gender] =&gt; unknown</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[email] =&gt; dfafdasf@123.fdsafds</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[qq] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[msn] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthday] =&gt; 0000-00-00</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[bloodType] =&gt; unknown</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[relationshipStatus] =&gt; unknown</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthProvince] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthCity] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[resideProvince] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[resideCity] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[viewNum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[friendNum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[myStatus] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[lastActivity] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[created] =&gt; 1261655045</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[credit] =&gt; 25</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[isUploadAvatar] =&gt;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[adminLevel] =&gt; none</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[homepagePrivacy] =&gt; public</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[profilePrivacyList] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[friendListPrivacy] =&gt; public</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[mode] =&gt;</li></ol></div>
<p>有了这些数据，我又注册了一个号码，把资料填全，看看是不是都被抓走：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">[result] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[totalNum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[friends] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[me] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[uId] =&gt; 4</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[handle] =&gt; sunboyu2</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[action] =&gt; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[realName] =&gt; 一个程序猿</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[realNameChecked] =&gt; 1</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[gender] =&gt; male</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[email] =&gt; 1231231@fdsfdsa.com</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[qq] =&gt; 176300676</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[msn] =&gt; sunboyu@gmail.com</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthday] =&gt; 2004-02-01</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[bloodType] =&gt; B</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[relationshipStatus] =&gt; single</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthProvince] =&gt; 北京</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthCity] =&gt; 东城</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[resideProvince] =&gt; 黑龙江</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[resideCity] =&gt; 佳木斯</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[viewNum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[friendNum] =&gt; 0</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[myStatus] =&gt; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[lastActivity] =&gt; 1261657227</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[created] =&gt; 1261657100</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[credit] =&gt; 40</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[isUploadAvatar] =&gt; 1</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[adminLevel] =&gt; none</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[homepagePrivacy] =&gt; friends</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[profilePrivacyList] =&gt; Array</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[relationshipStatus] =&gt; friends</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthday] =&gt; friends</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[bloodType] =&gt; me</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[birthPlace] =&gt; public</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[residePlace] =&gt; public</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[qq] =&gt; me</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[mobile] =&gt; public</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[msn] =&gt; public</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[friendListPrivacy] =&gt; me</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[mode] =&gt; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;)</li></ol></div>
<p>差不多基本资料都过去了。</p>
<p>这样，可以看出，康盛的服务器不断得在抓取用户的信息。这个事情是不是过火，从商业的角度，是应该很过火的。他把用户产品内的账号信息等关键东西都抓走，这些信息到他们手里，难免会交易给竞争对手。<br />
但是，从技术上讲，康盛的manyou服务器还有个缓存的功能。如果拉取用户信息这个请求都放在网站的服务器上，我相信大多数虚拟主机的用户会不堪重负，而康盛其实为这些负载买单了。买单的结果，就是你得把用户的信息提供给康盛。就这么简单。</p>
<p>从程序安全上讲，你的数据库信息，尤其用户信息，在你的网站和manyou之间共享，而康盛没有拉走用户或者管理员资料，也没有发现其他信息的提取，所以，两者之间是安全的。第三方网站是无法获得这些资料的。</p>
<p>但从商业安全上讲，康盛的服务器是否可信？康盛是否会拿这些信息作一些站长不希望做的事情？这个只能由官方来解释了。</p>
<p>睡一觉，研究其他产品去。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/24/discuz-hole-2.shtml/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>康盛，这么做是不是有点过火了</title>
		<link>http://www.sunboyu.cn/2009/12/10/discuz-hole.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/10/discuz-hole.shtml#comments</comments>
		<pubDate>Wed, 09 Dec 2009 17:02:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[纯属蛋疼]]></category>
		<category><![CDATA[discuz]]></category>
		<category><![CDATA[后门]]></category>
		<category><![CDATA[康盛]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1074</guid>
		<description><![CDATA[使用开源产品，的确能加快我们的产品实现进度，我们也感谢那些提供免费开源产品的人。当然，我个人也喜欢开源技术。
但如果开源的产品中给你下个后门，抓取你的数据，你还能高兴么？
现在分析 discuz 7.0 的几段代码：
if($adminid == 1 &#38;&#38; $action == 'home') {
	echo '&#60;sc '.'ript language=&#34;Jav'.'aScript&#34; src=&#34;ht'.'tp:/'.'/cus'.'tome'.'r.disc'.'uz.n'.'et/n'.'ews'.'.p'.'hp?'.bbsinformation().'&#34;&#62;';
	//echo '&#60;/sc&#62;&#60;sc '.'ript language=&#34;Jav'.'aScript&#34; src=&#34;http://localhost/com/n'.'ews'.'.p'.'hp?'.bbsinformation().'&#34;&#62;';
}
&#60;/sc&#62;
恩，看见了没，我告诉大家一个写木马常用的方式 eval ,比如asp中查找木马，通常查找fso等关键字，木马一般都给他写成 eval(&#8217;f'+&#8217;s&#8217;,'o&#8217;)，写php的应该很熟悉这个函数了。这段代码当然不是木马，咱看看他具体做了什么：
function bbsinformation() {
&#160;
	global $db, $timestamp, $tablepre, $charset, $bbname, $_SERVER, $siteuniqueid, $save_mastermobile, $msn;
	$update = array('uniqueid' =&#62; $siteuniqueid, 'version' =&#62; DISCUZ_VERSION, 'release' =&#62; DISCUZ_RELEASE, 'php' =&#62; PHP_VERSION, 'mysql' =&#62; $db-&#62;version(), 'charset' =&#62; $charset, 'bbname' =&#62; $bbname, [...]]]></description>
			<content:encoded><![CDATA[<p>使用开源产品，的确能加快我们的产品实现进度，我们也感谢那些提供免费开源产品的人。当然，我个人也喜欢开源技术。</p>
<p>但如果开源的产品中给你下个后门，抓取你的数据，你还能高兴么？</p>
<p>现在分析 discuz 7.0 的几段代码：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">if($adminid == 1 &amp;&amp; $action == 'home') {</li>
<li>	echo '&lt;sc '.'ript language=&quot;Jav'.'aScript&quot; src=&quot;ht'.'tp:/'.'/cus'.'tome'.'r.disc'.'uz.n'.'et/n'.'ews'.'.p'.'hp?'.bbsinformation().'&quot;&gt;';</li>
<li>	//echo '&lt;/sc&gt;&lt;sc '.'ript language=&quot;Jav'.'aScript&quot; src=&quot;http://localhost/com/n'.'ews'.'.p'.'hp?'.bbsinformation().'&quot;&gt;';</li>
<li>}</li>
<li>&lt;/sc&gt;</li></ol></div>
<p>恩，看见了没，我告诉大家一个写木马常用的方式 eval ,比如asp中查找木马，通常查找fso等关键字，木马一般都给他写成 eval(&#8217;f'+&#8217;s&#8217;,'o&#8217;)，写php的应该很熟悉这个函数了。这段代码当然不是木马，咱看看他具体做了什么：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">function bbsinformation() {</li>
<li>&nbsp;</li>
<li>	global $db, $timestamp, $tablepre, $charset, $bbname, $_SERVER, $siteuniqueid, $save_mastermobile, $msn;</li>
<li>	$update = array('uniqueid' =&gt; $siteuniqueid, 'version' =&gt; DISCUZ_VERSION, 'release' =&gt; DISCUZ_RELEASE, 'php' =&gt; PHP_VERSION, 'mysql' =&gt; $db-&gt;version(), 'charset' =&gt; $charset, 'bbname' =&gt; $bbname, 'mastermobile' =&gt; $save_mastermobile);</li>
<li>&nbsp;</li>
<li>	$updatetime = @filemtime(DISCUZ_ROOT.'./forumdata/updatetime.lock');</li>
<li>	if(empty($updatetime) || ($timestamp - $updatetime &gt; 3600 * 4)) {</li>
<li>		@touch(DISCUZ_ROOT.'./forumdata/updatetime.lock');</li>
<li>		$update['members'] = $db-&gt;result_first(&quot;SELECT COUNT(*) FROM {$tablepre}members&quot;);</li>
<li>		$update['threads'] = $db-&gt;result_first(&quot;SELECT COUNT(*) FROM {$tablepre}threads&quot;);</li>
<li>		$update['posts'] = $db-&gt;result_first(&quot;SELECT COUNT(*) FROM {$tablepre}posts&quot;);</li>
<li>		$query = $db-&gt;query(&quot;SELECT special, count(*) AS spcount FROM {$tablepre}threads GROUP BY special&quot;);</li>
<li>		while($thread = $db-&gt;fetch_array($query)) {</li>
<li>			$thread['special'] = intval($thread['special']);</li>
<li>			$update['spt_'.$thread['special']] = $thread['spcount'];</li>
<li>		}</li>
<li>		if($msn['on'] &amp;&amp; $msn['domain']) {</li>
<li>			$update['msn_domain'] = $msn['domain'];</li>
<li>		}</li>
<li>	}</li>
<li>&nbsp;</li>
<li>	$data = '';</li>
<li>	foreach($update as $key =&gt; $value) {</li>
<li>		$data .= $key.'='.rawurlencode($value).'&amp;';</li>
<li>	}</li>
<li>	return 'update='.rawurlencode(base64_encode($data)).'&amp;md5hash='.substr(md5($_SERVER['HTTP_USER_AGENT'].implode('', $update).$timestamp), 8, 8).'&amp;timestamp='.$timestamp;</li>
<li>}</li></ol></div>
<p>看见了吧，看他提交的几个关键字段：$update['members'],$update['threads'],$update['posts'],$thread['special'],$update['spt_'.$thread['special']],$update['msn_domain'],这些字段提交过去，也许对我们系统安全并无影响，可看看6.0版本的论坛还提交了什么：</p>
<p>uniqueid=**&#038;version=6.0.0&#038;release=20081117&#038;php=5.2.6&#038;mysql=5.0.22&#038;charset=utf-8&#038;bbname=**&#038;mastermobile=****&#038;members=4965&#038;threads=883&#038;posts=25921&#038;spt_0=879&#038;spt_1=4&#038;</p>
<p>mastermobile 看见这个字段你会汗不？</p>
<p>康盛应该为此行为买单不？不会 。</p>
<p>看下边：</p>
<blockquote><p>
III 有限担保和免责声明<br />
    1. 本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。<br />
    2. 用户出于自愿而使用本软件，您必须了解使用本软件的风险，在尚未购买产品技术服务之前，我们不承诺提供任何形式的技术支持、使用担保，也不承担任何因使用本软件而产生问题的相关责任。<br />
    3. 康盛创想(北京)科技有限公司不对使用本软件构建的论坛中的文章或信息承担责任。
</p></blockquote>
<p>您必须了解使用本软件的风险&#8211;用户了解信息泄露的风险么？<br />
康盛创想(北京)科技有限公司不对使用本软件构建的论坛中的文章或信息承担责任。其实，我也不愿意承担。</p>
<p>本文纯属月经文，如有难受，过几天自然恢复。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/10/discuz-hole.shtml/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>脱裤子放屁典范程序</title>
		<link>http://www.sunboyu.cn/2009/06/05/%e8%84%b1%e8%a3%a4%e5%ad%90%e6%94%be%e5%b1%81%e5%85%b8%e8%8c%83%e7%a8%8b%e5%ba%8f.shtml</link>
		<comments>http://www.sunboyu.cn/2009/06/05/%e8%84%b1%e8%a3%a4%e5%ad%90%e6%94%be%e5%b1%81%e5%85%b8%e8%8c%83%e7%a8%8b%e5%ba%8f.shtml#comments</comments>
		<pubDate>Fri, 05 Jun 2009 02:25:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[代码冗余]]></category>
		<category><![CDATA[康盛]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=766</guid>
		<description><![CDATA[最近搞一个单点登录的东东，研究了下康盛的ucenterhome产品，在研究cookie的时候发现这么一段处理程序：
$prelength = strlen($_SC['cookiepre']);
foreach($_COOKIE as $key =&#62; $val) {
	if(substr($key, 0, $prelength) == $_SC['cookiepre']) {
		$_SCOOKIE[(substr($key, $prelength))] = empty($magic_quote) ? saddslashes($val) : $val;
	}
}
其目的是把合法的cookie拿出来防到一个全局变量里去用。
cookie本身就是一个挺好的全局变量，而康盛又把这个变量拿出来去用，为什么？
或者，为了方便管理变量，但判断函数判断自定义全局变量跟判断cookie全局变量成本相同；
或者，为了让开发者必须彻底明白业务逻辑才能修改，提高竞争对手抄袭门槛或者提高二次开发门槛而给项目部带来更高的收入？
这样的代码里边很多，也许只有他们自己才能了解最终目的。
]]></description>
			<content:encoded><![CDATA[<p>最近搞一个单点登录的东东，研究了下康盛的ucenterhome产品，在研究cookie的时候发现这么一段处理程序：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">$prelength = strlen($_SC['cookiepre']);</li>
<li>foreach($_COOKIE as $key =&gt; $val) {</li>
<li>	if(substr($key, 0, $prelength) == $_SC['cookiepre']) {</li>
<li>		$_SCOOKIE[(substr($key, $prelength))] = empty($magic_quote) ? saddslashes($val) : $val;</li>
<li>	}</li>
<li>}</li></ol></div>
<p>其目的是把合法的cookie拿出来防到一个全局变量里去用。</p>
<p>cookie本身就是一个挺好的全局变量，而康盛又把这个变量拿出来去用，为什么？</p>
<p>或者，为了方便管理变量，但判断函数判断自定义全局变量跟判断cookie全局变量成本相同；</p>
<p>或者，为了让开发者必须彻底明白业务逻辑才能修改，提高竞争对手抄袭门槛或者提高二次开发门槛而给项目部带来更高的收入？</p>
<p>这样的代码里边很多，也许只有他们自己才能了解最终目的。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/06/05/%e8%84%b1%e8%a3%a4%e5%ad%90%e6%94%be%e5%b1%81%e5%85%b8%e8%8c%83%e7%a8%8b%e5%ba%8f.shtml/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.538 seconds -->
