|
我倒不怎么關(guān)心提示框,SABLOG怎么知道我的版本有漏洞呢,程序肯定有后門.每次登陸后臺(tái)自動(dòng)檢測(cè)官方版本跟當(dāng)前版本對(duì)比.嗯.后來找到了.在templates/admin/main.php最后的一部分.刪掉如下代碼就OK了.
其實(shí)這個(gè)不足以導(dǎo)致被黑的,現(xiàn)在一般有點(diǎn)常識(shí)的,密碼都比較復(fù)雜,幾個(gè)數(shù)字+幾個(gè)字母,MD5的話一般很難跑出來.當(dāng)然有彩虹表的話,另說...
復(fù)制代碼 代碼如下:
<script type="text/Javascript">
i=1;
var autourl=new Array();
autourl[1] = 'www.sablog.NET';
autourl[2] = 'cnc.sablog.NET';
function auto(url){
if(i){
i=0;
var oHead = document.getElementsByTagName('head').item(0);
var oScript= document.createElement("script");
oScript.type = "text/Javascript";
oScript.src = "http://"+url+"/update.php?version=$now_version&release=$now_release&hostname=$now_hostname";
oHead.appendChild(oScript);
}
}
function run(){
for(var i=1;i<autourl.length;i++) {
document.write("<img src=http://"+autourl+" width=1 height=1 onerror=auto('"+autourl+"')>");
}
}
run();
</script>
目前流行的程序里,不止SABLOG一個(gè),Discuz,DEDECMS都是有這樣的后門的.這樣的后門官方的真正用意很難說.
為了讓用戶及時(shí)得到最新的補(bǔ)丁,最新的版本是一方面,其他的,隨便人家怎么發(fā)揮了...
但是這個(gè)東西有好的一面,也有壞的一面,一旦官方被黑,后果可想而知,所有的用戶就被"批量掛馬"了.
現(xiàn)在干脆都給發(fā)出來吧.先來個(gè)DEDECMS的,標(biāo)示出來的刪掉就行:
復(fù)制代碼 代碼如下:
/include/inc_functions.php
function GetNewInfo(){
if(!isset($GLOBALS['__funAdmin'])) require_once(dirname(__FILE__)."/inc/inc_fun_funAdmin.php");
return SpGetNewInfo();
}
/include/inc/inc_fun_funAdmin.php
function SpGetNewInfo(){
global $cfg_version;
$nurl = $_SERVER["HTTP_HOST"];
if( eregi("[a-z/-]{1,}/.[a-z]{2,}",$nurl) ){ $nurl = urlencode($nurl); }
else{ $nurl = "test"; }
$gs = "<iframe name='stafrm' src='http://www.dedecms.com/newinfo.php?version=".urlencode($cfg_version)."&formurl=$nurl' frameborder='0' id='stafrm' width='100%' height='50'></iframe>";
return $gs;
}
dede/index_body.php(其中dede為后臺(tái)目錄)
<div class="bodytitle">
<div class="bodytitleleft"></div>
<div class="bodytitletxt">DedeCms最新消息</div>
</div>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><form name="uploadspider" action="upload_spider.php" method="post">
<td height="80" class="main_dnews">
<?php echo GetNewInfo()?> </td>
</form>
</tr>
</table>
再把DZ的"后門"發(fā)出來吧.admin/global.func.php里面查找"function cpfooter",替換成如下的function:
復(fù)制代碼 代碼如下:
function cpfooter() {
global $version, $adminid, $db, $tablepre, $action, $bbname, $charset, $timestamp, $isfounder, $insenz;
global $_COOKIE, $_SESSION, $_DCOOKIE, $_DCACHE, $_DSESSION, $_DCACHE, $_DPLUGIN, $sqldebug, $debuginfo;
$infmessage = '';
?>
<?=$infmessage?>
<?php echo $sqldebug;?>
</div>
</body>
</html>
<?php
updatesession();
}
這個(gè)文件中還有一個(gè)function,沒必要的,可以去掉:
復(fù)制代碼 代碼如下:
function bbsinformation() {
global $db, $timestamp, $tablepre, $charset, $bbname, $_SERVER, $siteuniqueid, $save_mastermobile;
$update = array('uniqueid' => $siteuniqueid, 'version' => DISCUZ_VERSION, 'release' => DISCUZ_RELEASE, 'php' => php_VERSION, 'mysql' => $db->version(), 'charset' => $charset, 'bbname' => $bbname, 'mastermobile' => $save_mastermobile);
$updatetime = @filemtime(DISCUZ_ROOT.'./forumdata/updatetime.lock');
if(emptyempty($updatetime) || ($timestamp - $updatetime > 3600 * 4)) {
@touch(DISCUZ_ROOT.'./forumdata/updatetime.lock');
$update['members'] = $db->result_first("SELECT COUNT(*) FROM {$tablepre}members");
$update['threads'] = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads");
$update['posts'] = $db->result_first("SELECT COUNT(*) FROM {$tablepre}posts");
$query = $db->query("SELECT special, count(*) AS spcount FROM {$tablepre}threads GROUP BY special");
while($thread = $db->fetch_array($query)) {
$thread['special'] = intval($thread['special']);
$update['spt_'.$thread['special']] = $thread['spcount'];
}
}
$data = '';
foreach($update as $key => $value) {
$data .= $key.'='.rawurlencode($value).'&';
}
return 'update='.rawurlencode(base64_encode($data)).'&md5hash='.substr(md5($_SERVER['HTTP_USER_AGENT'].implode('', $update).$timestamp), 8, 8).'×tamp='.$timestamp;
}
還有admin/home.inc.php,大概193~196行(DZ6.1.0 UTF-8官方原版),這里:
復(fù)制代碼 代碼如下:
showtablerow('', array('class="vtop td24 lineheight"', 'class="lineheight smallfont"'), array(
lang('home_discuz_version'),
'Discuz! '.DISCUZ_VERSION.' Release '.DISCUZ_RELEASE.' <a href="http://www.discuz.NET/forumdisplay.php?fid=10" class="lightlink smallfont" target="_blank">'.lang('home_check_newversion').'</a> '
));
雖然說這里沒有直接與官方進(jìn)行通信,但是,,,我看著不爽,想打補(bǔ)丁自己常去官方看就是了.還有所有文件名中包含insenz的文件,用不著的話就直接刪除.沒什么用.
php技術(shù):一些 PHP 管理系統(tǒng)程序中的后門,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。