CN118797636A - Memory horse detection method, device and electronic equipment - Google Patents
Memory horse detection method, device and electronic equipment Download PDFInfo
- Publication number
- CN118797636A CN118797636A CN202410763971.5A CN202410763971A CN118797636A CN 118797636 A CN118797636 A CN 118797636A CN 202410763971 A CN202410763971 A CN 202410763971A CN 118797636 A CN118797636 A CN 118797636A
- Authority
- CN
- China
- Prior art keywords
- detected
- class
- detection
- memory
- class object
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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)
- Devices For Executing Special Programs (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及网络安全技术领域,具体而言,涉及一种内存马检测方法、装置及电子设备。The present invention relates to the field of network security technology, and in particular to a memory horse detection method, device and electronic equipment.
背景技术Background Art
随着攻防技术的不断更新迭代,内存马逐渐发展成为一种热门的攻击方式。攻击者通过使用web中间件(位于web服务器和web应用程序之间的软件组件或库,用于实现附加功能、处理请求和向应用程序提供服务)的漏洞或利用链,向目标服务器的内存中注入恶意后门或木马并执行,从而实现远程控制目标服务器,相关技术中,主要采用以下两种方式检测内存马。With the continuous updating and iteration of attack and defense technologies, memory Trojans have gradually developed into a popular attack method. Attackers use vulnerabilities or exploit chains of web middleware (software components or libraries located between web servers and web applications, used to implement additional functions, process requests, and provide services to applications) to inject malicious backdoors or Trojans into the memory of the target server and execute them, thereby remotely controlling the target server. In related technologies, the following two methods are mainly used to detect memory Trojans.
方式一、将检测Java(一种编程语言)内存马的程序注入到待检测进程中,通过重写相关函数,从而获取待检测进程中已被加载的所有Java类的Class字节流进行内存马的检测分析,但是,该方式需要按照Class文件的格式解析所有字节流内容,然后根据解析结果进行内存马检测,检测效率低,并且受JDK(Java Development Kit,Java开发工具包)或JRE(Java Runtime Environment,Java运行时环境)版本差异的影响,该方式存在兼容性问题,需要针对不同版本编写对应的agent(代理检测程序),而且在目标进程中注入检测程序,具有侵入性,另外检测引擎运行于目标JVM(Java虚拟机)中,增加了待检测进程的内存开销,进一步降低内存马的检测效率。Method 1: Inject a program for detecting Java (a programming language) memory malware into the process to be detected, and obtain the Class byte streams of all Java classes loaded in the process to be detected by rewriting related functions to perform memory malware detection and analysis. However, this method requires parsing all byte stream contents according to the format of Class files, and then performing memory malware detection based on the parsing results. The detection efficiency is low, and is affected by the version differences of JDK (Java Development Kit) or JRE (Java Runtime Environment). This method has compatibility issues and requires writing corresponding agents (agent detection programs) for different versions. In addition, the detection program is injected into the target process, which is invasive. In addition, the detection engine runs in the target JVM (Java virtual machine), which increases the memory overhead of the process to be detected, further reducing the detection efficiency of memory malware.
方式二、遍历目标JVM所有的底层类,将类的字节码整个下载下来,并反编译,然后检测待检测进程是否包含内存马,性能低下,检测效率较差。Method 2: traverse all the underlying classes of the target JVM, download the entire bytecode of the class, decompile it, and then detect whether the process to be detected contains memory horses. The performance is low and the detection efficiency is poor.
针对上述的问题,目前尚未提出有效的解决方案。To address the above-mentioned problems, no effective solution has been proposed yet.
发明内容Summary of the invention
本发明实施例提供了一种内存马检测方法、装置及电子设备,以至少解决相关技术中将检测程序注入待检测进程中检测内存马,或者,下载字节码文件进行反编译的方式检测内存马,检测效率低的技术问题。The embodiments of the present invention provide a memory horse detection method, device and electronic device to at least solve the technical problem of low detection efficiency in the related art of injecting a detection program into a process to be detected to detect a memory horse, or downloading a bytecode file for decompilation to detect a memory horse.
根据本发明实施例的一个方面,提供了一种内存马检测方法,包括:确定目标设备中处于运行状态的目标进程;遍历所述目标进程已加载的类对象,并针对遍历到的每一个类对象,根据目标映射缓存,确定是否将所述类对象作为本次检测的待检测类对象,其中,所述目标映射缓存中记录有:进程的进程信息与所述进程的被检测过的类对象信息之间的映射关系;在将遍历到的类对象作为本次检测的待检测类对象的情况下,对所述待检测类对象的常量池进行检测,得到检测结果;根据所述检测结果,确定所述目标进程是否被注入内存马。According to one aspect of an embodiment of the present invention, a memory horse detection method is provided, comprising: determining a target process in a running state in a target device; traversing the class objects loaded by the target process, and for each traversed class object, determining whether to use the class object as a class object to be detected in this detection according to a target mapping cache, wherein the target mapping cache records: a mapping relationship between process information of a process and information on detected class objects of the process; in the case of using the traversed class object as a class object to be detected in this detection, detecting a constant pool of the class object to be detected to obtain a detection result; and determining whether a memory horse is injected into the target process according to the detection result.
进一步地,对所述待检测类对象的常量池进行检测,得到检测结果,包括:确定所述待检测类对象的常量池;基于所述待检测类对象的常量池在所述目标进程的内存中的存储格式,解析所述常量池,得到解析结果;利用目标检测工具加载预设检测规则对所述解析结果进行检测,得到所述待检测类对象对应的检测结果。Furthermore, the constant pool of the object of the class to be detected is detected to obtain a detection result, including: determining the constant pool of the object of the class to be detected; parsing the constant pool based on the storage format of the constant pool of the object of the class to be detected in the memory of the target process to obtain a parsing result; using a target detection tool to load a preset detection rule to detect the parsing result to obtain a detection result corresponding to the object of the class to be detected.
进一步地,所述常量池的存储格式中至少包括:第一数组和第二数组,其中,所述第一数组用于存储所述常量池的类型,所述第二数组用于存储所述常量池的数据;基于所述待检测类对象的常量池在所述目标进程的内存中的存储格式,解析所述常量池,得到解析结果,包括:基于所述第一数组和所述第二数组,解析所述待检测类对象的常量池,得到所述解析结果。Furthermore, the storage format of the constant pool includes at least: a first array and a second array, wherein the first array is used to store the type of the constant pool, and the second array is used to store data of the constant pool; parsing the constant pool based on the storage format of the constant pool of the class object to be detected in the memory of the target process to obtain the parsing result includes: parsing the constant pool of the class object to be detected based on the first array and the second array to obtain the parsing result.
进一步地,基于所述第一数组和所述第二数组,解析所述待检测类对象的常量池,得到所述解析结果,包括:解析所述第一数组,得到所述待检测类对象的常量池的类型,并解析所述第二数组,得到所述待检测类对象的常量池的数据;基于所述常量池的类型,替换所述常量池的数据中的符号引用,得到所述解析结果,其中,所述符号引用表示采用符号描述数据内容。Further, based on the first array and the second array, parsing the constant pool of the class object to be detected to obtain the parsing result includes: parsing the first array to obtain the type of the constant pool of the class object to be detected, and parsing the second array to obtain data of the constant pool of the class object to be detected; based on the type of the constant pool, replacing symbolic references in the data of the constant pool to obtain the parsing result, wherein the symbolic reference indicates that the data content is described by using symbols.
进一步地,内存马检测方法还包括:在被检测过的类对象中存在属性信息发生变化的目标类对象时,根据所述目标类对象的发生变化的属性信息,更新所述目标映射缓存;和/或,在获得所述待检测类对象的常量池对应的检测结果后,根据所述待检测类对象的属性信息以及所述目标进程的进程信息,更新所述目标映射缓存。Furthermore, the memory horse detection method also includes: when there is a target class object whose attribute information has changed in the detected class objects, updating the target mapping cache according to the changed attribute information of the target class object; and/or, after obtaining the detection result corresponding to the constant pool of the class object to be detected, updating the target mapping cache according to the attribute information of the class object to be detected and the process information of the target process.
进一步地,根据目标映射缓存,确定是否将所述类对象作为本次检测的待检测类对象,包括:确定所述目标映射缓存中是否存储有所述类对象的属性信息;在所述目标映射缓存中未存储有所述类对象的属性信息,或者所述类对象的属性信息在上一次检测之后发生变化的情况下,确定将所述类对象作为本次检测的待检测类对象;在所述目标映射缓存中存储有所述类对象的属性信息,且所述类对象的属性信息在上一次检测之后未发生变化的情况下,确定不将所述类对象作为本次检测的待检测类对象。Further, based on the target mapping cache, determining whether to use the class object as the class object to be detected in this detection includes: determining whether the attribute information of the class object is stored in the target mapping cache; determining to use the class object as the class object to be detected in this detection when the attribute information of the class object is not stored in the target mapping cache or the attribute information of the class object has changed after the last detection; determining not to use the class object as the class object to be detected in this detection when the attribute information of the class object is stored in the target mapping cache and the attribute information of the class object has not changed after the last detection.
进一步地,内存马检测方法还包括:在确定不将当前遍历到的第一类对象作为本次检测的待检测类对象的情况下,根据所述目标映射缓存,获取对所述第一类对象的常量池进行检测得到的历史检测结果;根据所述检测结果,确定所述目标进程是否被注入内存马,包括:根据所述第一类对象的历史检测结果以及第二类对象的检测结果,确定所述目标进程是否被注入内存马,其中,所述第二类对象用于作为本次检测的待检测类对象。Furthermore, the memory horse detection method also includes: when it is determined that the first type of object currently traversed is not to be used as the object of the class to be detected in this detection, according to the target mapping cache, obtaining the historical detection result obtained by detecting the constant pool of the first type of object; according to the detection result, determining whether the target process is injected with a memory horse, including: determining whether the target process is injected with a memory horse according to the historical detection result of the first type of object and the detection result of the second type of object, wherein the second type of object is used as the object of the class to be detected in this detection.
根据本发明实施例的另一方面,还提供了一种内存马检测装置,包括:第一确定单元,用于确定目标设备中处于运行状态的目标进程;处理单元,用于遍历所述目标进程已加载的类对象,并针对遍历到的每一个类对象,根据目标映射缓存,确定是否将所述类对象作为本次检测的待检测类对象,其中,所述目标映射缓存中记录有:进程的进程信息与所述进程的被检测过的类对象信息之间的映射关系;检测单元,用于在将遍历到的类对象作为本次检测的待检测类对象的情况下,对所述待检测类对象的常量池进行检测,得到检测结果;第二确定单元,用于根据所述检测结果,确定所述目标进程是否被注入内存马。According to another aspect of an embodiment of the present invention, a memory horse detection device is also provided, including: a first determination unit, used to determine a target process in a running state in a target device; a processing unit, used to traverse the class objects loaded by the target process, and for each traversed class object, determine whether to use the class object as a class object to be detected for this detection according to a target mapping cache, wherein the target mapping cache records: a mapping relationship between process information of a process and information on detected class objects of the process; a detection unit, used to detect a constant pool of the class object to be detected when the traversed class object is used as the class object to be detected for this detection, and obtain a detection result; a second determination unit, used to determine whether a memory horse is injected into the target process according to the detection result.
进一步地,检测单元包括:第一确定子单元,用于确定所述待检测类对象的常量池;解析子单元,用于基于所述待检测类对象的常量池在所述目标进程的内存中的存储格式,解析所述常量池,得到解析结果;检测子单元,用于利用目标检测工具加载预设检测规则对所述解析结果进行检测,得到所述待检测类对象对应的检测结果。Furthermore, the detection unit includes: a first determination subunit, used to determine the constant pool of the object of the class to be detected; a parsing subunit, used to parse the constant pool based on the storage format of the constant pool of the object of the class to be detected in the memory of the target process, and obtain a parsing result; a detection subunit, used to use a target detection tool to load preset detection rules to detect the parsing result, and obtain a detection result corresponding to the object of the class to be detected.
进一步地,所述常量池的存储格式中至少包括:第一数组和第二数组,其中,所述第一数组用于存储所述常量池的类型,所述第二数组用于存储所述常量池的数据;解析子单元包括:解析模块,用于基于所述第一数组和所述第二数组,解析所述待检测类对象的常量池,得到所述解析结果。Furthermore, the storage format of the constant pool includes at least: a first array and a second array, wherein the first array is used to store the type of the constant pool, and the second array is used to store the data of the constant pool; the parsing subunit includes: a parsing module, which is used to parse the constant pool of the class object to be detected based on the first array and the second array to obtain the parsing result.
进一步地,解析模块包括:解析子模块,用于解析所述第一数组,得到所述待检测类对象的常量池的类型,并解析所述第二数组,得到所述待检测类对象的常量池的数据;替换子模块,用于基于所述常量池的类型,替换所述常量池的数据中的符号引用,得到所述解析结果,其中,所述符号引用表示采用符号描述数据内容。Furthermore, the parsing module includes: a parsing submodule, used to parse the first array to obtain the type of the constant pool of the class object to be detected, and to parse the second array to obtain the data of the constant pool of the class object to be detected; a replacement submodule, used to replace the symbolic reference in the data of the constant pool based on the type of the constant pool to obtain the parsing result, wherein the symbolic reference indicates that the data content is described using symbols.
进一步地,内存马检测装置还包括:第一更新单元,用于在被检测过的类对象中存在属性信息发生变化的目标类对象时,根据所述目标类对象的发生变化的属性信息,更新所述目标映射缓存;和/或,第二更新单元,用于在获得所述待检测类对象的常量池对应的检测结果后,根据所述待检测类对象的属性信息以及所述目标进程的进程信息,更新所述目标映射缓存。Furthermore, the memory horse detection device also includes: a first update unit, which is used to update the target mapping cache according to the changed attribute information of the target class object when there is a target class object whose attribute information has changed in the detected class objects; and/or, a second update unit, which is used to update the target mapping cache according to the attribute information of the class object to be detected and the process information of the target process after obtaining the detection result corresponding to the constant pool of the class object to be detected.
进一步地,处理单元,包括:第二确定子单元,用于确定所述目标映射缓存中是否存储有所述类对象的属性信息;第三确定子单元,用于在所述目标映射缓存中未存储有所述类对象的属性信息,或者所述类对象的属性信息在上一次检测之后发生变化的情况下,确定将所述类对象作为本次检测的待检测类对象;第四确定子单元,用于在所述目标映射缓存中存储有所述类对象的属性信息,且所述类对象的属性信息在上一次检测之后未发生变化的情况下,确定不将所述类对象作为本次检测的待检测类对象。Further, the processing unit includes: a second determination subunit, used to determine whether the attribute information of the class object is stored in the target mapping cache; a third determination subunit, used to determine that the class object is used as the class object to be detected in this detection when the attribute information of the class object is not stored in the target mapping cache or the attribute information of the class object has changed after the last detection; and a fourth determination subunit, used to determine that the class object is not used as the class object to be detected in this detection when the attribute information of the class object is stored in the target mapping cache and the attribute information of the class object has not changed since the last detection.
进一步地,内存马检测装置还包括:获取单元,用于在确定不将当前遍历到的第一类对象作为本次检测的待检测类对象的情况下,根据所述目标映射缓存,获取对所述第一类对象的常量池进行检测得到的历史检测结果;第二确定单元包括:处理子单元,用于根据所述第一类对象的历史检测结果以及第二类对象的检测结果,确定所述目标进程是否被注入内存马,其中,所述第二类对象用于作为本次检测的待检测类对象。Furthermore, the memory horse detection device also includes: an acquisition unit, which is used to obtain historical detection results obtained by detecting the constant pool of the first type of object according to the target mapping cache when it is determined that the first type of object currently traversed is not to be used as the object of the class to be detected in this detection; the second determination unit includes: a processing subunit, which is used to determine whether the target process is injected with a memory horse based on the historical detection results of the first type of object and the detection results of the second type of object, wherein the second type of object is used as the object of the class to be detected in this detection.
根据本发明实施例的另一方面,还提供了一种电子设备,包括:处理器;以及存储器,用于存储处理器的可执行指令;其中,处理器配置为经由执行可执行指令来执行本申请实施例中的内存马检测方法。According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the memory horse detection method in the embodiment of the present application by executing the executable instructions.
根据本发明实施例的另一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,其中,在计算机程序运行时控制计算机可读存储介质所在设备执行本申请实施例中的内存马检测方法。According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the memory horse detection method in the embodiment of the present application.
在本发明中,确定目标设备中处于运行状态的目标进程;遍历目标进程已加载的类对象,并针对遍历到的每一个类对象,根据目标映射缓存,确定是否将类对象作为本次检测的待检测类对象,其中,目标映射缓存中记录有:进程的进程信息与进程的被检测过的类对象信息之间的映射关系;在将遍历到的类对象作为本次检测的待检测类对象的情况下,对待检测类对象的常量池进行检测,得到检测结果;根据检测结果,确定目标进程是否被注入内存马。进而解决了相关技术中将检测程序注入待检测进程中检测内存马,或者,下载字节码文件进行反编译的方式检测内存马,检测效率低的技术问题。In the present invention, the target process in the target device that is in the running state is determined; the class objects loaded by the target process are traversed, and for each traversed class object, it is determined according to the target mapping cache whether the class object is used as the class object to be detected in this detection, wherein the target mapping cache records: the mapping relationship between the process information of the process and the class object information of the process that has been detected; in the case of using the traversed class object as the class object to be detected in this detection, the constant pool of the class object to be detected is detected to obtain the detection result; according to the detection result, it is determined whether the target process is injected with a memory horse. This solves the technical problem of low detection efficiency in the related art of injecting a detection program into the process to be detected to detect a memory horse, or downloading a bytecode file for decompilation to detect a memory horse.
在本发明中,通过遍历目标进程中已加载的类对象,查找常量池,通过解析类对象的常量池,确定待检测进程是否被注入内存马,并利用已检测类对象的缓存(即目标映射缓存)来避免重复检测同一个类,达到了无需向待检测进程注入检测程序,获取Class字节流,以及无需下载字节码文件,进行反编译,即可对待检测进程进行内存马检测的目的,从而实现了提高内存马的检测效率的技术效果。In the present invention, by traversing the class objects loaded in the target process and searching the constant pool, it is determined whether the process to be detected is injected with a memory horse by parsing the constant pool of the class object, and the cache of the detected class objects (i.e., the target mapping cache) is used to avoid repeated detection of the same class, so that the purpose of performing memory horse detection on the process to be detected is achieved without injecting a detection program into the process to be detected, obtaining the Class byte stream, and downloading the bytecode file for decompilation, thereby achieving the technical effect of improving the detection efficiency of memory horses.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
图1是根据本发明实施例的一种内存马检测方法的流程图;FIG1 is a flow chart of a memory horse detection method according to an embodiment of the present invention;
图2是根据本发明实施例的一种变量constants与常量池的关系的示意图;FIG2 is a schematic diagram of a relationship between variables constants and a constant pool according to an embodiment of the present invention;
图3是根据本发明实施例的一种数组+链表的Klass查找路线图;FIG3 is a Klass search route map of an array+linked list according to an embodiment of the present invention;
图4是根据本发明实施例的一种链表形式的Klass查找路线图;FIG4 is a Klass search route map in a linked list form according to an embodiment of the present invention;
图5是根据本发明实施例的一种常量池ConstantPool在内存中的布局的示意图;5 is a schematic diagram of a layout of a constant pool ConstantPool in memory according to an embodiment of the present invention;
图6是根据本发明实施例的一种常量池的解析结果的示意图;FIG6 is a schematic diagram of a parsing result of a constant pool according to an embodiment of the present invention;
图7是根据本发明实施例的一种带类对象缓存的Java内存马检测流程的示意图;7 is a schematic diagram of a Java memory horse detection process with class object cache according to an embodiment of the present invention;
图8是根据本发明实施例的一种内存马检测系统的示意图;FIG8 is a schematic diagram of a memory horse detection system according to an embodiment of the present invention;
图9是根据本发明实施例的一种内存马检测装置的示意图;FIG9 is a schematic diagram of a memory horse detection device according to an embodiment of the present invention;
图10是根据本发明实施例的一种电子设备的示意图。FIG. 10 is a schematic diagram of an electronic device according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
需要说明的是,本发明的实施方式或实施例并非穷举,仅为部分实施方式或实施例的示意,不作为对本发明保护范围的具体限制。在不矛盾的情况下,某一实施方式或实施例中的每个步骤均可以作为独立实施例来实施,且各步骤之间可以任意组合,例如,在某一实施方式或实施例中去除部分步骤后的方案也可以作为独立实施例来实施,且在某一实施方式或实施例中各步骤的顺序可以任意交换,另外,某一实施方式或实施例中的可选方式或可选例可以任意组合;此外,各实施方式或实施例之间可以任意组合,例如,不同实施方式或实施例的部分或全部步骤可以任意组合,某一实施方式或实施例可以与其他实施方式或实施例的可选方式或可选例任意组合。It should be noted that the embodiments or examples of the present invention are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present invention. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be arbitrarily combined. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be arbitrarily combined; in addition, the various embodiments or examples can be arbitrarily combined. For example, some or all steps of different embodiments or examples can be arbitrarily combined, and a certain embodiment or example can be arbitrarily combined with the optional methods or optional examples of other embodiments or examples.
为了便于描述,下面对本发明各实施例涉及的部分术语或名词进行解释。For the convenience of description, some terms or nouns involved in the embodiments of the present invention are explained below.
内存马,也被称为无文件马,是一种无文件落盘的攻击手段,相比于常规的攻击手段,内存马由于无文件落地,只存在于内存中,更隐蔽、更难以被发现,Java语言由于在web领域(互联网领域)的流行度,使得Java内存马成为了黑客内存马攻击的重灾区,严重威胁企业的网络资产安全。Memory Trojans, also known as fileless Trojans, are a type of attack method that does not drop files onto disk. Compared with conventional attack methods, memory Trojans are more hidden and difficult to detect because they do not drop files onto disk and only exist in memory. Due to the popularity of the Java language in the web field (Internet field), Java memory Trojans have become a major disaster area for hacker memory Trojan attacks, seriously threatening the security of corporate network assets.
实施例一Embodiment 1
根据本发明实施例,提供了一种内存马检测方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, a method embodiment of a memory horse detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
图1是根据本发明实施例的一种内存马检测方法的流程图,如图1所示,该方法包括如下步骤:FIG. 1 is a flow chart of a memory horse detection method according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:
步骤S101,确定目标设备中处于运行状态的目标进程;Step S101, determining a target process in a running state in a target device;
上述的目标设备可以包括但不限于虚拟机、主机或容器等,上述的目标进程的类型可以包括但不限于Java进程。在Java语言中,Class类文件被JVM加载后,可以生成一个类对象代表这个类,后续要使用这个类时,由类对象生成实例对象使用,也即是的类对象可以表示被JVM加载后的Java类或类文件。The above-mentioned target device may include but is not limited to a virtual machine, a host or a container, etc., and the above-mentioned target process type may include but is not limited to a Java process. In the Java language, after a Class class file is loaded by the JVM, a class object can be generated to represent the class. When the class is to be used later, the class object generates an instance object for use, that is, the class object can represent a Java class or class file loaded by the JVM.
步骤S102,遍历目标进程已加载的类对象,并针对遍历到的每一个类对象,根据目标映射缓存,确定是否将类对象作为本次检测的待检测类对象,其中,目标映射缓存中记录有:进程的进程信息与进程的被检测过的类对象信息之间的映射关系。Step S102, traverse the class objects loaded by the target process, and for each traversed class object, determine whether to use the class object as the class object to be detected in this detection according to the target mapping cache, wherein the target mapping cache records: the mapping relationship between the process information of the process and the detected class object information of the process.
为了避免相关技术中每次对待检测进程进行检测时,需要重复检测同一个类,导致检测效率低的情况,在本实施例中,可以遍历目标进程加载的类对象,对于遍历到的所有类对象,可以基于目标映射缓存,将同一内存地址上的发生变化的类对象作为待检测类对象,而对于同一内存地址的未发生变化的类对象,可以无需作为本次检测的待检测类对象,而同一内存地址的未发生变化的类对象可以直接使用目标映射缓存中的该未发生变化的类对象对应的最后一次检测结果,即避免同一个类对象被重复检测。In order to avoid the situation in the related art where the same class needs to be repeatedly detected each time the process to be detected is detected, resulting in low detection efficiency, in the present embodiment, the class objects loaded by the target process can be traversed, and for all the traversed class objects, the changed class objects at the same memory address can be used as the class objects to be detected based on the target mapping cache, while the unchanged class objects at the same memory address do not need to be used as the class objects to be detected this time, and the unchanged class objects at the same memory address can directly use the last detection result corresponding to the unchanged class object in the target mapping cache, i.e., avoiding repeated detection of the same class object.
上述的目标映射缓存中可以记录已检测过是否被注入内存马的进程的进程信息、该进程所加载的类对象的属性信息以及进程信息与该进程的被检测过的类对象信息之间的映射关系,以便于判断遍历到的每一个类对象在之前是否已被检测过以及该类对象是否已发生变化。The above-mentioned target mapping cache can record the process information of the process that has been detected whether it has been injected into the memory horse, the attribute information of the class object loaded by the process, and the mapping relationship between the process information and the detected class object information of the process, so as to determine whether each traversed class object has been detected before and whether the class object has changed.
本实施例中,进程的进程信息可包括:进程标识;类对象信息可包括:类对象的属性信息,类对象的属性信息包括类对象在内存中的地址、类名、继承的类和接口名称等信息中的至少之一。In this embodiment, the process information of the process may include: process identification; the class object information may include: attribute information of the class object, and the attribute information of the class object includes at least one of the address of the class object in the memory, the class name, the inherited class and interface name, etc.
步骤S103,在将遍历到的类对象作为本次检测的待检测类对象的情况下,对待检测类对象的常量池进行检测,得到检测结果。Step S103, when the traversed class object is used as the class object to be detected in this detection, the constant pool of the class object to be detected is detected to obtain the detection result.
上述的检测结果可以用于表示待检测类对象是否含有内存马,为了避免相关技术中将检测程序注入待检测进程,获取所有Java类的Class字节流,根据Class字节流的解析结果进行内存马检测效率低,且具有侵入性的情况,在本实施例中,若某一个类对象作为本次检测的待检测类对象,可以查找该类对象的常量池,通过解析该类对象的常量池,得到常量池中的具体数据,根据预设的检测规则对常量池的具体数据进行检测,可以确定该类对象是否含有内存马,得到该类对象的检测结果。The above-mentioned detection results can be used to indicate whether the class object to be detected contains memory horse. In order to avoid the situation in which the detection program is injected into the process to be detected in the related technology, the Class byte stream of all Java classes is obtained, and the memory horse detection based on the parsing result of the Class byte stream is inefficient and invasive. In this embodiment, if a certain class object is used as the class object to be detected this time, the constant pool of the class object can be searched, and the specific data in the constant pool can be obtained by parsing the constant pool of the class object. The specific data of the constant pool can be detected according to the preset detection rules, so as to determine whether the class object contains memory horse and obtain the detection result of the class object.
在查找该类对象的常量池时,可以查找含有该类对象关联的常量池的属性信息的类,进而根据查找到类中常量池的属性信息,查找到存储该常量池的内存地址,达到了在内存马检测过程中无需获取Class字节流和下载整个字节码的目的。When searching for the constant pool of the class object, the class containing the attribute information of the constant pool associated with the class object can be searched, and then the memory address storing the constant pool can be found according to the attribute information of the constant pool in the class, thereby achieving the purpose of not having to obtain the Class byte stream and download the entire bytecode during the memory horse detection process.
步骤S104,根据检测结果,确定目标进程是否被注入内存马。Step S104: Determine whether the target process is injected into the memory based on the detection result.
在本实施例中,可以根据待检测类对象是否含有内存马,以及在目标进程加载的所有类对象中除待检测类对象的之外的其他类对象是否含有内存马,确定目标进程是否被注入内存马,例如,若目标进程中至少一个类对象包含内存马的情况下,则可以确定目标进程被注入内存马。In this embodiment, whether the target process is injected with a memory horse can be determined based on whether the class object to be detected contains a memory horse and whether other class objects except the class object to be detected among all class objects loaded by the target process contain a memory horse. For example, if at least one class object in the target process contains a memory horse, it can be determined that the target process is injected with a memory horse.
通过上述步骤,在本实施例中,通过遍历目标设备中已加载的类对象,查找常量池,通过解析类对象的常量池,确定待检测进程是否被注入内存马,并利用已检测类对象的缓存(即目标映射缓存)来避免重复检测同一个类,达到了无需向待检测进程注入检测程序,获取Class字节流,以及无需下载字节码文件,进行反编译,即可对待检测进程进行内存马检测的目的,从而实现了提高内存马的检测效率的技术效果。进而解决了相关技术中将检测程序注入待检测进程中检测内存马,或者,下载字节码文件进行反编译的方式检测内存马,检测效率低的技术问题。Through the above steps, in this embodiment, by traversing the class objects loaded in the target device, searching the constant pool, parsing the constant pool of the class object, determining whether the process to be detected is injected with a memory horse, and using the cache of the detected class object (i.e., the target mapping cache) to avoid repeated detection of the same class, the purpose of performing memory horse detection on the process to be detected without injecting the detection program into the process to be detected, obtaining the Class byte stream, and downloading the bytecode file for decompilation is achieved, thereby achieving the technical effect of improving the detection efficiency of the memory horse. Further, the technical problem of low detection efficiency in the related art of injecting the detection program into the process to be detected to detect the memory horse, or downloading the bytecode file for decompilation to detect the memory horse is solved.
可选地,对待检测类对象的常量池进行检测,得到检测结果,包括:确定待检测类对象的常量池;基于待检测类对象的常量池在目标进程的内存中的存储格式,解析常量池,得到解析结果;利用目标检测工具加载预设检测规则对解析结果进行检测,得到待检测类对象对应的检测结果。Optionally, the constant pool of the object to be detected is detected to obtain a detection result, including: determining the constant pool of the object to be detected; parsing the constant pool based on the storage format of the constant pool of the object to be detected in the memory of the target process to obtain a parsing result; using a target detection tool to load a preset detection rule to detect the parsing result, and obtain a detection result corresponding to the object to be detected.
这里,目标进程的内存可以为在目标设备中分配给目标进程的内存块或内存页。Here, the memory of the target process may be a memory block or a memory page allocated to the target process in the target device.
确定待检测类对象的常量池,可以包括:确定待检测类对象在目标进程的内存中的存储结构,得到存储结构类型;基于存储结构类型,查找目标类,并基于查找到的目标类确定常量池,其中,目标类中记录有常量池的属性。Determining a constant pool of an object of a class to be detected may include: determining a storage structure of the object of the class to be detected in a memory of a target process to obtain a storage structure type; searching for a target class based on the storage structure type, and determining a constant pool based on the found target class, wherein the target class records properties of the constant pool.
例如,为了避免相关技术中将检测程序注入到待检测进程,然后重写相关函数,从而获取被加载的Java的Class字节流,解析Class字节流,才能获取常量池,效率低的情况,在本实施例中,被JVM加载的Java类在内存中会以特定的结构保存,基于类对象关联的Java版本(例如,JDK版本),可以确定待检测类对象在目标进程的内存中的存储结构,得到待检测类对象的存储结构类型,例如,在JDK8、JDK9版本的存储结构类型可以为数组+链表形式(即数组与链表之间进行组合的组合类型),JDK10及以上版本的存储结构类型可以为链表形式(或链表类型)。For example, in order to avoid the low efficiency of injecting the detection program into the process to be detected and then rewriting the related functions to obtain the loaded Java Class byte stream and parse the Class byte stream to obtain the constant pool in the related technology, in this embodiment, the Java class loaded by the JVM will be saved in the memory in a specific structure, and based on the Java version associated with the class object (for example, the JDK version), the storage structure of the class object to be detected in the memory of the target process can be determined to obtain the storage structure type of the class object to be detected. For example, the storage structure type in JDK8 and JDK9 versions can be an array + linked list form (that is, a combination type of an array and a linked list), and the storage structure type in JDK10 and above versions can be a linked list form (or a linked list type).
在得到待检测类对象在目标进程的内存中的存储结构类型后,可以根据存储结构类型,查找目标类,根据目标类中记录的常量池的属性信息,可以确定常量池在内存中的地址,进而找到上述的常量池,例如,图2是根据本发明实施例的一种可选的一种变量constants与常量池的关系的示意图,如图2所示,在InstanceKlass(类对象)中有一个变量“_constants”,表示对应Java类的常量池。After obtaining the storage structure type of the class object to be detected in the memory of the target process, the target class can be found according to the storage structure type. According to the attribute information of the constant pool recorded in the target class, the address of the constant pool in the memory can be determined, and then the above-mentioned constant pool can be found. For example, Figure 2 is a schematic diagram of an optional relationship between a variable constants and a constant pool according to an embodiment of the present invention. As shown in Figure 2, there is a variable "_constants" in InstanceKlass (class object), which represents the constant pool of the corresponding Java class.
根据待检测类对象在内存中的存储结构,查找目标类,进而查找待检测类对象关联的常量池(即常量池),达到了无需入侵目标进程,获取Class字节流,即可确定常量池的目的,实现了提高常量池的获取效率的技术效果。According to the storage structure of the class object to be detected in the memory, the target class is found, and then the constant pool associated with the class object to be detected (i.e., the constant pool) is found, so that the purpose of determining the constant pool can be achieved without invading the target process and obtaining the Class byte stream, thereby achieving the technical effect of improving the efficiency of obtaining the constant pool.
上述的存储结构类型包括下述其中之一:数组与链表之间进行组合的组合类型、链表类型,基于存储结构类型,查找目标类,包括:在存储结构类型为组合类型的情况下,基于指定变量的内存地址,遍历哈希表数组中的链表,查找目标类,其中,哈希表数组用于记录目标类的地址;或者,在存储结构类型为链表类型的情况下,查找到类加载器,并基于类加载器查找目标类,其中,类加载器在目标进程的内存中以链表形式进行存储。The above-mentioned storage structure type includes one of the following: a combination type of an array and a linked list, and a linked list type. Based on the storage structure type, the target class is searched, including: when the storage structure type is a combination type, based on the memory address of the specified variable, traversing the linked list in the hash table array to search for the target class, wherein the hash table array is used to record the address of the target class; or, when the storage structure type is a linked list type, finding the class loader, and searching for the target class based on the class loader, wherein the class loader is stored in the memory of the target process in the form of a linked list.
上述的目标类中可以记录有常量池的属性信息,在存储结构类型为组合类型的情况下,可以基于指定变量的内存地址,遍历哈希表数组中的链表,查找目标类。The above-mentioned target class may record the attribute information of the constant pool. When the storage structure type is a composite type, the linked list in the hash table array may be traversed based on the memory address of the specified variable to find the target class.
图3是根据本发明实施例的一种数组+链表的Klass查找路线图,如图3所示,包括:SystemDictionary(SystemDictionary.hpp)、Dictionary(dictionary.hpp)、TwoQopHashtable<Klass*,mtClass>、Hashtable<Klass*,mtClass>、BasicHashtable<mtClass>、HashTableBucket<mtClass>、BasicHashTableEntry<mtClass>、HashtableEntry<Klass*,mtClass>、Klass、InstanceKlass。Figure 3 is a Klass search route map of an array + linked list according to an embodiment of the present invention. As shown in Figure 3, it includes: SystemDictionary (SystemDictionary.hpp), Dictionary (dictionary.hpp), TwoQopHashtable<Klass*, mtClass>, Hashtable<Klass*, mtClass>, BasicHashtable<mtClass>, HashTableBucket<mtClass>, BasicHashTableEntry<mtClass>, HashtableEntry<Klass*, mtClass>, Klass, InstanceKlass.
其中,SystemDictionary(SystemDictionary.hpp)可以是指libjvm.so(Java虚拟机加载的动态库)中暴露的符号表,用于存储Java类中的变量;Among them, SystemDictionary (SystemDictionary.hpp) can refer to the symbol table exposed in libjvm.so (a dynamic library loaded by the Java virtual machine), which is used to store variables in Java classes;
Dictionary(dictionary.hpp)可以表示哈希表,其组织形式可以为数组+链表,它是TwoQopHashtable<Klass*,mtClass>的一个子类;Dictionary (dictionary.hpp) can represent a hash table, which can be organized in the form of array + linked list. It is a subclass of TwoQopHashtable<Klass*, mtClass>;
TwoQopHashtable<Klass*,mtClass>是一个接受两个参数的模板类,用于实现一个哈希表,(Klass*表示键的类型;mtClass表示值的类型);它是Hashtable<Klass*,mtClass>的子类;TwoQopHashtable<Klass*, mtClass> is a template class that accepts two parameters and is used to implement a hash table (Klass* represents the type of the key; mtClass represents the type of the value); it is a subclass of Hashtable<Klass*, mtClass>;
Hashtable<Klass*,mtClass>也是一个哈希表的实现,是BasicHashtable<mtClass>的子类;Hashtable<Klass*, mtClass> is also an implementation of a hash table and a subclass of BasicHashtable<mtClass>;
BasicHashtable<mtClass>表示一个基本的哈希表数据结构,它的成员变量_table_size表示桶的数量(哈希表数组长度),_buckets表示哈希表数组;BasicHashtable<mtClass> represents a basic hash table data structure. Its member variable _table_size represents the number of buckets (the length of the hash table array), and _buckets represents the hash table array.
HashTableBucket<mtClass>哈希表中桶的实现,是一个数据结构,用于存储哈希表中的元素,每个桶可以存储一个或多个元素;HashTableBucket<mtClass> is the implementation of a bucket in a hash table. It is a data structure used to store elements in a hash table. Each bucket can store one or more elements.
BasicHashTableEntry<mtClass>是一个通用的数据结构,用于表示哈希表桶中存储的数据,通过它的_next成员变量可以找到同一个桶中下一个数据;BasicHashTableEntry<mtClass> is a general data structure used to represent the data stored in a hash table bucket. Its _next member variable can be used to find the next data in the same bucket.
HashtableEntry<Klass*,mtClass>是BasicHashTableEntry<mtClass>的子类,存储了Klass的地址;HashtableEntry<Klass*, mtClass> is a subclass of BasicHashTableEntry<mtClass>, which stores the address of Klass;
InstanceKlass是Klass的子类,表示类对象。InstanceKlass is a subclass of Klass and represents a class object.
下面结合图3对查找Klass(对应于上述的目标类)的流程进行举例说明:The following is an example of the process of finding Klass (corresponding to the above target class) in conjunction with Figure 3:
(1)解析gHotSpotVMStructs中的SystemDictionary,BasicHashTable,BasicHashTableEntry,HashTableEntry等关键成员变量(对应于上述的指定变量)的内存地址;(1) Parse the memory addresses of key member variables such as SystemDictionary, BasicHashTable, BasicHashTableEntry, and HashTableEntry in gHotSpotVMStructs (corresponding to the specified variables mentioned above);
(2)SystemDictionary::_dictionary是static(静态)变量,故可以直接读取_dictionary在内存中的地址。它是一个指针,可以指向Dictionary(Dictionary可视作一个哈希表,是BasicHashTable的子类,哈希表的组织形式可以为数组+链表)。(2) SystemDictionary::_dictionary is a static variable, so the address of _dictionary in memory can be directly read. It is a pointer that can point to Dictionary (Dictionary can be regarded as a hash table, which is a subclass of BasicHashTable. The organization form of the hash table can be array + linked list).
(3)BasicHashTable<mtClass>::_table_size表示哈希表数组的长度,BasicHashTable<mtClass>::_buckets表示哈希表数组,里面每个元素是一个list(链表),list中每一个节点是BasicHashTableEntry,结合BasicHashTableEntry::_next(链表的下一个条目)可以遍历这条链表,从而获取哈希表中所有的HashTableEntry节点。(3) BasicHashTable<mtClass>::_table_size represents the length of the hash table array, BasicHashTable<mtClass>::_buckets represents the hash table array, each element in it is a list (linked list), and each node in the list is a BasicHashTableEntry. Combined with BasicHashTableEntry::_next (the next entry in the linked list), this linked list can be traversed to obtain all HashTableEntry nodes in the hash table.
(4)而HashTableEntry::_literal指向了Klass,由此,即可以找到了一个被JVM加载的Java类。(4) HashTableEntry::_literal points to Klass, from which a Java class loaded by the JVM can be found.
在存储结构类型为链表类型的情况下,可以先查找类加载器,查找到类加载器,然后利用类加载器查找到被加载的目标类,进而找到待检测类对象的常量池。When the storage structure type is a linked list type, the class loader may be searched first, the class loader may be found, and then the loaded target class may be found using the class loader, and then the constant pool of the class object to be detected may be found.
图4是根据本发明实施例的一种链表形式的Klass查找路线图,如图4所示,包括:ClassLoaderDataGraph(classLoaderData.hpp)、ClassLoaderData(classLoaderData.hpp)、Klass(对应于目标类)和InstanceKlass,其中,ClassLoaderDataGraph(classLoaderData.hpp)通过链表的形式将类加载器组织起来,ClassLoaderData(classLoaderData.hpp)表示具体的类加载器,Klass对应于上述的目标类,InstanceKlass表示类对象。Figure 4 is a Klass search route map in the form of a linked list according to an embodiment of the present invention. As shown in Figure 4, it includes: ClassLoaderDataGraph (classLoaderData.hpp), ClassLoaderData (classLoaderData.hpp), Klass (corresponding to the target class) and InstanceKlass, wherein ClassLoaderDataGraph (classLoaderData.hpp) organizes the class loaders in the form of a linked list, ClassLoaderData (classLoaderData.hpp) represents a specific class loader, Klass corresponds to the above-mentioned target class, and InstanceKlass represents a class object.
下面结合图4对查找Klass的流程进行举例说明:The following is an example of the process of finding Klass with reference to Figure 4:
解析gHotSpotVMStructs(符号表)中的ClassLoaderDataGraph,ClassLoaderData,Klass关键成员变量的内存地址;Parse the memory addresses of the ClassLoaderDataGraph, ClassLoaderData, and Klass key member variables in gHotSpotVMStructs (symbol table);
ClassLoaderDataGraph::_head(类加载器的链表的头部节点,链表中的节点表示了当前目标进程中所有的类加载器)是static(静态)变量,故可以直接读取_head在内存中的地址。ClassLoaderDataGraph::_head (the head node of the class loader's linked list, the nodes in the linked list represent all the class loaders in the current target process) is a static variable, so the address of _head in memory can be read directly.
从_head指针开始,可以通过读取ClassLoaderData::_next可遍历所有ClassLoaderData对象(类加载器);Starting from the _head pointer, you can traverse all ClassLoaderData objects (class loaders) by reading ClassLoaderData::_next;
从ClassLoaderData::_klasses开始,可以通过读取Klass::_next_link(一个指针,代表下一个被同一类加载器加载的类对象的地址)可遍历所有被当前ClassLoaderData加载的Klass(即目标类)。Starting from ClassLoaderData::_klasses, you can traverse all Klass (i.e. target class) loaded by the current ClassLoaderData by reading Klass::_next_link (a pointer representing the address of the next class object loaded by the same class loader).
根据被JVM加载的Java类在内存中的存储结构,查找含有常量池的属性信息(或变量)的目标类,避免了相关技术中采用注入检测程序的方式,下载Class字节流,进行确定常量池的效率低的情况下,实现了提高常量池的查找效率的技术效果。According to the storage structure of the Java class loaded by the JVM in the memory, the target class containing the attribute information (or variables) of the constant pool is searched, avoiding the low efficiency of downloading the Class byte stream to determine the constant pool by injecting a detection program in the related technology, and achieving the technical effect of improving the search efficiency of the constant pool.
在本实施例中,还可以基于常量池在目标进程的内存中的存储格式,解析常量池,得到解析结果。In this embodiment, the constant pool may also be parsed based on the storage format of the constant pool in the memory of the target process to obtain a parsing result.
上述的常量池在目标进程的内存中的存储格式可以是指常量池在内存中的布局或存储方式,不同类型的常量池在内存中的存储方式不同,在本实施例中,可以按照JVM保存常量池的格式,对常量池进行解析,得到常量池的具体数据,即得到上述的解析结果。The storage format of the above-mentioned constant pool in the memory of the target process may refer to the layout or storage method of the constant pool in the memory. Different types of constant pools have different storage methods in the memory. In this embodiment, the constant pool may be parsed according to the format in which the JVM saves the constant pool to obtain specific data of the constant pool, that is, the above-mentioned parsing result.
利用目标检测工具加载预设检测规则对解析结果进行检测,可以确定待检测类对象是否含有内存马。By using the target detection tool to load the preset detection rules to detect the parsing results, it can be determined whether the object of the class to be detected contains memory horses.
上述的目标检测工具可以根据预设的检测规则对常量池的具体数据进行检测,以确定待检测类对象是否包含内存马,上述的目标检测工具可以包括但不限于:yara(恶意代码检测工具,一种用于恶意软件分析和检测的工具),利用目标检测工具可以加载预先定义的包含Java内存马特征的规则(即预设检测规则),然后可以使用预先定义的规则来检测常量池中的解析结果中是否包含这些特征,从而确定待检测进程中对应的Java类(即待检测类对象)是否包含内存马,得到待检测类对象的检测结果。The above-mentioned target detection tool can detect the specific data of the constant pool according to the preset detection rules to determine whether the class object to be detected contains a memory horse. The above-mentioned target detection tool may include but is not limited to: Yara (a malicious code detection tool, a tool for malware analysis and detection). The target detection tool can be used to load pre-defined rules containing Java memory horse features (i.e., preset detection rules), and then the pre-defined rules can be used to detect whether the parsing results in the constant pool contain these features, thereby determining whether the corresponding Java class in the process to be detected (i.e., the class object to be detected) contains a memory horse, and obtaining the detection result of the class object to be detected.
通过解析待检测类对象的常量池的解析结果,来判断待检测类对象是否包含内存马,避免下载类对象的字节码,无需反编译字节码,达到了提升检测性能的目的。在本实施例中,还可以建立已检测类对象的缓存(对应于目标映射缓存),对于没发生变化的,已检测过的类对象,可以不再重复检测,直接用上一次的结果,达到了提高检测效率的目的。By parsing the parsing result of the constant pool of the class object to be detected, it is determined whether the class object to be detected contains a memory horse, avoiding downloading the bytecode of the class object, and there is no need to decompile the bytecode, thereby achieving the purpose of improving the detection performance. In this embodiment, a cache of the detected class objects (corresponding to the target mapping cache) can also be established. For the class objects that have not changed and have been detected, it is not necessary to repeat the detection, and the result of the last time can be used directly, thereby achieving the purpose of improving the detection efficiency.
可选地,常量池的存储格式中至少包括:第一数组和第二数组,其中,第一数组用于存储常量池的类型,第二数组用于存储常量池的数据;基于待检测类对象的常量池在目标进程的内存中的存储格式,解析常量池,得到解析结果,包括:基于第一数组和第二数组,解析待检测类对象的常量池,得到解析结果。Optionally, the storage format of the constant pool includes at least: a first array and a second array, wherein the first array is used to store the type of the constant pool, and the second array is used to store data in the constant pool; based on the storage format of the constant pool of the class object to be detected in the memory of the target process, parsing the constant pool to obtain the parsing result includes: parsing the constant pool of the class object to be detected based on the first array and the second array to obtain the parsing result.
图5是根据本发明实施例的一种常量池ConstantPool在内存中的布局的示意图,如图5所示,包括继承自父类的虚表指针、ConstantPool(常量池)类自己的成员变量、以及_length个指针宽度的常量池数据。Figure 5 is a schematic diagram of the layout of a constant pool ConstantPool in memory according to an embodiment of the present invention. As shown in Figure 5, it includes a virtual table pointer inherited from a parent class, member variables of the ConstantPool (constant pool) class itself, and constant pool data of _length pointer width.
图5中的_tags(对应于第一数组)可以是指一个数组,数组中每一个元素可以表示一个常量池的类型,常量池的总项数(或者称为数组的长度)可以由_length来保存。JVM在加载Java类时,可以将常量池的类型存放到ConstantPool类中的_tags数组中,而具体的常量池数据存储到ConstantPool类后开辟的length个指针宽度的空间中,也可以称是length长度的指针数组(对应于上述的第二数组),这两个数组的下标一一对应。(即:_tags数组中可以只保存常量池的类型,而指针数组中对应下标的元素中保存了常量池的具体信息或具体数据),在本实施例中,可以基于_tags数组和指针数据两者一起来解析常量池,得到上述的解析结果。_tags in FIG. 5 (corresponding to the first array) may refer to an array, each element in the array may represent the type of a constant pool, and the total number of items in the constant pool (or the length of the array) may be saved by _length. When loading a Java class, the JVM may store the type of the constant pool in the _tags array in the ConstantPool class, and the specific constant pool data may be stored in a space of length pointer widths opened up after the ConstantPool class, which may also be referred to as a pointer array of length length (corresponding to the second array mentioned above), and the subscripts of the two arrays correspond one to one. (That is, the _tags array may only store the type of the constant pool, and the corresponding subscript element in the pointer array stores the specific information or specific data of the constant pool). In this embodiment, the constant pool may be parsed based on both the _tags array and the pointer data to obtain the above-mentioned parsing result.
在一种示例中,在JVM的内存中,常量池类型可能的取值有如下几种:In one example, in the JVM's memory, the possible values of the constant pool type are as follows:
常量池存储形式示例如下:The following are examples of constant pool storage formats:
(1)关于JVM_CONSTANT_Utf8/JVM_CONSTANT_String,字符类型的常量池,指针数组(即第二数组)中存放的可以是一个指针,指向一个Symbol对象(符号对象,是一种用于表示字符串常量的特殊对象)。Symbol结构如表1所示。(1) Regarding JVM_CONSTANT_Utf8/JVM_CONSTANT_String, the constant pool of character type, the pointer array (i.e., the second array) may store a pointer pointing to a Symbol object (a symbol object is a special object used to represent a string constant). The Symbol structure is shown in Table 1.
表1Table 1
其中,“length”表示存放的字符长度,“_body[1]”表示存放的字符的开始地址,从该地址开始往后连续的length个字节便是具体的常量池数据。Among them, "length" indicates the length of the stored characters, "_body[1]" indicates the starting address of the stored characters, and the length bytes from this address onwards are the specific constant pool data.
(2)关于JVM_CONSTANT_Long/JVM_CONSTANT_Double,long型、double型数值类型常量池,在指针数组中可以占用了八个字节来存放对应的数据值,高4字节存储high_bytes,低4字节存储low_bytes。(2) Regarding JVM_CONSTANT_Long/JVM_CONSTANT_Double, the long and double numeric type constant pools can occupy eight bytes in the pointer array to store the corresponding data values, with the upper 4 bytes storing high_bytes and the lower 4 bytes storing low_bytes.
(3)关于JVM_CONSTANT_Class/JVM_CONSTANT_UnresolvedClass,Class项比较特殊,其对应的常量池类型可能为JVM_CONSTANT_Class或JVM_CONSTANT_UnresolvedClass,如果是JVM_CONSTANT_Class,指针数组中可以存放的是一个指向Klass*的指针(二级指针),通过它可以解析得到调用的类名,如果是JVM_CONSTANT_UnresolvedClass,图5中_length个指针宽度(即指针数组)中可以存放的是一个CPSlot(Symbol*s)对象(一个最低位做了置1处理的Symbol指针)。(3) Regarding JVM_CONSTANT_Class/JVM_CONSTANT_UnresolvedClass, the Class item is quite special. Its corresponding constant pool type may be JVM_CONSTANT_Class or JVM_CONSTANT_UnresolvedClass. If it is JVM_CONSTANT_Class, the pointer array can store a pointer to Klass* (secondary pointer), through which the called class name can be resolved. If it is JVM_CONSTANT_UnresolvedClass, the pointer width of _length in Figure 5 (i.e., the pointer array) can store a CPSlot(Symbol*s) object (a Symbol pointer with the lowest bit set to 1).
在本实施例中,利用第一数组和第二数组两者一起来解析常量池,得到常量池的具体数据,可以便于提高后续进行内存马检测的检测结果的精准度。In this embodiment, the first array and the second array are used together to parse the constant pool to obtain specific data of the constant pool, which can improve the accuracy of the detection result of the subsequent memory horse detection.
可选地,基于第一数组和第二数组,解析待检测类对象的常量池,得到解析结果,包括:解析第一数组,得到待检测类对象的常量池的类型,并解析第二数组,得到待检测类对象的常量池的数据;基于常量池的类型,替换常量池的数据中的符号引用,得到解析结果,其中,符号引用表示采用符号描述数据内容。Optionally, based on the first array and the second array, parsing the constant pool of the class object to be detected to obtain a parsing result includes: parsing the first array to obtain the type of the constant pool of the class object to be detected, and parsing the second array to obtain the data of the constant pool of the class object to be detected; based on the type of the constant pool, replacing the symbolic reference in the data of the constant pool to obtain the parsing result, wherein the symbolic reference indicates that the data content is described using symbols.
图6是根据本发明实施例的一种常量池的解析结果的示意图,结合图6对常量池的解析结果进行说明。FIG. 6 is a schematic diagram of a parsing result of a constant pool according to an embodiment of the present invention. The parsing result of the constant pool is described in conjunction with FIG. 6 .
图6中最左侧方框中为(1)解析后的_tags数组内容,存储有常量池的类型;图6中间方框中(2)_length个指针宽度存放的常量池数据,解析后的第二数组中存储的内容,即常量池的具体数据(带符号引用);图6中最右侧方框是(3)反解后的产物:对于符号引用会进一步解析得到其文本描述,即替换掉符号引用之后得到的常量池的数据(解析结果),解析结果可以用于进行内存马检测。The leftmost box in Figure 6 shows (1) the parsed _tags array content, which stores the type of the constant pool; the middle box in Figure 6 shows (2) the constant pool data stored in _length pointer widths, which is the content stored in the second array after parsing, i.e., the specific data of the constant pool (with symbolic references); the rightmost box in Figure 6 shows (3) the product after inverse parsing: the symbolic reference will be further parsed to obtain its text description, i.e., the constant pool data obtained after replacing the symbolic reference (parsing result), which can be used for memory horse detection.
图6中,#1所在行的常量池数据为“#4.#22”,而“#4.#22”为符号引用,此时可以对#4.#22进行替换,具体如下:In Figure 6, the constant pool data of the row where #1 is located is "#4.#22", and "#4.#22" is a symbol reference. At this time, #4.#22 can be replaced as follows:
对#4进行替换:_tags数组中#4所在行对应的常量池数据为#26,此时#26也为符号引用,可以对#26在进行替换,_tags数组中#26对应的常量池数据为java/Lang/Object不是符号引用,因此,#4替换掉符号引用后可以为java/Lang/Object;Replace #4: The constant pool data corresponding to the row where #4 is located in the _tags array is #26. At this time, #26 is also a symbolic reference, so #26 can be replaced. The constant pool data corresponding to #26 in the _tags array is java/Lang/Object, not a symbolic reference. Therefore, after replacing the symbolic reference, #4 can be java/Lang/Object.
对#22进行替换:_tags数组中#22所在行对应的常量池数据为#12:#13,仍然为符号引用,_tags数组中#12所在行对应的常量池数据为<init>,_tags数组中#13所在行对应的常量池数据为()v,也即是,#22替换掉符号引用后,可以为”<init>”:()v;Replace #22: The constant pool data corresponding to the row where #22 is located in the _tags array is #12:#13, which is still a symbolic reference. The constant pool data corresponding to the row where #12 is located in the _tags array is <init>, and the constant pool data corresponding to the row where #13 is located in the _tags array is ()v. That is, after replacing the symbolic reference in #22, it can be "<init>":()v.
因此,#1所在行的常量池数据#4.#22替换掉符号引用后,可以为java/Lang/Object.”<init>”:()v。Therefore, after replacing the symbolic reference in the constant pool data #4.#22 in the line where #1 is located, it can be java/Lang/Object."<init>":()v.
利用_tags数组和指针数据两者一起来解析常量池,得到常量池的具体数据,可以便于提高后续进行内存马检测的检测结果的精准度。By using the _tags array and pointer data together to parse the constant pool and obtain the specific data of the constant pool, it is convenient to improve the accuracy of the subsequent memory horse detection results.
可选地,内存马检测方法还包括:在被检测过的类对象中存在属性信息发生变化的目标类对象时,根据目标类对象的发生变化的属性信息,更新目标映射缓存;和/或,在根据待检测类对象的常量池,完成检测目标进程是否被注入内存马后,根据待检测类对象的属性信息以及目标进程的进程信息,更新目标映射缓存。Optionally, the memory horse detection method also includes: when there is a target class object whose attribute information has changed in the detected class objects, updating the target mapping cache according to the changed attribute information of the target class object; and/or, after completing the detection of whether the target process is injected with a memory horse based on the constant pool of the class object to be detected, updating the target mapping cache according to the attribute information of the class object to be detected and the process information of the target process.
由于在整个JVM的生命周期中,如果这个类没有发生过变动,它不会被重新加载,即类对象不会更新,因此,为了避免相关技术中对同一个类对象重复检测,内存马检测效率低的情况,在本实施例中,可以设置目标映射缓存,在首次响应检测请求的情况下(即首次检测待检测进程是否被注入内存马的情况下),可以创建目标映射缓存,以保存被检测过的进程相关的类对象的一些基本属性(例如:在内存中的地址、类名、继承的类或接口名称等信息)(对应于属性信息),当这些基本属性都没有发生过变更时,说明该类对象未发生过变更,无需再重复检测它,可以直接使用上一次的检测结果,在根据待检测类对象的常量池,完成检测目标进程是否被注入内存马后,还可以根据此次的检测结果,更新目标映射缓存,例如,可以在目标映射缓存中,对发生变化的目标类对象的属性信息进行更新以及根据该目标类对象的本次检测结果,对该目标类对象的是否包含内存马的检测结果进行更新。Since during the entire life cycle of the JVM, if this class has not changed, it will not be reloaded, that is, the class object will not be updated. Therefore, in order to avoid repeated detection of the same class object in the related art and the low efficiency of memory horse detection, in this embodiment, a target mapping cache can be set. In the case of the first response to the detection request (that is, the first detection of whether the process to be detected is injected with a memory horse), a target mapping cache can be created to save some basic attributes of the class object related to the detected process (for example: the address in the memory, the class name, the inherited class or interface name, etc.) (corresponding to the attribute information). When these basic attributes have not changed, it means that the class object has not changed, and there is no need to detect it again. The last detection result can be used directly. After completing the detection of whether the target process is injected with a memory horse based on the constant pool of the class object to be detected, the target mapping cache can also be updated according to the detection result of this time. For example, the attribute information of the changed target class object can be updated in the target mapping cache, and the detection result of whether the target class object contains a memory horse can be updated according to the current detection result of the target class object.
在一种示例中,可以用ParsedClassInfo(一种数据结构,用于存储和表示已解析的类对象的信息)保存一个被检测过的Java类的基本属性,当类对象的这些属性没有发生变化时,则认为该Java类没有发生变化。用ParedClassesCache.ClassesCacheMap(ParedClassesCache是一个用来管理已被检测过的类对象的类;ClassesCacheMap是它的成员变量,里面存储了具体的类对象的信息,即:ParsedClassInfo)保存Java进程的标识和该进程中所有被检测过的Java类的基本属性,所保存的信息可以随每次检测实时更新,并被持久化保存在磁盘中,达到了保证目标映射缓存中的类对象的信息实时性的目的。In one example, ParsedClassInfo (a data structure used to store and represent information about parsed class objects) can be used to save the basic properties of a detected Java class. When these properties of the class object have not changed, it is considered that the Java class has not changed. ParedClassesCache.ClassesCacheMap (ParedClassesCache is a class used to manage detected class objects; ClassesCacheMap is its member variable, which stores information about specific class objects, namely: ParsedClassInfo) is used to save the identifier of the Java process and the basic properties of all detected Java classes in the process. The saved information can be updated in real time with each detection and is persistently saved on disk, achieving the purpose of ensuring the real-time information of the class objects in the target mapping cache.
可选地,根据目标映射缓存,确定是否将类对象作为本次检测的待检测类对象,包括:确定目标映射缓存中是否存储有类对象的属性信息;在目标映射缓存中未存储有类对象的属性信息,或者类对象的属性信息在上一次检测之后发生变化的情况下,确定将类对象作为本次检测的待检测类对象;在目标映射缓存中存储有类对象的属性信息,且类对象的属性信息在上一次检测之后未发生变化的情况下,确定不将类对象作为本次检测的待检测类对象。Optionally, based on the target mapping cache, determining whether to use the class object as the class object to be detected in this detection includes: determining whether attribute information of the class object is stored in the target mapping cache; determining to use the class object as the class object to be detected in this detection if attribute information of the class object is not stored in the target mapping cache, or if the attribute information of the class object has changed after the last detection; determining not to use the class object as the class object to be detected in this detection if attribute information of the class object is stored in the target mapping cache and the attribute information of the class object has not changed after the last detection.
在首次响应检测请求的情况下,可以将待检测进程所加载的所有类对象作为待检测进程,也即是在首次对待检测进程进行检测的情况下,可以解析待检测进程所加载的所有类对象的常量池,并根据所有类对象的常量池的解析结果,确定待检测进程是否被注入内存马。In the case of the first response to the detection request, all class objects loaded by the process to be detected can be used as the process to be detected. That is, when the process to be detected is detected for the first time, the constant pool of all class objects loaded by the process to be detected can be parsed, and based on the parsing results of the constant pool of all class objects, it is determined whether the process to be detected is injected into the memory horse.
为了避免相关技术中每次检测都要检测目标JVM所有的底层类,检测效率低的情况,在非首次响应检测请求的情况下,可以基于目标映射缓存中记录的信息,判断待检测进程所加载的每个类对象是否发生变化,对于未发生变化的类对象可以无需重复检测,此时,可以只将发生变化的类对象作为待检测类对象。In order to avoid the situation in related technologies where each detection requires detecting all underlying classes of the target JVM, which results in low detection efficiency, in the case of not the first response to a detection request, it is possible to determine whether each class object loaded by the process to be detected has changed based on the information recorded in the target mapping cache. There is no need to repeat the detection for class objects that have not changed. In this case, only the class objects that have changed can be used as class objects to be detected.
例如,在本实施例中,可以判断与目标映射缓存中的类对象为同一内存地址的类对象是否发生变化(例如,类对象的基本属性是否发生变更),在与目标映射缓存中的类对象为同一内存地址的类对象未发生变化的情况下,该类对象可以直接使用上一次的检测结果,无需对该类对象进行再次检测,也即是未发生变化的类对象可以无需作为上述的待检测类对象。在与目标映射缓存中的类对象为同一内存地址的类对象发生变化的情况下,可以将该类对象作为待检测类对象,也即可以对该类对象的常量池重新进行解析,基于解析结果检测该类对象是否包含内存马,并且还可以根据检测结果更新目标映射缓存中对应的缓存信息,达到了对于同一内存地址上的Java类,未发生变化的对象类无需再重新检测的目的,实现了提高内存马的检测效率的技术效果。For example, in this embodiment, it can be determined whether the class object with the same memory address as the class object in the target mapping cache has changed (for example, whether the basic attributes of the class object have changed). In the case that the class object with the same memory address as the class object in the target mapping cache has not changed, the class object can directly use the last detection result without re-detecting the class object, that is, the class object that has not changed does not need to be used as the above-mentioned class object to be detected. In the case that the class object with the same memory address as the class object in the target mapping cache has changed, the class object can be used as the class object to be detected, that is, the constant pool of the class object can be re-parsed, and the class object can be detected based on the parsing result to determine whether it contains a memory horse, and the corresponding cache information in the target mapping cache can also be updated according to the detection result, so as to achieve the purpose of not needing to re-detect the object class that has not changed for the Java class at the same memory address, and realize the technical effect of improving the detection efficiency of memory horses.
图7是根据本发明实施例的一种带类对象缓存的Java内存马检测流程的示意图,下面结合图7对内存马的检测流程进行举例说明:FIG. 7 is a schematic diagram of a Java memory horse detection process with class object cache according to an embodiment of the present invention. The memory horse detection process is illustrated below with reference to FIG. 7 :
检测引擎启动时,可以将ClassesCacheMap信息(类对象缓存信息)读取进内存中,当首次检测一个待检测Java进程(对应于待检测进程)时,由于没有其类对象缓存信息,可以建立缓存(即目标映射缓存);当再次检测该进程时,对于同一内存地址上的Java类,可以先根据ParsedClassInfo信息(即Java类的基本属性)判断其是否发生变化,如果没有,则可以无需重复解析检测该Java类,直接使用上一次的检测结果(即同一进程的同一内存地址上的同一Klass无需重复检测),如果和ParsedClassInfo中的信息不一致,则需要进一步解析、检测,并上报检测结果,更新对应缓存信息。When the detection engine is started, the ClassesCacheMap information (class object cache information) can be read into the memory. When a Java process to be detected is detected for the first time (corresponding to the process to be detected), since there is no class object cache information, a cache (i.e., a target mapping cache) can be established; when the process is detected again, for the Java class at the same memory address, it can be determined whether it has changed based on the ParsedClassInfo information (i.e., the basic properties of the Java class). If not, there is no need to repeatedly parse and detect the Java class, and the last detection result can be used directly (i.e., the same Klass at the same memory address of the same process does not need to be detected repeatedly). If it is inconsistent with the information in ParsedClassInfo, further analysis and detection are required, and the detection results are reported to update the corresponding cache information.
基于目标映射缓存,避免未发生变化的Java类被重复检测,导致内存马检测效率低的情况,从而实现了提高内存马的检测效率的技术效果。Based on the target mapping cache, the Java classes that have not changed are prevented from being repeatedly detected, which leads to low efficiency in memory horse detection, thereby achieving the technical effect of improving the efficiency of memory horse detection.
可选地,内存马检测方法还包括:在确定不将当前遍历到的第一类对象作为本次检测的待检测类对象的情况下,根据目标映射缓存,获取对第一类对象的常量池进行检测得到的历史检测结果;根据检测结果,确定目标进程是否被注入内存马,包括:根据第一类对象的历史检测结果以及第二类对象的检测结果,确定目标进程是否被注入内存马,其中,第二类对象用于作为本次检测的待检测类对象。Optionally, the memory horse detection method also includes: when it is determined that the first-class object currently traversed is not to be used as the class of object to be detected in this detection, according to the target mapping cache, obtaining the historical detection results obtained by detecting the constant pool of the first-class object; according to the detection results, determining whether the target process is injected with a memory horse, including: determining whether the target process is injected with a memory horse according to the historical detection results of the first-class object and the detection results of the second-class object, wherein the second-class object is used as the class of object to be detected in this detection.
上述的第一类对象可以是指遍历到的所有类对象中,在上一次进行内存马检测后,未发生变化的类对象(即遍历到的目标进程的所有类对象中,除待检测类对象之外的类对象),对于第一类对象可以无需解析常量池,直接使用第一类对象的最后一次检测的检测结果,即从目标映射缓存中,读取第一类对象的常量池进行内存马检测的上一次检测结果(即历史检测结果)。The above-mentioned first category objects may refer to class objects that have not changed after the last memory horse detection among all the traversed class objects (that is, class objects other than the class objects to be detected among all the traversed target process). For the first category objects, there is no need to parse the constant pool, and the detection result of the last detection of the first category objects can be used directly, that is, the constant pool of the first category objects is read from the target mapping cache to perform the last detection result of the memory horse detection (that is, the historical detection result).
上述的第二类对象可以是指本次检测的待检测类对象,根据第一类对象的历史检测结果(即第一类对象是否包含内存马),以及第二类对象的检测结果(即第二类对象是否包含内存马),可以确定目标进程是否被注入内存马,避免了未发生变化的同一类对象被重复检测的情况,实现了提高内存马的检测效率的技术效果。The above-mentioned second category of objects may refer to the objects to be detected in this detection. Based on the historical detection results of the first category of objects (i.e., whether the first category of objects contain memory horses) and the detection results of the second category of objects (i.e., whether the second category of objects contain memory horses), it can be determined whether the target process is injected with memory horses, thereby avoiding the situation where the same category of objects that have not changed are repeatedly detected, and achieving the technical effect of improving the detection efficiency of memory horses.
在一种示例中,还可以将最终的检测结果(即目标进程是否被注入内存马)上报给安全防护中心,以及时应对内存马攻击,提高网络安全性。In one example, the final detection result (i.e., whether the target process is injected with a memory horse) can also be reported to the security protection center to respond to the memory horse attack in a timely manner and improve network security.
需要说明的是,本实施例提供的内存马检测方法还可以适用于混合云场景中JDK/JRE版本为8及以上的Java内存马检测,且不论目标进程是运行在主机或容器中,一种示例中,在一个既有主机又有容器的环境中,运行有各自具有不同作用的Java业务进程,有的进程存在于主机上,有的存在于容器上,且由于历史原因,运行Java进程的JDK\JRE的版本不尽相同,从比较旧的1.8版本到最新的21都存在,通过本实施例,可以高效地完成所有Java业务进程的内存马检测。It should be noted that the memory horse detection method provided in this embodiment can also be applied to Java memory horse detection in hybrid cloud scenarios with JDK/JRE version 8 and above, regardless of whether the target process is running on the host or in a container. In one example, in an environment with both hosts and containers, Java business processes with different functions are running. Some processes exist on the host and some exist on the container. Due to historical reasons, the versions of JDK\JRE running Java processes are not the same, ranging from the older 1.8 version to the latest 21. Through this embodiment, memory horse detection of all Java business processes can be efficiently completed.
一种内存马检测系统可以用于执行本实施例提供的内存马的检测方法,图8是根据本发明实施例的一种内存马检测系统的示意图,如图8所示,包括:jvm内存解析、yara和结果三个模块。其中,jvm内存解析部分的jvm内存解析模块可以负责从内存中解析Java类的常量池,并将常量池提供给yara模块进行扫描检测,yara部分可以根据预定的规则识别常量池中是否包含内存马,进行常量池扫描,由结果模块可以上送检测结果到控制端。A memory horse detection system can be used to execute the memory horse detection method provided in this embodiment. FIG8 is a schematic diagram of a memory horse detection system according to an embodiment of the present invention. As shown in FIG8, it includes three modules: jvm memory parsing, yara and result. Among them, the jvm memory parsing module of the jvm memory parsing part can be responsible for parsing the constant pool of the Java class from the memory, and providing the constant pool to the yara module for scanning and detection. The yara part can identify whether the constant pool contains a memory horse according to a predetermined rule, and scan the constant pool. The result module can send the detection result to the control end.
下面对图8中各部分进行详细阐述。The following is a detailed description of each part in Figure 8.
1.Java版本探测模块和内存操作模块:Java版本探测模块可以用于确定目标Java程序的版本信息,以便于后续选择具体的Klass查找路线,内存操作模块可以获取访问目标进程的内存的文件描述符(FD),并根据给定的地址从内存中读取指定长度的内容。1. Java version detection module and memory operation module: The Java version detection module can be used to determine the version information of the target Java program to facilitate the subsequent selection of a specific Klass search route. The memory operation module can obtain the file descriptor (FD) for accessing the memory of the target process and read the content of a specified length from the memory according to the given address.
2.Klass查找模块:被JVM加载的Java类在内存中会以特定的结构保存,根据Java版本不同,主要有下面两种结构,(1)JDK8、9版本的数组+链表形式,(2)JDK10及以上版本的链表形式,可以根据不同的结构查找含有常量池的变量的Klass。2. Klass search module: Java classes loaded by the JVM are stored in memory in a specific structure. Depending on the Java version, there are two main structures: (1) array + linked list format for JDK8 and 9 versions, and (2) linked list format for JDK10 and above versions. Klass of variables in the constant pool can be searched based on different structures.
3.Klass常量池解析:根据常量池ConstantPool在内存中的布局,对常量池进行解析。3. Klass constant pool analysis: According to the layout of the constant pool ConstantPool in memory, the constant pool is analyzed.
4.已检测类对象缓存:在Java语言中,类文件被JVM加载后,会生成一个类对象代表这个类,后续要使用这个类时,由类对象生成实例对象使用。在整个JVM的生命周期中,如果这个类没有发生过变动,它不会被重新加载,即:类对象不会更新。因此,可以建立类对象的映射缓存,保存被检测过的类对象的一些基本属性(如:在内存中的地址、类名、继承的类或接口名称等信息),当这些基本属性都没有发生过变更时,说明该类未发生过变更,无需再重复检测它,直接使用上一次的检测结果,提高检测效率。4. Detected class object cache: In the Java language, after the class file is loaded by the JVM, a class object will be generated to represent the class. When the class is to be used later, the class object will generate an instance object for use. During the entire life cycle of the JVM, if the class has not changed, it will not be reloaded, that is, the class object will not be updated. Therefore, a mapping cache of class objects can be established to save some basic properties of the detected class objects (such as the address in memory, class name, inherited class or interface name, etc.). When these basic properties have not changed, it means that the class has not changed, and there is no need to re-detect it. The last detection result can be used directly to improve detection efficiency.
5.yara和结果输出模块:yara(对应于目标检测工具)加载预先定义的包含Java内存马特征的yara规则(对应于预设检测规则),然后使用这些规则来检测常量池中是否包含这些特征,从而确定对应的Java类是否包含内存马;最终由结果输出模块将检测的结果上送给控制终端。5. Yara and result output module: Yara (corresponding to the target detection tool) loads the pre-defined Yara rules (corresponding to the preset detection rules) containing Java memory horse features, and then uses these rules to detect whether these features are contained in the constant pool, thereby determining whether the corresponding Java class contains memory horses; finally, the result output module sends the detection results to the control terminal.
在本实施例中,根据JVM存储Java类的结构,反解Java类,避免下载类对象的字节码,无需反编译字节码,即可以完成内存马的检测,可以提升检测性能,建立已检测类对象的映射缓存,避免对同一个类对象重复检测,可以提高检测效率,本实施例提供的内存马检测方法可以适用于JDK/JRE版本8及以上的Java内存马检测,基于分析目标Java进程的内存的方式检测内存马,无需attach(注入检测程序),对于目标Java进程没有侵入性,扫描在外进行,不需要attach到目标Java进程,可以无需额外增加目标Java进程的内存开销。In this embodiment, according to the structure of JVM storing Java classes, Java classes are decrypted to avoid downloading the bytecode of class objects. There is no need to decompile the bytecode, so that the detection of memory horses can be completed, the detection performance can be improved, and a mapping cache of detected class objects is established to avoid repeated detection of the same class objects, thereby improving the detection efficiency. The memory horse detection method provided in this embodiment can be applied to Java memory horse detection of JDK/JRE version 8 and above. Memory horses are detected based on analyzing the memory of the target Java process. There is no need to attach (inject detection program), which is non-invasive to the target Java process. The scan is performed externally and does not need to be attached to the target Java process, so there is no need to increase the memory overhead of the target Java process.
实施例二Embodiment 2
本发明实施例二提供了一种内存马检测装置,该内存马检测装置中的各个实施单元对应于实施例一中的各个实施步骤。Embodiment 2 of the present invention provides a memory horse detection device, and each implementation unit in the memory horse detection device corresponds to each implementation step in embodiment 1.
图9是根据本发明实施例的一种内存马检测装置的示意图,如图9所示,该内存马检测装置包括:第一确定单元91、处理单元92、检测单元93和第二确定单元94。FIG9 is a schematic diagram of a memory horse detection device according to an embodiment of the present invention. As shown in FIG9 , the memory horse detection device includes: a first determination unit 91 , a processing unit 92 , a detection unit 93 , and a second determination unit 94 .
其中,第一确定单元91,用于确定目标设备中处于运行状态的目标进程;The first determining unit 91 is used to determine a target process in a running state in a target device;
处理单元92,用于遍历目标进程已加载的类对象,并针对遍历到的每一个类对象,根据目标映射缓存,确定是否将类对象作为本次检测的待检测类对象,其中,目标映射缓存中记录有:进程的进程信息与进程的被检测过的类对象信息之间的映射关系;The processing unit 92 is used to traverse the class objects loaded by the target process, and for each traversed class object, determine whether to use the class object as the class object to be detected in this detection according to the target mapping cache, wherein the target mapping cache records: the mapping relationship between the process information of the process and the detected class object information of the process;
检测单元93,用于在将遍历到的类对象作为本次检测的待检测类对象的情况下,对待检测类对象的常量池进行检测,得到检测结果;The detection unit 93 is used to detect the constant pool of the class object to be detected when the traversed class object is used as the class object to be detected in this detection, and obtain the detection result;
第二确定单元94,用于根据检测结果,确定目标进程是否被注入内存马。The second determining unit 94 is used to determine whether the target process is injected into the memory horse according to the detection result.
在本发明实施例二提供的内存马检测装置中,可以通过第一确定单元91,用于确定目标设备中处于运行状态的目标进程,通过处理单元92遍历目标进程已加载的类对象,并针对遍历到的每一个类对象,根据目标映射缓存,确定是否将类对象作为本次检测的待检测类对象,其中,目标映射缓存中记录有:进程的进程信息与进程的被检测过的类对象信息之间的映射关系,通过检测单元93在将遍历到的类对象作为本次检测的待检测类对象的情况下,对待检测类对象的常量池进行检测,得到检测结果,通过第二确定单元94根据检测结果,确定目标进程是否被注入内存马。进而解决了相关技术中将检测程序注入待检测进程中检测内存马,或者,下载字节码文件进行反编译的方式检测内存马,检测效率低的技术问题。In the memory horse detection device provided in the second embodiment of the present invention, the first determination unit 91 can be used to determine the target process in the running state in the target device, and the processing unit 92 can traverse the class objects loaded by the target process, and for each traversed class object, according to the target mapping cache, determine whether to use the class object as the class object to be detected in this detection, wherein the target mapping cache records: the mapping relationship between the process information of the process and the class object information of the process that has been detected, and the detection unit 93 uses the traversed class object as the class object to be detected in this detection. The constant pool of the class object to be detected is detected to obtain the detection result, and the second determination unit 94 determines whether the target process is injected with a memory horse according to the detection result. This solves the technical problem of low detection efficiency in the related art of injecting the detection program into the process to be detected to detect the memory horse, or downloading the bytecode file for decompilation to detect the memory horse.
在本实施例中,通过遍历目标设备中已加载的类对象,查找常量池,通过解析类对象的常量池,确定待检测进程是否被注入内存马,并利用已检测类对象的缓存(即目标映射缓存)来避免重复检测同一个类,达到了无需向待检测进程注入检测程序,获取Class字节流,以及无需下载字节码文件,进行反编译,即可对待检测进程进行内存马检测的目的,从而实现了提高内存马的检测效率的技术效果。In this embodiment, by traversing the class objects loaded in the target device and searching the constant pool, it is determined whether the process to be detected is injected with a memory horse by parsing the constant pool of the class object, and the cache of the detected class objects (i.e., the target mapping cache) is used to avoid repeated detection of the same class. The purpose of performing memory horse detection on the process to be detected is achieved without injecting a detection program into the process to be detected, obtaining the Class byte stream, and downloading the bytecode file for decompilation, thereby achieving the technical effect of improving the detection efficiency of memory horses.
可选地,在本发明实施例二提供的内存马检测装置中,检测单元包括:第一确定子单元,用于确定待检测类对象的常量池;解析子单元,用于基于待检测类对象的常量池在目标进程的内存中的存储格式,解析常量池,得到解析结果;检测子单元,用于利用目标检测工具加载预设检测规则对解析结果进行检测,得到待检测类对象对应的检测结果。Optionally, in the memory horse detection device provided in Example 2 of the present invention, the detection unit includes: a first determination subunit, used to determine the constant pool of the class object to be detected; a parsing subunit, used to parse the constant pool based on the storage format of the constant pool of the class object to be detected in the memory of the target process, and obtain the parsing result; the detection subunit, used to use the target detection tool to load the preset detection rules to detect the parsing result, and obtain the detection result corresponding to the class object to be detected.
可选地,在本发明实施例二提供的内存马检测装置中,常量池的存储格式中至少包括:第一数组和第二数组,其中,第一数组用于存储常量池的类型,第二数组用于存储常量池的数据;解析子单元包括:解析模块,用于基于第一数组和第二数组,解析待检测类对象的常量池,得到解析结果。Optionally, in the memory horse detection device provided in Embodiment 2 of the present invention, the storage format of the constant pool includes at least: a first array and a second array, wherein the first array is used to store the type of the constant pool, and the second array is used to store the data of the constant pool; the parsing subunit includes: a parsing module, which is used to parse the constant pool of the class object to be detected based on the first array and the second array to obtain a parsing result.
可选地,在本发明实施例二提供的内存马检测装置中,解析模块包括:解析子模块,用于解析第一数组,得到待检测类对象的常量池的类型,并解析第二数组,得到待检测类对象的常量池的数据;替换子模块,用于基于常量池的类型,替换常量池的数据中的符号引用,得到解析结果,其中,符号引用表示采用符号描述数据内容。Optionally, in the memory horse detection device provided in the second embodiment of the present invention, the parsing module includes: a parsing submodule, used to parse the first array to obtain the type of the constant pool of the class object to be detected, and to parse the second array to obtain the data of the constant pool of the class object to be detected; a replacement submodule, used to replace the symbolic reference in the data of the constant pool based on the type of the constant pool to obtain the parsing result, wherein the symbolic reference indicates the use of symbols to describe the data content.
可选地,在本发明实施例二提供的内存马检测装置中,内存马检测装置还包括:第一更新单元,用于在被检测过的类对象中存在属性信息发生变化的目标类对象时,根据目标类对象的发生变化的属性信息,更新目标映射缓存;和/或,第二更新单元,用于在根据待检测类对象的常量池,完成检测目标进程是否被注入内存马后,根据待检测类对象的属性信息以及目标进程的进程信息,更新目标映射缓存。Optionally, in the memory horse detection device provided in Embodiment 2 of the present invention, the memory horse detection device also includes: a first update unit, used to update the target mapping cache according to the changed attribute information of the target class object when there is a target class object whose attribute information has changed in the detected class objects; and/or, a second update unit, used to update the target mapping cache according to the attribute information of the class object to be detected and the process information of the target process after completing the detection of whether the target process is injected with a memory horse according to the constant pool of the class object to be detected.
可选地,在本发明实施例二提供的内存马检测装置中,处理单元,包括:第二确定子单元,用于确定目标映射缓存中是否存储有类对象的属性信息;第三确定子单元,用于在目标映射缓存中未存储有类对象的属性信息,或者类对象的属性信息在上一次检测之后发生变化的情况下,确定将类对象作为本次检测的待检测类对象;第四确定子单元,用于在目标映射缓存中存储有类对象的属性信息,且类对象的属性信息在上一次检测之后未发生变化的情况下,确定不将类对象作为本次检测的待检测类对象。Optionally, in the memory horse detection device provided in Embodiment 2 of the present invention, the processing unit includes: a second determination subunit, used to determine whether attribute information of a class object is stored in a target mapping cache; a third determination subunit, used to determine that the class object is used as the class object to be detected for this detection when the attribute information of the class object is not stored in the target mapping cache or the attribute information of the class object has changed after the last detection; and a fourth determination subunit, used to determine that the class object is not used as the class object to be detected for this detection when the attribute information of the class object is stored in the target mapping cache and the attribute information of the class object has not changed since the last detection.
可选地,在本发明实施例二提供的内存马检测装置中,内存马检测装置还包括:获取单元,用于在确定不将当前遍历到的第一类对象作为本次检测的待检测类对象的情况下,根据目标映射缓存,获取对第一类对象的常量池进行检测得到的历史检测结果;第二确定单元包括:处理子单元,用于根据第一类对象的历史检测结果以及第二类对象的检测结果,确定目标进程是否被注入内存马,其中,第二类对象用于作为本次检测的待检测类对象。Optionally, in the memory horse detection device provided in the second embodiment of the present invention, the memory horse detection device also includes: an acquisition unit, which is used to obtain historical detection results obtained by detecting the constant pool of the first category of objects according to the target mapping cache when it is determined that the first category of objects currently traversed are not used as the category of objects to be detected for this detection; the second determination unit includes: a processing subunit, which is used to determine whether the target process is injected with a memory horse based on the historical detection results of the first category of objects and the detection results of the second category of objects, wherein the second category of objects are used as the category of objects to be detected for this detection.
上述的内存马检测装置还可以包括处理器和存储器,上述的第一确定单元91、处理单元92、检测单元93和第二确定单元94等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The above-mentioned memory horse detection device can also include a processor and a memory. The above-mentioned first determination unit 91, processing unit 92, detection unit 93 and second determination unit 94 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
上述处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来通过遍历目标设备中已加载的类对象,查找常量池,通过解析类对象的常量池,确定待检测进程是否被注入内存马,并利用已检测类对象的缓存(即目标映射缓存)来避免重复检测同一个类,达到了无需向待检测进程注入检测程序,获取Class字节流,以及无需下载字节码文件,进行反编译,即可对待检测进程进行内存马检测的目的,从而实现了提高内存马的检测效率的技术效果。The above processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters are adjusted to traverse the class objects loaded in the target device, find the constant pool, and parse the constant pool of the class object to determine whether the process to be detected is injected with a memory horse, and use the cache of the detected class objects (i.e., the target mapping cache) to avoid repeated detection of the same class, so that the purpose of performing memory horse detection on the process to be detected is achieved without injecting the detection program into the process to be detected, obtaining the Class byte stream, and downloading the bytecode file for decompilation, thereby achieving the technical effect of improving the detection efficiency of memory horses.
上述存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
根据本发明实施例的另一方面,还提供了一种电子设备,包括:处理器;以及存储器,用于存储处理器的可执行指令;其中,处理器配置为经由执行可执行指令来执行上述任意一个实施例提供的内存马检测方法。According to another aspect of an embodiment of the present invention, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the memory horse detection method provided by any one of the above embodiments by executing the executable instructions.
根据本发明实施例的另一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,其中,在计算机程序运行时控制计算机可读存储介质所在设备执行上述任意一个实施例提供的内存马检测方法。According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the memory horse detection method provided by any one of the above embodiments.
图10是根据本发明实施例的一种电子设备的示意图,如图10所示,本发明实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,处理器执行程序时实现上述任意一个实施例提供的内存马检测方法。Figure 10 is a schematic diagram of an electronic device according to an embodiment of the present invention. As shown in Figure 10, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the memory horse detection method provided in any one of the above embodiments is implemented.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410763971.5A CN118797636A (en) | 2024-06-13 | 2024-06-13 | Memory horse detection method, device and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410763971.5A CN118797636A (en) | 2024-06-13 | 2024-06-13 | Memory horse detection method, device and electronic equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118797636A true CN118797636A (en) | 2024-10-18 |
Family
ID=93026092
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410763971.5A Pending CN118797636A (en) | 2024-06-13 | 2024-06-13 | Memory horse detection method, device and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118797636A (en) |
-
2024
- 2024-06-13 CN CN202410763971.5A patent/CN118797636A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110162296B (en) | Method and device for generating application programming interface document and terminal equipment | |
| US7861296B2 (en) | System and method for efficiently scanning a file for malware | |
| US6802006B1 (en) | System and method of verifying the authenticity of dynamically connectable executable images | |
| US7779472B1 (en) | Application behavior based malware detection | |
| JP5437550B2 (en) | System and method for reducing required memory capacity of firmware | |
| US9336018B2 (en) | Mechanism for class data sharing using extension and application class-loaders | |
| JP4902129B2 (en) | Method and system for enforcing a security policy via a security virtual machine | |
| US5649095A (en) | Method and apparatus for detecting computer viruses through the use of a scan information cache | |
| US6338141B1 (en) | Method and apparatus for computer virus detection, analysis, and removal in real time | |
| US6334213B1 (en) | Merging of separate executable computer programs to form a single executable computer program | |
| CN109614165B (en) | Multi-version parallel operation method and device for COM (component object model) component | |
| US6721847B2 (en) | Cache hints for computer file access | |
| US20040088570A1 (en) | Predictive malware scanning of internet data | |
| US20040103406A1 (en) | Method and apparatus for autonomic compiling of a program | |
| US20110178973A1 (en) | Web Content Rewriting, Including Responses | |
| JP2003526827A (en) | System and method for compressing software code | |
| US7191436B1 (en) | Computer system utility facilitating dynamically providing program modifications for identified programs | |
| US7650504B2 (en) | System and method of verifying the authenticity of dynamically connectable executable images | |
| CN109086183A (en) | A kind of monitoring method of application program, device, electronic equipment and storage medium | |
| US7665098B2 (en) | System and method for monitoring interactions between application programs and data stores | |
| US7634521B1 (en) | Technique for scanning stealthed, locked, and encrypted files | |
| EP1303802B1 (en) | System and method of verifying the authenticity of dynamically connectable executable images | |
| CN118070289A (en) | UEFI firmware vulnerability detection method and device | |
| US20070011686A1 (en) | Changing code execution path using kernel mode redirection | |
| CN104615935B (en) | A kind of hidden method towards Xen virtual platforms |
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 |