最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

一些 PHP 管理系統(tǒng)程序中的后門(mén)

 更新時(shí)間:2009年08月05日 00:19:29   作者:  
一些php網(wǎng)站管理程序的,一些后門(mén),其實(shí)官方也沒(méi)有惡意,主要是大家為了自己的安全。

我倒不怎么關(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ō)...

復(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都是有這樣的后門(mén)的.這樣的后門(mén)官方的真正用意很難說(shuō).
為了讓用戶及時(shí)得到最新的補(bǔ)丁,最新的版本是一方面,其他的,隨便人家怎么發(fā)揮了...
但是這個(gè)東西有好的一面,也有壞的一面,一旦官方被黑,后果可想而知,所有的用戶就被"批量掛馬"了.
現(xiàn)在干脆都給發(fā)出來(lái)吧.先來(lái)個(gè)DEDECMS的,標(biāo)示出來(lái)的刪掉就行:
復(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的"后門(mén)"發(fā)出來(lái)吧.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,沒(méi)必要的,可以去掉:
復(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 class="lightlink smallfont" target="_blank">'.lang('home_check_newversion').'</a> '
));

雖然說(shuō)這里沒(méi)有直接與官方進(jìn)行通信,但是,,,我看著不爽,想打補(bǔ)丁自己常去官方看就是了.還有所有文件名中包含insenz的文件,用不著的話就直接刪除.沒(méi)什么用.

相關(guān)文章

  • php 無(wú)極分類(遞歸)實(shí)現(xiàn)代碼

    php 無(wú)極分類(遞歸)實(shí)現(xiàn)代碼

    php 無(wú)極分類(遞歸)實(shí)現(xiàn)代碼,需要的朋友可以參考下。
    2010-01-01
  • PHP提交表單失敗后如何保留已經(jīng)填寫(xiě)的信息

    PHP提交表單失敗后如何保留已經(jīng)填寫(xiě)的信息

    這篇文章主要介紹了PHP提交表單失敗后如何保留已經(jīng)填寫(xiě)的信息,需要的朋友可以參考下
    2014-06-06
  • php中substr()函數(shù)參數(shù)說(shuō)明及用法實(shí)例

    php中substr()函數(shù)參數(shù)說(shuō)明及用法實(shí)例

    這篇文章主要介紹了php中substr()函數(shù)參數(shù)說(shuō)明及用法,以實(shí)例形式深入分析了substr()函數(shù)中的各個(gè)參數(shù)的含義,并舉例說(shuō)明了其對(duì)應(yīng)的用法,需要的朋友可以參考下
    2014-11-11
  • 判斷PHP數(shù)組是否為空的代碼

    判斷PHP數(shù)組是否為空的代碼

    這兩種方法足以應(yīng)對(duì)簡(jiǎn)單數(shù)組和多維數(shù)組是否為空的判斷問(wèn)題,個(gè)人一般用empty()來(lái)做數(shù)組非空判斷,這樣感覺(jué)代碼看起來(lái)更容易理解。
    2011-09-09
  • 最新評(píng)論

    邻水| 闻喜县| 理塘县| 牟定县| 思南县| 新蔡县| 房山区| 桂平市| 临汾市| 和平县| 南开区| 荥经县| 凌源市| 华池县| 新建县| 兴海县| 朔州市| 宁乡县| 通城县| 天津市| 始兴县| 潼南县| 绥中县| 平原县| 罗田县| 射洪县| 栖霞市| 昌乐县| 凉城县| 绩溪县| 上高县| 深圳市| 寿宁县| 蓬莱市| 佳木斯市| 贵德县| 博罗县| 耒阳市| 开封县| 南京市| 三河市|