A method, device and electronic device for detecting malicious programs
By obtaining the information summary MD5 value of the longest common substring of the information to be detected for malicious program detection, the problem of high false alarm rate and low detection efficiency in the existing technology is solved, and more efficient malicious program detection is achieved.
Patent Information
- Application Number
- CN202111197810.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-10-14
AI Technical Summary
Existing malicious program detection methods have a high false positive rate, mainly due to the removal of adjacent identical identifiers and the use of only the first 1,000 API information, resulting in a large amount of information being discarded and low detection efficiency.
By obtaining the information summary MD5 value of the longest common substring of the information to be detected, it is used for malware detection, reducing the amount of data used for detection, improving detection efficiency, and retaining valuable detection information through the MD5 value.
It reduces the false positive rate of malicious program detection, improves detection efficiency and detection rate, and avoids the problem of information discarding.
Smart Images

Figure CN113987486B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network security technology, and in particular to a malicious program detection method, device and electronic device. Background Art
[0002] The rapid development of computer technology has brought great changes to all walks of life. At the same time, the computer field has also been troubled and invaded by malicious programs. Faced with the complex network environment and the endless complex and changeable malicious programs, the current method for detecting malicious programs is to use machine learning training models, extract sample information during the training model, and the sample information contains multiple groups of samples. For each group of samples, the first 1000 application programming interfaces (Application Programming Interface, API) are extracted and translated into corresponding identifiers, and then each group of identifiers is deduplicated, and adjacent identical identifiers are removed to obtain a training model, which is used to detect malicious programs. However, since adjacent identical identifiers are removed and only the first 1000 are used for detection, a large amount of information is discarded, and the false alarm rate of malicious program detection using such a training model is high. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a malicious program detection method, device and electronic device.
[0004] In a first aspect, the present disclosure provides a method for detecting malicious programs, the method comprising:
[0005] Acquire first information to be detected and second information to be detected, where the first information to be detected and the second information to be detected are application programming interface API information of different target class programs, or are API information of the same target class program, and the target class program is a malicious program or a non-malicious program;
[0006] Determine a first maximum common substring between the first information to be detected and the second information to be detected;
[0007] Get the information digest MD5 value of the first largest common substring;
[0008] The MD5 value of the first largest common substring is used for target class program detection.
[0009] Optionally, the information digest MD5 value of the first largest common substring is obtained, including:
[0010] Calculate the MD5 value of at least one API in the first largest common substring;
[0011] and / or,
[0012] The total MD5 value of the first largest common substring.
[0013] Optionally, after obtaining the information digest MD5 value of the first largest common substring, the method further includes:
[0014] Get the number of APIs with the first largest common substring;
[0015] Get the information digest MD5 value of the first largest common substring, including:
[0016] Calculate the MD5 value of the first API in the first largest common substring;
[0017] According to the number of APIs in the first largest common substring, determine the last API in the first largest common substring;
[0018] Calculate the MD5 value of the last API in the first largest common substring.
[0019] Optionally, the first information to be detected and the second information to be detected are application programming interface API information of different target classes of programs. Before obtaining the first information to be detected and the second information to be detected, the method further includes:
[0020] Determine a second largest common substring between the third information to be detected and the fourth information to be detected;
[0021] The MD5 value of the second largest common substring is used for malicious program detection;
[0022] Acquiring first information to be detected and second information to be detected, including:
[0023] Removing the second largest common substring from the third information to be detected to obtain the first information to be detected;
[0024] The second largest common substring is removed from the fourth information to be detected to obtain the second information to be detected.
[0025] Optionally, the first information to be detected and the second information to be detected are API information of the same target class program, and before obtaining the first information to be detected and the second information to be detected, the method further includes:
[0026] Determine a second largest common substring between the third information to be detected and the fourth information to be detected;
[0027] The MD5 value of the second largest common substring is used for malicious program detection;
[0028] Acquiring first information to be detected and second information to be detected, including:
[0029] The second largest common substring is removed from the third information to be detected to obtain the first information to be detected and the second information to be detected.
[0030] Optionally, after obtaining the MD5 value of the first largest common substring, the following steps are further included:
[0031] If the first largest common substring is the same as the second largest common substring, the MD5 value of the first largest common substring is deleted.
[0032] Optionally, determining a first maximum common substring between the first information to be detected and the second information to be detected includes:
[0033] If the length of the second largest common substring is greater than or equal to the preset length, a first largest common substring between the first information to be detected and the second information to be detected is determined.
[0034] Optionally, the target class program is a malicious program;
[0035] The MD5 value of the first largest common substring is used for target class program detection, including:
[0036] If the MD5 value of the first largest common substring does not exist in the target storage data, the MD5 value of the first largest common substring is used for malicious program detection;
[0037] The target storage data is data used for detecting non-malicious programs.
[0038] In a second aspect, the present disclosure provides a malicious program detection device, the device comprising:
[0039] A receiving module, used for acquiring first information to be detected and second information to be detected, wherein the first information to be detected and the second information to be detected are application programming interface API information of different target class programs, or are API information of the same target class program, and the target class program is a malicious program or a non-malicious program;
[0040] The processing module is used to determine the first largest common substring between the first information to be detected and the second information to be detected; obtain the information digest MD5 value of the first largest common substring; and use the MD5 value of the first largest common substring for target class program detection.
[0041] Optionally, the processing module is further configured to obtain an information digest MD5 value of the first largest common substring, including:
[0042] Calculate the MD5 value of at least one API in the first largest common substring;
[0043] and / or,
[0044] The total MD5 value of the first largest common substring.
[0045] Optionally, the processing module is further configured to obtain the information digest MD5 value of the first largest common substring, and further include:
[0046] Get the number of APIs with the first largest common substring;
[0047] Get the information digest MD5 value of the first largest common substring, including:
[0048] Calculate the MD5 value of the first API in the first largest common substring;
[0049] According to the number of APIs in the first largest common substring, determine the last API in the first largest common substring;
[0050] Calculate the MD5 value of the last API in the first largest common substring.
[0051] Optionally, the first information to be detected and the second information to be detected are application programming interface API information of different target class programs;
[0052] The receiving module is also used to obtain the first information to be detected and the second information to be detected, and further includes:
[0053] Determine a second largest common substring between the third information to be detected and the fourth information to be detected;
[0054] The MD5 value of the second largest common substring is used for malicious program detection;
[0055] Acquiring first information to be detected and second information to be detected, including:
[0056] Removing the second largest common substring from the third information to be detected to obtain the first information to be detected;
[0057] The second largest common substring is removed from the fourth information to be detected to obtain the second information to be detected.
[0058] Optionally, the first information to be detected and the second information to be detected are API information of the same target class program;
[0059] The receiving module is also used to obtain the first information to be detected and the second information to be detected, and further includes:
[0060] Determine a second largest common substring between the third information to be detected and the fourth information to be detected;
[0061] The MD5 value of the second largest common substring is used for malicious program detection;
[0062] Acquiring first information to be detected and second information to be detected, including:
[0063] The second largest common substring is removed from the third information to be detected to obtain the first information to be detected and the second information to be detected.
[0064] Optionally, the processing module is further configured to obtain the MD5 value of the first largest common substring and further include:
[0065] If the first largest common substring is the same as the second largest common substring, the MD5 value of the first largest common substring is deleted.
[0066] Optionally, the processing module is further used to determine a first maximum common substring between the first information to be detected and the second information to be detected, including:
[0067] If the length of the second largest common substring is greater than or equal to the preset length, a first largest common substring between the first information to be detected and the second information to be detected is determined.
[0068] Optionally, the target class program is a malicious program;
[0069] The processing module is further used to use the MD5 value of the first largest common substring for target class program detection, including:
[0070] If the MD5 value of the first largest common substring does not exist in the target storage data, the MD5 value of the first largest common substring is used for malicious program detection;
[0071] The target storage data is data used for detecting non-malicious programs.
[0072] In a third aspect, the present disclosure provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, a malicious program detection method as in the first aspect is implemented.
[0073] In a fourth aspect, the present disclosure provides a computer-readable storage medium, which includes: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, a malicious program detection method as in the first aspect is implemented.
[0074] Compared with the prior art, the technical solution provided by the disclosed embodiment has the following advantages: extracting the longest common substring of the first information to be detected and the second information to be detected, and then obtaining the information digest MD5 value of the longest common substring, so as to use the MD5 value to detect malicious programs, and by extracting the longest common substring from the information to be detected, the amount of data used to detect malicious programs is reduced, thereby improving the efficiency of detecting malicious programs, and at the same time using the MD5 value to retain valuable detection information, thereby avoiding the problem of discarding a large amount of information in the process of extracting API feature information, resulting in a high false alarm rate in detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0076] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0077] Figure 1 A method for detecting malicious programs according to an embodiment of the present disclosure is shown in FIG. Figure 1 ;
[0078] Figure 2 A method for detecting malicious programs according to an embodiment of the present disclosure is shown in FIG. Figure 2 ;
[0079] Figure 3 A method for detecting malicious programs according to an embodiment of the present disclosure is shown in FIG. Figure 3 ;
[0080] Figure 4 A structural diagram of a malicious program detection device according to an embodiment of the present disclosure;
[0081] Figure 5 This is a structural diagram of an electronic device described in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0082] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0083] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0084] The present invention simulates the operation of malicious programs in a virtual environment such as a sandbox and applies sandbox dynamic behavior analysis to ensure that malicious programs have no right to modify programs and system settings outside the sandbox, thereby ensuring that the system will not be tampered with or invaded by malicious software and viruses.
[0085] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following briefly introduces the sandbox dynamic behavior analysis, the application programming interface (Application Programming Interface, API), and the message digest algorithm (Message-Digest Algorithm 5, MD5):
[0086] Sandbox dynamic behavior analysis, when dynamically analyzing a malicious program, in order to understand the runtime behavior, it is necessary to run the malicious program in an isolated sandbox environment to obtain the components and characteristics of the malicious program, thereby obtaining a highly accurate behavior analysis result.
[0087] Application Programming Interface (API) is a set of predefined interfaces (such as functions, HTTP interfaces), or agreements for connecting different components of a software system. It is used to provide a set of routines that applications and developers can access based on certain software or hardware.
[0088] Message-Digest Algorithm 5 (MD5) is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission.
[0089] The malicious program detection method described in the embodiments of the present disclosure may be applied to a malicious program detection device or an electronic device, wherein the malicious program detection device may be a functional module and / or functional entity in the electronic device that can implement the malicious program detection method.
[0090] The electronic devices mentioned above may include: smart phones (such as Android phones, IOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, video matrices, monitoring platforms, mobile Internet devices (MID, Mobile Internet Devices) or wearable devices, servers, such as cloud servers, etc. The above are only examples, not exhaustive, and include but are not limited to the above devices.
[0091] Figure 1 Schematic diagram of the malicious program detection method provided by the present disclosure Figure 1 , the method comprising:
[0092] Step S110, obtaining first information to be detected and second information to be detected.
[0093] In the embodiment of the present disclosure, the first information to be detected and the second information to be detected are application programming interface API information of different target class programs, or API information of the same target class program, and the target class program is a malicious program or a non-malicious program.
[0094] Among them, the information to be detected includes process / thread activity information, registry access information, system service access information, window / module operation information, network access information, file access information, etc.; malicious programs can be Trojans, zombie programs, worm virus files; non-malicious programs can be regular programs, such as Thunder, and the present disclosure does not limit this.
[0095] In some embodiments, due to different target program types and different ways of splitting the information to be detected, there are four situations including but not limited to the following:
[0096] (1) The first information to be detected and the second information to be detected may be different API information in a malicious program (black sample), such as two code segments A and B in a malicious program. The API information is composed of multiple API sequences, and each API sequence is composed of multiple characters. For example, A includes abc, B includes bcd, and a includes 123. Accordingly, the following discussion on the characters in the API sequence is similar and will not be repeated.
[0097] (2) The first information to be detected and the second information to be detected may be different API information in a non-malicious program (white sample), such as X and Y. The API information is composed of multiple API sequences, such as X including xyz and Y including xym.
[0098] It should be noted that, when the first information to be detected and the second information to be detected are different API information, before obtaining the first information to be detected and the second information to be detected, any two information to be detected (the third information to be detected and the fourth information to be detected) can also be obtained, and the second largest common substring of the two information to be detected can be further determined, and the MD5 value of the second largest common substring can be obtained for subsequent malicious program detection; then, the second largest common substring is removed from the third information to be detected to obtain the first information to be detected, and the second largest common substring is removed from the fourth information to be detected to obtain the second information to be detected.
[0099] For example, Figure 2 A method for detecting malicious programs according to an embodiment of the present disclosure is shown in FIG. Figure 2 ,like Figure 2 As shown in (a), two pieces of information to be detected A1 and B1 are obtained, A1 includes abceff, and B1 includes bcdeff, and the longest common substring between A1 and B1 is determined to be eff; Figure 2 As shown in (b), eff is deleted from A1 to obtain A, which includes abc; Figure 2 As shown in (c), eff is deleted from B1 to obtain B, which includes bcd.
[0100] (3) The first information to be detected and the second information to be detected may be two parts of the API sequence in the same API information in the malicious program (black sample). For example, a code segment C in the malicious program includes acdabd, the first detection information may be acd, and the second detection information may be abd. The present disclosure does not limit the method of splitting the API sequence.
[0101] (4) The first information to be detected and the second information to be detected may be two parts of the API sequence in the same API information in a non-malicious program (white sample). For example, Z includes xymxyn, the first detection information may be xym, and the second detection information may be xyn.
[0102] It should be noted that, when the first information to be detected and the second information to be detected are the same API information, and before obtaining the first information to be detected and the second information to be detected, any two information to be detected (the third information to be detected and the fourth information to be detected) can also be obtained, and the second largest common substring of the two information to be detected can be further determined, and the MD5 value of the second largest common substring can be obtained for subsequent malicious program detection; then the second largest common substring is removed from the third information to be detected to obtain the first information to be detected and the second information to be detected.
[0103] For example, Figure 3 A method for detecting malicious programs according to an embodiment of the present disclosure is shown in FIG. Figure 3 ,like Figure 3 As shown in (a), two pieces of information to be detected A2 and D2 are obtained, A2 includes abceffbcd, and D2 includes eff, and the longest common substring between A2 and D2 is determined to be eff; Figure 3 As shown in (b), eff is deleted from A2 to obtain A and B, and the A and B parts of A2 with the longest common substring are deleted without being concatenated. They are used as the first detection information A and the second detection information B for subsequent processing to determine the longest common string, where A includes abc and B includes bcd.
[0104] For ease of explanation, the following steps will be introduced for malicious programs (black samples). The method for processing the information to be detected for non-malicious programs (white samples) is the same or similar to that for malicious programs, and will not be elaborated in detail in this disclosure.
[0105] S120: Determine a first maximum common substring between the first information to be detected and the second information to be detected.
[0106] The methods for determining the longest common substring mainly include a method based on dynamic programming, a method based on a generalized suffix tree, and a method based on a suffix array.
[0107] A two-dimensional table is constructed based on the dynamic programming method, and the longest common substring is found using the one-way recursive method.
[0108] The generalized suffix tree method builds a tree with all the suffixes of the given source string. Each node of the tree is a string, and the root is an empty string. By finding the node with the largest depth and belonging to all the source strings in the tree, the concatenation of all the node strings on the path from the root to this node is the longest common substring.
[0109] The suffix array is an array composed of suffix indices arranged in the lexicographic order of the suffixes. The suffix array-based method combines the source strings into a new string, inserts sentinel characters in the middle, constructs the suffix array and the ranking array (the suffix array is inverted) according to the composite string, and uses the two to calculate the longest common prefix array of the suffixes pointed to by adjacent suffix array elements, and finally calculates the longest common substring based on the suffix array and the longest common prefix array.
[0110] Those skilled in the art can determine the first maximum common substring between the first information to be detected and the second information to be detected by the above method, and the following will be specifically introduced by taking the method based on dynamic programming as an example.
[0111] Exemplarily, as shown in the following table, each API of A1:abceff is used as a row of a two-dimensional table, and each API of B1:bcdeff is used as a column of the two-dimensional table. The characters corresponding to each row and column of the two-dimensional table are compared to see if they are the same. If the first row and the second column are the same, the value in the table corresponding to the first row and the second column is set to 1, otherwise it is set to 0. Then, the longest diagonal line of the two-dimensional table whose table value is 1 is found, and the corresponding longest common substring eff can be obtained.
[0112]
[0113] It should be noted that determining the first largest common substring between the first information to be detected and the second information to be detected is not limited to the above method, which will not be elaborated in detail in the present disclosure.
[0114] In some embodiments, technicians in this field set the length of the longest common substring according to actual needs to determine the longest valid common substring between two pieces of information to be detected. Generally, the length of the longest common substring is greater than or equal to 1 and less than or equal to the length of the longest common substring itself.
[0115] If the length of the second largest common substring is greater than or equal to the preset length, a first largest common substring between the first information to be detected and the second information to be detected is determined.
[0116] If the length of the second largest common substring is less than the preset length, it is worth emphasizing that there are two situations in which the length of the second largest common substring is less than the preset length. If the length of the two detection information is greater than the preset length and the length of the second largest common substring is less than the preset length, then continue to determine the longest common substring starting from the second API of the longest common substring; if the length of the two detection information is less than or equal to the preset length and the length of the second largest common substring is less than the preset length, it means that the longest common substring of the two detection information has been determined, and it is necessary to determine the longest common substring of other information to be detected.
[0117] Exemplarily, the preset length is 3 API sequences, and there are two information to be detected, A1 and B1, A1 includes abceff, B1 includes bcdeff, the longest common substring between A1 and B1 is determined to be eff, the length of eff is calculated to be 3, and eff is deleted from A1 and B1 to obtain A and B, where A includes abc and B includes bcd, the longest common substring between A and B is determined to be bc, and the length of bc is calculated to be 2, which means that the length of the longest common substring is less than the preset length 3, bc is not processed, and then the longest common substring of other information to be detected is determined.
[0118] By determining the first largest common substring between the first information to be detected and the second information to be detected as the same characteristic information in the malicious program sample, the characteristic information of the largest common substring between the information to be detected is used to detect malicious programs, and the malicious program samples are compressed to reduce the amount of data used for detection. At the same time, the integrity of the characteristic information is ensured, the detection rate of malicious program detection is improved, and the effect of malicious program detection is enhanced.
[0119] S130, obtaining the information digest MD5 value of the first largest common substring.
[0120] The MD5 value is a value calculated using the MD5 algorithm.
[0121] In some embodiments, obtaining the information digest MD5 value of the first largest common substring includes: calculating the MD5 value of at least one API in the first largest common substring; and / or the total MD5 value of the first largest common substring.
[0122] Exemplarily, the MD5 value of the first API in the first largest common substring is calculated; or the total MD5 value of the first largest common substring is calculated; or the MD5 value of the first API in the first largest common substring and the total MD5 value of the first largest common substring are calculated.
[0123] In some embodiments, after obtaining the information digest MD5 value of the first largest common substring, obtaining the number of APIs in the first largest common substring, and then calculating the MD5 value of at least one API in the first largest common substring includes: calculating the MD5 value of the first API in the first largest common substring; determining the last API in the first largest common substring based on the number of APIs in the first largest common substring; and calculating the MD5 value of the last API in the first largest common substring.
[0124] Exemplarily, using the above-mentioned information to be tested as A1 and B1, A1 includes abceff, B1 includes bcdeff, and the longest common substring between A1 and B1 is determined to be eff, and the number of APIs of eff is obtained to be 3. Then, the MD5 value of the first API "e" in eff is calculated, and the MD5 value of the last API "f" is determined based on the number of APIs of eff being 3, as well as the total MD5 value of eff.
[0125] In practical applications, since the longest common substring includes at least one API, generally more than two API sequences, and the time required to compare whether the API sequences are identical is long, resulting in low comparison efficiency. The present invention compresses the longer API sequence contained in the first longest common substring into a 16-byte MD5 value through the MD5 algorithm, thereby reducing the time required to compare the longest common string during subsequent malicious program detection and improving the comparison efficiency.
[0126] Furthermore, an API dictionary is created, and the MD5 value of the first longest common substring obtained and the number of APIs are stored correspondingly, and the API dictionary is used to compare with the malicious program, so as to detect the malicious program.
[0127] In some embodiments, based on obtaining the second largest common substring, after obtaining the information digest MD5 value of the first largest common substring, the first largest common substring is compared with the second common substring to see if they are the same. If they are the same, the MD5 value of the first largest common substring is deleted.
[0128] Exemplarily, the MD5 value of the second longest common substring eff is already stored in the API dictionary. After the detected information A1: abceff and B1: bcdeff determine that the first longest common substring is "eff", the MD5 value of the first longest common substring "eff" is obtained. When adding it to the API dictionary, the MD5 value of the first longest common substring "eff" is compared and found to be the same as the MD5 value of the second longest common substring eff. In this case, the MD5 value of the first longest common substring "eff" is deleted and will not be added to the API dictionary.
[0129] Since the information to be detected in actual applications is a long API sequence with a large amount of data, it is still not convenient to detect malicious programs even after the longest common substring of the information to be detected is extracted. In one implementation provided in the present disclosure, the MD5 value of the largest common substring is calculated to further compress the information to be detected into a 16-byte string, which not only saves data storage space, but also saves time for malicious program detection, thereby improving the efficiency of malicious program detection.
[0130] S140, using the MD5 value of the first largest common substring for target class program detection.
[0131] As described above, the MD5 value of the first API in the first longest common substring, the MD5 value of the last API in the first longest common substring, the total MD5 value of the first longest common substring, and the number of APIs in the first largest common substring are used for malicious program detection or non-malicious program detection.
[0132] For example, in the process of detecting the target class program, the MD5 value of the API sequence of the target class program is compared. If the comparison shows the same MD5 value as the MD5 value of the first API in the first longest common substring, the API is recorded as s. Then, according to the number of APIs in the first largest common substring, jump from the position where s is located to the API sequence corresponding to the number, the API is recorded as t, and compare. If the comparison result is the same as the MD5 value of the last API in the first longest common substring, then further compare the total MD5 value of the API sequence from s to t with the total MD5 value of the first longest common substring. If they are the same, it means that the target class program is a malicious program. If they are different, continue to compare the next API from the position where s is located.
[0133] In some embodiments, the target class program is a malicious program. In the process of using the MD5 value of the first largest common substring for the target class program detection, firstly, the MD5 value of the first largest common substring is searched in the target storage data, wherein the target storage data is data used for non-malicious program detection, including the MD5 value of the longest common substring of the non-malicious program and the number of APIs. If the MD5 value of the first largest common substring exists in the target storage data, the MD5 value of the first largest common substring is deleted from the API dictionary; if the MD5 value of the first largest common substring does not exist in the target storage data, the MD5 value of the first largest common substring is used for malicious program detection and stored in the API dictionary.
[0134] By comparing with the target stored data, the MD5 value of the longest common substring of the non-malicious program is deleted from the API dictionary, thereby avoiding detecting the non-malicious program as a malicious program, reducing the false alarm rate, and improving the effect of malicious program detection.
[0135] To summarize, the present invention extracts the longest common substring of the first information to be detected and the second information to be detected to compress the detection information, and then obtains the information digest MD5 value of the longest common substring to use the MD5 value to detect malicious programs. By compressing the information to be detected, the efficiency of detecting malicious programs is improved. At the same time, the MD5 value is used to retain valuable detection information, avoiding the problem of discarding a large amount of information in the process of compressing API information, resulting in a high false alarm rate of detection.
[0136] like Figure 4 As shown, the present disclosure provides a malicious program detection device, the device comprising:
[0137] The receiving module 410 is used to obtain first information to be detected and second information to be detected, where the first information to be detected and the second information to be detected are application programming interface API information of different target class programs, or are API information of the same target class program, and the target class program is a malicious program or a non-malicious program;
[0138] The processing module 420 is used to determine the first largest common substring between the first information to be detected and the second information to be detected; obtain the information digest MD5 value of the first largest common substring; and use the MD5 value of the first largest common substring for target class program detection.
[0139] Optionally, the processing module 420 is further configured to obtain an information digest MD5 value of the first largest common substring, including:
[0140] Calculate the MD5 value of at least one API in the first largest common substring;
[0141] and / or,
[0142] The total MD5 value of the first largest common substring.
[0143] Optionally, the processing module 420 is further configured to obtain the information digest MD5 value of the first largest common substring, and further include:
[0144] Get the number of APIs with the first largest common substring;
[0145] Get the information digest MD5 value of the first largest common substring, including:
[0146] Calculate the MD5 value of the first API in the first largest common substring;
[0147] According to the number of APIs in the first largest common substring, determine the last API in the first largest common substring;
[0148] Calculate the MD5 value of the last API in the first largest common substring.
[0149] Optionally, the first information to be detected and the second information to be detected are application programming interface API information of different target class programs;
[0150] The receiving module 410 is also used to obtain the first information to be detected and the second information to be detected, and further includes:
[0151] Determine a second largest common substring between the third information to be detected and the fourth information to be detected;
[0152] The MD5 value of the second largest common substring is used for malicious program detection;
[0153] Acquiring first information to be detected and second information to be detected, including:
[0154] Removing the second largest common substring from the third information to be detected to obtain the first information to be detected;
[0155] The second largest common substring is removed from the fourth information to be detected to obtain the second information to be detected.
[0156] Optionally, the first information to be detected and the second information to be detected are API information of the same target class program;
[0157] The receiving module 410 is also used to obtain the first information to be detected and the second information to be detected, and further includes:
[0158] Determine a second largest common substring between the third information to be detected and the fourth information to be detected;
[0159] The MD5 value of the second largest common substring is used for malicious program detection;
[0160] Acquiring first information to be detected and second information to be detected, including:
[0161] The second largest common substring is removed from the third information to be detected to obtain the first information to be detected and the second information to be detected.
[0162] Optionally, the processing module 420 is further configured to obtain the MD5 value of the first largest common substring and further include:
[0163] If the first largest common substring is the same as the second largest common substring, the MD5 value of the first largest common substring is deleted.
[0164] Optionally, the processing module 420 is further configured to determine a first maximum common substring between the first information to be detected and the second information to be detected, including:
[0165] If the length of the second largest common substring is greater than or equal to the preset length, a first largest common substring between the first information to be detected and the second information to be detected is determined.
[0166] Optionally, the target class program is a malicious program;
[0167] The processing module 420 is further configured to use the MD5 value of the first largest common substring for target class program detection, including:
[0168] If the MD5 value of the first largest common substring does not exist in the target storage data, the MD5 value of the first largest common substring is used for malicious program detection;
[0169] The target storage data is data used for detecting non-malicious programs.
[0170] It is worth noting that in the embodiment of the above-mentioned malicious program detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present disclosure.
[0171] like Figure 5 As shown, an embodiment of the present disclosure provides an electronic device, which includes: a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. The computer program is executed by the processor 501 to implement the various processes executed by the first terminal in the above-mentioned malicious program detection method, and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0172] The embodiment of the present disclosure provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the various processes executed by the first terminal in the above-mentioned malicious program detection method, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0173] The computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0174] Through the above description of the implementation methods, the technical personnel in the relevant field can clearly understand that the present disclosure can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0175] It should be noted that, in this article, relational terms such as "first" and "second" 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 sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0176] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting malicious programs, characterized in that: include: Acquire first information to be detected and second information to be detected, wherein the first information to be detected and the second information to be detected are application programming interface API information of different target class programs, or are API information of the same target class program, and the target class program is a malicious program or a non-malicious program; Determine a first maximum common substring between the first information to be detected and the second information to be detected; Obtain the information digest MD5 value of the first largest common substring; Using the MD5 value of the first largest common substring for target class program detection; Wherein, the first information to be detected and the second information to be detected are application programming interface API information of different target class programs; Before obtaining the first information to be detected and the second information to be detected, the method further includes: determining a second largest common substring between the third information to be detected and the fourth information to be detected; and using the MD5 value of the second largest common substring for malicious program detection; The acquiring of the first information to be detected and the second information to be detected includes: removing the second largest common substring from the third information to be detected to obtain the first information to be detected; and removing the second largest common substring from the fourth information to be detected to obtain the second information to be detected.
2. The method according to claim 1, characterized in that: The obtaining of the information digest MD5 value of the first largest common substring includes: Calculate the MD5 value of at least one API in the first largest common substring; and / or, The total MD5 value of the first largest common substring.
3. The method according to claim 2, characterized in that After obtaining the information digest MD5 value of the first largest common substring, the method further includes: Obtain the number of APIs of the first largest common substring; The obtaining of the information digest MD5 value of the first largest common substring includes: Calculate the MD5 value of the first API in the first largest common substring; Determine the last API in the first largest common substring according to the number of APIs in the first largest common substring; Calculate the MD5 value of the last API in the first largest common substring.
4. The method according to claim 1, characterized in that: The first information to be detected and the second information to be detected are API information of the same target class program; Before acquiring the first information to be detected and the second information to be detected, the method further includes: Determine a second largest common substring between the third information to be detected and the fourth information to be detected; Using the MD5 value of the second largest common substring for malicious program detection; The obtaining of the first information to be detected and the second information to be detected includes: The second largest common substring is removed from the third information to be detected to obtain the first information to be detected and the second information to be detected.
5. The method according to claim 1, characterized in that After obtaining the MD5 value of the first largest common substring, the method further includes: If the first largest common substring is the same as the second largest common substring, the MD5 value of the first largest common substring is deleted.
6. The method according to claim 1, characterized in that The determining a first maximum common substring between the first information to be detected and the second information to be detected includes: If the length of the second largest common substring is greater than or equal to a preset length, a first largest common substring between the first information to be detected and the second information to be detected is determined.
7. The method according to any one of claims 1 to 6, characterized in that: The target class program is a malicious program; The using the MD5 value of the first largest common substring for target class program detection includes: If the MD5 value of the first largest common substring does not exist in the target storage data, the MD5 value of the first largest common substring is used for malicious program detection; The target storage data is data used for detecting non-malicious programs.
8. A malicious program detection device, characterized in that: include: A receiving module, used for acquiring first information to be detected and second information to be detected, wherein the first information to be detected and the second information to be detected are application programming interface API information of different target class programs, or are API information of the same target class program, and the target class program is a malicious program or a non-malicious program; A processing module, used to determine a first largest common substring between the first information to be detected and the second information to be detected; obtain an information digest MD5 value of the first largest common substring; and use the MD5 value of the first largest common substring for target class program detection; Wherein, the first information to be detected and the second information to be detected are application programming interface API information of different target class programs; The receiving module, before acquiring the first information to be detected and the second information to be detected, is further used to: determine the second largest common substring between the third information to be detected and the fourth information to be detected; and use the MD5 value of the second largest common substring for malicious program detection; The receiving module is specifically used to: remove the second largest common substring from the third information to be detected to obtain the first information to be detected; and remove the second largest common substring from the fourth information to be detected to obtain the second information to be detected.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements a malicious program detection method as described in any one of claims 1 to 7.
