Method, device, electronic device and storage medium for monitoring and analyzing processes
By creating an isolated virtual running environment for each sample process in the current operating system and redirecting its operation objects, the problem of low sample analysis efficiency in the existing technology is solved, parallel monitoring and analysis of multiple sample processes is realized, and the efficiency is improved Analytical efficiency and accuracy.
Patent Information
- Application Number
- CN201811608344.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-26
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2038-12-26
AI Technical Summary
In the existing technology, when analyzing samples in a computer system, multiple virtual machines need to be opened, which results in high system resource consumption, long startup and end times, slow analysis speed, and low efficiency.
Create an isolated virtual running environment for each sample process in the current operating system, and redirect its operation objects to the corresponding virtual environment to achieve parallel running and monitoring analysis of multiple sample processes.
It improves the efficiency of sample analysis, avoids the interaction between different sample processes, ensures the accuracy of analysis results, and reduces the startup and end time of virtual machines.
Smart Images

Figure CN110888771B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer security technology, and in particular to a method, device, electronic equipment and storage medium for monitoring and analyzing a process. Background Art
[0002] Currently, when analyzing each sample in a computer system, it is necessary to start a virtual machine, wait for the analysis to end, and output the log.
[0003] In the existing sample analysis method, since each sample corresponds to a virtual machine, when there are many samples to be analyzed, multiple virtual machines need to be started at the same time, which consumes a lot of system resources. In addition, the startup and termination of the virtual machine take a long time, and the analysis speed is slow, resulting in low analysis efficiency. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method, an apparatus, an electronic device and a storage medium for monitoring and analyzing a process, so as to improve the efficiency of analyzing a sample.
[0005] In a first aspect, an embodiment of the present invention provides a method for monitoring and analyzing processes, including: monitoring the loading of sample processes in a current operating system; when monitoring that a first sample process is loaded in the current operating system, creating a first virtual operating environment for the first sample process; when monitoring that a second sample process is loaded in the current operating system, creating a second virtual operating environment for the second sample process, wherein the second virtual operating environment is isolated from the first virtual operating environment.
[0006] According to a specific implementation method of an embodiment of the present invention, monitoring the loading of the sample process in the current operating system includes: monitoring the loading of the sample process in the current operating system in the same virtual machine; or monitoring the loading of the sample process in the current operating system directly running on the physical device.
[0007] According to a specific implementation method of an embodiment of the present invention, creating a first virtual operating environment for a first sample process includes: creating first common resources and variables for the first sample process when the first sample process is running; creating a second virtual operating environment for a second sample process includes: creating second common resources and variables for the second sample process when the second sample process is running.
[0008] According to a specific implementation manner of an embodiment of the present invention, after creating a first virtual operating environment for a first sample process, the method further includes: redirecting an operation object of the first sample process to the first virtual operating environment; after creating a second virtual operating environment for a second sample process, the method further includes: redirecting an operation object of the second sample process to the second virtual operating environment.
[0009] According to a specific implementation manner of an embodiment of the present invention, after redirecting the operation object of the second sample process to the second virtual execution environment, the method further includes: outputting the execution monitoring logs of the first sample process and the second sample process.
[0010] In a second aspect, an embodiment of the present invention provides a device for monitoring and analyzing processes, comprising: a monitoring module for monitoring the loading of a sample process in a current operating system; a first virtual environment creation module for creating a first virtual operating environment for the first sample process when monitoring the loading of the first sample process in the current operating system; a second virtual environment creation module for creating a second virtual operating environment for the second sample process when monitoring the loading of the second sample process in the current operating system; wherein the second virtual operating environment is isolated from the first virtual operating environment.
[0011] According to a specific implementation of an embodiment of the present invention, the monitoring module is specifically used to: monitor the loading of the sample process in the current operating system in the same virtual machine; or monitor the loading of the sample process in the current operating system directly running on the physical device.
[0012] According to a specific implementation method of an embodiment of the present invention, the first virtual environment creation module is specifically used to monitor when the first sample process is loaded in the current operating system, and create a first common resource and variables for the first sample process when the first sample process is running; the second virtual environment creation module is specifically used to monitor when the second sample process is loaded in the current operating system, and create a second common resource and variables for the second sample process when the second sample process is running.
[0013] According to a specific implementation method of an embodiment of the present invention, the device also includes: a first redirection module, used to redirect the operation object of the first sample process to the first virtual operating environment; and a second redirection module, used to redirect the operation object of the second sample process to the second virtual operating environment.
[0014] According to a specific implementation of the embodiment of the present invention, the device further includes: a log output module, which is used to output the operation monitoring log of the first sample process and the second sample process.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method described in any of the aforementioned implementation methods.
[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in any of the aforementioned implementation methods.
[0017] An embodiment of the present invention provides a method, device, electronic device and storage medium for monitoring and analyzing processes. The method monitors the loading of sample processes in the current operating system. When a first sample process is monitored to be loaded in the current operating system, a first virtual operating environment is created for the first sample process. When a second sample process is monitored to be loaded in the current operating system, a second virtual operating environment is created for the second sample process. The second virtual operating environment is isolated from the first virtual operating environment. In this way, different sample processes can be run in parallel in the same operating system. Different sample processes run in their respective independent virtual operating environments. Therefore, the operating behaviors of multiple different sample processes can be monitored and analyzed simultaneously in the same operating system, which is beneficial to improving analysis efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A schematic diagram of a process flow of an embodiment of a method for monitoring and analyzing a process provided by the present invention;
[0020] Figure 2 A schematic diagram of the structure of an embodiment of a device for monitoring and analyzing a process provided by the present invention;
[0021] Figure 3 A schematic diagram of the structure of another embodiment of the device for monitoring and analyzing a process provided by the present invention;
[0022] Figure 4A schematic structural diagram of another embodiment of the device for monitoring and analyzing a process provided by the present invention;
[0023] Figure 5 A schematic diagram of the structure of an electronic device embodiment provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0025] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In a first aspect, an embodiment of the present invention provides a method for monitoring and analyzing a process, so as to improve the efficiency of analyzing a sample.
[0027] Figure 1 A flow chart of an embodiment of a method for monitoring and analyzing a process provided by the present invention is shown in FIG. Figure 1 As shown, the method of this embodiment may include:
[0028] Step 101: Monitor the loading of a sample process in the current operating system.
[0029] The current operating system may be an operating system installed on a virtual machine, or an operating system directly running on a physical hardware device, that is, an operating system of a real computer. The operating system may be a Windows operating system, or a Linux operating system, etc.
[0030] Step 102: When monitoring that the first sample process is loaded in the current operating system, create a first virtual operating environment for the first sample process.
[0031] In order to run different sample processes in parallel in the same operating system and avoid mutual influence between different sample processes to ensure the accuracy of the analysis results, in this embodiment, it is necessary to create different virtual operating environments for different sample processes running in the same operating system, and the virtual operating environments created for each sample process are isolated from each other, that is, the virtual operating environment of each sample process is relatively independent, and a sample process can only perform related operations in its corresponding virtual operating environment.
[0032] Step 103: When monitoring that the second sample process is loaded in the current operating system, create a second virtual operating environment for the second sample process, wherein the second virtual operating environment is isolated from the first virtual operating environment.
[0033] In this embodiment, multiple different sample processes can be run in parallel in the same operating system. When the first sample process is monitored to be loaded in the current operating system, a first virtual operating environment is created for the first sample process. If the second sample process is monitored to be loaded in the current operating system, a second virtual operating environment is created for the second sample process. As mentioned above, in order to avoid mutual influence between the first sample process and the second sample process and to ensure the accuracy of the analysis results, the second virtual operating environment is isolated from the first virtual operating environment.
[0034] In an embodiment of the present invention, by monitoring the loading of sample processes in the current operating system, when a first sample process is monitored to be loaded in the current operating system, a first virtual operating environment is created for the first sample process, and when a second sample process is monitored to be loaded in the current operating system, a second virtual operating environment is created for the second sample process, and the second virtual operating environment is isolated from the first virtual operating environment. In this way, different sample processes can be run in parallel in the same operating system, and different sample processes run in their respective independent virtual operating environments. Therefore, the operating behaviors of multiple different sample processes can be monitored and analyzed simultaneously in the same operating system, which is conducive to improving analysis efficiency.
[0035] In an embodiment of the present invention, the step of monitoring the loading of the sample process in the current operating system (step 101) may include: monitoring the loading of the sample process in the current operating system in the same virtual machine.
[0036] In this embodiment, the virtual machine is a complete computer system with complete hardware system functions and running in a completely isolated environment, which is simulated by software. For example, it can be VMware Workstation, VirtualBox under Windows operating system; it can also be KVM under Linux operating system, etc. Multiple virtual machines can be installed under one operating system, and each virtual machine can be installed with its own operating system. The operating system in the virtual machine can be Windows operating system, Linux operating system, etc.
[0037] In this embodiment, only one virtual machine can be installed on the host machine, and multiple monitoring samples can be run in parallel in the virtual machine. By monitoring the loading of sample processes in the operating system of the virtual machine, when the first sample process is monitored to be loaded in the current operating system, the operating system of the virtual machine creates a first virtual operating environment for the first sample process, and when the second sample process is monitored to be loaded in the current operating system, the operating system of the virtual machine creates a second virtual operating environment for the second sample process, and the second virtual operating environment is isolated from the first virtual operating environment.
[0038] In this embodiment, multiple different sample processes run in parallel in the operating system of the same virtual machine, so as to facilitate parallel monitoring and analysis of multiple different sample processes. The embodiment of the present invention is not limited thereto. In another embodiment of the present invention, the monitoring of the loading of the sample process in the current operating system (step 101) may include: monitoring the loading of the sample process in the current operating system directly running on the physical device, that is, monitoring the loading of the sample process in the operating system of the real computer.
[0039] In this embodiment, by monitoring the loading of sample processes in the operating system of a real computer, when it is monitored that a first sample process is loaded in the current operating system, the operating system of the real computer creates a first virtual operating environment for the first sample process, and when it is monitored that a second sample process is loaded in the current operating system, the operating system of the real computer creates a second virtual operating environment for the second sample process, and the second virtual operating environment is isolated from the first virtual operating environment.
[0040] By running multiple sample processes in parallel directly in the operating system of the same real computer, the operational behaviors of multiple different sample processes can also be monitored and analyzed in parallel without installing a virtual machine. This helps avoid the situation where the behaviors of some anti-virtual machine sample processes are not triggered, resulting in inaccurate analysis results.
[0041] In one embodiment of the present invention, when the first sample process is monitored to be loaded in the current operating system, creating a first virtual operating environment for the first sample process (step 102) may include: creating a first public resource for the first sample process and variables when the first sample process is running.
[0042] The first public resource may include a first file system, a first registry, a first cache area, a first user directory, and the like.
[0043] Regarding the creation of the first file system, a memory hard disk may be virtualized in memory to create the file system, or the file system may be directly created in a fixed directory under a physical hard disk.
[0044] Regarding the creation of the first registry, a database can be customized to be placed in the memory in a tree structure, or a text file can be directly used for recording, which can be deleted after use.
[0045] Regarding the creation of the first user directory, when the first sample process is monitored to be loaded in the current operating system, a corresponding set of user directories can be automatically created according to the sample process ID.
[0046] User directories are used to store user personal data. For example, in the Linux operating system, except for the root user, other users' setting files, desktop files, and personal data are all placed in their respective user directories. For example, the test user's personal data and desktop files are all placed in the / home / test / directory.
[0047] A variable at the runtime of a process refers to the PATH (path) used when the process is running, such as the python script interpreter path, the installation path of the java virtual machine, the flash plug-in path, the location of various sdk, the temporary buffer path, some default locations, such as c:\program files\, My Documents, etc. In addition, there are runtime libraries needed when the process starts, the default size of the thread stack, PEB (process environment block), TEB (thread environment block), access tokens (token), mutexes (mutex), critical (critical), atoms (atom), various vector tables, etc.
[0048] Regarding the creation of variables when the first sample process is running, an intermediate layer is inserted between the sample and the operating system environment to convert (translate, or replace) the environment variables, so that the sample mistakenly believes that the provided environment variables are the environment variables of the operating system itself.
[0049] In one embodiment of the present invention, when the second sample process is monitored to be loaded in the current operating system, a second virtual operating environment is created for the second sample process (step 103), including: creating second public resources and variables of the second sample process when it is running for the second sample process.
[0050] The second public resources may include a second file system, a second registry, a second cache area, a second user directory, and the like.
[0051] The process of creating the second public resource is similar to the process of creating the first public resource, and will not be repeated here.
[0052] The meaning of the variables when the second sample process is running and their creation are basically the same as the meaning of the variables when the first sample process is running and their creation process, and will not be repeated here.
[0053] After the virtual operating environment is created, in order to monitor the operation process of the sample process in the virtual operating environment, it is necessary to redirect the operation object of the sample process to the created virtual operating environment, so that the sample process can perform corresponding reading and writing operations in the created virtual operating environment. Specifically, in one embodiment of the present invention, after creating a first virtual operating environment for a first sample process, the method may also include: redirecting the operation object of the first sample process to the first virtual operating environment.
[0054] After creating the second virtual execution environment for the second sample process, the method further includes: redirecting the operation object of the second sample process to the second virtual execution environment.
[0055] There are many ways to redirect the operation objects of the sample process to the virtual execution environment. The following are some examples:
[0056] (I) Kernel-based approach
[0057] 1) Modify the operating system kernel, bypass the protection of PatchGuard, and add pre-set function codes. PatchGuard is the kernel protection system of Windows Vista.
[0058] 2) Hooking the operating system kernel API (Application Programming Interface) to pass through the protection of PatchGuard, so that the sample points to the pre-built virtual operating environment through the pre-set hook function during operation.
[0059] 3) Through the written filter driver, the operation of the sample process is redirected to the constructed virtual operating environment.
[0060] (II) Based on the application layer
[0061] 1) In the application layer, the API called by each process is hooked by injecting APC (Asynchronous Procedure Call).
[0062] 2) Through CRT (Create Remote Thread) injection, the API called by each process is hooked, and the objects operated by the sample process (including: file paths, registry, environment variables, etc.) are redirected to point to the pre-built virtual operating environment.
[0063] 3) Replace the DLL (dynamic link library) called by the system and redirect the objects operated by the sample process to point to the pre-built virtual operating environment.
[0064] The above-mentioned kernel layer-based approach and application layer-based approach can be used alone or in combination with each other to optimize the performance to the greatest extent.
[0065] After the operation object of the first sample process is redirected to the first virtual operating environment, the operation process of the first sample process can be recorded and analyzed to form an operation monitoring log for the first sample process; similarly, after the operation object of the second sample process is redirected to the second virtual operating environment, the operation process of the second sample process can be recorded and analyzed to form an operation monitoring log for the second sample process.
[0066] In one embodiment of the present invention, after redirecting the operation object of the second sample process to the second virtual operating environment, the method may further include: outputting the operation monitoring logs of the first sample process and the second sample process to determine whether there is malicious behavior based on the logs.
[0067] In a second aspect, an embodiment of the present invention provides a device for monitoring and analyzing a process, so as to improve the efficiency of analyzing a sample.
[0068] Figure 2 A schematic diagram of a structure of an embodiment of a device for monitoring and analyzing a process provided by the present invention, as shown in FIG. Figure 2 As shown, the device of this embodiment may include: a monitoring module 11, a first virtual environment creation module 12 and a second virtual environment creation module 13; wherein the monitoring module 11 is used to monitor the loading of the sample process in the current operating system; the first virtual environment creation module 12 is used to create a first virtual operating environment for the first sample process when monitoring the loading of the first sample process in the current operating system; the second virtual environment creation module 13 is used to create a second virtual operating environment for the second sample process when monitoring the loading of the second sample process in the current operating system; wherein the second virtual operating environment is isolated from the first virtual operating environment.
[0069] The device of this embodiment can be used to perform Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0070] In an embodiment of the present invention, the monitoring module 11 is specifically used to monitor the loading of the sample process in the current operating system in the same virtual machine.
[0071] In this embodiment, the virtual machine is a complete computer system with complete hardware system functions and running in a completely isolated environment, which is simulated by software. For example, it can be VMware Workstation, VirtualBox under Windows operating system; it can also be KVM under Linux operating system, etc. Multiple virtual machines can be installed under one operating system, and each virtual machine can be installed with its own operating system. The operating system in the virtual machine can be Windows operating system, Linux operating system, etc.
[0072] In this embodiment, only one virtual machine can be installed on the host machine, and multiple monitoring samples can be run in parallel in the virtual machine. By monitoring the loading of sample processes in the operating system of the virtual machine, when the first sample process is monitored to be loaded in the current operating system, the operating system of the virtual machine creates a first virtual operating environment for the first sample process, and when the second sample process is monitored to be loaded in the current operating system, the operating system of the virtual machine creates a second virtual operating environment for the second sample process, and the second virtual operating environment is isolated from the first virtual operating environment.
[0073] In this embodiment, multiple different sample processes run in parallel in the operating system of the same virtual machine, so as to monitor and analyze multiple different sample processes in parallel. The embodiment of the present invention is not limited to this. In another embodiment of the present invention, the monitoring module 11 can also be specifically used to monitor the loading of the sample process in the current operating system directly running on the physical device.
[0074] In this embodiment, by monitoring the loading of sample processes in the operating system of a real computer, when it is monitored that a first sample process is loaded in the current operating system, the operating system of the real computer creates a first virtual operating environment for the first sample process, and when it is monitored that a second sample process is loaded in the current operating system, the operating system of the real computer creates a second virtual operating environment for the second sample process, and the second virtual operating environment is isolated from the first virtual operating environment.
[0075] By running multiple sample processes in parallel directly in the operating system of the same real computer, the operating behaviors of multiple different sample processes can also be monitored and analyzed simultaneously without installing a virtual machine. This helps to avoid the situation where some anti-virtual machine sample process behaviors are not triggered, resulting in inaccurate analysis results.
[0076] In one embodiment of the present invention, the first virtual environment creation module 12 is specifically used to monitor when the first sample process is loaded in the current operating system, and to create a first common resource and variables for the first sample process when the first sample process is running; the second virtual environment creation module 13 is specifically used to monitor when the second sample process is loaded in the current operating system, and to create a second common resource and variables for the second sample process when the second sample process is running.
[0077] In this embodiment, the process of creating a first public resource for the first sample process and variables when the first sample process is running, and creating a second public resource for the second sample process and variables when the second sample process is running is basically the same as the above method embodiment and will not be repeated here.
[0078] After the virtual operating environment is created, in order to monitor the operation process of the sample process in the virtual operating environment, it is necessary to redirect the operation object of the sample process to the created virtual operating environment so that the sample process can perform corresponding read and write operations in the created virtual operating environment. For details, see Figure 3 As shown, in another embodiment of the present invention, the device further includes: a first redirection module 14 and a second redirection module 15; wherein the first redirection module 14 is used to redirect the operation object of the first sample process to the first virtual operating environment; the second redirection module 15 is used to redirect the operation object of the second sample process to the second virtual operating environment.
[0079] The manner of redirecting the operation object of the sample process to the virtual operating environment is the same as the corresponding manner in the above method embodiment, and will not be repeated here.
[0080] After the operation object of the first sample process is redirected to the first virtual operating environment, the operation process of the first sample process can be recorded and analyzed to form an operation monitoring log for the first sample process; similarly, after the operation object of the second sample process is redirected to the second virtual operating environment, the operation process of the second sample process can be recorded and analyzed to form an operation monitoring log for the second sample process.
[0081] See also Figure 4 In another embodiment of the present invention, the device further includes: a log output module 15, which is used to output the operation monitoring logs of the first sample process and the second sample process, so as to determine whether there is malicious behavior based on the logs.
[0082] In a third aspect, an embodiment of the present invention further provides an electronic device. Figure 5 A schematic diagram of the structure of an electronic device embodiment provided by an embodiment of the present invention can implement the present invention Figure 1 The process of the embodiment shown is as follows: Figure 5 As shown, the electronic device may include: a housing 41, a processor 42, a memory 43, a circuit board 44 and a power supply circuit 45, wherein the circuit board 44 is placed inside the space enclosed by the housing 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power supply circuit 45 is used to supply power to various circuits or devices of the electronic device; the memory 43 is used to store executable program codes; the processor 42 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 43, so as to execute the method described in any of the above embodiments.
[0083] For details on the specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the executable program code, please refer to the present invention. Figure 1 The description of the illustrated embodiment will not be repeated here.
[0084] The electronic device exists in various forms, including but not limited to desktop computers with computing and processing functions, servers or other electronic devices with computing and processing functions.
[0085] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to execute the method described in any of the aforementioned embodiments.
[0086] The method, device, electronic device and storage medium for monitoring and analyzing processes provided by the embodiments of the present invention monitor the loading of sample processes in the current operating system. When a first sample process is monitored to be loaded in the current operating system, a first virtual operating environment is created for the first sample process. When a second sample process is monitored to be loaded in the current operating system, a second virtual operating environment is created for the second sample process. The second virtual operating environment is isolated from the first virtual operating environment. In this way, different sample processes can be run in parallel in the same operating system. Different sample processes run in their respective independent virtual operating environments. Therefore, the operating behaviors of multiple different sample processes can be monitored and analyzed simultaneously in the same operating system, which is beneficial to improving analysis efficiency.
[0087] When multiple sample processes are directly run in parallel in the operating system of the same real computer, it is helpful to avoid the situation where the behaviors of some anti-virtual machine sample processes are not triggered, resulting in inaccurate analysis results.
[0088] When redirecting the operation object of the sample process, the kernel layer-based method and the application layer-based method can be used in combination to optimize the performance to the greatest extent. After the operation behaviors of the first sample process and the second sample process in the virtual operation environment are monitored to form a monitoring log, the operation monitoring logs of the first sample process and the second sample process can be output to determine whether there is malicious behavior based on the log.
[0089] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0090] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0091] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0092] For the convenience of description, the above device is described by dividing the functions into various units / modules. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0093] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0094] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for monitoring and analyzing a process, characterized in that: include: Monitor the loading of sample processes in the current operating system; When monitoring that the first sample process is loaded in the current operating system, creating a first virtual operating environment for the first sample process; When monitoring that the second sample process is loaded in the current operating system, creating a second virtual operating environment for the second sample process, wherein the second virtual operating environment is isolated from the first virtual operating environment; The monitoring of the loading of the sample process in the current operating system includes: monitoring the loading of the sample process in the current operating system in the same virtual machine; or monitoring the loading of the sample process in the current operating system directly running on the physical device; The step of creating a first virtual operating environment for the first sample process includes: creating a first public resource for the first sample process and variables when the first sample process is running; The step of creating a second virtual operating environment for the second sample process includes: creating a second public resource for the second sample process and variables when the second sample process is running; Among them, public resources include file systems, registry, cache areas, and user directories; The step of creating a first public resource for the first sample process includes: Create a first file system by virtualizing a memory hard disk in memory, or directly create a file system in a fixed directory under a physical hard disk; Create the first registry, customize a database in a tree structure and store it in memory, or directly use a text file to record and delete it after use; Creating a first user directory, and automatically creating a corresponding set of user directories according to the sample process ID when monitoring that the first sample process is loaded in the current operating system; The variables of the sample process when running include: PATH used when the process is running, runtime library required when the process is started, default size of thread stack, PEB, TEB, access token, mutex, critical, atom, various vector tables; The variables created when the sample process is running include: By inserting an intermediate layer between the sample and the operating system environment, the environment variables are translated or replaced, so that the sample mistakenly believes that the provided environment variables are the environment variables of the operating system itself; After creating the first virtual execution environment for the first sample process, the method further includes: redirecting the operation object of the first sample process to the first virtual execution environment; After creating the second virtual operating environment for the second sample process, the method further includes: redirecting the operation object of the second sample process to the second virtual operating environment; After redirecting the operation object of the first sample process to the first virtual execution environment, the method further includes: recording and analyzing the execution process of the first sample process to form an execution monitoring log of the first sample process; After redirecting the operation object of the second sample process to the second virtual execution environment, the method further includes: recording and analyzing the execution process of the second sample process to form an execution monitoring log of the second sample process; After redirecting the operation object of the second sample process to the second virtual execution environment, the method further includes: Outputting the operation monitoring log of the first sample process and the second sample process; The step of redirecting the operation object of the first sample process to the first virtual operating environment, or redirecting the operation object of the second sample process to the second virtual operating environment, includes: In the application layer, the API called by each process is HOOKed through APC injection; The API called by each process is hooked through CRT injection, and the objects operated by the sample process are redirected to point to the pre-built virtual operating environment. The objects include: file paths, registry and environment variables; Replace the DLL of the system call and redirect the object operated by the sample process to point to the pre-built virtual operating environment; and, The redirecting the operation object of the first sample process to the first virtual operating environment, or redirecting the operation object of the second sample process to the second virtual operating environment, further includes: Modify the operating system kernel to bypass PatchGuard protection and add pre-set function code; PatchGuard is the kernel protection system of Windows Vista; Hook the operating system kernel API and pass through the protection of PatchGuard, so that the sample points to the pre-built virtual operating environment through the pre-set hook function during operation; Through the written filter driver, the operations of the sample process are redirected to the constructed virtual operating environment.
2. A device for monitoring and analyzing a process, characterized in that: include: A monitoring module, used to monitor the loading of sample processes in the current operating system; A first virtual environment creation module, configured to create a first virtual operating environment for the first sample process when monitoring that the first sample process is loaded in the current operating system; A second virtual environment creation module, used to create a second virtual operating environment for the second sample process when monitoring that the second sample process is loaded in the current operating system; wherein the second virtual operating environment is isolated from the first virtual operating environment; The monitoring module is specifically used to: monitor the loading of the sample process in the current operating system in the same virtual machine; or monitor the loading of the sample process in the current operating system directly running on the physical device; A first virtual environment creation module, specifically used to monitor that when the first sample process is loaded in the current operating system, create a first public resource and a variable when the first sample process is running for the first sample process; A second virtual environment creation module, specifically used to monitor when the second sample process is loaded in the current operating system, and to create a second public resource and variables when the second sample process is running for the second sample process; Among them, public resources include file systems, registry, cache areas, and user directories; The first virtual environment creation module is specifically used to: Create a first file system by virtualizing a memory hard disk in memory, or directly create a file system in a fixed directory under a physical hard disk; Create the first registry, customize a database in a tree structure and store it in memory, or directly use a text file to record and delete it after use; Creating a first user directory, and automatically creating a corresponding set of user directories according to the sample process ID when monitoring that the first sample process is loaded in the current operating system; A first redirection module, used for redirecting the operation object of the first sample process to the first virtual operating environment; A second redirection module, used for redirecting the operation object of the second sample process to the second virtual operating environment; A first sample monitoring module, used for recording and analyzing the running process of the first sample process to form a running monitoring log about the first sample process; A second sample monitoring module, used for recording and analyzing the running process of the second sample process to form a running monitoring log about the second sample process; Also includes: A log output module, used to output the operation monitoring log of the first sample process and the second sample process; the first redirection module, and the second redirection module, Specifically used to HOOK the API called by each process through APC injection at the application layer; The API called by each process is hooked through CRT injection, and the objects operated by the sample process are redirected to point to the pre-built virtual operating environment. The objects include: file paths, registry and environment variables; Replace the DLL of the system call and redirect the object operated by the sample process to point to the pre-built virtual operating environment; and, Modify the operating system kernel to bypass PatchGuard protection and add pre-set function code; PatchGuard is the kernel protection system of Windows Vista; Hook the operating system kernel API and pass through the protection of PatchGuard, so that the sample points to the pre-built virtual operating environment through the pre-set hook function during operation; Through the written filter driver, the operations of the sample process are redirected to the constructed virtual operating environment.
3. An electronic device, characterized in that: The electronic device comprises: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method described in the aforementioned claim 1.
4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in claim 1.
Citation Information
Patent Citations
Process migration tracking method based on multi-core platform virtual machine
CN101561769A
Method and device for detecting application program sample
CN102736944A
Safe progress isolating method based on system virtualization technology
CN103778368A
Method for quickly recovering sandbox based on file system filter driver
CN104766007A
Method for starting virtual operating system of cloud mobile phone, storage medium and processor
CN107741877A
