Application processing method and apparatus, and attack defense system

By monitoring the sample program loading the network dynamic link library and judging the memory block conditions, terminating the shell code execution, obtaining and intercepting the network connection parameters, the problem of identifying and defending against shell code attacks is solved, and real-time security protection of computer equipment is achieved.

WO2025189909A1PCT designated stage Publication Date: 2025-09-18HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/143017
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-11
Filing Date
2024-12-27
Publication Date
2025-09-18

AI Technical Summary

Technical Problem

When identifying and defending against shell code attacks, existing technologies are unable to identify malicious programs before the shell code is loaded into the computer device memory, resulting in the computer device being remotely attacked or data being stolen.

Method used

By monitoring whether the sample program on the computer device loads the network dynamic link library and judging whether the target memory block meets the shell code running conditions, if so, the execution of the sample program is terminated, its network connection parameters are obtained and intercepted, and the protective equipment is linked to block the attacker's control facilities.

Benefits of technology

It effectively prevents shell code from connecting to remote servers, prevents computer devices from being remotely controlled or data from being stolen, and provides real-time protection for computer devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024143017_18092025_PF_FP_ABST
    Figure CN2024143017_18092025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer security, and provides an application processing method and apparatus, and an attack defense system. A computer device monitors whether an application running on the computer device loads a network dynamic link library. If it is detected that the application loads the network dynamic link library, and a memory block where the running code used for loading the network dynamic link library in the application is located meets a shellcode running condition, the execution of the application is terminated before the application successfully calls a network connection function in the network dynamic link library. In this way, an application running shellcode can be prevented from being connected to a remote server, thereby preventing the computer device from being controlled by an attacker by means of the remote server or preventing internal data of the computer device from being stolen by the attacker by means of the remote server.
Need to check novelty before this filing date? Find Prior Art

Description

Application processing method and device, attack defense system

[0001] This application claims priority to Chinese patent application number 202410272421.3, filed on March 11, 2024, entitled “Application Processing Method and Device, Attack Defense System,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of computer security, and in particular to an application processing method and device, and an attack defense system. Background Art

[0003] Shellcode is a piece of machine code executed to exploit software vulnerabilities. It's used to perform specific tasks within a computer system, such as providing remote access or escalating privileges. Therefore, shellcode is often used to launch malicious attacks against computer systems. In other words, shellcode is a form of malicious code. Because shellcode is simply a piece of machine code, it can easily evade detection through methods such as distortion or encryption. Furthermore, shellcode is often used to decrypt malicious files and execute them in memory. Since shellcode itself doesn't perform any actual malicious functions, it can easily evade static anti-virus (AV) detection.

[0004] In scenarios where shellcode is used as a malicious program to attack a computer device, related technologies provide a solution for identifying malicious programs running on the computer device by performing memory scanning on the computer device to detect whether malicious files are loaded into the computer device's memory. However, when using the memory scanning technology provided by related technologies, the malicious program can only be identified after the shellcode has loaded the malicious file into the computer device's memory. Before the malicious program is identified, the shellcode may have already run the malicious file, indicating that actual malicious behavior has already occurred, resulting in the computer device being remotely attacked, such as the computer device being remotely controlled by the attacker or the data in the computer device being stolen by the attacker. Summary of the Invention

[0005] The present application provides an application processing method and device, and an attack defense system.

[0006] In a first aspect, a method for processing an application is provided. The method includes: a computer device monitors whether a sample program running on the computer device loads a network dynamic link library. The network dynamic link library is used to support network communication of the application. The network dynamic link library includes one or more network connection functions. In response to monitoring that the sample program loads the network dynamic link library, the computer device determines whether a target memory block meets the shellcode running condition, where the target memory block is the memory block where the running code for loading the network dynamic link library is located in the sample program. If the target memory block meets the shellcode running condition, the computer device executes a malicious program processing flow for the sample program. The malicious program processing flow includes: terminating the execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library. The target memory block meets the shellcode running condition, that is, the running code in the target memory block is shellcode.

[0007] In the present application, when a computer device determines that shellcode is running in a sample program, the sample program is treated as a malicious program, so that the sample program is terminated before the network connection function in the network dynamic link library is successfully called, so as to prevent the application from connecting to the remote server, thereby preventing the computer device from being controlled by an attacker through the remote server, or the internal data of the computer device from being stolen by an attacker through the remote server, thereby achieving protection for the computer device.

[0008] Optionally, the target memory block is determined to meet the shellcode execution condition when the target memory block meets any one of the following conditions. The conditions include: the size of the target memory block is equal to the memory page size in the operating system of the computer device; the target memory block has private permission, writable permission, and executable permission; and the target memory block contains a format header of a portable executable (PE) file (or the target memory block contains a complete PE file).

[0009] Optionally, an implementation method for a computer device to monitor whether a sample program running on the computer device loads a network dynamic link library includes: the computer device hooks a dynamic library loading function in the operating system of the computer device through a first hook function to monitor whether the sample program loads the network dynamic link library, and the dynamic library loading function is used to load the network dynamic link library.

[0010] In this application, the computer device uses hook technology to monitor whether the running sample program loads the network dynamic link library.

[0011] Optionally, the first hook function is a user-mode hook function in the sample program, and the first hook function is injected into the sample program after the sample program is started. Alternatively, the first hook function is a kernel-mode hook function in the kernel of the computer device.

[0012] In this application, the computer device uses user-mode hook technology to monitor whether the running sample program loads the network dynamic link library, or uses kernel-mode hook technology to monitor whether the running sample program loads the network dynamic link library.

[0013] Optionally, the computer device executes a malicious program processing process on the sample program, including: obtaining network connection parameters provided by the sample program when the sample program attempts to call a network connection function in a network dynamic link library, and terminating execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library. The network connection parameters include network address information of a remote server that the sample program attempts to connect to.

[0014] This application helps to provide security protection against network attacks carried out by the attacker through the control facility by obtaining the network address information of the attacker's control facility before the malicious program in the computer device commits any actual malicious behavior.

[0015] Optionally, one implementation of a computer device obtaining network connection parameters provided by a sample program when attempting to call a network connection function in a network dynamic link library includes: the computer device suspending execution of the sample program and, during the suspension period, hooking the network connection function in the network dynamic link library using a second hook function. After the computer device completes hooking the network connection function in the network dynamic link library using the second hook function, it resumes execution of the sample program. In response to the sample program calling the network connection function in the network dynamic link library, the computer device obtains, through the second hook function, the network connection parameters provided by the sample program when calling the network connection function.

[0016] In this application, the computer device uses hook technology to obtain the network connection parameters provided by the sample program without querying the configuration file of the sample program. The network address information of the attacker's control facility can also be obtained for fileless attack scenarios. It is highly feasible and can cover more attack scenarios.

[0017] Optionally, the second hook function is a user-mode hook function in the sample program, and the second hook function is injected into the sample program after the sample program is started. Alternatively, the second hook function is a kernel-mode hook function in the kernel of the computer device.

[0018] Optionally, the computer device also sends the network address information of the remote server to a protection device deployed between the computer device and the remote server, and the network address information of the remote server is used by the protection device to intercept traffic from and / or traffic to the remote server.

[0019] In this application, the computer device provides the protection device with the network address information of the remote server identified as the attacker's control facility. The protection device can prevent the data in the computer devices within the protected network from being stolen by intercepting the traffic sent from the protected network to the remote server. The protection device can prevent the computer devices within the protected network from being remotely controlled by intercepting the traffic sent from the remote server to the protected network. This application realizes the global ban of the attacker's control facility by linking the computer device with the protection device, thereby protecting all computer devices within the protected network from remote attacks by the attacker.

[0020] Optionally, the network address information of the remote server includes one or more of an Internet Protocol (IP) address of the remote server, a domain name address of the remote server, or a port number of the remote server.

[0021] Optionally, the above method is executed by security software running in a computer device.

[0022] In a second aspect, a device for processing malicious programs is provided. The device is applied to a computer device. The device includes multiple functional modules that interact with each other to implement the method of the first aspect and its respective embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation.

[0023] In a third aspect, a computer device is provided, comprising: a memory, a network interface, and at least one processor. The memory is configured to store program instructions, and the at least one processor reads the program instructions stored in the memory, thereby causing the computer device to execute the method of the first aspect and its respective embodiments.

[0024] In a fourth aspect, an attack defense system is provided, comprising: a computer device and a protection device, wherein the computer device is located within a protected network protected by the protection device, wherein the computer device is configured to execute the method of the first aspect and its respective embodiments.

[0025] For example, a computer device is configured to monitor whether a sample program running on the computer device loads a network dynamic link library (DLL), which is used to support network communication for applications and includes one or more network connection functions. The computer device is further configured to, in response to monitoring the sample program loading the DLL, determine whether a target memory block meets a shellcode execution condition, where the target memory block is the memory block containing the execution code in the sample program used to load the DLL. If the target memory block meets the shellcode execution condition, execute a malicious program processing flow on the sample program. The malicious program processing flow includes obtaining network connection parameters provided by the sample program when attempting to call a network connection function in the DLL, and terminating execution of the sample program before the sample program successfully calls the network connection function in the DLL. The network connection parameters include network address information of a remote server that the sample program attempts to connect to. The computer device is further configured to transmit the remote server's network address information to a protection device. The protection device is configured to intercept traffic from and / or to the remote server based on the remote server's network address information.

[0026] Optionally, the attack defense system further includes a cloud security server. The computer device and / or the protection device is further configured to send the network address information of the remote server to the cloud security server. The cloud security server is configured to aggregate the network address information of remote servers (malicious servers) collected from various sources. Optionally, the cloud security server is further configured to provide the subscriber with an attacker profile based on subscription requirements. The attacker profile includes, but is not limited to, the malicious server's network address information and / or attack behavior characteristics.

[0027] In a fifth aspect, an attack defense system is provided, comprising: a computer device and a cloud security server, wherein the computer device is configured to execute the method of the first aspect and its respective embodiments.

[0028] For example, a computer device is used to monitor whether a sample program running on the computer device loads a network dynamic link library, which is used to support network communication for applications and includes one or more network connection functions. The computer device is also used to, in response to monitoring the sample program loading the network dynamic link library, determine whether a target memory block meets the shellcode execution condition, where the target memory block is the memory block where the execution code used to load the network dynamic link library in the sample program is located; and if the target memory block meets the shellcode execution condition, execute a malicious program processing flow on the sample program, wherein the malicious program processing flow includes: obtaining network connection parameters provided when the sample program attempts to call a network connection function in the network dynamic link library, and terminating execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library, wherein the network connection parameters include network address information of a remote server that the sample program attempts to connect to. The computer device is also used to send the network address information of the remote server to a cloud security server. The cloud security server is used to aggregate the network address information of remote servers (i.e., malicious servers) collected from various sources. Optionally, the cloud security server is also used to provide the subscriber with an attack organization portrait according to subscription requirements. The attack organization portrait includes but is not limited to the network address information and / or attack behavior characteristics of the malicious server.

[0029] Optionally, the attack defense system further includes a protection device, wherein the computer device is located within a protected network protected by the protection device. The computer device and / or the cloud security server is further configured to send the network address information of the remote server to the protection device. The protection device is configured to intercept traffic from and / or traffic destined for the remote server based on the network address information of the remote server.

[0030] In a sixth aspect, a computer-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the method in the above-mentioned first aspect and its various embodiments is implemented.

[0031] In a seventh aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method in the above-mentioned first aspect and its various embodiments.

[0032] In an eighth aspect, a chip is provided, which includes a programmable logic circuit and / or program instructions. When the chip is running, it implements the method in the above-mentioned first aspect and its various embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG1 is a schematic diagram of an implementation scenario provided by an embodiment of the present application;

[0034] FIG2 is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application;

[0035] FIG3 is a schematic diagram of the hardware structure of a protective device provided in an embodiment of the present application;

[0036] FIG4 is a flow chart of an application processing method provided in an embodiment of the present application;

[0037] FIG5 is a schematic structural diagram of an application processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0039] Shellcode, a piece of machine code executed to exploit software vulnerabilities, is often used to launch malicious attacks on computer systems. For example, in the first attack scenario, the attacker implementing an advanced threat or fileless attack does not directly provide a malicious program with actual malicious functions. Instead, the attacker injects shellcode as a malicious program into a computer device. By running the shellcode on the computer device, the attacker pulls a fully functional encrypted dynamic link library (DLL) from the network to the computer device, decrypts the encrypted DLL on the computer device, loads the decrypted DLL into the computer device's memory, and executes the functions in the DLL to launch the attack on the computer device. For another example, in the second attack scenario, the attacker stores the fully functional encrypted DLL in the malicious program's local directory or its own resource segment, and then injects the shellcode as a malicious program along with the file containing the fully functional encrypted DLL into the computer device. By running the shellcode on the computer device, the attacker decrypts the encrypted DLL injected into the computer device, loads the decrypted DLL into the computer device's memory, and executes the functions in the DLL to launch the attack on the computer device. Among them, the decrypted dynamic link library is the real attack payload.

[0040] When using the memory scanning technology provided by the related technology, it can be identified that a malicious program is running in the computer device only after the shellcode has loaded the attack payload into the memory of the computer device. However, before the malicious program is identified, the shellcode may have already run the attack payload, causing the computer device to be remotely attacked, such as the computer device has been remotely controlled by the attacker, or the data in the computer device has been stolen by the attacker.

[0041] Based on this, the present application provides a technical solution, which monitors and analyzes the application running on the computer device in real time to determine whether the application is a malicious program containing shellcode, or whether it is injected with shellcode (i.e., infected by a malicious program), and terminates the execution of the malicious program before the malicious program performs any substantial malicious behavior, thereby ensuring the security of the computer system. The technical solution of the present application is as follows: the computer device monitors whether the application running on the computer device loads a network dynamic link library, which is used to support the application to perform network communication. In response to monitoring that the application loads the network dynamic link library, the computer device determines whether the memory block where the running code for loading the network dynamic link library in the application meets the shellcode running conditions. If the memory block meets the shellcode running conditions, the computer device executes the malicious program processing flow for the application to terminate the execution of the application before the application successfully calls the network connection function in the network dynamic link library. The present application determines whether the running code in the memory block used to load the network dynamic link library in the application is shellcode by judging whether the memory block where the running code is located meets the shellcode running conditions. If the running code is shellcode, it means that the application is very likely to be a malicious program, or the application is very likely to have been infected by a malicious program. Then, if the application continues to run, it is likely to cause the computer device to be attacked by the malicious program, and the security of the computer device will be threatened. Therefore, when the present application determines that there is shellcode running in the memory space of the application, the application is treated as a malicious program, so that the application is terminated before the network connection function in the network dynamic link library is successfully called, so as to avoid the application from connecting to the remote server, thereby preventing the computer device from being controlled by the attacker through the remote server, or the internal data of the computer device from being stolen by the attacker through the remote server.

[0042] For example, for the first attack scenario mentioned above, by implementing the solution of the present application, it is possible to prevent shellcode from connecting to the remote server, thereby preventing shellcode from downloading a fully functional encrypted dynamic link library from the network. For the second attack scenario mentioned above, by implementing the solution of the present application, it is possible to prevent shellcode from connecting to the remote server, thereby preventing shellcode from loading the attack payload into the memory and then connecting to the attacker's server after execution. In short, by implementing the solution of the present application, it is possible to identify whether shellcode is running on a computer device. After identifying that shellcode is running on the computer device, it is further possible to prevent shellcode from connecting to the remote server, thereby preventing the computer device from being attacked and controlled by the remote server, thereby achieving protection for the computer device.

[0043] Optionally, the shellcode running conditions are determined based on the characteristics of the memory block in which the shellcode is running. Before the shellcode is run in a computer device, it is necessary to apply for a memory block in the computer device's memory for running the shellcode. Since the characteristics of the memory block used to run the shellcode are somewhat different from the characteristics of the memory block used to run a normal application, the characteristics of the memory block include but are not limited to the memory block size, memory block permissions or memory block content. Therefore, the present application summarizes the characteristics of the memory block used to run the shellcode, and realizes the judgment based on the memory block size, memory block permissions or memory block content whether the memory block where the running code is located meets the shellcode running conditions, that is, judges whether the running code is shellcode. The specific judgment method is as follows: when the size of the memory block where the running code is located is equal to the memory page size in the operating system of the computer device, or the memory block where the running code is located has private permissions, writable permissions and executable permissions, or the memory block where the running code is located contains the format header of the PE file, it is determined that the memory block where the running code is located meets the shellcode running conditions. The judgment principle based on the above three conditions is explained below.

[0044] (1) Judgment condition 1: When the size of the memory block where the running code is located is equal to the memory page size in the operating system of the computer device, it is determined that the memory block meets the shellcode running condition. The memory page size in the operating system is the smallest memory allocation unit in the operating system. For example, the memory page size in the Windows operating system generally defaults to 4 kilobytes (KB). In this case, the above judgment condition 1 is: when the size of the memory block where the running code is located is equal to 4KB, it is determined that the memory block meets the shellcode running condition. Since the code segment of a normal application usually contains compiler code when running in memory, the memory occupied by the code segment of a normal application is generally much larger than the memory page size in the operating system (such as 4KB). Shellcode, as a machine code, requires very little memory to run, usually less than the memory page size in the operating system (such as 4KB). Therefore, if the memory block size where the running code is located is equal to the memory page size in the operating system of the computer device, then the running code is very likely to be shellcode. It is worth noting that the memory page size in the operating system can be configured and modified. For example, the memory page size in the Windows operating system can be set to other values ​​such as 8KB or 32KB.

[0045] (2) Judgment condition 2: When the memory block where the running code is located has private permissions, writable permissions, and executable permissions, it is determined that the memory block meets the shellcode running conditions. Since the memory block where the code segment of a normal application is located usually only has read permissions and executable permissions, the memory block where the shellcode is located must have private permissions, writable permissions, and executable permissions to support the normal operation of the shellcode. Therefore, if the memory block where the running code is located has private permissions, writable permissions, and executable permissions, then the running code is very likely to be shellcode.

[0046] (3) Judgment condition 3: When the memory block where the running code is located contains the format header of the PE file, it is determined that the memory block meets the shellcode running condition. Since the format header of the PE file of a normal application is read-only, and the code segment of the PE file of a normal application is readable and executable, and the permissions of the same memory block are the same, when a normal application is running in the memory, the format header and code segment of the PE file will be loaded into different memory blocks, so that the format header and code segment of the PE file have different read and write permissions. When the shellcode is running in the memory of the computer device, the PE file of the shellcode will be loaded completely into the same memory block. Therefore, if the memory block where the running code is located also contains the format header of the PE file, then the running code is very likely to be shellcode. Since the memory block where the running code is located must include the code segment of the PE file, if the memory block also contains the format header of the PE file, it means that the memory block contains a complete PE file. Accordingly, in the above judgment condition 3, "the memory block contains the format header of the PE file" can also be replaced with: the memory block contains the complete PE file, or the memory block contains the format header and code segment of the PE file.

[0047] In some embodiments, when a computer device processes an application as a malicious program, it obtains the network connection parameters provided by the application when it attempts to call a network connection function in a network dynamic link library, and terminates the execution of the application before the application successfully calls the network connection function in the network dynamic link library. The network connection parameters include the network address information of the remote server that the application attempts to connect to. Optionally, the network address information of the remote server includes one or more of the IP address of the remote server, the domain name address of the remote server, or the port number of the remote server. Since the application provides network connection parameters including the network address information of the remote server when calling the network connection function in the network dynamic link library to try to connect to the remote server, for a malicious program, the remote server that the malicious program attempts to connect to is usually the attacker's control facility. This application helps to provide security protection against network attacks carried out by the attacker through the control facility by obtaining the network address information of the attacker's control facility before the malicious program in the computer device commits any substantial malicious behavior.

[0048] In some embodiments, the computer device is located in a protected network protected by a protective device, that is, a protective device is deployed between the computer device and the remote server. After obtaining the network address information of the remote server, the computer device sends the network address information of the remote server to the protective device deployed between the computer device and the remote server. The protective device intercepts the traffic from the remote server and / or the traffic sent to the remote server based on the network address information of the remote server. By intercepting the traffic sent from the protected network to the remote server, the protective device can prevent the data in the computer device in the protected network from being stolen. By intercepting the traffic sent from the remote server to the protected network, the protective device can prevent the computer device in the protected network from being remotely controlled. The present application realizes a global ban on the attacker's control facilities by linking the computer device with the protective device, thereby protecting the computer devices in the protected network from remote attacks by the attacker. Alternatively, after obtaining the network address information of the remote server, the computer device can also output the network address information of the remote server, and the security operation and maintenance personnel can input the network address information of the remote server into the protective device through manual configuration, so that the protective device can intercept the sending traffic and / or receiving traffic (collectively referred to as attack traffic) of the remote server. This application does not limit the manner in which the protection device obtains the network address information of the remote server collected by the computer device.

[0049] The following is a detailed introduction to the technical solution of this application from multiple perspectives, including implementation scenarios, hardware devices, method flows, software devices, and systems.

[0050] The following is an example of an implementation scenario of the embodiment of the present application.

[0051] The application processing methods provided in the embodiments of the present application can be applied to various computer devices that may be vulnerable to remote attacks based on shellcode. For example, the computer device is a terminal device installed with a Windows operating system, including but not limited to a server, host, personal computer, mobile phone, or workstation. Windows operating systems include but are not limited to Windows XP, Windows Server 2003, Windows 7, Windows 8, or Windows 10.

[0052] The embodiments of the present application can handle various shellcode-based remote attack scenarios, such as commercial remote control systems that use shellcode, including but not limited to CobaltStrike, MeterPreter, Gh0stRat, Silver, and Brute Force C4. Another example is fileless Trojan attacks that use shellcode, including but not limited to Icedid, Emotet, and Ursnif.

[0053] Optionally, the computer device in the embodiments of the present application is located within a protected network protected by a protective device, i.e., the computer device is a protected device. For example, Figure 1 is a schematic diagram of an implementation scenario provided by an embodiment of the present application. As shown in Figure 1, this implementation scenario primarily involves three types of devices: a protective device, a computer device, and a remote server. The following provides examples of each of these three types of devices.

[0054] (1) Protective equipment

[0055] Protection devices are deployed between the external network (such as the Internet) and the protected network. For example, protection devices are usually deployed at the boundary of the protected network to protect computer devices in the protected network from attacks from the external network. Protection devices can securely filter the traffic entering and leaving the protected network, blocking attack traffic to ensure the security of computer devices in the protected network, while allowing normal traffic to ensure that computer devices in the protected network can communicate normally with the external network. Protection devices include but are not limited to firewalls, security gateways (such as routers or switches), intrusion detection systems (IDS) type devices, intrusion prevention systems (IPS) type devices, unified threat management (UTM) devices, AV devices, anti-distributed denial of service attack (anti-DDoS) devices, and next generation firewalls (NGFW) integrated with one or more of them.

[0056] (2) Computer equipment

[0057] The computer device is a protected device located in a protected network. From the perspective of the computer device, the protected network in which the computer device resides is an internal network, and the Internet is an external network. Optionally, the computer device is a protected server, used to provide services to normal clients (not shown in the figure) in the protected network and on the Internet. For example, the computer device includes but is not limited to an application server or a web server. Among them, application servers include but are not limited to game servers, video application servers, file servers, search engine servers, instant messaging servers, etc. A web server is also called a World Wide Web (World Wide Web) server or website server.

[0058] (3) Remote Server

[0059] The remote server is a control facility used by attackers to conduct remote attacks. Optionally, the remote server is located on an external network (such as the Internet), allowing attackers to launch remote attacks from the external network to computer devices within the protected network. For example, a remote server is a command and control (CC) server, which supports network attacks, hacker activities, or other illegal activities. CC servers are characterized by high controllability and configurability, and can communicate with malicious programs to remotely control and operate infected computer devices.

[0060] Optionally, please continue to refer to Figure 1. This implementation scenario also involves a cloud security server. The cloud security server is communicatively connected to a computer device to receive the network address information of a malicious server sent by the computer device; and / or, the cloud security server is communicatively connected to a protective device to receive the network address information of a malicious server sent by the protective device (Figure 1 takes the communication connection between the cloud security server and the computer device as an example). Optionally, the cloud security server is used to collect and aggregate the network address information of malicious servers collected from various sources, and is further used to provide attack organization portraits to subscribers according to subscription requirements. Attack organization portraits include but are not limited to network address information of malicious servers and / or attack behavior characteristics.

[0061] The following is an example of the basic hardware structure involved in the embodiments of the present application.

[0062] For example, Figure 2 is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application. As shown in Figure 2, computer device 200 includes a processor 201 and a memory 202, and processor 201 and memory 202 are connected via a bus 203. Figure 2 illustrates processor 201 and memory 202 as independent of each other. Optionally, processor 201 and memory 202 are integrated together. Optionally, in conjunction with Figure 1, computer device 200 shown in Figure 2 is any computer device in the implementation scenario shown in Figure 1.

[0063] The memory 202 is used to store computer programs, which include an operating system and program code. Optionally, the operating system is a Windows operating system. The memory 202 is a storage medium of various types, such as read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), flash memory, optical memory, register, optical disk storage, optical disc storage, magnetic disk, or other magnetic storage device.

[0064] The processor 201 is a general-purpose processor or a dedicated processor. The processor 201 may be a single-core processor or a multi-core processor. The processor 201 includes at least one circuit to execute the application processing method provided in the embodiment of the present application.

[0065] Optionally, the computer device 200 further includes a network interface 204, which is connected to the processor 201 and the memory 202 via the bus 203. The network interface 204 enables the computer device 200 to communicate with other devices.

[0066] Optionally, computer device 200 further includes an input / output (I / O) interface 205, which is connected to processor 201 and memory 202 via bus 203. Processor 201 can receive input commands or data through I / O interface 205. I / O interface 205 is used to connect computer device 200 to input devices, such as a keyboard and a mouse. Optionally, in some possible scenarios, the network interface 204 and I / O interface 205 are collectively referred to as a communication interface.

[0067] Optionally, the computer device 200 further includes a display 206, which is connected to the processor 201 and the memory 202 via the bus 203. The display 206 can be used to display intermediate results and / or final results generated by the processor 201 executing the application processing method provided in the embodiments of the present application, such as network address information of a remote server. In one possible implementation, the display 206 is a touch screen display to provide a human-computer interaction interface.

[0068] The bus 203 is any type of communication bus for interconnecting the internal components of the computer device 200, such as a system bus. The embodiments of the present application illustrate the example of interconnecting the aforementioned components within the computer device 200 via the bus 203. Alternatively, the aforementioned components within the computer device 200 may be communicatively connected to each other using other connection methods besides the bus 203, such as interconnecting the aforementioned components within the computer device 200 via a logical interface within the computer device 200.

[0069] The above-mentioned devices can be provided on separate chips, or at least partially or entirely on the same chip. Whether to provide each device independently on different chips or to integrate them on one or more chips often depends on the product design requirements. The embodiments of this application do not limit the specific implementation of the above-mentioned devices.

[0070] The computer device 200 shown in FIG2 is merely exemplary. During implementation, the computer device 200 includes other components, which are not listed here. The computer device 200 shown in FIG2 can process malicious programs by executing all or part of the steps of the data backup method provided in the embodiment of the present application.

[0071] For example, Figure 3 is a schematic diagram of the hardware structure of a protection device provided in an embodiment of the present application. As shown in Figure 3, protection device 300 includes a central processing unit (CPU) 301, a dedicated hardware chip 302, and at least one network interface 303. CPU 301 and dedicated hardware chip 302 can be collectively referred to as a processor. Optionally, in conjunction with Figure 1, protection device 300 shown in Figure 3 is the protection device in the implementation scenario shown in Figure 1.

[0072] The CPU 301 is a general-purpose central processing unit (CPU) with high scalability and flexibility. The CPU 301 is, for example, a single-core processor (single-CPU) or a multi-core processor (multi-CPU).

[0073] The dedicated hardware chip 302 is a high-performance processing hardware module and includes at least one of an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a network processor (NP).

[0074] At least one network interface 303 includes, for example, network interface 1, network interface 2, network interface 3, ..., network interface n in FIG3 . The network interface 303 uses any transceiver-like device for communicating with other devices. For example, the network interface 1 in FIG3 communicates with a computer device, and the network interface 2 in FIG3 communicates with a remote server. Optionally, the network interface 303 includes at least one of a wired network interface or a wireless network interface. The wired network interface is, for example, an Ethernet interface. The Ethernet interface is, for example, an optical interface, an electrical interface, or a combination thereof. The wireless network interface is, for example, a wireless local area network (WLAN) interface, a cellular network interface, or a combination thereof.

[0075] At least one network interface 303 and the dedicated hardware chip 302, as well as the dedicated hardware chip 302 and the CPU 301, are connected via an internal connection 304. The internal connection 304 includes a path for transmitting data between the network interface 303, the dedicated hardware chip 302, and the CPU 301. Optionally, the internal connection 304 is a single board or a bus. For example, the internal connection 304 is Ethernet, fiber channel, PCI-E (peripheral component interconnect express, PCI Express, a high-speed serial computer bus), RapidIO (a high-performance, low-pin-count, packet-switching-based interconnect architecture), InfiniBand, or a XAUI bus (an interface extender characterized by connecting the Ethernet Media Access Control (MAC) layer to the physical layer).

[0076] Optionally, protection device 300 further includes a content addressable memory (CAM) 305. CAM 305 is, for example, a ternary content addressable memory (TCAM). CAM 305 is used, for example, to store network address information of a remote server (the attacker's control facility). Optionally, CAM 305 exists independently and is connected to dedicated hardware chip 302 via the aforementioned internal connection 304. Alternatively, CAM 305 and dedicated hardware chip 302 are integrated, i.e., CAM 305 serves as memory within dedicated hardware chip 302.

[0077] Optionally, the protection device 300 further includes a memory 306. The memory 306 may be, for example, a ROM or other type of static storage device capable of storing static information and instructions, a RAM or other type of dynamic storage device capable of storing information and instructions, an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing the desired program code 308 in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 306 may be, for example, independent and connected to the CPU 301 via the internal connection 304. Alternatively, the memory 306 and the CPU 301 may be integrated.

[0078] An operating system 307 and program code 308 are stored in memory 306. Optionally, CPU 301 reads operating system 307 from memory 306 and runs the operating system 307. CPU 301 also reads program code 308 from memory 306 and implements the method provided in the embodiment of the present application by running program code 308 on operating system 307. For example, protection device 300 is the protection device in the implementation scenario shown in FIG. 1 . When CPU 301 runs program code 308, it performs the following process: Protection device 300 intercepts traffic from and / or traffic destined for a remote server based on the network address information of the remote server.

[0079] Optionally, the above-mentioned devices are respectively provided on independent chips, or at least partially or entirely provided on the same chip. Whether each device is provided independently on different chips or integrated on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation of the above-mentioned devices.

[0080] The following is an example of the method flow of the embodiment of the present application.

[0081] For example, Figure 4 is a flow chart of an application processing method 400 provided in an embodiment of the present application. As shown in Figure 4, method 400 includes but is not limited to the following steps 401 to 403. The method 400 is applied to a computer device. Optionally, the method 400 is executed by security software running on the computer device, and the security software is, for example, endpoint detection and response (EDR) software. Optionally, in combination with the implementation scenario shown in Figure 1, the computer device in the method 400 is any computer device in Figure 1. Optionally, the computer device in the method 400 has the hardware structure shown in Figure 2.

[0082] Step 401: The computer device monitors whether the sample program running on the computer device has loaded a network dynamic link library.

[0083] The network dynamic link library is used to support the application program to perform network communication, and the network dynamic link library includes one or more network connection functions.

[0084] Optionally, the network dynamic link library is a library file (DLL file) that comes with the operating system of the computer device. Of course, the embodiment of the present application does not exclude the possibility of the application program carrying the network dynamic link library. Optionally, the file type of the network dynamic link library includes but is not limited to ws2_32.dll, dnsapi.dll, Winhttp.dll or urlmon.dll.

[0085] Optionally, the network connection functions in the network dynamic link library include, but are not limited to, one or more of the following: InternetConnectA function, InternetConnectW function, UrlDownloadToFile function, connect function, WinHttpConnect function, or DnsQuery function. An application on a computer device can achieve network connection by loading the network dynamic link library and further calling the network connection functions in the network dynamic link library.

[0086] In the embodiments of the present application, a sample program is used to refer to any application program running on a computer device. A sample program may be, for example, a browser, office software, or game software.

[0087] Optionally, the computer device uses hook technology to monitor whether the running sample program loads the network dynamic link library. Accordingly, the implementation method of the above-mentioned step 401 is that the computer device hooks the dynamic library loading function in the operating system of the computer device through a first hook function to monitor whether the sample program loads the network dynamic link library. The first hook function hooks the dynamic library loading function in the operating system of the computer device, that is, the first hook function hooks the application programming interface (API) that calls the dynamic library loading function. In this way, the first hook function can monitor the behavior of the sample program calling the dynamic library loading function to load the network dynamic link library.

[0088] The dynamic library loading function is a function in a dynamic link library (different from a network dynamic link library) that comes with the operating system of the computer device. The dynamic link library function is used to load a dynamic link library, for example, to load a network dynamic link library. Optionally, the dynamic library loading function includes a LoadLibrary function or an LdrLoadDll function.

[0089] Optionally, the computer device uses user-state hook technology to monitor whether the running sample program loads the network dynamic link library. User-state hook technology is a technology for intercepting and modifying function calls made in an application. In this implementation, the first hook function is a user-state hook function in the sample program, and the first hook function is injected into the sample program after the sample program is started. For ease of distinction, in the embodiment of the present application, the user-state hook function used to hook the dynamic library loading function in the operating system of the computer device is referred to as the first user-state hook function. For example, when the computer device detects that the sample program is started, it injects the first user-state hook function into the sample program through security software. Optionally, the computer device injects the first user-state hook function into the sample program by injecting a DLL.

[0090] A user-mode hook function refers to a hook function that runs in user mode. User mode refers to the non-privileged mode in which applications can only access restricted resources and cannot directly operate hardware or execute privileged instructions. Applications enter kernel mode through the system call interface and request privileged operations from the operating system. Optionally, user-mode hooking techniques include, but are not limited to, inline hooking or import address table (IAT) hooking.

[0091] Alternatively, the computer device uses kernel-state hook technology to monitor whether the running sample program loads the network dynamic link library. Kernel-state hook technology is a technology for intercepting and modifying function calls performed in the kernel of the operating system. In this implementation, the first hook function is a kernel-state hook function in the kernel of the computer device. For ease of distinction, in the embodiment of the present application, the kernel-state hook function used to hook the dynamic library loading function in the operating system of the computer device is referred to as the first kernel-state hook function. For example, after the security software on the computer device is started, the first kernel-state hook function is injected into the kernel of the computer device. Among them, injecting the kernel-state hook function into the kernel of the computer device can be understood as implementing the function of the hook function in the kernel-state driver of the operating system.

[0092] A kernel-state hook function refers to a hook function that runs in kernel state. Kernel state refers to the kernel running in privileged mode, with access to all resources and the ability to execute privileged instructions. The operating system executes system calls and handles interrupts in kernel state. Optionally, kernel-state hooks are implemented based on a hypervisor. For example, kernel-state hooking techniques include, but are not limited to, model-specific register hooks (MSR hooks) or extended page table hooks (EPT hooks).

[0093] Step 402: In response to monitoring that the sample program loads the network dynamic link library, the computer device determines whether a target memory block meets the shellcode execution condition, where the target memory block is a memory block where the execution code for loading the network dynamic link library in the sample program is located.

[0094] Optionally, when the target memory block meets any one of the following conditions, it is determined that the target memory block meets the shellcode running condition. The multiple conditions include: the size of the target memory block is equal to the memory page size in the operating system of the computer device; the target memory block has private permissions, writable permissions, and executable permissions; the target memory block contains the format header of the PE file. That is, when the size of the target memory block is equal to the memory page size in the operating system of the computer device, it is determined that the target memory block meets the shellcode running condition. Alternatively, when the target memory block has private permissions, writable permissions, and executable permissions, it is determined that the target memory block meets the shellcode running condition. Alternatively, when the target memory block contains the format header of the PE file, it is determined that the target memory block meets the shellcode running condition.

[0095] Optionally, the computer device sequentially determines whether the size, permissions, and content of the target memory block meet the shellcode execution conditions. Once it is determined that the target memory block meets the shellcode execution conditions, the computer device stops executing the judgment process. The embodiment of the present application does not limit the order of judging these three judgment conditions.

[0096] If the target memory block does not meet the shellcode execution conditions, it indicates that the code running in the target memory block for loading the network dynamic link library is normal code, and the computer device does not interfere with the network behavior after the code is executed. If the target memory block meets the shellcode execution conditions, it indicates that the code running in the target memory block for loading the network dynamic link library is shellcode, and the computer device needs to block the network behavior after the shellcode. The specific implementation method is shown in step 403 below.

[0097] Step 403: If the target memory block meets the shellcode running condition, the computer device executes a malicious program processing flow for the sample program, wherein the malicious program processing flow includes: terminating the execution of the sample program before the sample program successfully calls a network connection function in a network dynamic link library.

[0098] The computer device terminates execution of the sample program, including closing the sample program and releasing the memory space occupied by the sample program.

[0099] In an embodiment of the present application, when a computer device determines that shellcode is running in a sample program, the sample program is treated as a malicious program, so that the sample program is terminated before the network connection function in the network dynamic link library is successfully called, so as to prevent the application from connecting to the remote server, thereby preventing the computer device from being controlled by an attacker through the remote server, or preventing the internal data of the computer device from being stolen by an attacker through the remote server, thereby protecting the computer device.

[0100] Optionally, before terminating the execution of the sample program, the computer device also obtains the network address information of the remote server that the sample program attempts to connect to. Accordingly, the computer device executes a malicious program processing process on the sample program, including: the computer device obtains the network connection parameters provided when the sample program attempts to call the network connection function in the network dynamic link library, and terminates the execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library. Among them, the network connection parameters include the network address information of the remote server that the sample program attempts to connect to. The network address information of the remote server includes but is not limited to one or more of the IP address of the remote server, the domain name address of the remote server, or the port number of the remote server. Optionally, the network connection parameters also include information such as a user name and a login password. Based on the network connection parameters provided by the sample program, the computer device can connect to the remote server.

[0101] Optionally, the computer device uses hook technology to obtain the network connection parameters provided by the sample program. Accordingly, the computer device obtains the network connection parameters provided when the sample program attempts to call the network connection function in the network dynamic link library in the following implementation method, including the following steps S1 to S3.

[0102] In step S1, the computer device suspends the execution of the sample program, and during the suspension period, hooks the network connection function in the network dynamic link library through the second hook function.

[0103] Among them, the second hook function hooks the network connection function in the network dynamic link library, that is, the second hook function hooks the API that calls the network connection function in the network dynamic link library, so that the second hook function can monitor the behavior of the sample program calling the network connection function to connect to the remote server.

[0104] Optionally, the second hook function is a user-mode hook function in the sample program, which is injected into the sample program after the sample program is launched. For ease of distinction, in the embodiments of the present application, the user-mode hook function used to hook the network connection function in the network dynamic link library is referred to as the second user-mode hook function. For example, upon detecting the launch of the sample program, the computer device injects the second user-mode hook function into the sample program via security software. Optionally, the computer device injects the second user-mode hook function into the sample program by injecting a DLL.

[0105] Optionally, when the computer device detects that the sample program is started, it injects the first user-state hook function and the second user-state hook function into the sample program at the same time, and hooks the dynamic library loading function in the operating system of the computer device through the first user-state hook function. Thereafter, when it is necessary to obtain the network connection parameters of the remote server to which the sample program attempts to connect, it hooks the network connection function in the network dynamic link library through the second user-state hook function. Alternatively, when the computer device detects that the sample program is started, it injects the first user-state hook function into the sample program, and hooks the dynamic library loading function in the operating system of the computer device through the first user-state hook function. Thereafter, when it is necessary to obtain the network connection parameters of the remote server to which the sample program attempts to connect, it injects the second user-state hook function into the sample program, and hooks the network connection function in the network dynamic link library through the second user-state hook function. That is, the first user-state hook function and the second user-state hook function can be injected into the sample program at one time, or can be injected into the sample program separately.

[0106] Alternatively, the second hook function is a kernel-mode hook function in the kernel of the computer device. For ease of distinction, in the embodiments of the present application, the kernel-mode hook function used to hook the network connection function in the network dynamic link library is referred to as the second kernel-mode hook function. For example, after the security software on the computer device is started, the second kernel-mode hook function is injected into the kernel of the computer device.

[0107] Optionally, after the security software on the computer device is started, the first kernel-state hook function and the second kernel-state hook function are simultaneously injected into the kernel of the computer device, and the first kernel-state hook function is used to hook the dynamic library loading function in the operating system of the computer device. Thereafter, when it is necessary to obtain the network connection parameters of the remote server to which the sample program attempts to connect, the second kernel-state hook function is used to hook the network connection function in the network dynamic link library. Alternatively, after the security software on the computer device is started, the first kernel-state hook function is injected into the kernel of the computer device, and the first kernel-state hook function is used to hook the dynamic library loading function in the operating system of the computer device. Thereafter, when it is necessary to obtain the network connection parameters of the remote server to which the sample program attempts to connect, the second kernel-state hook function is injected into the kernel of the computer device, and the second kernel-state hook function is used to hook the network connection function in the network dynamic link library. In other words, the first kernel-state hook function and the second kernel-state hook function can be injected into the kernel of the computer device at once, or can be injected into the kernel of the computer device separately.

[0108] In step S2, after the computer device completes hooking the network connection function in the network dynamic link library through the second hook function, it resumes executing the sample program.

[0109] Optionally, after the computer device completes hooking all network connection functions in the network dynamic link library through the second hook function, it resumes executing the sample program. In this way, no matter which network connection function in the network dynamic link library is called by the sample program, the second hook function can monitor it, thereby achieving comprehensive monitoring of the network connection behavior of the sample program.

[0110] In step S3, in response to the sample program calling the network connection function in the network dynamic link library, the computer device obtains the network connection parameters provided by the sample program when calling the network connection function through the second hook function.

[0111] Afterwards, the computer device terminates execution of the sample program.

[0112] Because the second hook function hooks the network connection function in the network dynamic link library, the second hook function can monitor the sample program's call to the network connection function in the network dynamic link library, thereby obtaining the network connection parameters provided by the sample program when calling the network connection function. For shellcode running in an application, the remote server the shellcode attempts to connect to is typically the attacker's control facility. By obtaining the network address information of the attacker's control facility before the malicious program in the computer device actually performs any malicious behavior, the embodiments of the present application help provide security protection against network attacks carried out by the attacker through the control facility.

[0113] Optionally, the computer device is located within a protected network protected by the protection device, and the computer device further transmits the network address information of the remote server to the protection device deployed between the computer device and the remote server. The network address information of the remote server is used by the protection device to intercept traffic from and / or traffic to the remote server.

[0114] In an embodiment of the present application, a computer device provides the protection device with the network address information of a remote server identified as the attacker's control facility. The protection device can prevent data from being stolen from computer devices within the protected network by intercepting traffic sent from the protected network to the remote server. The protection device can prevent computer devices within the protected network from being remotely controlled by intercepting traffic sent from the remote server to the protected network. The present application achieves a global blockade of the attacker's control facility by linking computer devices with the protection device, thereby protecting all computer devices within the protected network from remote attacks by the attacker.

[0115] Optionally, the computer device also reports the network address information of the remote server identified as the attacker's control facility to the cloud. By collecting information reported by different computer devices, the cloud analyzes the attacker's attack behavior characteristics, such as the attacker's target, the industry, and whether the attack is targeting a specific local area network or type of computer device or an indiscriminate attack. This creates a profile of the attacking organization to help businesses and individuals prevent and respond to cyberattacks. This profile includes, but is not limited to, the network address information of the malicious server and / or attack behavior characteristics.

[0116] The order of the steps of the application processing method provided in the embodiments of the present application can be adjusted appropriately, and the steps can be increased or decreased accordingly. Any method that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application.

[0117] The following describes the virtual device in the embodiment of the present application by way of example.

[0118] Figure 5 is a schematic diagram of the structure of an application processing device provided in an embodiment of the present application. The application processing device having the structure shown in Figure 5 is used to implement the method 400 described in the above embodiment. Optionally, the application processing device shown in Figure 5 is the computer device shown in Figure 1 or Figure 2, or the application processing device shown in Figure 5 is the security software in the computer device shown in Figure 1 or Figure 2. As shown in Figure 5, the application processing device 500 includes a monitoring module 501 and a processing module 502. Optionally, please continue to refer to Figure 5, the application processing device 500 also includes a transceiver module 503.

[0119] The monitoring module 501 is configured to monitor whether the sample program running on the computer device has loaded a network dynamic link library (DLL), which is used to support network communication for the application program and includes one or more network connection functions. The processing module 502 is configured to, in response to monitoring that the sample program has loaded the DLL, determine whether a target memory block satisfies a shellcode execution condition. The target memory block is the memory block containing the execution code in the sample program used to load the DLL; and if the target memory block satisfies the shellcode execution condition, execute a malicious program processing flow on the sample program. The malicious program processing flow includes: terminating the sample program before the sample program successfully calls a network connection function in the DLL.

[0120] Optionally, when the target memory block meets any one of the following conditions, it is determined that the target memory block meets the shellcode execution condition, and the multiple conditions include: the size of the target memory block is equal to the memory page size in the operating system of the computer device; the target memory block has private permission, writable permission and executable permission; the target memory block contains the format header of the PE file.

[0121] Optionally, the monitoring module 501 is specifically configured to hook a dynamic library loading function in the operating system of the computer device through a first hook function to monitor whether the sample program loads a network dynamic link library, where the dynamic library loading function is used to load the network dynamic link library.

[0122] Optionally, the first hook function is a user-mode hook function in the sample program, and the first hook function is injected into the sample program after the sample program is started. Alternatively, the first hook function is a kernel-mode hook function in the kernel of the computer device.

[0123] Optionally, the processing module 502 is specifically configured to obtain network connection parameters provided when the sample program attempts to call a network connection function in a network dynamic link library if the target memory block meets the shellcode running conditions, and terminate the execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library, where the network connection parameters include network address information of a remote server that the sample program attempts to connect to.

[0124] Optionally, the processing module 502 is specifically used to: if the target memory block meets the shellcode running conditions, suspend the execution of the sample program, and hook the network connection function in the network dynamic link library through the second hook function during the suspension period; after the hooking of the network connection function in the network dynamic link library is completed through the second hook function, resume the execution of the sample program; in response to the sample program calling the network connection function in the network dynamic link library, obtain the network connection parameters provided by the sample program when calling the network connection function through the second hook function; and terminate the execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library.

[0125] Optionally, the second hook function is a user-mode hook function in the sample program, and the second hook function is injected into the sample program after the sample program is started. Alternatively, the second hook function is a kernel-mode hook function in the kernel of the computer device.

[0126] Optionally, the transceiver module 503 is used to send the network address information of the remote server to the protection device deployed between the computer device and the remote server. The network address information of the remote server is used by the protection device to intercept traffic from the remote server and / or traffic sent to the remote server.

[0127] Optionally, the network address information of the remote server includes one or more of an IP address of the remote server, a domain name address of the remote server, or a port number of the remote server.

[0128] The device embodiment described in FIG5 is merely schematic. For example, the division of the modules is merely a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. The functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned modules in FIG5 may be implemented in the form of hardware or in the form of software functional units. For example, when implemented in software, the above-mentioned monitoring module 501 and processing module 502 may be implemented as software functional modules generated by the processor 201 in FIG2 after reading the program code stored in the memory 202. The modules described above in FIG5 may also be implemented separately by different hardware components of the computer device. For example, the monitoring module 501 and processing module 502 may be implemented by a portion of the processing resources of the processor 201 in FIG2 (e.g., one core in a multi-core processor), while the transceiver module 503 may be implemented by the network interface 204 in FIG2 and the remaining processing resources of the processor 201 (e.g., other cores in a multi-core processor). Obviously, the functional modules described above may also be implemented using a combination of software and hardware. For example, the transceiver module 503 may be implemented by a hardware programmable device, while the monitoring module 501 and processing module 502 may be software functional modules generated by the processor after reading program instructions stored in the memory.

[0129] The following is an example of the system in the embodiment of the present application.

[0130] For example, an embodiment of the present application provides an attack defense system, comprising: a computer device and a protection device. The computer device is located within a protected network protected by the protection device. The computer device is configured to execute the above-described method 400. Optionally, the structure of the attack defense system is, for example, as shown in FIG1 .

[0131] For example, a computer device is configured to monitor whether a sample program running on the computer device loads a network dynamic link library (DLL), which is used to support network communication for applications and includes one or more network connection functions. The computer device is further configured to, in response to monitoring the sample program loading the DLL, determine whether a target memory block meets a shellcode execution condition, where the target memory block is the memory block containing the execution code in the sample program used to load the DLL. If the target memory block meets the shellcode execution condition, execute a malicious program processing flow on the sample program. The malicious program processing flow includes obtaining network connection parameters provided by the sample program when attempting to call a network connection function in the DLL, and terminating execution of the sample program before the sample program successfully calls the network connection function in the DLL. The network connection parameters include network address information of a remote server that the sample program attempts to connect to. The computer device is further configured to transmit the remote server's network address information to a protection device. The protection device is configured to intercept traffic from and / or to the remote server based on the remote server's network address information.

[0132] Optionally, the attack defense system further includes a cloud security server. The computer device and / or the protection device is further configured to send the network address information of the remote server to the cloud security server. The cloud security server is configured to aggregate the network address information of the remote server (malicious server) collected from various sources.

[0133] Optionally, the cloud security server is also used to provide the subscriber with an attacker profile according to subscription requirements. The attacker profile includes but is not limited to the network address information of the malicious server and / or attack behavior characteristics.

[0134] For another example, an embodiment of the present application provides another attack defense system, including: a computer device and a cloud security server.

[0135] For example, a computer device is used to monitor whether a sample program running on the computer device loads a network dynamic link library, which is used to support network communication for applications and includes one or more network connection functions. The computer device is also used to, in response to monitoring the sample program loading the network dynamic link library, determine whether a target memory block meets the shellcode execution conditions, where the target memory block is the memory block where the execution code used to load the network dynamic link library in the sample program is located; and if the target memory block meets the shellcode execution conditions, execute a malicious program processing flow on the sample program, wherein the malicious program processing flow includes: obtaining network connection parameters provided by the sample program when attempting to call a network connection function in the network dynamic link library, and terminating execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library, wherein the network connection parameters include network address information of a remote server that the sample program attempts to connect to. The computer device is also used to send the network address information of the remote server to a cloud security server. The cloud security server is used to aggregate the network address information of remote servers (malicious servers) collected from various sources.

[0136] Optionally, the cloud security server is also used to provide the subscriber with an attack organization portrait according to subscription requirements. The attack organization portrait includes but is not limited to the network address information and / or attack behavior characteristics of the malicious server.

[0137] Optionally, the attack defense system further includes a protection device, wherein the computer device is located within a protected network protected by the protection device. The computer device and / or the cloud security server is further configured to send the network address information of the remote server to the protection device. The protection device is configured to intercept traffic from and / or traffic destined for the remote server based on the network address information of the remote server.

[0138] An embodiment of the present application further provides a computer device comprising: a memory, a network interface, and at least one processor. The memory is configured to store program instructions, and the at least one processor reads the program instructions stored in the memory, causing the computer device to execute the above-described method 400. Optionally, the hardware structure of the computer device is shown in FIG2 .

[0139] An embodiment of the present application further provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed by a processor of a computer device, the steps executed by the computer device in the above method embodiment are implemented; or, when the instructions are executed by a processor of a management device, the steps executed by the management device in the above method embodiment are implemented.

[0140] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor of a computer device, implements the steps performed by the computer device in the above method embodiment; or, when executed by a processor of a management device, implements the steps performed by the management device in the above method embodiment.

[0141] In the embodiments of this application, the term traffic is also referred to as network traffic or data traffic. Traffic refers to the data transmitted over a network at a given point in time. For example, the traffic received by a device at time point T refers to all messages received by the device at time point T.

[0142] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0143] The terms "first" and "second" and the like in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects, and cannot be understood as indicating or implying relative importance.

[0144] In the description of the embodiments of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality of" means two or more.

[0145] A refers to B, which means that A is the same as B or A is a simple variant of B.

[0146] In this application, the term "and / or" simply describes a relationship between related objects, indicating the existence of three relationships. For example, A and / or B means: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0147] Optionally, in the above embodiments, all or part of the embodiments are implemented by software, hardware, firmware, or any combination thereof. Optionally, when implemented using software, all or part of the embodiments are implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. Optionally, the computer is a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Optionally, the computer instructions are stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. Optionally, the computer-readable storage medium is any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. Alternatively, the available medium is a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disk (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0148] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing an application, characterized in that: The method comprises: Monitoring whether a sample program running on a computer device has loaded a network dynamic link library, wherein the network dynamic link library is used to support network communication of an application program, and the network dynamic link library includes one or more network connection functions; In response to monitoring that the sample program loads the network dynamic link library, determining whether a target memory block meets a shellcode execution condition, the target memory block being a memory block where an execution code for loading the network dynamic link library in the sample program is located; If the target memory block meets the shellcode running condition, a malicious program processing flow is executed on the sample program, wherein the malicious program processing flow includes: terminating the execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library.

2. The method according to claim 1, characterized in that When the target memory block satisfies any one of the following conditions, it is determined that the target memory block satisfies the shellcode execution condition, wherein the conditions include: The size of the target memory block is equal to the memory page size in the operating system of the computer device; The target memory block has private permission, writable permission and executable permission; The target memory block includes a format header of a movable executable PE file.

3. The method according to claim 1 or 2, characterized in that The monitoring of whether the sample program running on the computer device loads the network dynamic link library includes: The dynamic library loading function in the operating system of the computer device is hooked through a first hook function to monitor whether the sample program loads the network dynamic link library, and the dynamic library loading function is used to load the network dynamic link library.

4. The method according to claim 3, characterized in that The first hook function is a user-mode hook function in the sample program, and the first hook function is injected into the sample program after the sample program is started; or, the first hook function is a kernel-mode hook function in the kernel of the computer device.

5. The method according to any one of claims 1 to 4, characterized in that: The malicious program processing process for the sample program includes: Obtain network connection parameters provided by the sample program when attempting to call a network connection function in the network dynamic link library, and terminate execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library, wherein the network connection parameters include network address information of a remote server that the sample program attempts to connect to.

6. The method according to claim 5, characterized in that The obtaining of the network connection parameters provided by the sample program when attempting to call the network connection function in the network dynamic link library includes: Pausing the execution of the sample program, and hooking the network connection function in the network dynamic link library through a second hook function during the suspension period; After the network connection function in the network dynamic link library is hooked by the second hook function, resuming execution of the sample program; In response to the sample program calling the network connection function in the network dynamic link library, the network connection parameters provided by the sample program when calling the network connection function are obtained through the second hook function.

7. The method according to claim 6, characterized in that The second hook function is a user-mode hook function in the sample program, and the second hook function is injected into the sample program after the sample program is started; or, the second hook function is a kernel-mode hook function in the kernel of the computer device.

8. The method according to any one of claims 5 to 7, characterized in that: The method further comprises: The network address information of the remote server is sent to a protection device deployed between the computer device and the remote server, and the network address information of the remote server is used by the protection device to intercept traffic from and / or traffic to the remote server.

9. The method according to any one of claims 5 to 8, characterized in that: The network address information of the remote server includes one or more of the Internet Protocol (IP) address of the remote server, the domain name address of the remote server, or the port number of the remote server.

10. The method according to any one of claims 1 to 9, characterized in that: The method is executed by security software running in the computer device.

11. A computer device, characterized in that: include: memory, a network interface, and at least one processor, The memory is used to store program instructions, After the at least one processor reads the program instructions stored in the memory, the computer device is caused to perform the following operations: monitoring whether a sample program running on the computer device has loaded a network dynamic link library, wherein the network dynamic link library is used to support network communication of the application program, and the network dynamic link library includes one or more network connection functions; In response to monitoring that the sample program loads the network dynamic link library, determining whether a target memory block meets a shellcode execution condition, the target memory block being a memory block where an execution code for loading the network dynamic link library in the sample program is located; If the target memory block meets the shellcode running condition, a malicious program processing flow is executed on the sample program, wherein the malicious program processing flow includes: terminating the execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library.

12. The computer device according to claim 11, wherein: When the target memory block satisfies any one of the following conditions, it is determined that the target memory block satisfies the shellcode execution condition, wherein the conditions include: The size of the target memory block is equal to the memory page size in the operating system of the computer device; The target memory block has private permission, writable permission and executable permission; The target memory block includes a format header of a movable executable PE file.

13. The computer device according to claim 11 or 12, characterized in that After the program instructions are read by the at least one processor, the computer device performs the following operations: The dynamic library loading function in the operating system of the computer device is hooked through a first hook function to monitor whether the sample program loads the network dynamic link library, and the dynamic library loading function is used to load the network dynamic link library.

14. The computer device according to claim 13, wherein: The first hook function is a user-mode hook function in the sample program, and the first hook function is injected into the sample program after the sample program is started; or, the first hook function is a kernel-mode hook function in the kernel of the computer device.

15. The computer device according to any one of claims 11 to 14, characterized in that: After the program instructions are read by the at least one processor, the computer device performs the following operations: If the target memory block meets the shellcode execution condition, network connection parameters provided by the sample program when attempting to call a network connection function in the network dynamic link library are obtained, and execution of the sample program is terminated before the sample program successfully calls the network connection function in the network dynamic link library, wherein the network connection parameters include network address information of a remote server that the sample program attempts to connect to.

16. The computer device according to claim 15, wherein: After the program instructions are read by the at least one processor, the computer device performs the following operations: If the target memory block meets the shellcode running condition, suspending the execution of the sample program, and hooking the network connection function in the network dynamic link library through the second hook function during the suspension; After the network connection function in the network dynamic link library is hooked by the second hook function, resuming execution of the sample program; In response to the sample program calling a network connection function in the network dynamic link library, obtaining, through the second hook function, the network connection parameters provided by the sample program when calling the network connection function; The execution of the sample program is terminated before the sample program successfully calls the network connection function in the network dynamic link library.

17. The computer device according to claim 16, wherein: The second hook function is a user-mode hook function in the sample program, and the second hook function is injected into the sample program after the sample program is started; or, the second hook function is a kernel-mode hook function in the kernel of the computer device.

18. The computer device according to any one of claims 15 to 17, characterized in that: After the program instructions are read by the at least one processor, the computer device further performs the following operations: The network address information of the remote server is sent to a protection device deployed between the computer device and the remote server, and the network address information of the remote server is used by the protection device to intercept traffic from and / or traffic to the remote server.

19. The computer device according to any one of claims 15 to 18, characterized in that: The network address information of the remote server includes one or more of the Internet Protocol (IP) address of the remote server, the domain name address of the remote server, or the port number of the remote server.

20. An attack defense system, characterized in that: include: Computer equipment and a protective device, the computer equipment being located within a protected network protected by the protective device; The computer device is used to monitor whether the sample program running on the computer device has loaded a network dynamic link library, wherein the network dynamic link library is used to support the application program to perform network communication, and the network dynamic link library includes one or more network connection functions; The computer device is further configured to, in response to monitoring that the sample program loads the network dynamic link library, determine whether a target memory block meets a shellcode execution condition, wherein the target memory block is a memory block where the execution code for loading the network dynamic link library in the sample program is located; and, if the target memory block meets the shellcode running condition, executing a malicious program processing flow for the sample program, wherein the malicious program processing flow includes: obtaining network connection parameters provided by the sample program when attempting to call a network connection function in the network dynamic link library, and terminating execution of the sample program before the sample program successfully calls the network connection function in the network dynamic link library, wherein the network connection parameters include network address information of a remote server that the sample program attempts to connect to; The computer device is further configured to send the network address information of the remote server to the protection device; The protection device is used to intercept traffic from the remote server and / or traffic destined for the remote server based on the network address information of the remote server.

21. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.

22. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Malicious code tracking and recognizing method based on memory protection type monitoring

    CN106991324A

  • An application layer shellcode detection method and device

    CN112395609A

  • A kernel layer shellcode detection method and device

    CN112395610A

  • Method and system for detecting shellcode malicious code and computer equipment

    CN115600204A

  • Method to detect application execution hijacking using memory protection

    US10210329B1