CN112861129A - 一种检测Windows操作系统中隐藏的恶意程序进程的方法 - Google Patents
一种检测Windows操作系统中隐藏的恶意程序进程的方法 Download PDFInfo
- Publication number
- CN112861129A CN112861129A CN202110115351.7A CN202110115351A CN112861129A CN 112861129 A CN112861129 A CN 112861129A CN 202110115351 A CN202110115351 A CN 202110115351A CN 112861129 A CN112861129 A CN 112861129A
- Authority
- CN
- China
- Prior art keywords
- operating system
- ntquerysysteminformation
- function
- windows operating
- malicious program
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 238000009795 derivation Methods 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 claims description 44
- 238000013507 mapping Methods 0.000 claims description 3
- 238000012216 screening Methods 0.000 abstract 1
- 238000001514 detection method Methods 0.000 description 4
- 241000700605 Viruses Species 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000026676 system process Effects 0.000 description 2
- 230000002155 anti-virotic effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 101150026195 hook gene Proteins 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/566—Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Virology (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本发明公开了一种检测Windows操作系统中隐藏的恶意程序进程的方法,其特征在于包括以下步骤:S100:从Windows操作系统应用层检测隐藏进程,包括以下步骤:S101:获取%SystemRoot%\System32\ntdll.dll,并根据解析ntdll.dll的结果获取ntdll.dll的导出函数NtQuerySystemInformation;S102:采用导出函数NtQuerySystemInformation筛选出Nt开头的功能,并进行解析,获取NtQuerySystemInformation的系统服务描述符的编号;S103:根据所获取的NtQuerySystemInformation的系统服务描述符的编号,构建调用功能,并使用SYSENTER\SYSTEMCALL指令访问内核层;S104:对比进程列表,查找隐藏的恶意程序进程;S200:判断是否查找到隐藏的恶意程序进程,如果是,结束流程,否则,执行步骤S300;S300:从Windows操作系统内核层检测隐藏进程。
Description
技术领域
本发明属于计算机安全及计算机病毒检测与防护领域,涉及一种检测Windows操作系统中隐藏的恶意程序进程的方法。
背景技术
在恶意软件威胁、病毒注入、挖矿程序肆意的当下,对于Windows操作系统进程的监控不仅是计算机安全从业人员需要关心的重点,更是守护信息安全、杜绝恶意威胁的关键。但非法盗用计算机资源的违法人员不会直接将恶意程序注入并运行。现有技术进行检测时,极易遇到进程被恶意挂钩,这些隐藏手段使计算机安全从业人员无法直接察觉该恶意软件正在盗用我们的计算机资源。
恶意代码为了保护自己的进程不被发现,通过进程挂起,替换内存数据再恢复执行,或通过HOOK函数NtQuerySystemInfornation实现进程隐藏等方法,在常见的64位Windows操作系统下wow64进程下的Wow64Transition进行挂钩,实现进程隐藏和欺骗,用来对抗进程检测。在64位Windows操作系统下,恶意代码也能实现进程隐藏和欺骗,也能对抗进程检测。
因此,现有技术中,用户和第三方杀毒工具等不能直接查看所有真实进程列表,无法绕过恶意程序的隐藏和欺骗。
发明内容
针对现有技术的不足,本发明提供了一种检测Windows操作系统中隐藏的恶意程序进程的方法,从应用层调用与驱动层访问的方案,在恶意程序进行进程隐藏和欺骗的情况下,绕过程序挂钩、进程断链等,提取到实际的系统进程列表,挖掘出恶意程序进程。本发明具有稳定可靠并能全面检测Windows操作系统中隐藏的恶意程序进程的有益效果。
本发明申请包括以下步骤:
S100:从Windows操作系统应用层检测隐藏进程,包括以下步骤:
S101:获取%SystemRoot%\System32\ntdll.dll,并根据解析ntdll.dll的结果获取ntdll.dll的导出函数NtQuerySystemInformation;
S102:采用导出函数NtQuerySystemInformation筛选出Nt开头的功能,并进行解析,获取NtQuerySystemInformation的系统服务描述符的编号,包括以下步骤:
S1021:采用二进制方式读取ntdll.dll文件,获取PE文件导出表,解析NTQuerySystemInformation的相对虚拟地址RVA;
S1022:解析PE文件区段表并按页对齐,映射到内存后,读取PE文件头地址ImageBase;
S1023:计算功能地址fn:功能地址fn=ImageBase+RVA;
S1024:根据功能地址fn及操作系统的位数,获取NtQuerySystemInformation的系统服务描述符的编号,其中,
对于Windows 32位操作系统:NtQuerySystemInformation的系统服务描述符的编号=fn+1;
对于Windows 64位操作系统:NtQuerySystemInformation的系统服务描述符的编号=fn+4;
S103:根据所获取的NtQuerySystemInformation的系统服务描述符的编号,构建调用功能,并使用SYSENTER\SYSTEMCALL指令访问内核层;
S104:对比进程列表,查找隐藏的恶意程序进程:
通过步骤S103所构建的调用功能,查询Windows操作系统当前运行的进程列表;
直接运行NtQuerySystemInformation,查询Windows操作系统当前运行的进程列表;
比较两次查询进程列表的结果,查找并获取隐藏的恶意程序进程;
S200:判断是否查找到隐藏的恶意程序进程,如果是,结束流程,否则,执行步骤S300;
S300:从Windows操作系统内核层检测隐藏进程。
优选地,所述步骤S101包括以下步骤:
S1011:判断Windows操作系统是否为32位操作系统,如果是,执行步骤S2012,否则,执行步骤S1013:
S1012:读取%SystemRoot%\System32\ntdll.dll,执行步骤S1014;
S1013:执行Wow64DisableWow64FsRedirection,用以禁用重定位,并获取%SystemRoot%\System32\ntdll.dll;
S1014:以二进制数据读取方式读取ntdll.dll文件,以win32 PE文件方式解析,得到模块的导出函数NtQuerySystemInformation。
优选地,所述步骤102的方法为:
优选地,所述步骤S103包括以下步骤:
对于Windows 32位操作系统,所构建调用功能为:
mov eax,NtQueryInformationProcess
call$+8
ret 14
mov edx,esp
sysenter
ret
对于Windows 32位操作系统,所构建调用功能为;
mov eax,NtQueryInformationProcess
mov r10,rcx
syscall
retn
优选地,所述步骤S300包括以下步骤:
S301:采用运行NtQuerySystemInformation方式,使用SystemProcessInformation功能,枚举出所有csrss.exe进程;
S302:采用运行NtQuerySystemInformation方式,使用SystemHandleInformation功能,枚举出当前Windows操作系统所有句柄表,根据返回的SYSTEM_HANDLE_INFORMATION::SYSTEM_HANDLE_TABLE_ENTRY_INFO中的UniqueProcessId,对比PID所属进程为csrss.exe的进程;
S303:采用NtDuplicateObject功能,将句柄复制到自身,对句柄调用NtQueryObject功能,采用ObjectTypeInformation进行句柄类型查询;
S304:当句柄类型名称为Process时,获取对象Object,作为进程csrss.exe所属会话session中活动进程的EProcess;
S305:将步骤S304中所获取的对象Object与直接运行NtQuerySystemInformation并查询的Windows操作系统当前运行的进程列表进行对比,查找并获取隐藏的恶意程序进程。
本发明所通过的方法的有益效果是:解决了现有技术中尚无检测Windows操作系统中隐藏的恶意程序进程的方法的技术问题。
附图说明
图1为本发明所提供的方法的总流程图。
具体实施方式
图1示出了本发明所提供的方法的总流程图。如图1所示,本发明的方法包括以下步骤:
S100:从Windows操作系统应用层检测隐藏进程,包括以下步骤:
S101:获取%SystemRoot%\System32\ntdll.dll,并根据解析ntdll.dll的结果获取ntdll.dll的导出函数NtQuerySystemInformation;
步骤S101包括以下步骤:
S1011:判断Windows操作系统是否为32位操作系统,如果是,执行步骤S2012,否则,执行步骤S1013:
S1012:读取%SystemRoot%\System32\ntdll.dll,执行步骤S1014;
S1013:执行Wow64DisableWow64FsRedirection,用以禁用重定位,并获取%SystemRoot%\System32\ntdll.dll;
S1014:以二进制数据读取方式读取ntdll.dll文件,以win32 PE文件方式解析,得到模块的导出函数NtQuerySystemInformation。
S102:采用导出函数NtQuerySystemInformation筛选出Nt开头的功能,并进行解析,获取NtQuerySystemInformation的系统服务描述符的编号,包括以下步骤:
S1021:采用二进制方式读取ntdll.dll文件,获取PE文件导出表,解析NTQuerySystemInformation的相对虚拟地址RVA;
S1022:解析PE文件区段表并按页对齐,映射到内存后,读取PE文件头地址ImageBase;
S1023:计算功能地址fn:功能地址fn=ImageBase+RVA;
S1024:根据功能地址fn及操作系统的位数,获取NtQuerySystemInformation的系统服务描述符的编号,其中,
对于Windows 32位操作系统:NtQuerySystemInformation的系统服务描述符的编号=fn+1;
对于Windows 64位操作系统:NtQuerySystemInformation的系统服务描述符的编号=fn+4;
具体地,步骤S102可以通过如下脚本来实现:
S103:根据所获取的NtQuerySystemInformation的系统服务描述符的编号,构建调用功能,并使用SYSENTER\SYSTEMCALL指令访问内核层;
步骤S103包括以下步骤:
对于Windows 32位操作系统,所构建调用功能为以下脚本:
mov eax,NtQueryInformationProcess
call$+8
ret 14
mov edx,esp
sysenter
ret
对于Windows 32位操作系统,所构建调用功能为以下脚本;
mov eax,NtQueryInformationProcess
mov r10,rcx
syscall
retn
所构建的调用功能,查询Windows操作系统当前运行的实际的进程列表;
S104:对比进程列表,查找隐藏的恶意程序进程:
通过步骤S103所构建的调用功能,查询Windows操作系统当前运行的实际的进程列表;
直接运行NtQuerySystemInformation,查询Windows操作系统当前运行的进程列表;
比较两次查询进程列表的结果,查找并获取隐藏的恶意程序进程;
S200:判断是否查找到隐藏的恶意程序进程,如果是,结束流程,否则,执行步骤S300;
S300:从Windows操作系统内核层检测隐藏进程。
步骤S300包括以下步骤:
S301:采用运行NtQuerySystemInformation方式,使用SystemProcessInformation功能,枚举出所有csrss.exe进程;
S302:采用运行NtQuerySystemInformation方式,使用SystemHandleInformation功能,枚举出当前Windows操作系统所有句柄表,根据返回的SYSTEM_HANDLE_INFORMATION::SYSTEM_HANDLE_TABLE_ENTRY_INFO中的UniqueProcessId,对比PID所属进程为csrss.exe的进程;
S303:采用NtDuplicateObject功能,将句柄复制到自身,对句柄调用NtQueryObject功能,采用ObjectTypeInformation进行句柄类型查询;
S304:当句柄类型名称为Process时,获取对象Object,作为进程csrss.exe所属会话session中活动进程的EProcess;
S305:将步骤S304中所获取的对象Object与直接运行NtQuerySystemInformation并查询的Windows操作系统当前运行的进程列表进行对比,查找并获取隐藏的恶意程序进程。
通过上述应用层与驱动层相结合的方法,绕过恶意程序的欺骗,访问到Windows操作系统任务进程的真实列表,能够查找并获取隐藏的恶意程序进程。
应当理解的是,本发明不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。
Claims (5)
1.一种检测Windows操作系统中隐藏的恶意程序进程的方法,其特征在于包括以下步骤:
S100:从Windows操作系统应用层检测隐藏进程,包括以下步骤:
S101:获取%SystemRoot%\System32\ntdll.dll,并根据解析ntdll.dll的结果获取ntdll.dll的导出函数NtQuerySystemInformation;
S102:采用导出函数NtQuerySystemInformation筛选出Nt开头的功能,并进行解析,获取NtQuerySystemInformation的系统服务描述符的编号,包括以下步骤:
S1021:采用二进制方式读取ntdll.dll文件,获取PE文件导出表,解析NTQuerySystemInformation的相对虚拟地址RVA;
S1022:解析PE文件区段表并按页对齐,映射到内存后,读取PE文件头地址ImageBase;
S1023:计算功能地址fn:功能地址fn=ImageBase+RVA;
S1024:根据功能地址fn及操作系统的位数,获取NtQuerySystemInformation的系统服务描述符的编号,其中,
对于Windows 32位操作系统:NtQuerySystemInformation的系统服务描述符的编号=fn+1;
对于Windows 64位操作系统:NtQuerySystemInformation的系统服务描述符的编号=fn+4;
S103:根据所获取的NtQuerySystemInformation的系统服务描述符的编号,构建调用功能,并使用SYSENTER\SYSTEMCALL指令访问内核层;
S104:对比进程列表,查找隐藏的恶意程序进程:
通过步骤S103所构建的调用功能,查询Windows操作系统当前运行的实际的进程列表;
直接运行NtQuerySystemInformation,查询Windows操作系统当前运行的进程列表;
比较两次查询进程列表的结果,查找并获取隐藏的恶意程序进程;
S200:判断是否查找到隐藏的恶意程序进程,如果是,结束流程,否则,执行步骤S300;
S300:从Windows操作系统内核层检测隐藏进程。
2.根据权利要求1所述的一种检测Windows操作系统中隐藏的恶意程序进程的方法,其特征在于,所述步骤S101包括以下步骤:
S1011:判断Windows操作系统是否为32位操作系统,如果是,执行步骤S2012,否则,执行步骤S1013:
S1012:读取%SystemRoot%\System32\ntdll.dll,执行步骤S1014;
S1013:执行Wow64DisableWow64FsRedirection,用以禁用重定位,并获取%SystemRoot%\System32\ntdll.dll;
S1014:以二进制数据读取方式读取ntdll.dll文件,以win32 PE文件方式解析,得到模块的导出函数NtQuerySystemInformation。
4.根据权利要求1所述的一种检测Windows操作系统中隐藏的恶意程序进程的方法,其特征在于,所述步骤S103包括以下步骤:
对于Windows 32位操作系统,所构建调用功能为:
mov eax,NtQueryInformationProcess
call$+8
ret 14
mov edx,esp
sysenter
ret
对于Windows 32位操作系统,所构建调用功能为;
mov eax,NtQueryInformationProcess
mov r10,rcx
syscall
retn。
5.根据权利要求1所述的一种检测Windows操作系统中隐藏的恶意程序进程的方法,其特征在于,所述步骤S300包括以下步骤:
S301:采用运行NtQuerySystemInformation方式,使用SystemProcessInformation功能,枚举出所有csrss.exe进程;
S302:采用运行NtQuerySystemInformation方式,使用SystemHandleInformation功能,枚举出当前Windows操作系统所有句柄表,根据返回的SYSTEM_HANDLE_INFORMATION::SYSTEM_HANDLE_TABLE_ENTRY_INFO中的UniqueProcessId,对比PID所属进程为csrss.exe的进程;
S303:采用NtDuplicateObject功能,将句柄复制到自身,对句柄调用NtQueryObject功能,采用ObjectTypeInformation进行句柄类型查询;
S304:当句柄类型名称为Process时,获取对象Object,作为进程csrss.exe所属会话session中活动进程的EProcess;
S305:将步骤S304中所获取的对象Object与直接运行NtQuerySystemInformation并查询的Windows操作系统当前运行的进程列表进行对比,查找并获取隐藏的恶意程序进程。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110115351.7A CN112861129A (zh) | 2021-01-28 | 2021-01-28 | 一种检测Windows操作系统中隐藏的恶意程序进程的方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110115351.7A CN112861129A (zh) | 2021-01-28 | 2021-01-28 | 一种检测Windows操作系统中隐藏的恶意程序进程的方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112861129A true CN112861129A (zh) | 2021-05-28 |
Family
ID=75986875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110115351.7A Pending CN112861129A (zh) | 2021-01-28 | 2021-01-28 | 一种检测Windows操作系统中隐藏的恶意程序进程的方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112861129A (zh) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103400074A (zh) * | 2013-07-09 | 2013-11-20 | 青岛海信传媒网络技术有限公司 | 一种隐藏进程的检测方法及装置 |
CN104715201A (zh) * | 2015-03-31 | 2015-06-17 | 北京奇虎科技有限公司 | 一种虚拟机恶意行为检测方法和系统 |
CN110765456A (zh) * | 2018-11-07 | 2020-02-07 | 北京安天网络安全技术有限公司 | 一种检测隐藏进程的方法、装置及存储设备 |
CN111931192A (zh) * | 2020-09-10 | 2020-11-13 | 杭州海康威视数字技术股份有限公司 | rootkit检测方法、装置及电子设备 |
-
2021
- 2021-01-28 CN CN202110115351.7A patent/CN112861129A/zh active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103400074A (zh) * | 2013-07-09 | 2013-11-20 | 青岛海信传媒网络技术有限公司 | 一种隐藏进程的检测方法及装置 |
CN104715201A (zh) * | 2015-03-31 | 2015-06-17 | 北京奇虎科技有限公司 | 一种虚拟机恶意行为检测方法和系统 |
CN110765456A (zh) * | 2018-11-07 | 2020-02-07 | 北京安天网络安全技术有限公司 | 一种检测隐藏进程的方法、装置及存储设备 |
CN111931192A (zh) * | 2020-09-10 | 2020-11-13 | 杭州海康威视数字技术股份有限公司 | rootkit检测方法、装置及电子设备 |
Non-Patent Citations (3)
Title |
---|
孟晨宇 等: ""Rootkit进程隐藏与检测技术研究"", 《软件导刊》 * |
崔竞松 等: ""创建软件定义网络中的进程级纵深防御体系结构"", 《软件学报》 * |
张德成: ""进程隐藏技术及其在恶意代码检测中的应用"", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8387139B2 (en) | Thread scanning and patching to disable injected malware threats | |
CN109033828B (zh) | 一种基于计算机内存分析技术的木马检测方法 | |
US7340777B1 (en) | In memory heuristic system and method for detecting viruses | |
US8099596B1 (en) | System and method for malware protection using virtualization | |
US11822654B2 (en) | System and method for runtime detection, analysis and signature determination of obfuscated malicious code | |
US8898775B2 (en) | Method and apparatus for detecting the malicious behavior of computer program | |
US8661541B2 (en) | Detecting user-mode rootkits | |
US8397292B2 (en) | Method and device for online secure logging-on | |
US7607173B1 (en) | Method and apparatus for preventing rootkit installation | |
US20100306851A1 (en) | Method and apparatus for preventing a vulnerability of a web browser from being exploited | |
US7665139B1 (en) | Method and apparatus to detect and prevent malicious changes to tokens | |
US20070094496A1 (en) | System and method for kernel-level pestware management | |
US9659173B2 (en) | Method for detecting a malware | |
CN113569244B (zh) | 一种基于处理器跟踪的内存恶意代码检测方法 | |
US7284276B2 (en) | Return-to-LIBC attack detection using branch trace records system and method | |
TW201020845A (en) | Monitor device, monitor method and computer program product thereof for hardware | |
US7860850B2 (en) | Scanning files using direct file system access | |
KR101223594B1 (ko) | Lkm 루트킷 검출을 통한 실시간 운영정보 백업 방법 및 그 기록매체 | |
US20080028462A1 (en) | System and method for loading and analyzing files | |
US8578495B2 (en) | System and method for analyzing packed files | |
EP2341458B1 (en) | Method and device for detecting if a computer file has been copied | |
CN112861129A (zh) | 一种检测Windows操作系统中隐藏的恶意程序进程的方法 | |
Fu et al. | A windows rootkit detection method based on cross-view | |
Kirmani et al. | Analyzing detection avoidance of malware by process hiding | |
Xianghe et al. | Kernel rootkits implement and detection |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210528 |
|
RJ01 | Rejection of invention patent application after publication |