[ summary of the invention ]
Aspects of the present invention provide a method and an apparatus for processing a virus, so as to improve security performance of a system.
In one aspect of the present invention, a method for processing a virus is provided, including:
performing characteristic analysis on threads included by a target process to determine whether at least one thread is successfully matched with virus characteristic information in the threads included by the target process;
if at least one thread exists in the threads included in the target process and the virus characteristic information is successfully matched, determining virus type information according to the successfully matched virus characteristic information;
and forbidding the execution of the process creation operation according to the virus type information.
The foregoing aspect and any possible implementation manner further provide an implementation manner, where performing feature analysis on threads included in a target process to determine whether at least one of the threads included in the target process is successfully matched with virus feature information includes:
obtaining the name of the target process and/or the hash value of the name;
obtaining characteristic information of threads included by the target process;
and matching in a virus feature library according to the name of the target process and/or the hash value of the name and the feature information of the threads included by the target process to determine whether at least one thread exists in the threads included by the target process and the virus feature information included in the virus feature library is successfully matched.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where after prohibiting execution of a process creation operation according to the virus type information, the method further includes:
determining a first file operated by a target process corresponding to the at least one thread;
according to the virus type information, repairing the first file to generate a second file, wherein the file name of the second file comprises a preset or randomly generated repairing identifier;
and copying the second file to generate a third file, wherein the file name of the third file is the same as that of the first file.
The foregoing aspect and any possible implementation manner further provide an implementation manner, where after the performing the copy operation on the second file to generate a third file, the method further includes:
instructing the system to execute a restart operation;
and deleting the second file.
The above-described aspect and any possible implementation manner further provide an implementation manner, where the prohibiting execution of the process creation operation according to the virus type information includes:
determining whether to enter a safe repair mode or not according to the virus type information;
if the safe repair mode is determined to be entered, generating a notification event;
and according to the notification event, forbidding the execution of the process creation operation.
In another aspect of the present invention, there is provided a virus processing apparatus including:
the analysis unit is used for carrying out characteristic analysis on the threads included by the target process so as to determine whether at least one thread is successfully matched with the virus characteristic information in the threads included by the target process;
the determining unit is used for determining virus type information according to the successfully matched virus characteristic information if at least one thread exists in the threads included in the target process and the virus characteristic information is successfully matched;
and the operation unit is used for forbidding the execution of the process creation operation according to the virus type information.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, and the determining unit is specifically configured to
Obtaining the name of the target process and/or the hash value of the name;
obtaining characteristic information of threads included by the target process; and
and matching in a virus feature library according to the name of the target process and/or the hash value of the name and the feature information of the threads included by the target process to determine whether at least one thread exists in the threads included by the target process and the virus feature information included in the virus feature library is successfully matched.
There is further provided in accordance with the above-mentioned aspect and any possible implementation manner, an implementation manner, wherein the apparatus further includes a repair unit configured to repair the device
Determining a first file operated by a target process corresponding to the at least one thread;
according to the virus type information, repairing the first file to generate a second file, wherein the file name of the second file comprises a preset or randomly generated repairing identifier; and
and copying the second file to generate a third file, wherein the file name of the third file is the same as that of the first file.
The above-mentioned aspects and any possible implementation further provide an implementation that the repair unit is further configured to
Instructing the system to execute a restart operation; and
and deleting the second file.
The above-described aspects and any possible implementation further provide an implementation of the operating unit, which is specifically configured to
Determining whether to enter a safe repair mode or not according to the virus type information;
if the safe repair mode is determined to be entered, generating a notification event; and
and sending the notification event to notify that the process creation operation is forbidden to be executed.
As can be seen from the foregoing technical solutions, in the embodiments of the present invention, feature analysis is performed on threads included in a target process to determine whether at least one thread successfully matches with virus feature information in the threads included in the target process, and if at least one thread successfully matches with virus feature information in the threads included in the target process, virus type information is determined according to the successfully matched virus feature information, so that a process creation operation can be prohibited according to the virus type information.
In addition, by adopting the technical scheme provided by the invention, the characteristic analysis is not performed by taking the file as a unit, but the characteristic analysis is performed by taking the thread included in the target process as a unit, and the granularity of the characteristic analysis is reduced, so that the safety performance of the system can be further improved.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Fig. 1 is a schematic flow chart of a virus processing method according to an embodiment of the present invention, as shown in fig. 1.
101. And performing characteristic analysis on the threads included by the target process to determine whether at least one thread is successfully matched with the virus characteristic information in the threads included by the target process.
Wherein the target process can be understood as all processes in the system.
102. And if at least one thread exists in the threads included in the target process and the virus characteristic information is successfully matched, determining the virus type information according to the successfully matched virus characteristic information.
Specifically, processes in the system may be traversed using a snapshot approach to obtain process information for each process. Such as the name of the process, the name of the thread, the state of the thread and the behavior of the thread, etc.
103. And forbidding the execution of the process creation operation according to the virus type information.
Viruses, also known as computer viruses, may include, but are not limited to, trojans, backdoors, local area network worms, mail worms, spyware, infectious viruses, or Rootkits/Bootkits.
It should be noted that the execution main bodies 101 to 103 may be antivirus engines, and may be located in local clients to perform offline operation to remove viruses, or may be located in servers on a network side to perform online operation to remove viruses, which is not limited in this embodiment.
It should be understood that the client may be an application installed on the terminal, or may also be a web page of a browser, as long as the objective existence form of the secure system environment can be provided by implementing virus removal, which is not limited in this embodiment.
Therefore, whether at least one thread and virus characteristic information are successfully matched in the threads included by the target process is determined by performing characteristic analysis on the threads included by the target process, if at least one thread and virus characteristic information are successfully matched in the threads included by the target process, the virus type information is determined according to the successfully matched virus characteristic information, so that the process creation operation can be prohibited to be executed according to the virus type information, and due to the fact that measures for prohibiting the process creation operation from being executed are adopted, the virus in the system can be effectively prevented from being copied, and the safety performance of the system is improved.
Optionally, in a possible implementation manner of this embodiment, in 101, the antivirus engine may specifically obtain a name of the target process and/or a hash value of the name. Then, the antivirus engine obtains characteristic information of the thread included by the target process. Then, the antivirus engine may perform matching in a virus feature library according to the name of the target process and/or the hash value of the name, and feature information of the threads included in the target process, so as to determine whether at least one thread exists in the threads included in the target process and the virus feature information included in the virus feature library is successfully matched.
The feature information may include dynamic features and/or static features, among others. The dynamic characteristics can be understood as being based on virus behaviors as the basis for judging the virus, and the static characteristics can be understood as being based on the feature codes of the virus as the basis for judging the virus.
Specifically, the virus feature library stores information related to virus feature information, including but not limited to an identifier of a process (e.g., a name of a target process and/or a hash value of the name), feature information of a thread, and an Identifier (ID) of the virus feature information, which is not particularly limited in the present invention.
For example,
the antivirus engine may specifically perform first matching in the virus feature library according to the name of the target process and/or the hash value of the name, so as to determine whether at least one target process in the target process is successfully matched with the name of the process included in the virus feature library.
If the matching is successful, the antivirus engine may further perform second matching in the virus feature library according to the feature information of the thread included in the successfully matched target process, so as to determine whether at least one thread exists in the thread included in the successfully matched target process and the virus feature information corresponding to the target process included in the virus feature library is successfully matched. If the matching is not successful, the antivirus engine can further perform third matching in the virus feature library according to the feature information of the threads included in the successfully matched target process, so as to determine whether at least one thread exists in the threads included in the successfully matched target process and the other virus feature information included in the virus feature library except the virus feature information corresponding to the target process is successfully matched.
If the matching is not successful, the antivirus engine may further perform a second matching in the virus feature library according to the feature information of the threads included in the target process, so as to determine whether at least one thread exists in the threads included in the target process and the virus feature information included in the virus feature library is successfully matched.
Further, after 102, the antivirus engine may further determine to perform an operation on the at least one thread and instruct the process management unit, e.g., suspend the thread, or, e.g., stop the thread, again, etc.
Optionally, the antivirus engine in this embodiment may further perform initialization processing on the virus feature library in advance. Specifically, the antivirus engine may initialize the virus feature library according to a start sequence of a process.
Optionally, in a possible implementation manner of this embodiment, the antivirus engine may specifically adopt a masking manner to transmit the successfully matched virus feature information. For example,
in 101, when each thread is successfully matched with virus feature information included in the virus feature library, the antivirus engine may record a virus feature code, and then the antivirus engine performs or operation on the recorded virus feature code in sequence to obtain a return value. In particular, the disinfection engine may store the return value in a global variable.
Specifically, the virus signature code may be 4 bytes in the virus code, and may include two or three instructions, or may also be another number of bytes in the virus code, which is not particularly limited in this embodiment.
At 102, the antivirus engine performs an and operation according to the return value obtained at 101 to obtain a virus signature.
Optionally, in a possible implementation manner of this embodiment, after 103, the antivirus engine may specifically determine the first file run by the target process corresponding to the at least one thread. Then, the antivirus engine may perform a repair operation on the first file according to the virus type information to generate a second file, where a file name of the second file includes a preset or randomly generated repair identifier. Then, the antivirus engine may perform a copy operation on the second file to generate a third file, where a file name of the third file is the same as a file name of the first file.
Specifically, the antivirus engine may specifically load a corresponding special antivirus engine according to the determined virus type information, and perform a repair operation on the first file according to the virus type information. Since the second file is a file generated after the first file is repaired and is already a file without virus infection, if the file name of the second file is still set to be the same as that of the first file, the antivirus engine repeatedly scans and kills the second file, and thus, the antivirus engine is caused to have dead circulation. By adopting the technical scheme of the invention, the dead cycle of the killing engine can be effectively prevented.
Accordingly, the antivirus engine may then further instruct the system to perform a reboot operation. Then, during or after the system is restarted, the antivirus engine may delete the second file. For example, the antivirus engine may set a delayed deletion flag bit, and when the delayed deletion flag bit is true, the antivirus engine may instruct the system to perform a restart operation, and then determine and delete the second file according to the repair identifier. When the delay flag bit is not true, the antivirus engine may generate a notification event and send the notification event to the driver to notify the driver to enter a normal state, that is, to no longer prohibit the process creation operation from being executed.
Optionally, in a possible implementation manner of this embodiment, in 103, the antivirus engine may specifically determine whether to enter a secure repair mode according to the virus type information. If the security repair mode is determined to be entered, the antivirus engine may generate a notification event and send the notification event to notify that the process creation operation is prohibited.
Specifically, if the virus indicated by the virus type information has the characteristic of single-process residence, the antivirus engine may directly suspend or stop the related thread by using a method in the prior art; if the virus indicated by the virus type information has the characteristic of multi-process residence, the antivirus engine can pop up a dialog box to inquire whether to enter a safe repair mode or not to a user. For example, the content of the pop-up dialog box is "antivirus mini-tip: and (3) discovering stubborn xxx viruses, switching to a safe repair mode to thoroughly search and kill the xxx viruses, wherein the xxx viruses cannot operate other application programs in the repair process.
If the user clicks a 'confirm' button, the antivirus engine can generate a notification event and send the notification event to a driver to notify the driver that the process creation operation is forbidden; if the user clicks the "cancel" button, the antivirus engine may directly suspend or stop the associated thread using methods known in the art.
In this embodiment, feature analysis is performed on threads included in a target process to determine whether at least one thread successfully matches with virus feature information in the threads included in the target process, and if at least one thread successfully matches with virus feature information in the threads included in the target process, virus type information is determined according to the successfully matched virus feature information, so that a process creation operation can be prohibited from being executed according to the virus type information.
In addition, by adopting the technical scheme provided by the invention, the characteristic analysis is not performed by taking the file as a unit, but the characteristic analysis is performed by taking the thread included in the target process as a unit, and the granularity of the characteristic analysis is reduced, so that the safety performance of the system can be further improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Fig. 2 is a schematic structural diagram of a virus processing apparatus according to another embodiment of the present invention, as shown in fig. 2. The virus processing apparatus of the present embodiment may include an analysis unit 21, a determination unit 22, and an operation unit 23.
The analysis unit 21 is configured to perform feature analysis on the threads included in the target process to determine whether at least one of the threads included in the target process is successfully matched with the virus feature information. Wherein the target process can be understood as all processes in the system.
And the determining unit 22 is configured to determine, if at least one of the threads included in the target process is successfully matched with the virus characteristic information, the virus type information according to the successfully matched virus characteristic information. Specifically, the determining unit 22 may specifically use a snapshot method to traverse the processes in the system to obtain the process information of each process. Such as the name of the process, the name of the thread, the state of the thread and the behavior of the thread, etc.
And an operation unit 23, configured to prohibit execution of a process creation operation according to the virus type information. Viruses, also known as computer viruses, may include, but are not limited to, trojans, backdoors, local area network worms, mail worms, spyware, infectious viruses, or Rootkits/Bootkits.
It should be noted that the virus processing device provided in this embodiment may be a virus killing engine, and may be located in a local client to perform offline operation to remove the virus, or may be located in a server on a network side to perform online operation to remove the virus, which is not limited in this embodiment.
It should be understood that the client may be an application installed on the terminal, or may also be a web page of a browser, as long as the objective existence form of the secure system environment can be provided by implementing virus removal, which is not limited in this embodiment.
Therefore, the analysis unit is used for carrying out characteristic analysis on the threads included by the target process to determine whether at least one thread and the virus characteristic information are successfully matched in the threads included by the target process, and further, if at least one thread and the virus characteristic information are successfully matched in the threads included by the target process, the determination unit is used for determining the virus type information according to the successfully matched virus characteristic information, so that the operation unit can forbid the execution of the process creation operation according to the virus type information.
Optionally, in a possible implementation manner of this embodiment, the determining unit 22 may be specifically configured to obtain a name of the target process and/or a hash value of the name; obtaining characteristic information of threads included by the target process; and matching in a virus feature library according to the name of the target process and/or the hash value of the name and the feature information of the threads included in the target process to determine whether at least one thread exists in the threads included in the target process and the virus feature information included in the virus feature library is successfully matched.
The feature information may include dynamic features and/or static features, among others. The dynamic characteristics can be understood as being based on virus behaviors as the basis for judging the virus, and the static characteristics can be understood as being based on the feature codes of the virus as the basis for judging the virus.
Specifically, the virus feature library stores information related to virus feature information, including but not limited to an identifier of a process (e.g., a name of a target process and/or a hash value of the name), feature information of a thread, and an Identifier (ID) of the virus feature information, which is not particularly limited in the present invention.
For example,
the determining unit 22 may specifically perform first matching in the virus feature library according to the name of the target process and/or the hash value of the name, so as to determine whether at least one target process in the target process successfully matches the name of the process included in the virus feature library.
If the matching is successful, the determining unit 22 may further perform second matching in the virus feature library according to the feature information of the threads included in the successfully matched target process, so as to determine whether at least one thread exists in the threads included in the successfully matched target process, and the virus feature information corresponding to the target process included in the virus feature library is successfully matched. If the matching is not successful, the determining unit 22 may further perform third matching in the virus feature library according to the feature information of the threads included in the successfully matched target process, so as to determine whether at least one thread exists in the threads included in the successfully matched target process, and the matching is successful with other virus feature information included in the virus feature library, except for the virus feature information corresponding to the target process.
If the matching is not successful, the determining unit 22 may further perform a second matching in the virus feature library according to the feature information of the threads included in the target process, so as to determine whether at least one of the threads included in the target process is successfully matched with the virus feature information included in the virus feature library.
Further, after 102, the determining unit 22 may further determine to perform an operation on the at least one thread and instruct the process management unit, for example, to suspend the thread, or, for example, to stop the thread again, etc.
Optionally, the device provided in this embodiment may be further configured to initialize the virus feature library in advance. Specifically, the virus feature library may be initialized according to a starting sequence of the processes.
Optionally, in a possible implementation manner of this embodiment, the provided virus processing device, for example, the analysis unit 21, the determination unit 22, the operation unit 23, and the like, may specifically adopt a mask mode to transmit the virus feature information successfully matched. For example,
the analysis unit 21 may record a virus feature code when each thread is successfully matched with virus feature information included in the virus feature library, and then the analysis unit 21 performs or operation on the recorded virus feature code in sequence to obtain a return value. In particular, the analysis unit 21 may store the return value into a global variable.
Specifically, the virus signature code may be 4 bytes in the virus code, and may include two or three instructions, or may also be another number of bytes in the virus code, which is not particularly limited in this embodiment.
The determining unit 22 performs and operation according to the return value obtained by the analyzing unit 21 to obtain a virus signature.
Optionally, in a possible implementation manner of this embodiment, as shown in fig. 3, the virus processing apparatus provided in this embodiment may further include a repair unit 31, configured to determine a first file run by a target process corresponding to the at least one thread; according to the virus type information, repairing the first file to generate a second file, wherein the file name of the second file comprises a preset or randomly generated repairing identifier; and copying the second file to generate a third file, wherein the file name of the third file is the same as that of the first file.
Specifically, the repairing unit 31 may specifically load a corresponding special killing engine according to the virus type information determined by the determining unit 22, and perform a repairing operation on the first file according to the virus type information. Since the second file is a file generated after the first file is repaired and is already a file without virus infection, if the file name of the second file is still set to be the same as that of the first file, the antivirus engine repeatedly scans and kills the second file, and thus, the antivirus engine is caused to have dead circulation. By adopting the technical scheme of the invention, the dead cycle of the killing engine can be effectively prevented.
Accordingly, the repair unit 31 may further be configured to instruct the system to perform a restart operation; and deleting the second file. Specifically, during or after the system is restarted, the repair unit 31 may delete the second file. For example, the repair unit 31 may set a delayed deletion flag bit, and when the delayed deletion flag bit is true, the repair unit 31 may instruct the system to perform a restart operation, and then determine the second file according to the repair identifier and delete the second file. When the delay flag bit is not true, the repair unit 31 may generate a notification event and send the notification event to the driver to notify the driver to enter a normal state, that is, to no longer prohibit the process creation operation.
Optionally, in a possible implementation manner of this embodiment, the operation unit 23 may be specifically configured to determine whether to enter a secure repair mode according to the virus type information; if the safe repair mode is determined to be entered, generating a notification event; and sending the notification event to notify that the process creation operation is prohibited.
Specifically, if the virus indicated by the virus type information has the characteristic of single-process residence, the operation unit 23 may directly suspend or stop the related thread by using a method in the prior art; if the virus indicated by the virus type information has a multi-process resident characteristic, the operation unit 23 may pop up a dialog box to ask the user whether to enter a security repair mode. For example, the content of the pop-up dialog box is "antivirus mini-tip: and (3) discovering stubborn xxx viruses, switching to a safe repair mode to thoroughly search and kill the xxx viruses, wherein the xxx viruses cannot operate other application programs in the repair process.
If the user clicks the "ok" button, the operation unit 23 may generate a notification event and transmit the notification event to the driver to notify the driver that the process creation operation is prohibited; if the user clicks the cancel button, the operation unit 23 may directly suspend or stop the relevant thread by a method in the related art.
In this embodiment, an analysis unit performs feature analysis on threads included in a target process to determine whether at least one thread exists in the threads included in the target process and the virus feature information is successfully matched, and then, if at least one thread exists in the threads included in the target process and the virus feature information is successfully matched, a determination unit determines virus type information according to the successfully matched virus feature information, so that an operation unit can prohibit execution of a process creation operation according to the virus type information.
In addition, by adopting the technical scheme provided by the invention, the characteristic analysis is not performed by taking the file as a unit, but the characteristic analysis is performed by taking the thread included in the target process as a unit, and the granularity of the characteristic analysis is reduced, so that the safety performance of the system can be further improved.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided by the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.