Process protection method, marking method, device and equipment

By obtaining the preset identification in the extended attributes of the process file to identify and protect the process, it solves the problem of frequent configuration and inaccurate identification of the policy list in the traditional method, and achieves accurate protection and convenient configuration of the protected process.

CN112182558BActive Publication Date: 2024-09-24DATANG GAOHONG XINAN ZHEJIANG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011043749.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-09-24
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

Traditional process protection methods require frequent reconfiguration of the policy list and cannot accurately obtain protected processes, resulting in inconvenience and policy failure.

Method used

Determine the protected process by obtaining the preset identification in the extended attributes of the process file, and prevent it from closing when the process termination is detected, avoiding repeated configuration of the policy list.

Benefits of technology

It achieves accurate identification and protection of protected processes, reduces the complexity of user configuration, improves convenience and flexibility of use, and ensures the continuous service capability of key processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112182558B
    Figure CN112182558B
Patent Text Reader

Abstract

The present invention provides a process protection method, a marking method, an apparatus and a device, wherein the process protection method comprises: when a first process is detected to be terminated, obtaining an extended attribute of a process file corresponding to the first process; when the extended attribute contains a preset identifier, determining that the first process is a protected process, and preventing the first process from being closed. The present invention uses the preset identifier in the extended attribute of the process file to identify the protected process, which can not only accurately distinguish between the protected process and the ordinary process, but also does not need to repeatedly configure the policy list, which brings great convenience to the user's policy configuration and is convenient and flexible to use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a process protection method, marking method, device and equipment. Background Art

[0002] The operating system is the general manager of computer software and hardware resources and data. It is responsible for the management of huge computer system resources, frequent input and output control, and uninterrupted communication between users and the operating system. The security of the operating system cannot be ignored. At present, there are more and more attack methods against the operating system, and the methods are complex and diverse. They use the operating system's own vulnerabilities to carry out malicious damage. By killing important processes such as service processes and log processes in the system, the normal functions of the operating system are destroyed, giving viruses, Trojans and other malicious programs an opportunity to take advantage. The issue of protecting the continuous service capabilities of core processes has become an important topic in operating system security.

[0003] Traditional process protection methods use the process identification number (PID) or the absolute path of the process file to distinguish between protected processes and normal processes. The PID or absolute path of the process is collected at the user level to form a policy list, which is loaded into the kernel. The kernel distinguishes between protected processes and normal processes by matching the policy list.

[0004] Traditional process protection methods have some problems: the PID of a process changes dynamically and is different every time it is started, which means that the policy needs to be reconfigured after the process is restarted, which is extremely inconvenient to use. Although this problem can be avoided by using the absolute path of the process file, it is difficult to obtain the absolute path of the process file from the kernel state. In some specific scenarios, the obtained path is not accurate, resulting in policy failure. Summary of the invention

[0005] The present invention provides a process protection method, a marking method, a device and equipment, which solve the problem that the policy list in the traditional process protection method needs to be reconfigured repeatedly and the protected process cannot be accurately obtained.

[0006] In a first aspect, an embodiment of the present invention provides a process protection method, comprising:

[0007] When the termination of the first process is detected, obtaining an extended attribute of a process file corresponding to the first process;

[0008] In a case where the extended attribute includes a preset identifier, the first process is determined to be a protected process, and closing of the first process is prevented.

[0009] In a second aspect, an embodiment of the present invention provides a process marking method, characterized by comprising:

[0010] Obtaining a preset identifier of a target process, wherein the preset identifier is used to indicate that the target process is a protected process;

[0011] According to the preset identifier, an extended attribute of the process file corresponding to the target process is obtained.

[0012] In a third aspect, an embodiment of the present invention provides a process protection device, comprising: a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the process protection method described in the first aspect when executing the computer program.

[0013] In a fourth aspect, an embodiment of the present invention provides a process protection device, including:

[0014] A first acquisition module is used to acquire an extended attribute of a process file corresponding to the first process when a target operation of closing the first process is detected;

[0015] The processing module is used to determine that the first process is a protected process and prevent the first process from being closed when the extended attribute includes a preset identifier.

[0016] In a fifth aspect, an embodiment of the present invention provides a process marking device, including:

[0017] A second acquisition module is used to acquire a preset identifier input by a user for a target process, where the preset identifier is used to indicate that the target process is a protected process;

[0018] The third acquisition module is used to obtain the extended attribute of the process file corresponding to the target process according to the preset identifier.

[0019] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the process protection method as described in the first aspect, or the steps of the process marking method as described in the second aspect.

[0020] The beneficial effects of the above technical solution of the present invention are:

[0021] The solution of the present invention utilizes the preset identifier in the extended attribute of the process file to identify the protected process, which can not only accurately distinguish the protected process from the ordinary process, but also eliminates the need to repeatedly configure the policy list, thus greatly facilitating the user's policy configuration and being convenient and flexible to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram showing a process flow of a process protection method according to an embodiment of the present invention;

[0023] Figure 2 A schematic diagram showing a process flow of a process marking method according to an embodiment of the present invention;

[0024] Figure 3 A schematic diagram showing a module of a process protection device according to an embodiment of the present invention;

[0025] Figure 4 A schematic diagram showing a module of a process marking device according to an embodiment of the present invention;

[0026] Figure 5 A structural block diagram showing a process protection device and a process marking device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help fully understand the embodiments of the present invention. Therefore, it should be clear to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. In addition, for clarity and brevity, the description of known functions and structures is omitted.

[0028] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0029] In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0030] Additionally, the terms "system" and "network" are often used interchangeably herein.

[0031] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0032] Specifically, the embodiments of the present invention provide a process protection method and a process marking method, which solve the problem that the policy list in the traditional process protection method needs to be reconfigured repeatedly and the protected process cannot be accurately obtained.

[0033] First embodiment

[0034] like Figure 1 As shown, an embodiment of the present invention provides a process protection method, which is applied to a terminal or a server, etc., and specifically includes the following steps:

[0035] Step 101: When it is detected that a first process is terminated, an extended attribute of a process file corresponding to the first process is obtained.

[0036] In this step, the first process can be any process. The termination of the first process is triggered by the start of the second process. The second process and the second process are two different processes.

[0037] Step 102: When the extended attribute includes a preset identifier, determine that the first process is a protected process, and prevent the first process from being closed.

[0038] The preset identifier may be a preset specific identifier, through which a process is identified as a protected process.

[0039] The process protection method of the embodiment of the present invention utilizes a preset identifier in the extended attributes of a process file to identify a protected process, which can not only accurately distinguish between a protected process and an ordinary process, but also eliminates the need to repeatedly configure a policy list, thereby greatly facilitating the user's policy configuration and being convenient and flexible to use.

[0040] Optionally, the process file is a binary executable file.

[0041] In the embodiment of the present application, when the termination of the first process is detected, the extended attribute of the binary executable file of the first process is obtained, and whether the first process is a protected process is distinguished by judging whether the extended attribute of the binary executable file contains a preset identifier.

[0042] Optionally, obtaining an extended attribute of a process file corresponding to the first process includes:

[0043] By ending the process hook function, the extended attribute of the process file corresponding to the first process is obtained.

[0044] For example, the task_kill hook function is used to obtain the extended attributes of the process file, so as to subsequently determine whether the first process is a protected process according to the extended attributes.

[0045] Further optionally, obtaining the extended attribute of the process file corresponding to the first process by ending the process hook function includes:

[0046] By ending the process hook function, the process structure of the first process is obtained;

[0047] By calling a file acquisition function, the file structure information of the process file is acquired from the process structure of the first process;

[0048] According to the file structure information of the process file, the extended attribute of the process file is obtained.

[0049] Exemplarily, the process structure (task_struct) of the first process is first obtained through the task_kill hook function, and then the get_task_exe_file function is called to obtain the file structure information (file structure) of the process file from the process structure, and finally the extended attributes of the process file are obtained according to the file structure information.

[0050] Optionally, after obtaining the extended attribute of the process file corresponding to the first process, the method further includes:

[0051] When the extended attribute does not include a preset identifier, the process is allowed to be terminated.

[0052] In the case that the extended attribute does not include the preset identifier, it is determined that the first process is not the first process, and the process is allowed to be terminated.

[0053] The process protection method of the embodiment of the present application is a kernel-level process protection method, which is implemented based on the kernel Linux Security Modules (LSM). Hook the hook function of the process killing in the kernel state. When a kill operation occurs in the kernel, first call the get_task_exe_file function to obtain the file structure of the process for the binary file (binary executable file) from the task_struct of the killed process. Then read the preset identifier of the binary file extension attribute based on the file structure, and determine whether the killed process is a protected process by the preset identifier. If it is a protected process, the current kill operation is blocked, otherwise no control is performed. This method can accurately distinguish between protected processes and normal processes, and can safely and effectively prevent the protected process from being killed.

[0054] The above-mentioned scheme of the embodiment of the present application can safely and effectively ensure that the key processes in the operating system are not killed, and can also accurately distinguish between protected processes and ordinary processes. It is convenient and flexible to use, will not cause damage to the operating system, and has no effect on the performance of the system. It can be widely used in various fields such as network servers, data centers, industrial control, personal desktops, etc.

[0055] Second embodiment

[0056] like Figure 2 As shown, an embodiment of the present invention provides a process marking method, which is applied to a terminal or a server, etc. The method specifically includes:

[0057] Step 201: Obtain a preset identifier of a target process, where the preset identifier is used to indicate that the target process is a protected process.

[0058] The preset identifier here specifically refers to the preset identifier written in the extended attribute of the process file of the target process, and the above-mentioned target process is a protected process set by the user.

[0059] Optionally, the user writes the preset identifier into the extended attribute by calling an interface provided by the file extended attribute; or, the user writes the preset identifier into the file header of a binary executable file in ELF format.

[0060] Step 202: According to the preset identifier, an extended attribute of the process file corresponding to the target process is obtained.

[0061] The process file corresponding to the above target process may specifically be a binary executable file.

[0062] Here, the extended attribute with the preset identifier is used as the extended attribute of the process file corresponding to the target process file.

[0063] In the embodiment of the present application, a user can prepare a protected process list, which includes at least one protected process, and write a preset identifier in the extended attribute of the process file of the protected process. The purpose of distinguishing between protected processes and ordinary processes is achieved through the preset identifier. Once the preset identifier is written into the extended attribute, the protection will take effect immediately regardless of whether the process is in a running state or a non-started state.

[0064] The process marking method of the embodiment of the present application identifies the protected process through the preset identifier in the extended attributes of the process file, which can accurately distinguish between the protected process and the ordinary process, and greatly facilitates the user's policy configuration. If the user wants to protect a process to prevent illegal termination, he only needs to write a specific identifier into the extended attributes of the binary executable file corresponding to the process. At the same time, if the user wants to cancel the protection control of a process, he only needs to delete the specific identifier of the extended attributes of the binary file of the process.

[0065] Third embodiment

[0066] like Figure 3 As shown, an embodiment of the present invention provides a process protection device 300, including:

[0067] A first acquisition module 301 is used to acquire an extended attribute of a process file corresponding to the first process when a target operation of closing the first process is detected;

[0068] The processing module 302 is used to determine that the first process is a protected process and prevent the first process from being closed when the extended attribute includes a preset identifier.

[0069] Optionally, in the process protection device of an embodiment of the present invention, the process file is a binary executable file.

[0070] Optionally, in the process protection device of an embodiment of the present invention, the first acquisition module is used to obtain the extended attribute of the process file corresponding to the first process by ending the process hook function.

[0071] Optionally, in the process protection device of the embodiment of the present invention, the first acquisition module includes:

[0072] A first acquisition submodule, used to acquire a process structure of the first process by ending a process hook function;

[0073] A second acquisition submodule is used to acquire file structure information of the process file from the process structure of the first process by calling a file acquisition function;

[0074] The third acquisition submodule is used to acquire the extended attribute of the process file according to the file structure information of the process file.

[0075] Optionally, the process protection device of the embodiment of the present invention further includes:

[0076] The closing module is used to allow the process to be terminated after the first obtaining module obtains the extended attribute of the process file corresponding to the first process, if the extended attribute does not contain a preset identifier.

[0077] The process protection device of the embodiment of the present invention is a device corresponding to the first embodiment of the above-mentioned method. All implementation means in the above-mentioned first embodiment are applicable to the embodiment of the process protection device and can achieve the same technical effect, which will not be repeated here.

[0078] Fourth embodiment

[0079] like Figure 4 As shown, an embodiment of the present invention provides a process marking device 400, which is applied to a terminal or a server, and the device includes:

[0080] The second acquisition module 401 is used to acquire a preset identifier input by a user for a target process, where the preset identifier is used to indicate that the target process is a protected process;

[0081] The third acquisition module 402 is used to obtain the extended attribute of the process file corresponding to the target process according to the preset identifier.

[0082] Optionally, the process file is a binary executable file.

[0083] The process marking device of the present invention is a device corresponding to the above-mentioned second embodiment. All implementation means in the above-mentioned second embodiment are applicable to the embodiment of the process marking device and can achieve the same technical effect, which will not be repeated here.

[0084] Fifth embodiment

[0085] In order to better achieve the above goals, Figure 5 As shown, an embodiment of the present invention also provides a process protection device, which can be a terminal or a server, and includes: a processor 500; and a memory 520 connected to the processor 500 through a bus interface, wherein the memory 520 is used to store programs and data used by the processor 500 when performing operations, and the processor 500 calls and executes the programs and data stored in the memory 520.

[0086] The transceiver 510 is connected to the bus interface and is used to receive and send data under the control of the processor 500; the processor 500 is used to read the program in the memory 520 to perform the following steps:

[0087] When the termination of the first process is detected, an extended attribute of a process file corresponding to the first process is obtained; when the extended attribute includes a preset identifier, the first process is determined to be a protected process, and closing of the first process is prevented.

[0088] Among them, Figure 5 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 500 and various circuits of memory represented by memory 520 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 510 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. For different terminals, the user interface 530 may also be an interface capable of externally connecting to required internal devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like. The processor 500 is responsible for managing the bus architecture and general processing, and the memory 520 may store data used by the processor 500 when performing operations.

[0089] Optionally, the process file is a binary executable file.

[0090] Optionally, when acquiring the extended attribute of the process file corresponding to the first process, the processor 500 is specifically configured to:

[0091] By ending the process hook function, the extended attribute of the process file corresponding to the first process is obtained.

[0092] Optionally, when the processor 500 obtains the extended attribute of the process file corresponding to the first process through the process end hook function, it is specifically configured to:

[0093] By ending the process hook function, the process structure of the first process is obtained; by calling the file acquisition function, the file structure information of the process file is obtained from the process structure of the first process; and according to the file structure information of the process file, the extended attribute of the process file is obtained.

[0094] Optionally, the processor 500 is further configured to:

[0095] When the extended attribute does not include a preset identifier, the process is allowed to be terminated.

[0096] The fifth embodiment described above corresponds to the first embodiment of the method described above. All implementation means in the first embodiment described above are applicable to the first optional implementation method and can achieve the same technical effect.

[0097] Sixth embodiment

[0098] In order to better achieve the above goals, Figure 5 As shown, an embodiment of the present invention further provides a process marking device, which can be a terminal or a server, and includes: a processor 500; and a memory 520 connected to the processor 500 via a bus interface, wherein the memory 520 is used to store programs and data used by the processor 500 when performing operations, and the processor 500 calls and executes the programs and data stored in the memory 520.

[0099] The transceiver 510 is connected to the bus interface and is used to receive and send data under the control of the processor 500; the processor 500 is used to read the program in the memory 520 to perform the following steps:

[0100] A preset identifier of a target process is obtained, where the preset identifier is used to indicate that the target process is a protected process; and an extended attribute of a process file corresponding to the target process is obtained according to the preset identifier.

[0101] Optionally, the process file is a binary executable file.

[0102] The sixth embodiment corresponds to the second embodiment. All implementation means in the second embodiment are applicable to the sixth embodiment and can achieve the same technical effects, which will not be described in detail here.

[0103] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing related hardware through a computer program, wherein the computer program includes instructions for executing part or all of the steps of the above method; and the computer program may be stored in a readable storage medium, and the storage medium may be any form of storage medium.

[0104] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the process protection method described above, or the steps of the process marking method described above, are implemented.

[0105] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0106] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0107] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A process protection method, characterized in that: include: When the termination of the first process is detected, obtaining an extended attribute of a process file corresponding to the first process; In a case where the extended attribute includes a preset identifier, determining that the first process is a protected process, and preventing the first process from being closed; Wherein, obtaining the extended attribute of the process file corresponding to the first process includes: By ending the process hook function, the process structure of the first process is obtained; By calling a file acquisition function, the file structure information of the process file is acquired from the process structure of the first process; According to the file structure information of the process file, the extended attribute of the process file is obtained.

2. The process protection method according to claim 1, characterized in that: The process file is a binary executable file.

3. The process protection method according to claim 1, characterized in that: After obtaining the extended attribute of the process file corresponding to the first process, the method further includes: When the extended attribute does not include a preset identifier, the process is allowed to be terminated.

4. A process marking method, characterized in that: include: Obtaining a preset identifier of a target process, wherein the preset identifier is used to indicate that the target process is a protected process; According to the preset identifier, obtaining an extended attribute of a process file corresponding to the target process; Among them, the extended attribute is obtained based on the file structure information of the process file, the file structure information of the process file is obtained from the process structure of the first process through a file acquisition function, and the process structure of the first process is obtained through an end process hook function.

5. The process marking method according to claim 4, characterized in that: The process file is a binary executable file.

6. A process protection device, comprising: A transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the process protection method as claimed in any one of claims 1 to 3 when executing the computer program.

7. A process marking device, comprising: A transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the process marking method as described in any one of claims 4 to 5 when executing the computer program.

8. A process protection device, characterized in that: include: A first acquisition module is used to acquire an extended attribute of a process file corresponding to the first process when a target operation of closing the first process is detected; a processing module, configured to determine that the first process is a protected process and prevent the first process from being closed if the extended attribute includes a preset identifier; Wherein, the first acquisition module includes: A first acquisition submodule, used to acquire a process structure of the first process by ending a process hook function; A second acquisition submodule is used to acquire file structure information of the process file from the process structure of the first process by calling a file acquisition function; The third acquisition submodule is used to acquire the extended attribute of the process file according to the file structure information of the process file.

9. A process marking device, characterized in that: include: A second acquisition module is used to acquire a preset identifier input by a user for a target process, where the preset identifier is used to indicate that the target process is a protected process; A third acquisition module, configured to obtain, according to the preset identifier, an extended attribute of a process file corresponding to the target process; Among them, the extended attribute is obtained based on the file structure information of the process file, the file structure information of the process file is obtained from the process structure of the first process through a file acquisition function, and the process structure of the first process is obtained through an end process hook function.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the process protection method according to any one of claims 1 to 3, or the steps of the process marking method according to any one of claims 4 to 5.