Trusted verification strategy method for web portal

By comparing the hash value of the debugging program and registering the operating system kernel hook, a solution that takes into account debugging requirements and security in the software development process is realized, improving the execution security of the program, and is suitable for Unix and Linux operating systems.

CN118709178APending Publication Date: 2024-09-27GUANGDONG NUCLEAR POWER JOINT VENTURE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410645661.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

During the software development process, the debugger is used by hackers and malicious attackers to crack software, steal key information or tamper with execution, resulting in security vulnerabilities and user privacy leakage. How to take into account debugging requirements and security?

Method used

Using a trusted verification strategy method for portal websites, by loading preset programs, obtaining and comparing the hash values ​​of debugging programs, using trusted root operations and SM3 algorithms to verify data consistency, registering the operating system kernel hook to adjust Hook order ensures that only debuggers allowed by security policies are debugged.

Benefits of technology

While protecting business programs from debugging attacks, they allow programs to be debugged normally, improving program execution security and are suitable for Unix and Linux operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709178A
    Figure CN118709178A
Patent Text Reader

Abstract

The invention relates to a credible verification strategy method for a web portal. The method comprises the following steps: loading and executing a first program and a second program; when the first debugging program debugs the second program, the first program obtains first data of the first debugging program and second data of the second program; when the second debugging program debugs the third program, the first program obtains third data of the third program and compares the third data with the second data; if the comparison result is consistent, the first program obtains fourth data of the second debugging program and compares the fourth data with the first data; and if the comparison result of the fourth data of the second debugging program and the first data is consistent, allowing the second debugging program to debug. The method can be suitable for the current Unix and Linux operating systems, normal debugging and updating behaviors of the program can be considered while the service program is protected from being debugged and attacked, and the execution safety of the program is improved on the premise that the service behaviors are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security, and in particular to a trusted verification strategy method for a portal website. Background Art

[0002] In the current software product development process, process debugging technology is a powerful tool for software development and debugging, but it can also be used by hackers and malicious attackers to carry out attacks. One typical attack is to use a debugger to crack the software, steal key information of the program (including algorithms, encryption keys, sensitive data and other intellectual property) or tamper with the software execution. The use of a debugger may expose the program to various security vulnerabilities, which attackers can exploit to attack, such as memory corruption, buffer overflow, etc. Through debugging technology, attackers can find vulnerabilities in the program and use them to attack, such as executing malicious code through buffer overflow attacks, so that the malicious code can wreak havoc as a normal user. This attack behavior may lead to serious security issues, including theft of intellectual property, leakage of user privacy, discovery of system vulnerabilities, etc., and debugging is an indispensable link in the process of software development, deployment, and application. Users are very confused about how to balance these two aspects. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a trusted verification strategy method for a portal website.

[0004] The technical solution adopted by the present invention to solve the technical problem is: a trusted verification strategy method for a portal website, comprising the following steps:

[0005] Loading and executing a preset first program and a preset second program;

[0006] When the first debugging program is preset to debug the second program, the first program obtains first data of the first debugging program and second data of the second program;

[0007] When the preset second debugging program debugs the preset third program, the first program obtains third data of the third program and compares it with the second data;

[0008] If the comparison results are consistent, the first program obtains the fourth data of the second debugging program and compares it with the first data;

[0009] If the comparison result of the fourth data of the second debugging program is consistent with the first data, the second debugging program is allowed to perform debugging.

[0010] Furthermore, in a trusted verification strategy method for a portal website described in the present invention, if the comparison result between the third data of the third program obtained by the first program and the second data is inconsistent, the second debugging program is allowed to perform debugging.

[0011] Furthermore, in a trusted verification strategy method for a portal website described in the present invention, comparing the first data with the second data in the first program includes:

[0012] The first data and the second data in the first program are compared after being calculated by a trusted root.

[0013] Furthermore, in a trusted verification strategy method for a portal website described in the present invention, if the comparison result of the fourth data of the second debugging program is inconsistent with the first data, the second debugging program is not allowed to debug, and logs are generated and / or an alarm is issued.

[0014] Further, in a trusted verification strategy method for a portal website described in the present invention, the first data includes a hash value of the data of an executable code segment in the memory of the first debugger; the second data includes a hash value of the data of an executable code segment in the memory of the second program; the third data includes a hash value of the data of an executable code segment in the memory of the third program; and the fourth data includes a hash value of the data of an executable code segment in the memory of the second debugger.

[0015] Further, in a trusted verification strategy method for a portal website described in the present invention, the hash value of the data of the executable code segment in the memory of the first debugger is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the second debugger is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the first program is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the second program is obtained through the cryptographic service provided by the trusted root.

[0016] Furthermore, in a trusted authentication strategy method for a portal website described in the present invention, the cryptographic service provided by the trusted root includes an SM3 algorithm.

[0017] Furthermore, in a trusted verification policy method for a portal website described in the present invention, the first debugging program includes a debugging program permitted by a preset security policy.

[0018] Furthermore, in a trusted verification strategy method for a portal website described in the present invention, after the first program obtains the first data of the first debugging program and the second data of the second program:

[0019] Registering an operating system kernel hook in a preset first function and a preset second function;

[0020] Determining whether the hook is of the first order;

[0021] If not, adjust the hook to the first order.

[0022] Furthermore, in a trusted verification strategy method for a portal website described in the present invention, the first function includes ptrace_access_check; the second function includes ptrace_traceme.

[0023] Furthermore, in the trusted verification strategy method for a portal website described in the present invention, the operating system kernel hook includes an LSM hook.

[0024] The implementation of the present invention has the following beneficial effects: the present invention can be applied to current Unix and Linux operating systems, can protect business programs from debugging attacks while taking into account normal debugging and updating behaviors of the programs, and improves the execution security of the programs while satisfying business behaviors. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0026] Figure 1 It is a schematic diagram of the steps of a trusted verification strategy method for a portal website of the present invention;

[0027] Figure 2 It is a flow chart of a trusted verification strategy method for a portal website of the present invention;

[0028] Figure 3 It is a flow chart of a trusted verification strategy method for a portal website of the present invention;

[0029] Figure 4 It is a flow chart of a trusted verification strategy method for a portal website of the present invention. DETAILED DESCRIPTION

[0030] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0031] The terms "first", "second", "third", etc. are only used to facilitate the description of the technical solution, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the features. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0032] like Figures 1 to 4 As shown, in the first embodiment of the present invention, a trusted verification strategy method for a portal website includes the following steps (S1, S2, S3, S4 and S5):

[0033] Step S1: Load and execute a preset first program and a preset second program. In this embodiment, the preset first program is a security program, which refers to a software program used to improve the security of a computer system, network or application. These programs can take various measures to prevent unauthorized access, data leakage, malware infection and other security threats. In this embodiment, the security program is used to improve the execution security of the program. The preset second program is a protected program, such as a portal website program.

[0034] Step S2: When the first debugging program is preset to debug the second program, the first program obtains the first data of the first debugging program and the second data of the second program. In this embodiment, the first debugging program is preset as a debugging program allowed by a preset security policy, and the preset security policy is a policy for protecting the second program. The first debugging program is a program for debugging, such as a GDB (GNU Debugger) program. GDB is a powerful debugger for debugging programs written in programming languages ​​such as C and C++. It is part of the GNU (GNU's Not Unix, an important part of the free software movement, which aims to provide users with a completely free operating system) project and supports multiple operating systems, including Linux, Unix, and Windows.

[0035] Step S3: When the preset second debugging program debugs the preset third program, the first program obtains the third data of the third program and compares it with the second data. In this embodiment, the preset second debugging program is a program different from the first debugging program, and the third program is a program different from the second program.

[0036] Further, if Figure 3As shown, in this embodiment, the first data is a hash value of the data of the executable code segment (text segment) in the memory of the first debugging program, and the first data will be stored in the first program as a reference value of the security policy; the second data is a hash value of the data of the executable code segment in the memory of the second program, and the second data will be stored in the first program as a reference value of the preset protection policy, which is a policy for protecting the second program; the third data is a hash value of the data of the executable code segment in the memory of the third program; and the fourth data is a hash value of the data of the executable code segment in the memory of the second debugging program.

[0037] In a preferred embodiment, the hash value of the data of the executable code segment in the memory of the first debugger is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the second debugger is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the first program is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the second program is obtained through the cryptographic service provided by the trusted root. It should be noted that the executable code segment contains the instructions and data of the program, and these instructions are represented in binary form in the memory. In GDB, these data can be viewed through different instructions. For example, to view the assembly instructions of the executable code segment: disassemble main, this instruction will display the assembly instructions of the main function of the program (assuming it is main), including the instructions and data in the executable code segment.

[0038] In a preferred embodiment, the cryptographic service provided by the trusted root includes the SM3 algorithm. Among them, the trusted root operation refers to the trusted root-based calculation (Trusted Computing). The SM3 algorithm is used to obtain the data hash value and store it in the first program. And the first program can store multiple hash values. It should be noted that the SM3 algorithm is a cryptographic algorithm issued by the China National Cryptography Administration to replace unsafe hash algorithms such as MD5 and SHA-1. It adopts a hash structure design, has high security and anti-collision capabilities, and is suitable for various security application scenarios, such as digital signatures, message authentication codes, certificate verification, etc.

[0039] In a preferred embodiment, a full disk scan is performed when the system is initialized, and the hash value of the first data and / or the second data is stored in the first program as a reference value.

[0040] Step S4: If the comparison results are consistent, the first program obtains the fourth data of the second debugging program and compares it with the first data. Figure 3As shown, if the hash value of the data of the executable code in the memory of the third program obtained by the first program through the SM3 algorithm provided by the trusted root is consistent with the comparison result of the second data, it means that the third program is the protection object of the protection policy, and the first program needs to obtain the fourth data of the second debugging program and compare it with the first data to determine whether the second debugging program is a program allowed by the security policy.

[0041] Further, such as Figure 3 As shown, if the first program obtains the third data of the third program and the comparison result is inconsistent with the second data, the second debugging program is allowed to debug. Specifically, if the first program obtains the third data of the third program and the comparison result is inconsistent with the second data, it indicates that the third program is not a protection object of the protection policy, and the second debugging program is allowed to debug the third program.

[0042] Step S5: If the comparison result of the fourth data of the second debugging program is consistent with the first data, the second debugging program is allowed to perform debugging. Figure 4 As shown, specifically, if the hash value of the data of the executable code in the memory of the second debugging program obtained by the first program through the SM3 algorithm provided by the trusted root is consistent with the comparison result of the first data, it means that the second debugging program is a debugging program allowed by the security policy, and the second debugging program is allowed to debug the third program.

[0043] Further, such as Figure 4 As shown, if the comparison result of the fourth data of the second debugging program is inconsistent with the first data, the second debugging program is not allowed to debug, and logs and / or alarms are issued. Specifically, if the comparison result of the fourth data of the second debugging program is inconsistent with the first data, it means that the second debugging program is not a debugging program allowed by the security policy, and the second debugging program is not allowed to debug, and logs and / or alarms are issued. Among them, the trusted root will record the event of verification failure in the system log, including timestamp, operation type, related data information, etc. These logs can be checked by administrators to identify possible security issues or attack behaviors. The trusted root can be configured to send an alarm notification to the administrator or security team when the verification fails. The alarm notification can be sent by email, SMS, instant messaging, etc., so as to respond to security incidents in a timely manner and take necessary measures. When the comparison results are inconsistent, the trusted root can also automatically execute some predefined countermeasures, such as suspending data transmission, blocking access to specific resources, switching to a backup system, etc., to reduce potential risks and damages.

[0044] Further, if Figure 2 As shown, in a trusted verification strategy method for a portal website of the present invention, after the first program obtains the first data of the first debugging program and the second data of the second program:

[0045] Registering operating system kernel hooks in the first function and the second function;

[0046] Determine whether the hook is the first order;

[0047] If not, adjust the hook to the first order.

[0048] Further, in a trusted verification strategy method for a portal website of the present invention, the first function includes ptrace_access_check; the second function includes ptrace_traceme. Preferably, in a trusted verification strategy method for a portal website of the present invention, the operating system kernel hook includes an LSM hook. LSM hooks refer to specific points inserted in the kernel for intercepting and checking behaviors such as system calls, file access, and process management. By registering LSM hooks at appropriate locations, the tracing (ptrace) behavior between processes in the system can be monitored and controlled. Specifically, ptrace_access_check: This function is used to check whether a process has permission to trace another process. Registering the LSM hook at this location allows additional security checks to be performed before or after the permission check. For example, the security context (such as SELinux labels) of the calling process and the target process can be checked to determine whether the tracing operation is allowed. ptrace_traceme: This function is used to implement the ptrace (PTRACE_TRACEME) system call, which enables the current process to be traced by other processes. Registering the LSM hook at this location can control which processes can become the target of tracing. It should be noted that if the hook is in the first order, it means that the first program has completed the hook initialization and can obtain the data of the debugging program.

[0049] Exemplarily, registering an LSM hook includes the following steps:

[0050] 1. Define a hook function: First, you need to define a hook function that complies with the interface standard of the LSM framework. The function returns an integer value to indicate whether the operation is allowed (usually 0 for permission, non-zero for rejection).

[0051] 2. Register hook: Find the appropriate registration location in the kernel code (such as during LSM framework initialization) and register the hook function to the corresponding hook point (such as ptrace_access_check or ptrace_traceme).

[0052] 3. Processing logic: In the hook function, write the processing logic to decide whether to allow or deny the tracking operation based on the security context of the process (such as SELinux label) or other conditions.

[0053] 4. Testing and Verification: After developing and registering the hook function, ensure that the code is thoroughly tested and verified to avoid unexpected behaviors or system vulnerabilities.

[0054] The present invention can be applied to current Unix and Linux operating systems, can protect business programs from debugging attacks while taking into account normal debugging and updating behaviors of the programs, and improves the execution security of the programs while satisfying business behaviors.

[0055] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0056] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0057] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0058] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot limit the scope of protection of the present invention. All equivalent changes and modifications made to the scope of the claims of the present invention should fall within the scope of the claims of the present invention.

Claims

1. A trusted authentication strategy method for a portal website, characterized in that: The following steps are involved: Loading and executing a preset first program and a preset second program; When the first debugging program is preset to debug the second program, the first program obtains first data of the first debugging program and second data of the second program; When the preset second debugging program debugs the preset third program, the first program obtains third data of the third program and compares it with the second data; If the comparison results are consistent, the first program obtains the fourth data of the second debugging program and compares it with the first data; If the comparison result of the fourth data of the second debugging program is consistent with the first data, the second debugging program is allowed to perform debugging.

2. A trusted authentication strategy method for a portal website according to claim 1, characterized in that: If the first program obtains the third data of the third program, and the comparison result is inconsistent with the second data, the second debugging program is allowed to perform debugging.

3. A trusted authentication strategy method for a portal website according to claim 1, characterized in that: If the comparison result of the fourth data of the second debugging program is inconsistent with the first data, the second debugging program is not allowed to perform debugging, and a log is generated and / or an alarm is issued.

4. A trusted authentication strategy method for a portal website according to claim 1, characterized in that: The first data includes a hash value of data of an executable code segment in the memory of the first debugger; the second data includes a hash value of data of an executable code segment in the memory of the second program; the third data includes a hash value of data of an executable code segment in the memory of the third program; and the fourth data includes a hash value of data of an executable code segment in the memory of the second debugger.

5. A trusted authentication strategy method for a portal website according to claim 4, characterized in that: The hash value of the data of the executable code segment in the memory of the first debugger is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the second debugger is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the first program is obtained through the cryptographic service provided by the trusted root; the hash value of the data of the executable code segment in the memory of the second program is obtained through the cryptographic service provided by the trusted root.

6. A trusted authentication strategy method for a portal website according to claim 5, characterized in that: The cryptographic services provided by the trusted root include the SM3 algorithm.

7. A trusted authentication strategy method for a portal website according to claim 1, characterized in that: The first debugging program includes a debugging program allowed by a preset security policy.

8. A trusted authentication strategy method for a portal website according to claim 1, characterized in that: After the first program acquires the first data of the first debugging program and the second data of the second program: Registering an operating system kernel hook in a preset first function and a preset second function; Determining whether the hook is of the first order; If not, adjust the hook to the first order.

9. A trusted authentication strategy method for a portal website according to claim 8, characterized in that: The first function includes ptrace_access_check; the second function includes ptrace_traceme.

10. A trusted authentication strategy method for a portal website according to claim 8, characterized in that: The operating system kernel hook includes an LSM hook.