一些 PHP 管理系統(tǒng)程序中的后門(mén)
我倒不怎么關(guān)心提示框,SABLOG怎么知道我的版本有漏洞呢,程序肯定有后門(mén).每次登陸后臺(tái)自動(dòng)檢測(cè)官方版本跟當(dāng)前版本對(duì)比.嗯.后來(lái)找到了.在templates/admin/main.php最后的一部分.刪掉如下代碼就OK了.
其實(shí)這個(gè)不足以導(dǎo)致被黑的,現(xiàn)在一般有點(diǎn)常識(shí)的,密碼都比較復(fù)雜,幾個(gè)數(shù)字+幾個(gè)字母,MD5的話一般很難跑出來(lái).當(dāng)然有彩虹表的話,另說(shuō)...
<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都是有這樣的后門(mén)的.這樣的后門(mén)官方的真正用意很難說(shuō).
為了讓用戶及時(shí)得到最新的補(bǔ)丁,最新的版本是一方面,其他的,隨便人家怎么發(fā)揮了...
但是這個(gè)東西有好的一面,也有壞的一面,一旦官方被黑,后果可想而知,所有的用戶就被"批量掛馬"了.
現(xiàn)在干脆都給發(fā)出來(lái)吧.先來(lái)個(gè)DEDECMS的,標(biāo)示出來(lái)的刪掉就行:
/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的"后門(mén)"發(fā)出來(lái)吧.admin\global.func.php里面查找"function cpfooter",替換成如下的function:
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,沒(méi)必要的,可以去掉:
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官方原版),這里:
showtablerow('', array('class="vtop td24 lineheight"', 'class="lineheight smallfont"'), array(
lang('home_discuz_version'),
'Discuz! '.DISCUZ_VERSION.' Release '.DISCUZ_RELEASE.' <a class="lightlink smallfont" target="_blank">'.lang('home_check_newversion').'</a> '
));
雖然說(shuō)這里沒(méi)有直接與官方進(jìn)行通信,但是,,,我看著不爽,想打補(bǔ)丁自己常去官方看就是了.還有所有文件名中包含insenz的文件,用不著的話就直接刪除.沒(méi)什么用.
相關(guān)文章
關(guān)于JSON以及JSON在PHP中的應(yīng)用技巧
這篇文章主要介紹了關(guān)于JSON以及JSON在PHP中的應(yīng)用技巧。需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2013-11-11
PHP通過(guò)調(diào)用新浪API生成t.cn格式短網(wǎng)址鏈接的方法詳解
這篇文章主要介紹了PHP通過(guò)調(diào)用新浪API生成t.cn格式短網(wǎng)址鏈接的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了php調(diào)用新浪API生成t.cn格式短網(wǎng)址鏈接的具體操作步驟與相關(guān)注意事項(xiàng),需要的朋友可以參考下2019-02-02
php+ajax實(shí)時(shí)刷新簡(jiǎn)單實(shí)例
這篇文章主要介紹了php+ajax實(shí)時(shí)刷新簡(jiǎn)單實(shí)現(xiàn)方法,實(shí)例分析了Ajax的實(shí)現(xiàn)原理以及對(duì)應(yīng)的php處理文件基本原理與操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-02-02
php 無(wú)極分類(遞歸)實(shí)現(xiàn)代碼
PHP提交表單失敗后如何保留已經(jīng)填寫(xiě)的信息
php中substr()函數(shù)參數(shù)說(shuō)明及用法實(shí)例

