Process monitoring method and device, equipment, storage medium and program product
By writing breakpoints at the access address of the instruction read function, obtaining the instructions input by the user in real time and performing security evaluation, the problems of low accuracy and performance impact of user behavior monitoring in traditional technology are solved, ensuring the stability of the operating system.
Patent Information
- Application Number
- CN202411397495.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-11-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In traditional technology, user behavior monitoring has the problem of low accuracy. Real-time monitoring methods require modification of terminal configuration or installation of additional tools, which affects operating system performance.
By writing breakpoints, the instructions entered by the user are obtained in real time, stored in the access address of the instruction read function, and writing the breakpoint at the access address, interrupting the process for security evaluation, and if passed, continue execution.
It realizes accurate monitoring and security evaluation of user instructions, avoids the impact of malicious instructions on the operating system, ensures the stability of the operating system, and does not require modification of terminal configuration.
Smart Images

Figure CN118898069A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a process monitoring method, apparatus, device, storage medium and program product. Background Art
[0002] Operating systems often parse and execute user commands through the command language interpreter shell to achieve interaction between the terminal and the operating system. For example, the Linux operating system often interacts with the terminal through the Bourne Again Shell, or Bash. Users enter commands at the terminal to perform various operations such as file management, system configuration, and program execution. However, this system operation method is prone to security risks. For example, the operating system executes malicious commands under the user's instructions, or performs unauthorized operations. Therefore, it is crucial to monitor user behavior.
[0003] In traditional technology, the bash_history file is often viewed through the history command to obtain and detect user behavior. However, since historical records can be cleared or modified, this user behavior detection method has the problem of low accuracy. The real-time monitoring method often requires modifying the terminal configuration or installing additional recording tools, which can easily affect the performance of the operating system and also lead to inaccurate user behavior monitoring. Summary of the invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a process monitoring method, apparatus, device, storage medium and program product, which can obtain the user input instructions in real time by writing breakpoints without modifying the terminal configuration, thereby ensuring the accuracy of user instruction monitoring.
[0005] In a first aspect, the present application provides a process monitoring method. The method comprises: Get user instructions, store the user instructions to the access address of the instruction reading function, and write a breakpoint at the access address; Execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction into the instruction register, and interrupt the process in response to the breakpoint; Perform security assessment on the user instruction. If the user instruction passes the security assessment, continue the execution process to obtain the user instruction from the instruction register and execute the user instruction.
[0006] In combination with the first aspect, in a possible implementation method, before storing the user instruction to the access address of the instruction reading function, the method also includes: obtaining the address information of the process corresponding to the user instruction in the memory, as well as the occupied memory and offset address of the instruction reading function; determining the access address of the instruction reading function based on the address information of the process, the occupied memory and the offset address of the instruction reading function.
[0007] In combination with the first aspect, in a possible implementation method, the access address of the instruction reading function is determined based on the address information of the process, the occupied memory of the instruction reading function and the offset address, including: determining the starting address of the process in the memory from the address information of the process; adding the starting address, the occupied memory of the instruction reading function and the offset address to obtain the access address of the instruction reading function.
[0008] In combination with the first aspect, in a possible implementation, the method also includes: obtaining the identifiers of all currently running processes; determining the device parameters corresponding to the process based on the process identifier, and determining whether the process is an interactive process based on the device parameters; if the process is an interactive process, writing a breakpoint at the access address of the instruction reading function corresponding to the process.
[0009] In combination with the first aspect, in a possible implementation, writing a breakpoint at an access address includes: storing a user instruction to an access address of an instruction reading function, and writing a breakpoint after the storage address of the user instruction.
[0010] In combination with the first aspect, in a possible implementation, performing a security assessment on the user instruction includes: matching the user instruction with a preset instruction blacklist, and determining a security assessment result of the user instruction based on the matching result.
[0011] In a second aspect, the present application also provides a process monitoring device. The device comprises: A writing module is used to obtain user instructions, store the user instructions to the access address of the instruction reading function, and write a breakpoint at the access address; An interrupt module is used to execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction into the instruction register, and interrupt the process in response to the breakpoint; The evaluation module is used to perform security evaluation on the user instruction. If the user instruction passes the security evaluation, the execution process continues to obtain the user instruction from the instruction register and executes the user instruction.
[0012] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0013] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0014] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0015] The embodiment of the present application provides a process monitoring method, device, equipment, storage medium and program product, which can obtain user instructions, store user instructions to the access address of the instruction reading function, write breakpoints at the access address, execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction to the instruction register, and respond to the breakpoint to interrupt the process. Perform a security assessment on the user instruction. If the user instruction passes the security assessment, continue to execute the process to obtain the user instruction from the instruction register and execute the user instruction. That is, the embodiment of the present application can determine the memory address after the operating system reads the user instruction and before the execution in the process corresponding to the user instruction, and write a breakpoint at the address, so that the operation instruction interrupts the process first after reading the user instruction, performs a security assessment on the user instruction, and continues to execute the process corresponding to the user instruction when the security assessment passes, avoiding the user instruction with security issues from affecting the operating system, and ensuring the stability of the operating system. The present application can obtain the instructions input by the user in real time by writing breakpoints, without modifying the terminal configuration, and ensuring the accuracy of user instruction monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 A schematic diagram of a process monitoring method in one embodiment; Figure 2 Another schematic diagram of a process monitoring method in one embodiment; Figure 3 Another schematic diagram of a process monitoring method in one embodiment; Figure 4 A schematic diagram of the relationship between an address corresponding to a process and an address of an instruction reading function in one embodiment; Figure 5 Another schematic diagram of a process monitoring method in one embodiment; Figure 6 is a structural block diagram of a process monitoring device in one embodiment; Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0017] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0018] It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. In addition, the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects.
[0019] In one embodiment, Figure 1 As shown, a process monitoring method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps: Step 101: Obtain user instructions, store the user instructions to the access address of the instruction reading function, and write a breakpoint at the access address.
[0020] In the embodiment of the present application, when the user inputs an instruction in the terminal, the operating system creates a process to implement the user's instruction. During the process execution, the operating system first reads the instruction input by the user through the instruction reading function, temporarily stores the user's instruction in the access address of the instruction reading function, that is, the address of the instruction reading function in the memory, and then executes the user's instruction.
[0021] Therefore, the breakpoint can be written to the address of the instruction reading function in the memory (that is, the access address mentioned above), that is, the breakpoint can be written at the address after the user instruction is read and before execution.
[0022] Specifically, the user instruction is stored at the access address of the instruction reading function, and a breakpoint is written after the storage address of the user instruction. That is, after the user instruction is stored at the access address of the instruction reading function, a breakpoint can be written after the storage address of the user instruction, so that the operating system interrupts the process after reading the user instruction.
[0023] Step 102: execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction into the instruction register, and interrupt the process in response to the breakpoint.
[0024] In an embodiment of the present application, after the breakpoint is written, the operating system can call the waitpid function to monitor the execution progress of the process. When the process corresponding to the user instruction executes to the address corresponding to the instruction reading function, the waitpid function sends a prompt message to the operating system, and the operating system calls the instruction reading function to obtain the temporarily stored user instruction from the access address, and stores the user instruction to the instruction register corresponding to the instruction reading function, for example, the rax register.
[0025] At the same time, since a breakpoint is written at the address corresponding to the instruction reading function, the process is interrupted, that is, after the operating system reads the user instruction, it responds to the breakpoint and stops the subsequent execution process of the user instruction.
[0026] The operating system may be a Linux system, and the instruction reading function may be a readline function.
[0027] Step 103: Perform a security assessment on the user instruction. If the user instruction passes the security assessment, continue the execution process to obtain the user instruction from the instruction register and execute the user instruction.
[0028] In the embodiment of the present application, after the operating system interrupts the process corresponding to the user instruction, it performs a security assessment on the user instruction to determine the security of the user instruction. If it is determined that there is no security problem with the user instruction, that is, the user instruction passes the security assessment, the process corresponding to the user instruction continues to be executed from the interrupt address. Specifically, the operating system can obtain the user instruction from the instruction register and call related tools to execute the user instruction.
[0029] Specifically, the security assessment method of the user instruction may be to match the user instruction with a preset instruction blacklist, and determine the security assessment result of the user instruction according to the matching result.
[0030] That is, the operating system can preset an instruction blacklist based on the hazards to the system, and after interrupting the process corresponding to the user instruction and obtaining the user instruction, match the user instruction with the preset blacklist to determine whether there is an instruction identical to the user instruction in the preset blacklist. If there is an instruction matching the user instruction in the preset instruction blacklist, it is determined that the user instruction has a security problem and has failed the security assessment. The operating system can call tools to modify the user instruction, for example, calling ptrace to modify the value of the instruction register, thereby blocking the operating system from actually executing the user instruction.
[0031] If there is no instruction matching the user instruction in the preset instruction blacklist, it is determined that the user instruction has no security issues and the security assessment result is passed. The operation instruction can continue to execute the process corresponding to the user instruction from the breakpoint position.
[0032] The operating system may update the preset blacklist at predetermined intervals to ensure the accuracy of the process monitoring results.
[0033] The process monitoring method provided by the embodiment of the present application can obtain user instructions, store user instructions to the access address of the instruction reading function, write breakpoints at the access address, execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction to the instruction register, and respond to the breakpoint to interrupt the process. Perform a security assessment on the user instruction. If the user instruction passes the security assessment, the process continues to be executed to obtain the user instruction from the instruction register and execute the user instruction. That is, the embodiment of the present application can determine the memory address after the operating system reads the user instruction and before the execution in the process corresponding to the user instruction, and write a breakpoint at the address, so that the operation instruction interrupts the process after reading the user instruction, performs a security assessment on the user instruction, and continues to execute the process corresponding to the user instruction when the security assessment passes, avoiding the user instruction with security issues from affecting the operating system, and ensuring the stability of the operating system. The present application can obtain the instructions input by the user in real time by writing breakpoints, without modifying the terminal configuration, and ensuring the accuracy of user instruction monitoring.
[0034] The above-mentioned embodiment introduces a scheme for storing user instructions at the access address of the instruction reading function. In another embodiment of the present application, a scheme for determining the access address of the instruction reading function is provided. This embodiment includes the following steps: Figure 2 Steps shown: Step 201: Obtain the address information of the process corresponding to the user instruction in the memory, as well as the occupied memory and offset address of the instruction reading function.
[0035] Step 202: Determine the access address of the instruction reading function according to the address information of the process, the occupied memory and the offset address of the instruction reading function.
[0036] In an embodiment of the present application, the memory mapping information of the process corresponding to the user instruction can be obtained by reading the / proc / [pid] / maps file, and the memory mapping information includes the address information of the process in the memory, for example, the starting address and ending address of the process in the memory.
[0037] Among them, pid is the process identifier.
[0038] Then, the libbfd library can be called to obtain the binary file symbol information table, traverse the binary file symbol information table, query the symbol information of the instruction reading function, and determine the memory occupied by the instruction reading function (that is, the function body size) and the offset address of the instruction reading function relative to the process from the symbol information, specifically, the offset address of the instruction reading function relative to the starting address of the process.
[0039] Finally, the access address of the instruction reading function can be determined by calculating the address information of the process, the memory occupied by the instruction reading function, and the offset address. The specific determination process may include the following: Figure 3 Steps shown: Step 301: Determine the starting address of the process in the memory from the address information of the process.
[0040] Step 302: Add the starting address, the occupied memory of the instruction reading function and the offset address to obtain the access address of the instruction reading function.
[0041] In an embodiment of the present application, after the memory mapping information of the process corresponding to the user instruction is obtained, the starting address of the process in the memory is determined from the memory mapping information.
[0042] It is understandable that the execution of a process requires the use of multiple tools, such as functions, etc. Among them, the process corresponding to the user instruction needs to call the instruction reading function, that is, the address range occupied by the process corresponding to the user instruction in the memory includes the part of the address corresponding to the instruction reading function. Figure 4 As shown in the figure, it is the relationship between the address corresponding to the process and the address of the instruction reading function. The difference between the starting address of the instruction reading function in the memory and the starting address of the process in the memory is the offset address corresponding to the instruction reading function. Among them, X is the address range occupied by the process corresponding to the user instruction in the memory, x1 is the starting address of the process corresponding to the user instruction in the memory, and x2 is the end address of the process corresponding to the user instruction in the memory; M is the address range occupied by the instruction reading function in the memory, m1 is the starting address of the instruction reading function in the memory, and m2 is the end address (access address) of the instruction reading function in the memory; n is the offset address of the instruction reading function.
[0043] When the function code of the instruction reading function is executed to the return instruction (for example, return), it indicates that the instruction reading function has read the user instruction, and the address of the return instruction in the memory is the access address of the instruction reading function.
[0044] The return instruction is often the last instruction code in the function code. Therefore, the starting address of the process plus the offset address of the instruction reading function is the starting address of the instruction reading function. The memory occupied by the instruction reading function is the end address of the instruction reading function, that is, the address of the return instruction, which is also the access address of the above instruction reading function.
[0045] In one embodiment, considering the situation that the return instruction is not the end instruction code of the function, the starting address and the ending address of the instruction reading function can be determined in the manner described in the above embodiment, thereby determining the address range of the instruction reading function in the memory. Then, libopcodes can be used to disassemble the instruction code in the address range corresponding to the instruction reading function, convert the machine language into assembly language, and obtain the assembly instruction set of the instruction reading function. Next, the assembly instruction set is traversed to determine the return instruction of the instruction reading function, and then the address of the return instruction in the memory can be determined, that is, the access address of the instruction reading function can be determined.
[0046] In the method provided in the embodiment of the present application, the address information of the process corresponding to the user instruction in the memory, as well as the occupied memory and offset address of the instruction reading function can be obtained, and then the access address of the instruction reading function can be determined according to the above three parameters. The access address calculated by the specific parameters of the process and function in the embodiment of the present application is more accurate, thereby ensuring the accuracy of process monitoring.
[0047] The above-mentioned embodiment introduces a scheme for monitoring the process corresponding to the user instruction. Since the process created by the operating system based on the instruction input by the user is an interactive process, in another embodiment of the present application, the process type can be judged before monitoring the process. This embodiment includes the following: Figure 5 Steps shown: Step 401: Get the IDs of all currently running processes.
[0048] Step 402: Determine the device parameters corresponding to the process according to the process identifier, and determine whether the process is an interactive process according to the device parameters.
[0049] Step 403: If the process is an interactive process, a breakpoint is written at the access address of the instruction reading function corresponding to the process.
[0050] In an embodiment of the present application, the identifiers of all running processes of the operating system, i.e., PIDs, can be obtained by reading the / proc directory. Then, for each process, the device parameters corresponding to the process are obtained by reading the / proc / [pid] / stat file and parsing the tty field value in the file using the major function. Finally, the device parameters corresponding to the process are matched with the device parameters of the interactive terminal to determine whether the process is an interactive process. If the device parameters corresponding to the process are different from the device parameters of the interactive terminal, the process is determined not to be an interactive process; if the device parameters corresponding to the process are the same as the device parameters of the interactive terminal, the process is determined to be an interactive process.
[0051] When it is determined that the process is an interactive process, a breakpoint is written at the access address of the instruction reading function corresponding to the process, and the process monitoring process described in the above embodiment is executed.
[0052] In a possible implementation, after the interactive processes among all the running processes of the operating system are determined, a process list may be established based on all the running interactive processes, thereby facilitating monitoring of the interactive processes.
[0053] After obtaining the interactive process by reading the / proc directory for the first time, you can create a netlink socket and use the NETLINK_CONNECTOR protocol to block and listen to the process event to obtain the newly created interactive process. When there is a process event, the process event is parsed, and if the process event is a process creation and the newly created process is an interactive process, the newly created process is monitored. If the process event is a process termination and the terminated process is a process in the process list, the monitoring of the process is stopped.
[0054] At the same time, the operating system can also update the process list based on the newly created interactive process and the terminated interactive process determined by the blocking monitoring. The newly created interactive process is added to the process list, and the terminated interactive process is deleted from the monitoring list.
[0055] In the method provided in the embodiment of the present application, the identifiers of all currently running processes can be obtained, the device parameters corresponding to the process can be determined according to the identifier of the process, and whether the process is an interactive process can be determined according to the device parameters. If the process is an interactive process, a breakpoint is written at the access address of the instruction reading function corresponding to the process. That is, the embodiment of the present application first selects the interactive process from all the processes of the operating system, and then performs process monitoring, thereby ensuring the accuracy of process monitoring.
[0056] It should be noted that although the operations of the method of the present invention are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0057] Further references Figure 6 , which shows an exemplary structural block diagram of a process monitoring device according to an embodiment of the present application.
[0058] In one embodiment, the process monitoring device includes: a writing module 501, an interruption module 502 and an evaluation module 503, wherein: The writing module 501 is used to obtain user instructions, store the user instructions to the access address of the instruction reading function, and write a breakpoint at the access address.
[0059] The interrupt module 502 is used to execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction into the instruction register, and interrupt the process in response to the breakpoint.
[0060] The evaluation module 503 is used to perform a security evaluation on the user instruction. If the user instruction passes the security evaluation, the execution process continues to obtain the user instruction from the instruction register and execute the user instruction.
[0061] In one embodiment, the process monitoring device also includes an access address determination module 504, which is used to obtain the address information of the process corresponding to the user instruction in the memory, as well as the occupied memory and offset address of the instruction reading function; and determine the access address of the instruction reading function based on the address information of the process, the occupied memory and offset address of the instruction reading function.
[0062] In one embodiment, the access address determination module 504 is also used to determine the starting address of the process in the memory from the address information of the process; the starting address, the occupied memory of the instruction reading function and the offset address are added to obtain the access address of the instruction reading function.
[0063] In one embodiment, the process monitoring device also includes a process determination module 505, which is used to obtain the identifiers of all currently running processes; determine the device parameters corresponding to the process based on the process identifier, and determine whether the process is an interactive process based on the device parameters; if the process is an interactive process, write a breakpoint at the access address of the instruction reading function corresponding to the process.
[0064] In one embodiment, the writing module 501 is specifically used to store the user instruction to the access address of the instruction reading function, and write a breakpoint after the storage address of the user instruction.
[0065] In one embodiment, the evaluation module 503 is specifically used to match the user instruction with a preset instruction blacklist, and determine the security evaluation result of the user instruction according to the matching result.
[0066] It should be understood that the units or modules described in the process monitoring device are similar to those described in the reference Figure 1The various steps in the described method correspond to each other. Therefore, the operations and features described above for the method are also applicable to the process monitoring device and the units contained therein, and will not be repeated here. The process monitoring device can be pre-implemented in the browser or other security applications of the electronic device, and can also be loaded into the browser or its security application of the electronic device by downloading or the like. The corresponding units in the process monitoring device can cooperate with the units in the electronic device to implement the solution of the embodiment of the present application.
[0067] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device or server suitable for implementing an embodiment of the present application.
[0068] like Figure 7 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0069] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0070] In particular, according to the embodiments of the present disclosure, the above reference Figure 1 The described processes may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising a computer program for executing Figure 1 In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 609 and / or installed from the removable medium 611.
[0071] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium such as a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0072] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0073] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0074] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the computer device described in the above embodiment, or may exist independently without being installed in the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application. For example, it can be executed Figure 1 The individual steps of the method are shown.
[0075] The present application embodiment provides a computer program product, which includes instructions. When the instructions are executed, the method described in the present application embodiment is executed. For example, Figure 1 The individual steps of the method are shown.
[0076] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0077] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A process monitoring method, characterized in that: The method comprises: Obtaining a user instruction, storing the user instruction in an access address of an instruction reading function, and writing a breakpoint at the access address; Execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction into the instruction register, and interrupt the process in response to the breakpoint; A security assessment is performed on the user instruction. If the user instruction passes the security assessment, the process continues to be executed to obtain the user instruction from the instruction register and execute the user instruction.
2. The method according to claim 1, characterized in that Before storing the user instruction to the access address of the instruction reading function, the method further includes: Obtaining the address information of the process corresponding to the user instruction in the memory, as well as the occupied memory and offset address of the instruction reading function; The access address of the instruction reading function is determined according to the address information of the process, the occupied memory and the offset address of the instruction reading function.
3. The method according to claim 2, characterized in that Determining the access address of the instruction reading function according to the address information of the process, the occupied memory and the offset address of the instruction reading function includes: Determining a starting address of the process in the memory from the address information of the process; The starting address, the occupied memory of the instruction reading function and the offset address are added together to obtain the access address of the instruction reading function.
4. The method according to claim 1, characterized in that: The method further comprises: Get the IDs of all currently running processes; Determining a device parameter corresponding to the process according to the identifier of the process, and determining whether the process is an interactive process according to the device parameter; If the process is an interactive process, a breakpoint is written at the access address of the instruction reading function corresponding to the process.
5. The method according to claim 1, characterized in that Writing a breakpoint at the access address comprises: The user instruction is stored at the access address of the instruction reading function, and the breakpoint is written after the storage address of the user instruction.
6. The method according to claim 1, characterized in that The performing security assessment on the user instruction includes: The user instruction is matched with a preset instruction blacklist, and a security assessment result of the user instruction is determined according to the matching result.
7. A process monitoring device, characterized in that: The device comprises: A writing module, used for acquiring user instructions, storing the user instructions to an access address of an instruction reading function, and writing a breakpoint at the access address; an interrupt module, configured to execute the process corresponding to the user instruction, call the instruction reading function to access the access address to obtain the user instruction, write the user instruction into an instruction register, and interrupt the process in response to the breakpoint; The evaluation module is used to perform a security evaluation on the user instruction. If the user instruction passes the security evaluation, the process continues to be executed to obtain the user instruction from the instruction register and execute the user instruction.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cluster fault-tolerance system, apparatus and method
CN101369241A
Dynamic stain data analyzing method and device
CN104750602A
System kernel data attack detection method and device, storage medium and computer equipment
CN112395599A
Verification method and device of operation instruction, equipment and medium
CN115001779A
Container debugging system and method
CN116302916A
