A system security protection method, device and storage medium
Patent Information
- Application Number
- CN202311252088.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-09-26
AI Technical Summary
但在windows操作系统中使用该方法时,常用的hook技术会被windows操作系统中独有的patchguard系统(内核保护系统)检测并记录,黑客可能会利用patchguard记录的内容对windows操作系统进行对应的攻击,因此如何在不被patchguard检测并记录到的情况下,对windows操作系统进行安全防护成为一个问题
Smart Images

Figure CN117313104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of security protection, and in particular to a method, apparatus and storage medium for system security protection. Background Technology
[0002] Currently, to prevent hacker attacks, hooking techniques are commonly used to obtain data from within the Windows operating system to check for potential attacks. However, when using this method on Windows, common hooking techniques are detected and recorded by the PatchGuard system (a kernel protection system) unique to Windows. Hackers may use the information recorded by PatchGuard to launch corresponding attacks on the Windows operating system. Therefore, how to protect the Windows operating system without being detected and recorded by PatchGuard has become a problem. Summary of the Invention
[0003] In order to provide security protection for the Windows operating system without being detected by the PatchGuard system, this application provides a method, apparatus and storage medium for system security protection.
[0004] Firstly, this application provides a method for system security protection, which adopts the following technical solution: A method for system security protection includes: When a called function is detected, the relevant information corresponding to the called function is stored in the stack; The relevant information at a preset storage location in the stack is modified to obtain a first target function, which is the modified function of the called function.
[0005] By adopting the above technical solution, when a called function is detected, the relevant information corresponding to the called function is stored in the stack, and the relevant information at a preset storage location in the stack is modified to obtain the first target function. Since the modification of the function is performed within the stack, and the kernel protection system cannot detect modifications within the stack, the process of modifying the function will not be detected or recorded.
[0006] In another possible implementation, after modifying the relevant information at a preset storage location in the stack to obtain the first objective function, the method further includes: Call the first target function and obtain the return value of the first target function; If the return value contains a preset return value, then the called function is determined to have been successfully modified.
[0007] By employing the above technical solution, calling the first target function allows us to obtain its return value. The preset return value is a pre-defined, specified return value. If the preset return value exists in the return value of the first target function, it indicates that the called function has been modified to the first target function, meaning the modification was successful. This allows users to clearly understand that the first target function has been modified and is running normally.
[0008] In another possible implementation, the method further includes: Establish the association between each called function and its corresponding first target function; An original information database is generated based on the relevant information corresponding to each called function, and an object function database is generated based on each first object function. If driver uninstallation is detected, then each function in the driver is matched with the target function library; If any function matches the target function library, then that function is determined as the target function of the driver. Based on the association relationship corresponding to the target function of the driver and the original relevant information database, the relevant information of the called function corresponding to the target function of the driver is determined; Replace the relevant information of the target function of the driver with the relevant information of the corresponding called function.
[0009] By adopting the above technical solution, an association relationship is established between each called function and its corresponding first target function, so that the corresponding called function can be determined according to the first target function and the association relationship. An original relevant information database is generated based on the relevant information corresponding to each called function to back up the relevant information of the called functions, and a target function library is generated according to each first target function. Since a modified function exists in the driver, the driver will be detected as an abnormal driver during uninstallation. Therefore, when the driver is detected for uninstallation, each function in the driver is matched with the target function library. When any function successfully matches the target function library, it indicates that a modified function exists in the driver, and this function is identified as the driver's target function. This allows the relevant information of the called function corresponding to the target function in the driver to be determined according to the association relationship of the driver's target function and the original relevant information database. The relevant information of the driver's target function is then replaced with the relevant information of the corresponding called function, thereby restoring the driver to its state before modification. This ensures that no abnormality is detected when the driver is uninstalled.
[0010] In another possible implementation, determining the relevant information of the called function corresponding to the target function of the driver based on the association relationship corresponding to the target function of the driver and the original relevant information database includes: The called functions of the driver are determined based on the association relationships corresponding to the target functions of the driver. The called function is searched in the original relevant information database to determine the relevant information corresponding to the called function.
[0011] By adopting the above technical solution, since the association relationship is a one-to-one correspondence between the called function and the first target function, the called function corresponding to the target function can be determined based on the association relationship corresponding to the target function in the driver program. The original relevant information database includes information about multiple called functions; that is, searching for the called function in the original relevant information database can determine the relevant information corresponding to the called function. This facilitates the subsequent replacement of the target function's relevant information with the corresponding called function's relevant information.
[0012] In another possible implementation, the method further includes: The original relevant information database is encrypted to obtain the first verification information corresponding to the original relevant information database; When the original relevant information database is detected to be invoked, it is determined whether the verification information of the original relevant information database input by the user is the same as the first verification information; If the verification information of the original relevant information database is the same as the first verification information, then a first prompt message is output to indicate that the original relevant information database is available for use.
[0013] In this embodiment, since the original relevant information database includes information about multiple called functions, when the Windows operating system is attacked, the relevant information in the original relevant information database may be exposed. Therefore, the original relevant information database needs to be encrypted to obtain the corresponding first verification information. When it is detected that the original relevant information database has been called, it indicates that the user needs the relevant information in the original relevant information database. The system determines whether the verification information entered by the user is the same as the first verification information to confirm that the user is an authorized user. When it is detected that the verification information entered by the user is the same as the first verification information, a first prompt message is output to indicate that the original relevant information database is available, so that the user clearly understands that the original relevant information database is available.
[0014] In another possible implementation, the method further includes: The target function library is encrypted to obtain the second verification information corresponding to the target function library; When the target function library is detected to be called, it is determined whether the verification information of the target function library input by the user is the same as the second verification information; If the verification information of the target function library is the same as the second verification information, then a second prompt message is output to indicate that the target function library is available for use.
[0015] In this embodiment of the application, since the target function library includes multiple first target functions, when the Windows operating system is attacked, multiple first target functions in the target function library may be exposed. Therefore, the target function library needs to be encrypted to obtain the corresponding second verification information. When the target function library is detected to be called, it indicates that the user needs the first target functions within the target function library. The system determines whether the user's input verification information matches the second verification information to confirm that the user is an authorized user. When the user's input verification information matches the second verification information, a second prompt message is output to indicate that the target function library is available, so that the user clearly understands that the target function library is available.
[0016] In another possible implementation, the method further includes: When a user-triggered function determination command is detected, the second target function is determined from the preset function library; Replace the called function with the second target function.
[0017] In the embodiments of this application, the preset function library is a pre-set function library that contains multiple second target functions. When a function determination instruction triggered by the user is detected, the second target function can be determined from the preset function library, and the called function can be replaced with the second target function. Since the replacement operation is to replace the entire called function, the process of user modification is reduced, thereby improving the efficiency of function replacement.
[0018] Secondly, this application provides a system security protection device, which adopts the following technical solution: A system security protection device, comprising: The storage module is used to store the relevant information corresponding to the called function into the stack when a called function is detected. The modification module is used to modify the relevant information at a preset storage location in the stack to obtain a first target function, which is the modified function of the called function.
[0019] By adopting the above technical solution, when a called function is detected, the storage module stores the relevant information corresponding to the called function in the stack, and the modification module modifies the relevant information at a preset storage location in the stack to obtain the first target function. Since the modification of the function is performed within the stack, and the kernel protection system cannot detect modifications within the stack, the process of modifying the function will not be detected or recorded.
[0020] In another possible implementation, the device further includes: The calling module is used to call the first target function and obtain the return value of the first target function; The first determining module is used to determine that the called function has been successfully modified when the return value contains a preset return value.
[0021] In another possible implementation, the device further includes: A module is established to establish the association between each called function and its corresponding first target function; The generation module is used to generate an original information database based on the relevant information corresponding to each called function, and to generate a target function database based on each first target function; A matching module is used to match each function in the driver with the target function library when driver uninstallation is detected. The second determining module is used to determine any function as the target function of the driver program when any function successfully matches the target function library. The third determining module is used to determine the relevant information of the called function corresponding to the target function of the driver based on the association relationship corresponding to the target function of the driver and the original relevant information database; The first replacement module is used to replace the relevant information of the target function of the driver with the relevant information of the corresponding original function.
[0022] In another possible implementation, when the third determining module determines the relevant information of the called function corresponding to the target function of the driver based on the association relationship corresponding to the target function of the driver and the original relevant information database, it is specifically used for: The called functions of the driver are determined based on the association relationships corresponding to the target functions of the driver. The called function is searched in the original relevant information database to determine the relevant information of the called function.
[0023] In another possible implementation, the device further includes: The first encryption module is used to encrypt the original relevant information database to obtain the first verification information corresponding to the original relevant information database; The first judgment module is used to determine whether the verification information of the original relevant information database input by the user is the same as the first verification information when the original relevant information database is detected to be called. The first output module is used to output a first prompt message indicating that the original relevant information database is available when the verification information of the original relevant information database is the same as the first verification information.
[0024] In another possible implementation, the device further includes: The second encryption module is used to encrypt the target function library to obtain the second verification information corresponding to the target function library; The second judgment module is used to determine whether the verification information of the target function library input by the user is the same as the second verification information when the target function library is detected to be called. The second output module is used to output a second prompt message indicating that the target function library is available for use when the verification information of the target function library is the same as the second verification information.
[0025] In another possible implementation, the device further includes: The fourth determination module is used to determine the second target function from a preset function library when a user-triggered function determination command is detected. The second replacement module is used to replace the called function with the second target function.
[0026] Thirdly, this application provides an electronic device that adopts the following technical solution: An electronic device comprising: One or more processors; Memory; One or more applications, wherein the applications are stored in memory and configured to be executed by one or more processors, the applications being configured to: perform a method of system security protection as shown in any possible implementation of the first aspect.
[0027] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium that, when the computer program is executed in a computer, causes the computer to perform the system security protection method described in any one of the first aspects.
[0028] In summary, this application includes at least one of the following beneficial technical effects: 1. When a called function is detected, the relevant information of the called function is stored in the stack, and the relevant information at a preset storage location in the stack is modified to obtain the first target function. Since the modification of the function is performed in the stack, and the kernel protection system cannot detect the modification in the stack, the process of modifying the function will not be detected and recorded; 2. Calling the first target function will retrieve its return value. The default return value is a pre-defined value. If the default return value is present in the return value of the first target function, it indicates that the called function has been modified to match the first target function, meaning the modification was successful. This allows users to clearly understand that the first target function has been modified and is functioning correctly. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating a system security protection method according to an embodiment of this application.
[0030] Figure 2 This is a schematic diagram of the structure of a system security protection device according to an embodiment of this application.
[0031] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0032] The following is in conjunction with the appendix Figure 1-3 This application will be described in further detail.
[0033] After reading this specification, those skilled in the art may make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.
[0034] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0036] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0037] This application provides a system security protection method executed by an electronic device, which can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication. This application does not impose any limitations on this connection. Figure 1 As shown, the method includes steps S101 and S102, wherein, Step S101: When a called function is detected, the relevant information corresponding to the called function is stored in the stack.
[0038] In this embodiment of the application, the called function refers to the function called by the system. A system call (syscall) is a call from ring 3 to ring 0 of the kernel. Assuming the relevant information of the called function is a=123, when the existence of a called function is detected, the relevant information of the called function is stored on the stack. Specifically, the push operation can be used to push the relevant information in the function's registers onto the stack. For example, push ax means to store the relevant information in the ax register onto the stack.
[0039] In this embodiment of the application, the existence of a called function can be detected by using the event tracing function of ETW (Event Tracing for Windows). ETW mainly collects Windows Event Tracing events, such as page faults, virtual memory address allocation and release, interrupts, syscall system calls, network and disk DPC events, context switches, etc.
[0040] Step S102: Modify the relevant information at the preset storage location in the stack to obtain the first objective function. The first target function is the modified function of the called function.
[0041] In this embodiment, the preset storage location is the position of the relevant information of the called function on the stack. For example, the preset storage location could be the position at WMI_LOGGER_CONTEXT + 0x28 on the stack. Therefore, modifying the relevant information in the storage location can yield the first target function. Since the modification of the function is performed on the stack, and the patchguard system cannot detect the modification on the stack, the process of modifying the function will not be detected and recorded by the patchguard system.
[0042] In one possible implementation of this application embodiment, step S102 is followed by steps S103 (not shown in the figure) and S104 (not shown in the figure), wherein... Step S103: Call the first objective function and obtain the return value of the first objective function.
[0043] In this embodiment of the application, assuming the first target function is NtReadVirtualMemory, it can be called using `callNtReadVirtualMemory`. Assume the return value of this first target function is a=123 and b=1.
[0044] Step S104: If the return value contains a preset return value, then the called function is confirmed to have been successfully modified.
[0045] In this embodiment of the application, the preset return value is a pre-set return value used to detect whether the called function has been successfully modified. If the preset return value exists in the function's return value, it indicates that the called function has been successfully modified.
[0046] Taking step S103 as an example, the return value of the NtReadVirtualMemory function is a=123, b=1. Assume the default return value is b=1. Since the NtReadVirtualMemory function has a default return value, it is determined that the NtReadVirtualMemory function is the first target function. This allows the user to clearly understand that the called function has been successfully modified.
[0047] One possible implementation of this application embodiment further includes steps S105 (not shown in the figure), S106 (not shown in the figure), S107 (not shown in the figure), S108 (not shown in the figure), S109 (not shown in the figure), and S110 (not shown in the figure), wherein, Step S105: Establish the association between each called function and its corresponding first target function.
[0048] In this embodiment of the application, an association is established between each called function and its corresponding first target function, so that the corresponding called function can be determined subsequently based on the first target function and the association. For example, function 'a' is associated with the first target function 'A'. Subsequently, when the first target function is function 'A', the called function can be determined to be function 'a' based on the association.
[0049] Step S106: Generate an original information database based on the relevant information corresponding to each called function, and generate a target function database based on each first target function.
[0050] In this embodiment of the application, an original information database is generated based on the relevant information corresponding to each called function. Specifically, the relevant information corresponding to each called function can be stored to generate the original information database, so as to facilitate the subsequent determination of the relevant information corresponding to the called function. An object function library is generated based on each first object function. Specifically, each first object function can be stored to obtain the object function library, so that each first object function is recorded in the object database, thereby facilitating the subsequent determination of the object functions in the driver program.
[0051] Assume the original relevant information database includes function a: a=123, and the target function database includes functions A, D, and E.
[0052] Step S107: If driver uninstallation is detected, then each function in the driver is matched with the target function library.
[0053] In this embodiment, when a replaced target function exists in the driver, it will be detected by PatchGuard during driver uninstallation, leading to blue screen errors. Therefore, when driver uninstallation is detected, each function in the driver is matched with the target function library to determine whether a replaced target function exists in the driver. For example, the driver includes functions A, B, and C, and the target function library includes functions A, D, and E.
[0054] Step S108: If any function successfully matches the target function library, then that function is determined as the target function of the driver.
[0055] In the embodiments of this application, when any function successfully matches the target function library, it indicates that there is a modified function in the driver, and that function is determined as the target function of the driver. Taking step S108 as an example, if function A in the target function library is consistent with function A in the driver, function A is determined as the target function of the driver.
[0056] Step S109: Determine the relevant information of the called function corresponding to the target function of the driver based on the association relationship of the target function of the driver and the original relevant information database.
[0057] In this embodiment of the application, the original relevant information database includes information corresponding to multiple called functions. The relevant information corresponding to the called functions is determined based on the association relationships between the driver's target functions and the original relevant information database. This allows the driver to be restored to its original state subsequently based on the relevant information corresponding to the called functions.
[0058] Taking steps S105 and S108 as examples, the target function of the driver is function A. Based on the association relationship corresponding to function A and the original related information database function a: a=123, the related information a=123 corresponding to function a is determined.
[0059] Step S110: Replace the relevant information of the target function of the driver with the relevant information of the corresponding called function.
[0060] In this embodiment of the application, the relevant information of the target function of the driver is replaced with the relevant information of the corresponding called function, thereby restoring the driver to its state before modification, so that when the driver is uninstalled, no abnormality is detected in the driver.
[0061] In one possible implementation of this application embodiment, step S109, when determining the relevant information of the called function corresponding to the target function of the driver based on the association relationship corresponding to the target function of the driver and the original relevant information database, specifically includes steps S1091 (not shown in the figure) and S1092 (not shown in the figure), wherein, Step S1091: Determine the called function of the driver based on the association relationship corresponding to the target function of the driver.
[0062] In this embodiment of the application, the called function of the driver is determined through the association relationship, so as to facilitate the subsequent determination of the relevant information corresponding to the called function. Taking steps S105 and S109 as examples, the target function of the driver is function A, and the called function of the driver is determined to be function a based on the association relationship corresponding to function A.
[0063] Step S1092: Search the original relevant information database for the function to be called to determine the relevant information corresponding to the function to be called.
[0064] For the embodiments of this application, the original relevant information database includes the relevant information of multiple called functions. Taking steps S106 and S1091 as examples, the function of the driver is function a. In the original relevant information database function a: a=123, the relevant information corresponding to the called function is determined to be a=123.
[0065] One possible implementation of this application embodiment further includes steps S111 (not shown in the figure), S112 (not shown in the figure), and S113 (not shown in the figure), wherein step S111 can be executed after step S106, wherein, Step S111: Encrypt the original relevant information database to obtain the first verification information corresponding to the original relevant information database.
[0066] In this embodiment of the application, since there is a possibility that the original relevant information database may be illegally viewed, it is necessary to encrypt the original relevant information database. Specifically, the encryption method can be to generate first verification information corresponding to the original relevant information database simultaneously when it is generated, thus obtaining the first verification information corresponding to the original relevant information database to improve its security. For example, when encrypting the original relevant information database, the generated first verification information is 4859.
[0067] Step S112: When the original relevant information database is detected to be called, determine whether the verification information of the original relevant information database input by the user is the same as the first verification information.
[0068] In this embodiment of the application, when the original relevant information database is detected to be accessed, it indicates that the user needs to obtain relevant information from the original relevant information database. The system then determines whether the verification information entered by the user from the original relevant information database is the same as the first verification information, thereby confirming the user's identity. For example, the verification information entered by the user is 4859.
[0069] Step S113: If the verification information of the original relevant information database is the same as the first verification information, then output the first prompt information to indicate that the original relevant information database is available for use.
[0070] In this embodiment of the application, when the verification information entered by the user is the same as the first verification information, it indicates that the user is a user authorized to use the original relevant information database. A first prompt message is then output to indicate that the original relevant information database is available, so that the user can clearly understand that the original relevant information database can be used normally. Taking steps S112 and S115 as examples, if the verification information 4859 entered by the user is the same as the second verification information 4859, the first prompt message is output. The first prompt message can be output on a display screen, sent to the user's terminal device, output via voice broadcast, or other output methods.
[0071] One possible implementation of this application embodiment further includes steps S114 (not shown in the figure), S115 (not shown in the figure), and S116 (not shown in the figure), wherein step S114 can be executed after step S106, wherein, Step S114: Encrypt the target function library to obtain the second verification information corresponding to the target function library.
[0072] In this embodiment of the application, since there is a possibility that the target function library may be illegally viewed, it is necessary to encrypt the target function library. Specifically, the encryption method can be to generate second verification information corresponding to the target function library simultaneously when the target function library is generated, thus obtaining the second verification information corresponding to the target function library to improve its security. For example, when encrypting the target function library, the generated second verification information is 7586.
[0073] Step S115: When the target function library is detected to be called, determine whether the verification information of the target function library input by the user is the same as the second verification information.
[0074] In this embodiment of the application, when a call to the target function library is detected, it indicates that the user needs to obtain the target function within that target function library. The system then determines whether the verification information of the target function library entered by the user is the same as the second verification information to confirm the user's identity. For example, the verification information entered by the user is 7586.
[0075] Step S116: If the verification information of the target function library is the same as the second verification information, then output the second prompt information to indicate that the target function library is available for use.
[0076] In this embodiment of the application, when the verification information input by the user is the same as the second verification information, it indicates that the user is a user authorized to use the target function library. A second prompt message is then output to indicate that the target function library is available, so that the user can clearly understand that the target function library can be used normally. Taking steps S114 and S115 as examples, if the verification information 7586 input by the user is the same as the second verification information 7586, the second prompt message is output. The first prompt message can be output on a display screen, sent to the user's terminal device, output via voice broadcast, or other output methods.
[0077] One possible implementation of this application embodiment further includes steps S117 (not shown in the figure) and S118 (not shown in the figure), wherein step S117 can be executed after step S101, wherein, Step S117: When a user-triggered function determination instruction is detected, the second target function is determined from the preset function library.
[0078] In this embodiment of the application, the preset function library is a pre-defined function library containing multiple second target functions. When a function determination command triggered by the user is detected, the second target function can be determined from the preset function library. The user can trigger the function determination command via keyboard or mouse, via touchscreen, or other triggering methods.
[0079] Step S118: Replace the called function with the second target function.
[0080] In this embodiment of the application, the called function is replaced with a second target function. Since the replacement operation is to replace the entire called function, the process of user modification is reduced, thereby improving the efficiency of function replacement.
[0081] The above embodiments describe a method for system security protection from the perspective of process flow. The following embodiments describe a device for system security protection from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0082] This application provides a system security protection device 20, such as... Figure 2 As shown, the safety protection device 20 of this system may specifically include: The storage module 201 is used to store the relevant information of the called function into the stack when the existence of the called function is detected. Modification module 202 is used to modify relevant information at a preset storage location in the stack to obtain the first target function, which is the modified function of the called function.
[0083] In this embodiment of the application, when a called function is detected, the storage module 201 stores the relevant information corresponding to the called function in the stack, and the modification module 202 modifies the relevant information at a preset storage location in the stack to obtain the first target function. Since the modification of the function is performed in the stack, and the kernel protection system cannot detect the modification in the stack, the process of modifying the function will not be detected and recorded.
[0084] In one possible implementation of this application embodiment, the apparatus 20 further includes: The calling module is used to call the first target function and obtain the return value of the first target function; The first determination module is used to determine that the called function has been successfully modified when the return value contains a preset return value.
[0085] In one possible implementation of this application embodiment, the apparatus 20 further includes: The calling module is used to call the target function and obtain the return value of the target function; The first determining module is used to determine the target function as the replaced target function when a preset return value exists in the return value.
[0086] In one possible implementation of this application embodiment, the apparatus 20 further includes: A module is established to establish the association between each called function and its corresponding first target function; The generation module is used to generate an original information database based on the relevant information corresponding to each called function, and to generate a target function database based on each first target function. The matching module is used to match each function in the driver with the target function library when driver uninstallation is detected. The second determining module is used to determine any function as the target function of the driver program when any function successfully matches the target function library. The third determining module is used to determine the relevant information of the called function corresponding to the target function of the driver based on the association relationship corresponding to the target function of the driver and the original relevant information database; The first replacement module is used to replace the relevant information of the target function of the driver with the relevant information of the corresponding original function.
[0087] In one possible implementation of this application embodiment, when the third determining module determines the relevant information of the called function corresponding to the target function of the driver based on the association relationship corresponding to the target function of the driver and the original relevant information database, it is specifically used for: The called functions of the driver are determined based on the association relationship between the target functions of the driver. The function to be called is searched in the original relevant information database to determine the relevant information of the function to be called.
[0088] In one possible implementation of this application embodiment, the apparatus 20 further includes: The first encryption module is used to encrypt the original relevant information database to obtain the first verification information corresponding to the original relevant information database; The first judgment module is used to determine whether the verification code of the original relevant information database entered by the user is the same as the first verification information when the original relevant information database is detected to be called. The first output module is used to output a first prompt message indicating that the original relevant information database is available when the verification information of the original relevant information database matches the first verification code information.
[0089] In one possible implementation of this application embodiment, the apparatus 20 further includes: The second encryption module is used to encrypt the target function library to obtain the second verification information corresponding to the target function library; The second judgment module is used to determine whether the verification information of the target function library input by the user is the same as the second verification information when the target function library is detected to be called. The second output module is used to output a second prompt message indicating that the target function library is available when the verification information of the target function library is the same as the second verification information.
[0090] In one possible implementation of this application embodiment, the apparatus 20 further includes: The fourth determination module is used to determine the second target function from a preset function library when a user-triggered function determination command is detected. The second replacement module is used to replace the called function with the second target function.
[0091] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0092] In the embodiments of this application, the first determining module, the second determining module, the third determining module, and the fourth determining module can be the same determining module, different determining modules, or partially the same determining module. The first replacement module and the second replacement module can be the same replacement module or different replacement modules. The first judgment module and the second judgment module can be the same judgment module or different judgment modules. The first output module and the second output module can be the same output module or different output modules.
[0093] This application provides an electronic device, such as... Figure 3 As shown, Figure 3 The illustrated electronic device 30 includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302. Optionally, the electronic device 30 may also include a transceiver 304. It should be noted that in practical applications, the transceiver 304 is not limited to one type, and the structure of this electronic device 30 does not constitute a limitation on the embodiments of this application.
[0094] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0095] Bus 302 may include a pathway for transmitting information between the aforementioned components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 302 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0096] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0097] The memory 303 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the foregoing method embodiments.
[0098] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0099] This application provides a computer-readable storage medium storing a computer program. When the program is run on a computer, it enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with related technologies, in this application embodiment, when a called function is detected, the relevant information corresponding to the called function is stored in the stack, and the relevant information at a preset storage location in the stack is modified to obtain the first target function. Since the modification of the function is performed in the stack, and the kernel protection system cannot detect the modification in the stack, the process of modifying the function is not detected and recorded.
[0100] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0101] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for system security protection, characterized in that, include: When a called function is detected, the relevant information corresponding to the called function is stored in the stack; The relevant information at a preset storage location in the stack is modified to obtain a first target function, which is the modified function of the called function. The process of modifying the relevant information at a preset storage location in the stack to obtain the first objective function further includes: Call the first target function and obtain the return value of the first target function; If the return value contains a preset return value, then the called function is determined to have been successfully modified. The method further includes: Establish the association between each called function and its corresponding first target function; An original information database is generated based on the relevant information corresponding to each called function, and an object function database is generated based on each first object function. If driver uninstallation is detected, then each function in the driver is matched with the target function library; If any function matches the target function library, then that function is determined as the target function of the driver. Based on the association relationship corresponding to the target function of the driver and the original relevant information database, the relevant information of the called function corresponding to the target function of the driver is determined; Replace the relevant information of the target function of the driver with the relevant information of the corresponding called function.
2. The system security protection method according to claim 1, characterized in that, The determination of relevant information about the original function corresponding to the objective function of the driver based on the association relationship corresponding to the objective function of the driver and the original relevant information database includes: The called functions of the driver are determined based on the association relationships corresponding to the target functions of the driver. The called function is searched in the original relevant information database to determine the relevant information of the called function.
3. The system security protection method according to claim 1, characterized in that, The method further includes: The original relevant information database is encrypted to obtain the first verification information corresponding to the original relevant information database; When the original relevant information database is detected to be invoked, it is determined whether the verification information of the original relevant information database input by the user is the same as the first verification information; If the verification information of the original relevant information database is the same as the first verification information, then a first prompt message is output to indicate that the original relevant information database is available for use.
4. The system security protection method according to claim 1, characterized in that, The method further includes: The target function library is encrypted to obtain the second verification information corresponding to the target function library; When the target function library is detected to be called, it is determined whether the verification information of the target function library input by the user is the same as the second verification information; If the verification information of the target function library is the same as the second verification information, then a second prompt message is output to indicate that the target function library is available for use.
5. The system security protection method according to claim 1, characterized in that, The method further includes: When a user-triggered function determination command is detected, the second target function is determined from the preset function library; Replace the called function with the second target function.
6. A system safety protection device, characterized in that, The method for implementing system security protection as described in any one of claims 1-5 includes: The storage module is used to store the relevant information corresponding to the called function into the stack when a called function is detected. The modification module is used to modify the relevant information at a preset storage location in the stack to obtain a first target function, which is the modified function of the called function.
7. An electronic device, characterized in that, It includes: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to: perform a method for system security protection according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed in the computer, the computer is instructed to perform a system security protection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
System call monitoring method and device, electronic equipment and storage medium
CN115525892A
