CN101582047A - 一种Windows下系统服务Rootkits检测与恢复方法 - Google Patents

一种Windows下系统服务Rootkits检测与恢复方法 Download PDF

Info

Publication number
CN101582047A
CN101582047A CNA2008100247282A CN200810024728A CN101582047A CN 101582047 A CN101582047 A CN 101582047A CN A2008100247282 A CNA2008100247282 A CN A2008100247282A CN 200810024728 A CN200810024728 A CN 200810024728A CN 101582047 A CN101582047 A CN 101582047A
Authority
CN
China
Prior art keywords
rootkits
system service
detection
windows
hook
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2008100247282A
Other languages
English (en)
Inventor
龙海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CNA2008100247282A priority Critical patent/CN101582047A/zh
Publication of CN101582047A publication Critical patent/CN101582047A/zh
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种检测和恢复Windows系统服务Rootkits的方法,利用Windows驱动程序,分别检测int2E hook和sysenter hook,SSDT表重定向,SSDT表项修改,服务函数重定向。能准确检测出Windows下各种系统服务rootkits并且进行恢复。

Description

一种Windows下系统服务Rootkits检测与恢复方法
所属技术领域
本发明涉及一种针对Windows下系统服务Rootkits的检测和恢复方法。
背景技术
Windows内核rootkits是近年来Windows操作系统安全的主要威胁之一。在Windows内核rookits中针对系统服务的rootkits占据主要部分,无论是进程隐藏,文件隐藏,还是注册表隐藏都能利用系统服务rootkits实现。关于内核rootkits的检测方法有:在内核rootkits进入时进行静态检测;对系统中已经存在的rootkits进行动态检测和恢复。
现有检测方法的不足:
1,不完全准确,检测出来以后不能确定rootkits的类型,也不能动态检测内核中已经存在的rootkits。
2,依赖于内核执行程序的符号文件。
发明内容
本发明的主要目的是动态检测和恢复Windows系统服务Rootkits。为了克服现有检测方法的不足,对当前Windows下系统服务rootkits的各类情况,提出一种利用驱动程序,无需符号文件,检测和修复系统内核的方法。本发明能准确检测出针对系统服务的rootkits,在发现异常的情况下进行恢复。
本发明采取的检测方法是:
1,int 2E hook和sysenter hook的检测和恢复
检测int 2E hook和sysenter hook需要确定KiSystemService在磁盘的相对偏移地址KiSystemServiceRVA。KiSystemService的地址是保存在IDT表中的第2E数据项。IDT table是一张未导出的表其表项的数据结构定义为:
IDTEntry macro name,access
        dd      offset FLAT:name
        dw      access
        dw      KGDT_RO_CODE
        endm
第一项为所对应的中断处理函数的地址,若IDT table在磁盘文件ntoskrnl.exe的相对偏移地址为IDTRVA,在重定位表中,将存在重定位项指向,IDTRVA+i*8(i=0,......255)。
KGDT_RO_CODE的值为0x0008。根据这个特征在重定位表中可以很快得到IDT table的入口点的相对偏移地址IDTRVA,其第2E项保存了KiSystemServiceRVA。
在内核模式下,对于int 2E方式调用系统服务,通过指令sidt得到IDT table在内存中的地址,其第2E项是KiSystemService的地址KiSystemServiceAddr。对于sysenter调用系统服务,通过指令rmsr获得IA32_SYSENTER_EIP的值KiSystemServiceAddr。
检测和恢复算法A1:
if(KiSystemServiceAddr-KernelBaseAddress!=KiSystemServiceRVA)
{
 if(int 2E方式调用系统服务)
 {
  IDT table[2E].FunctionAddress=KiSystemServiceRVA+KernelBaseAddress;
 }
 else
 {
   KiSystemServiceAddr=KiSystemServiceRVA+KernelBaseAddress;
 }
}
2,SSDT表重定向的检测和恢复
检测SSDT表重定向需要确定KeServiceDescriptorTable的RVA。KeServiceDescriptorTable是被ntoskrnl.exe导出的变量,其偏移地址可以通过如下方式获得。
KeHandle=LoadLibraryEx(“ntoskrnl.exe”,0,DONT_RESOLVE_DLL_REFERENCES);
KeAddr=GetProcAddress(KeHandle,″KeServiceDescriptorTable″)));
KeServiceDescriptorTableRVA=KeAddr-(DWORD)KeHandle;
在内核模式下,可以直接得到KeServiceDescriptorTableAddr。
检测和恢复算法A2:
if(KeServiceDescriptorTable.Base-KernelBaseAddress!=KiServiceTableRVA)
{
    KeServiceDescriptorTable.Base=KiServiceTableRVA+KernelBaseAddress;
}
3,SSDT表项修改的检测和恢复
KiServiceTable不是被ntoskrnl.exe导出的变量,不能按第二种情况的方法获得RVA。但是在ntoskrnl.exe的内部函数KiInitSystem中对KeServiceDescriptorTable进行了初始化的操作:
KeServiceDescriptorTable[0].Base=&KiServiceTable[0];
对应的汇编代码是:
rva:mov KeServiceDescriptorTableRVA,
KiServiceTableRVA
对应的机器代码是:rva:C705**** ****
在重定位表中将存在一条指针指向rva+2,rva+2地址处保存的值为KeServiceDescriptorTableRVA,并且在rva处的值为0X05C7,搜索重定位表能确定rva的值,紧接着在重定位表中将存在一条指针指向rva+6,其值为KiServiceTable的RVA。得到KiServiceTableRVA后,可以对每一个表项进行检测。
检测和恢复算法A3:
KiServiceTableAddr=KiServiceTableRVA+KernelBaseAddress;
for(int i=1;i<=ServieFunctionNum;i++)
{
  if(KiServiceTableAddr[i]-KernelBaseAddress!=KiServiceTableRVA[i])
  {
   KiServiceTableAddr[i]=KiServiceTableRVA[i]+KernelBaseAddress;
   }
  }
4,服务函数重定向的检测和恢复
已经得到了KiServiceTable的RVA,KiServiceTable是一张保存系统服务函数地址的线性表,因此也得到了各个系统服务函数的RVA。比较内核各个系统服务函数的头几个(NUM)字节与磁盘上的原文件相应RVA处保存的内容,判断系统服务函数是否被重定向了。
检测和恢复算法A4:
for(int i=1;i<=ServieFunctionNum;i++)
{
 if(memcompare(iServiceFunction,iServiceFunctionRVA,NUM)!=0))
  {
       memcpy(iServiceFunction,iServiceFunctionRVA,NUM);
   }
}
本发明能准确检测出针对系统服务的rootkits,在发现异常的情况下进行恢复。
附图说明
下面结合附图和对本发明进一步说明。
图1是本发明系统服务检测点图
图2是int2E hook和sysenter hook图
图3是SSDT表重定向图
图4是SSDT表项修改图
图5是服务函数重定向图
具体实施方式
如图1所示,对于int 2E Hook和sysenter Hook采用算法1进行检测和恢复;对于SSDT表重定向采用算法2进行检测和恢复;对于SSDT表项修改采用算法3进行检测和恢复;对于服务函数重定向采用算法4检测检测和恢复。

Claims (2)

1.一种检测和恢复Windows系统服务Rootkits的方法,其特征是:一种利用驱动程序,无需符号文件,检测和修复系统内核的方法。
2.根据权利要求1所述的,其特征是:利用Windows驱动程序,分别检测int2E hook和sysenter hook,SSDT表重定向,SSDT表项修改,服务函数重定向。
CNA2008100247282A 2008-05-12 2008-05-12 一种Windows下系统服务Rootkits检测与恢复方法 Pending CN101582047A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100247282A CN101582047A (zh) 2008-05-12 2008-05-12 一种Windows下系统服务Rootkits检测与恢复方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100247282A CN101582047A (zh) 2008-05-12 2008-05-12 一种Windows下系统服务Rootkits检测与恢复方法

Publications (1)

Publication Number Publication Date
CN101582047A true CN101582047A (zh) 2009-11-18

Family

ID=41364201

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100247282A Pending CN101582047A (zh) 2008-05-12 2008-05-12 一种Windows下系统服务Rootkits检测与恢复方法

Country Status (1)

Country Link
CN (1) CN101582047A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722679A (zh) * 2012-06-06 2012-10-10 西安电子科技大学 Windows操作系统中防止消息挂钩方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722679A (zh) * 2012-06-06 2012-10-10 西安电子科技大学 Windows操作系统中防止消息挂钩方法

Similar Documents

Publication Publication Date Title
KR101554633B1 (ko) 악성 코드 검출 장치 및 그 방법
WO2012061663A3 (en) Using power fingerprinting (pfp) to monitor the integrity and enhance security of computer based systems
US10558801B2 (en) System and method for detection of anomalous events based on popularity of their convolutions
WO2007061671A3 (en) Systems and methods for detecting and disabling malicious script code
JP2009129451A (ja) 悪性コードによって挿入されたダイナミックリンクライブラリ検出装置及び方法
WO2006130233A3 (en) Methods and systems for repairing applications
US20120131675A1 (en) Server, user device and malware detection method thereof
WO2007117582A3 (en) Malware detection system and method for mobile platforms
WO2008091785A3 (en) System and method for determining data entropy to identify malware
TW200536325A (en) Watermark detection
WO2007127764A3 (en) Automated analysis of collected field data for error detection
CN101833631A (zh) 一种结合指针分析的软件安全漏洞动态检测方法
CN103886229A (zh) 一种提取pe文件特征的方法及装置
CN100489730C (zh) 实时检查进程完整性的方法与系统
WO2005086063A3 (en) Method and system to minimize power consumption by using staged life-threatening arrhythmia detection algorithm
CN101582047A (zh) 一种Windows下系统服务Rootkits检测与恢复方法
CN107800673A (zh) 一种白名单的维护方法及装置
CN101986283A (zh) 检测Windows系统已知漏洞的方法和系统
Gao et al. Blind watermark algorithm based on QR barcode
CN103369555A (zh) 一种用于检测手机病毒的方法和装置
CN111723373A (zh) 复合式二进制文档的漏洞利用文件检测方法及装置
KR101042858B1 (ko) 윈도우즈 커널 변조 탐지방법
Pevný et al. Malicons: Detecting payload in favicons
CN112286707B (zh) 一种mcu运行异常的故障定位系统及方法
US10818321B1 (en) Method for detecting the tilting of hard disk drive based on first and second control units

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C57 Notification of unclear or unknown address
DD01 Delivery of document by public notice

Addressee: Long Hai

Document name: Notification of Publication of the Application for Invention

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20091118