Classification method and device and electronic equipment
By extracting and comparing the sequences of malware, and using common subsequences and similarity formulas, efficient classification of malware is achieved, solving the problem of low classification efficiency in the existing technology, and improving classification accuracy and efficiency.
Patent Information
- Application Number
- CN202410852913.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-29
AI Technical Summary
When identifying and classifying malware, existing technologies need to write rules for different architectures, which results in a large amount of time spent when there are too many malwares and is difficult to classify efficiently.
By extracting the common subsequence and length value of the first sequence and the second sequence of the malware, comparing it with the preset length threshold, the classification result is determined, and the similarity value between the malware is calculated using the similarity formula, thereby achieving rapid Classification.
Improves the efficiency and accuracy of malware classification, avoids the need to retrain models, reduces model training costs, and supports incremental training and merging of classification models.
Smart Images

Figure CN118862066A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a classification method, device and electronic equipment. Background Art
[0002] With the development of the Internet, the number of malware is increasing. In order to better protect network security, various malware are classified based on the functions they implement. The specific classification method is as follows:
[0003] In order to accurately identify the software type of malware, it is necessary to extract the feature string in the malware, which can be composed of numbers, letters, and characters. The feature string is matched with the feature strings in each rule in turn. When a rule that is completely consistent with the feature string of the malware is matched, the software type corresponding to the malware is extracted from the determined rule to obtain the classification result; when the malware does not match the corresponding rule, the rule needs to be rewritten for the malware, as follows:
[0004] Since the architectures of the attacked devices corresponding to malware are diverse, and malware that implements the same function has different presentation forms under different architectures, it is necessary to write rules for identifying malware for different architectures.
[0005] Obtain the binary file corresponding to the malware and write rules for the binary file based on the known architecture. When there are too many malware, each malware corresponds to different rules under different architectures. Therefore, one malware corresponds to at least one rule. It is necessary to write the rules corresponding to all the malware in turn, which will take a lot of time.
[0006] Therefore, how to achieve efficient classification of malware has become the main problem to be solved at present. Summary of the invention
[0007] The present application provides a classification method, device and electronic device for realizing efficient classification of malware.
[0008] In a first aspect, the present application provides a classification method, the method comprising:
[0009] Obtaining a first sequence of malware to be detected, and obtaining a second sequence corresponding to the malware;
[0010] Extracting a common subsequence corresponding to the first sequence and the second sequence, and determining a sequence length value corresponding to the common subsequence;
[0011] A comparison result between the sequence length value and a preset length threshold is determined, and a classification result corresponding to the malware to be detected is determined based on the comparison result.
[0012] Through the above method, the classification result of the malware to be detected is determined based on the comparison result between the sequence length value and the preset length threshold, avoiding rule training or retraining model based on the malware to be detected, thereby improving the classification efficiency of the malware to be detected.
[0013] In a possible design, obtaining a first sequence of the malware to be detected and obtaining a second sequence corresponding to the malware include:
[0014] Decompiling the malware to be detected and the malware to obtain a first character string and a first reference address corresponding to the malware to be detected, and obtaining a second character string and a second reference address corresponding to the malware;
[0015] combining the first character string and the first reference address to generate the first sequence; and
[0016] The second character string and the second reference address are combined to generate the second sequence.
[0017] By using the above method, the first sequence corresponding to the malware to be detected and the second sequence corresponding to the malware are determined respectively, which is conducive to comparing the malware to be detected with the malware.
[0018] In a possible design, determining a comparison result between the sequence length value and a preset length threshold, and determining a classification result corresponding to the malware to be detected based on the comparison result, includes:
[0019] If the sequence length value of the common subsequence is greater than the preset length threshold, determining the classification result of the malware to be detected based on the similarity between the malware to be detected and each malware;
[0020] If the sequence length value of the common subsequence is not greater than the preset length threshold, a new software type name is created for the malware to be detected, and the new software type name is used as the classification result.
[0021] Through the above method, the malware to be detected is classified based on the comparison between the sequence length value and the preset length threshold, thereby ensuring the accuracy of the classification of the malware to be detected.
[0022] In a possible design, determining the classification result of the malware to be detected based on the similarity between the malware to be detected and each malware includes:
[0023] Determine a first position identifier corresponding to a first reference address of the first sequence, sort the first sequence according to the first position identifier, and generate a first increasing sequence, wherein the first reference address represents a position of the malware to be detected in the address space; and
[0024] Determine a second position identifier corresponding to a second reference address of the second sequence, sort the second sequence according to the second position identifier, and generate a second increasing sequence, wherein the second reference address represents the position of the malware in the address space.
[0025] Substituting the first increasing sequence and the second increasing sequence into a similarity formula, and calculating a similarity value between the malware to be detected and the malware;
[0026] The similarity value is compared with a preset similarity threshold to determine a classification result.
[0027] Through the above method, the similarity value between the malware to be detected and the malware is calculated based on the first increasing sequence and the second increasing sequence, and the malware to be detected is classified based on the size comparison between the similarity value and the preset similarity threshold, which is conducive to ensuring the accuracy of the classification of the malware to be detected.
[0028] In a possible design, the step of bringing the first increasing sequence and the second increasing sequence into a similarity formula to calculate a similarity value between the malware to be detected and the malware includes:
[0029] Extracting a common increasing subsequence corresponding to the first increasing sequence and the second increasing sequence;
[0030] Determining an increasing sequence length value corresponding to the common increasing subsequence;
[0031] The increasing sequence length value, the first increasing sequence, and the second increasing sequence are put into the similarity formula to calculate the similarity value between the malware to be detected and the malware.
[0032] By using the above method, the similarity value is calculated based on the similarity formula, which is conducive to classifying the malware to be detected based on the similarity value.
[0033] In a possible design, comparing the similarity value with a preset similarity threshold to determine a classification result includes:
[0034] If the similarity value is lower than the preset similarity threshold, a new software type name is created for the malware to be detected, and the new software type name is used as the classification result;
[0035] If the similarity value is not lower than the preset similarity threshold, the malware corresponding to the maximum similarity value and the target malware category corresponding to the malware are determined, and the target malware category is taken as the result, wherein all malware are clustered to obtain the malware category corresponding to the malware.
[0036] Through the above method, based on the comparison between the similarity value and the preset similarity threshold, different comparison results correspond to different classifications, thereby ensuring the accuracy of classification of the malware to be detected.
[0037] In a possible design, clustering all malware to obtain malware categories corresponding to the malware includes:
[0038] Determine an undirected graph corresponding to all malware, and cluster the undirected graph to obtain a plurality of clusters;
[0039] Each cluster is regarded as the malware category corresponding to the malware.
[0040] Through the above method, known malware is presented as an undirected graph, and the known malware is classified by clustering the undirected graph, which is conducive to incremental training through clustering.
[0041] In a second aspect, the present application provides a classification device, the device comprising:
[0042] An obtaining module, used for obtaining a first sequence of the malware to be detected, and obtaining a second sequence corresponding to the malware;
[0043] an extraction module, configured to extract a common subsequence corresponding to the first sequence and the second sequence, and determine a sequence length value corresponding to the common subsequence;
[0044] The classification module is used to determine a comparison result between the sequence length value and a preset length threshold, and determine a classification result corresponding to the malware to be detected based on the comparison result.
[0045] In one possible design, the acquisition module is specifically used to decompile the malware to be detected and the malware, obtain a first string and a first reference address corresponding to the malware to be detected, and obtain a second string and a second reference address corresponding to the malware, combine the first string and the first reference address to generate the first sequence, and combine the second string and the second reference address to generate the second sequence.
[0046] In one possible design, the classification module is specifically used to determine the classification result of the malware to be detected based on the similarity between the malware to be detected and each malware if the sequence length value of the common subsequence is greater than the preset length threshold; if the sequence length value of the common subsequence is not greater than the preset length threshold, establish a new software type name for the malware to be detected, and use the new software type name as the classification result.
[0047] In one possible design, the classification module is also used to determine a first position identifier corresponding to a first reference address of the first sequence, sort the first sequence according to the first position identifier to generate a first ascending sequence, and determine a second position identifier corresponding to a second reference address of the second sequence, sort the second sequence according to the second position identifier to generate a second ascending sequence, bring the first ascending sequence and the second ascending sequence into a similarity formula, calculate a similarity value between the malware to be detected and the malware, compare the similarity value with a preset similarity threshold, and determine a classification result.
[0048] In one possible design, the classification module is also used to extract the common increasing subsequence corresponding to the first increasing sequence and the second increasing sequence, determine the increasing sequence length value corresponding to the common increasing subsequence, bring the increasing sequence length value, the first increasing sequence and the second increasing sequence into the similarity formula, and calculate the similarity value between the malware to be detected and the malware.
[0049] In one possible design, the classification module is also used to establish a new software type name for the malware to be detected if the similarity value is lower than the preset similarity threshold, and use the new software type name as the classification result; if the similarity value is not lower than the preset similarity threshold, determine the malware corresponding to the maximum similarity value and the target malware category corresponding to the malware, and use the target malware category as the result, wherein all malware are clustered to obtain the malware category corresponding to the malware.
[0050] In a possible design, the classification module is further used to determine an undirected graph corresponding to all malware, cluster the undirected graph to obtain multiple clusters, and use each cluster as a malware category corresponding to the malware.
[0051] In a third aspect, the present application provides an electronic device, including:
[0052] Memory, used to store computer programs;
[0053] The processor is used to implement the above-mentioned classification method steps when executing the computer program stored in the memory.
[0054] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned classification method are implemented.
[0055] For each aspect from the first to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 A flow chart of the steps of a classification method provided for this application;
[0057] Figure 2 Undirected graph structure diagram provided for this application;
[0058] Figure 3 A schematic diagram of a process for determining the classification results of malware to be detected provided by this application;
[0059] Figure 4 A schematic diagram of the structure of a classification device provided in this application;
[0060] Figure 5 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0062] In the previous technology, in order to accurately identify the software type of malware, it is necessary to extract the feature string in the malware, match the feature string with the feature string in each rule in turn, and when a rule that is completely consistent with the feature string of the malware is matched, the software type corresponding to the malware is extracted from the determined rule to obtain a classification result; when the malware does not match the corresponding rule, it is necessary to rewrite the rule for the malware, as follows: obtain the binary file corresponding to the malware, and write rules for the binary file based on the known architecture. When the number of malware is too large, since each malware corresponds to different rules under different architectures, one malware corresponds to at least one rule, and it is necessary to write the rules corresponding to all malware in turn, which will take a lot of time.
[0063] In order to solve the above-described problems, the embodiments of the present application provide a classification method for improving the efficiency of determining the classification results corresponding to the malware to be detected. The method and the device described in the embodiments of the present application are based on the same technical concept. Since the principles of the problems solved by the method and the device are similar, the embodiments of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0064] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0065] Reference Figure 1 The present application provides a classification method, which can improve the efficiency of determining the classification results of the malware to be detected. The implementation process of the method is as follows:
[0066] Step S1: obtaining a first sequence of malware to be detected, and obtaining a second sequence corresponding to the malware.
[0067] In order to accurately classify the malware to be detected, it is necessary to determine the undirected graph corresponding to all the malware. The structure of the undirected graph is as follows: Figure 2 As shown, in Figure 2 In the example, each node represents malware, and the edges between nodes represent the relationship between malware. Figure 2 In the figure, 5 nodes and the connection relationship between the 5 nodes are used as an example. The undirected graph can be adjusted according to the actual situation, and no further explanation is given here.
[0068] After determining the undirected graph, the undirected graph is clustered to obtain multiple clusters. The clustering method in the embodiment of the present application can be: hierarchical clustering, graph theory clustering, Mean-Shift clustering, K-Means clustering, etc. Since the clustering method is a technology well known to those skilled in the art, it is not described in detail here. After obtaining multiple clusters, each cluster is used as a malware category corresponding to the malware, and each cluster contains at least one malware, thereby realizing the classification of malware based on clustering.
[0069] In order to determine the relationship between the malware to be detected and the known malware categories after clustering, it is necessary to compare the malware to be detected with the malware in the undirected graph. Since the process of comparing the malware to be detected with each malware is the same, the embodiment of the present application is described by comparing the malware to be detected with one malware, which is as follows:
[0070] When cyber attackers are writing malware code, they need to divide the code into segments and put them into the address space so that the malware code can be loaded into any location in the physical memory. The address space represents the size of the memory occupied by the computer entity, and each segment of code put into the address space will correspond to a location identifier. When the code is called, the reference address of the code will be generated based on the location indicated by the location identifier.
[0071] Based on the above description, it is necessary to decompile the malware to be detected and the malware to obtain a first assembly code corresponding to the malware to be detected and a second assembly code corresponding to the malware, and then extract a first string and a first reference address corresponding to the malware to be detected from the first assembly code, the first string represents the malware to be detected, the first string and the first reference address are combined to generate a first sequence, and the second string and the second reference address corresponding to the malware to be detected are extracted from the second assembly code, and the second string and the second reference address are combined to generate a second sequence.
[0072] For example, if the first string is: " / proc / cpuinfo", the first reference address is: "0x800000", then the first sequence is: "proc / cpuinfo, 0x800000";
[0073] The second character string is " / Program / Files", and the second reference address is: "0x650000". Therefore, the second sequence is: "Program / Files, 0x650000".
[0074] By using the above method, the first sequence corresponding to the malware to be detected is determined, and the second sequence of the malware is determined, which is conducive to the comparison between the malware to be detected and the malware.
[0075] Step S2: extracting a common subsequence corresponding to the first sequence and the second sequence, and determining a sequence length value corresponding to the common subsequence.
[0076] After determining the first sequence and the second sequence, in order to accurately determine the classification result corresponding to the malware to be detected, it is necessary to extract the common subsequence of the first sequence and the second sequence and determine the sequence length value of the common subsequence.
[0077] For example, if the first sequence is ABVED1 and the second sequence is WCVEEF2, the common subsequence of the first sequence and the second sequence is VE, and the sequence length of VE is 2.
[0078] By using the above method, the malware to be detected and the malware are compared based on the common subsequence, which is helpful to accurately determine the classification result corresponding to the malware to be detected.
[0079] Step S3: Determine a comparison result between the sequence length value and a preset length threshold, and determine a classification result corresponding to the malware to be detected based on the comparison result.
[0080] After determining the sequence length value, the sequence length value is compared with a preset length threshold. If the sequence length value is not greater than the preset length threshold, it is determined that the software type of the malware to be detected is inconsistent with the software type of the malware. Therefore, the software type of the malware to be detected is a new software type, and the new software type name is used as the classification result. The embodiment of the present application can establish a new cluster for the malware to be detected; if the sequence length value is greater than the preset length threshold, the software type of the malware to be detected is a known software type. Therefore, the similarity between the malware to be detected and the malware is further determined.
[0081] For example, after clustering, there are three clusters, each of which corresponds to malware categories A, B, and C. The preset sequence length value is 0. When the common subsequence value is 0, it means that the software type of the malware to be detected is not A, B, or C, and the malware to be detected is classified into a new cluster D. When the common subsequence value is 1, it means that the software type of the malware to be detected is one of A, B, and C.
[0082] After determining that the sequence length value is greater than a preset length threshold, in order to accurately determine the software type of the malware to be detected, it is necessary to determine the first position identifier corresponding to the first reference address, sort the first sequence according to the first position identifier, and generate a first ascending sequence, and determine the second position identifier corresponding to the second reference address, sort the second sequence according to the second position identifier, and generate a second ascending sequence.
[0083] For example, the increasing sequence can be S = [XS1, ..., XS i ,…,XS |XS| ], in the sequence, Where i∈[1,|XS|), |XS| is the sequence length value.
[0084] After determining the first increasing sequence and the second increasing sequence, the first increasing sequence is compared with the second increasing sequence to obtain a common subsequence between the first increasing sequence and the second increasing sequence, and the common subsequence length value of the common subsequence is determined. Then, the similarity value between the malware to be detected and the malware is calculated using a similarity formula. The similarity formula is as follows:
[0085]
[0086] In the above formula, S NEW represents the first increasing sequence of malware to be detected, S km Represents the CL after clustering k The second increasing sequence extracted from the mth malware in the cluster, k and m are both positive integers, LCS(S NEW ,S km ) represents the common subsequence length value between and, LengthOf S NEW The length of the first increasing sequence of malware to be detected, LengthOf S km The sequence length value representing the second increasing sequence of malware, Sim(S NEW ,S km ) represents the similarity value, Sim(S NEW ,S km ) has a value range of [0, 1]. The larger the calculated similarity value is, the higher the similarity between the first increasing sequence and the second increasing sequence is.
[0087] For example, the common subsequence of the malware to be detected and the malware is "abcd", and the common subsequence length of "abcd" is 4. If the sequence length of the malware to be detected is 8 and the sequence length of the malware is 9, the listed parameters are brought into the above similarity formula, as follows:
[0088]
[0089] Based on the above formula, Sim(S NEW ,S km ) is 0.47, and the similarity between the malware to be detected and the malware is 47%.
[0090] Further, if it is determined that the software type of the malware to be detected is one of A, B, and C, the similarity values between the malware to be detected and A, B, and C are calculated according to the above method. The similarity value between the malware to be detected and A is 47%, the similarity value between the malware to be detected and B is 68%, and the similarity value between the malware to be detected and C is 87%. 47%<68%<87%, and it is determined that the software type of the malware to be detected is C.
[0091] Based on the above method, the similarity value between the malware to be detected and the malware is calculated. When the similarity value is lower than the preset similarity threshold, a new software type name will be established for the malware to be detected, and the new software type name will be used as the classification result; when the similarity value is not lower than the preset similarity threshold, the malware corresponding to the maximum similarity value is determined from all clusters, and the target malware category corresponding to the malware is determined, and the target malware category is used as the classification result corresponding to the malware to be detected.
[0092] For example: The process diagram for determining the classification results of the malware to be detected is as follows Figure 3 As shown, in Figure 3 In the method, an undirected graph is constructed according to known malware, and the undirected graph is clustered to obtain multiple clusters. Then, the common subsequence between the malware to be detected and the malware in the cluster is determined. When the sequence length value of the common subsequence is 0, it means that the malware to be detected and the cluster corresponding to the malware are mutually exclusive. If the malware to be detected is mutually exclusive with each cluster, a new cluster is established and the malware to be detected is classified into the new cluster. When the sequence length value of the common subsequence is greater than 0, the similarity value between the malware to be detected and the malware in the non-exclusive clusters is calculated, and the malware corresponding to the maximum similarity value and the target malware category corresponding to the malware are determined, and the target malware category is used as the classification result.
[0093] It should be noted that in the embodiments of the present application, since the classification of each malware to be detected is performed according to the process described above, when there is continuous malware to be detected that needs to be classified, there is an incremental training link in the classification model. Therefore, the process described above is also an incremental training process for the malware to be detected, and there is no performance degradation phenomenon. In addition, there is a newly added classification model, which can be merged with the existing classification model. The determination process of the newly added classification model is consistent with that of the existing classification model, thereby reducing the computing power overhead in the merging process.
[0094] Furthermore, both the existing classification model and the newly added classification model are based on clustering of undirected graphs to achieve classification of malware to be detected. In the embodiment of the present application, the existing classification model and the newly added classification model are merged and converted into a merge of an existing undirected graph and a newly added undirected graph. The same nodes in the existing undirected graph and the newly added undirected graph are merged, and the merged nodes inherit the connection relationship of the corresponding nodes. Therefore, the computing power overhead of the classification model merging process can be reduced.
[0095] Based on the method described above, the malware to be detected is placed in a cluster corresponding to a known maximum similarity value, or a new cluster is established for the malware to be detected, thereby avoiding retraining of the malware to be detected, ensuring that the malware to be detected can be quickly classified, and reducing the cost of model training.
[0096] Based on the same inventive concept, a classification device is also provided in the embodiment of the present application. The classification device is used to implement the function of a classification method. Figure 4 , the device comprises:
[0097] An obtaining module 401 is used to obtain a first sequence of the malware to be detected, and obtain a second sequence corresponding to the malware;
[0098] An extraction module 402 is used to extract a common subsequence corresponding to the first sequence and the second sequence, and determine a sequence length value corresponding to the common subsequence;
[0099] The classification module 403 is used to determine a comparison result between the sequence length value and a preset length threshold, and determine a classification result corresponding to the malware to be detected based on the comparison result.
[0100] In one possible design, the acquisition module 401 is specifically used to decompile the malware to be detected and the malware, obtain a first string and a first reference address corresponding to the malware to be detected, and obtain a second string and a second reference address corresponding to the malware, combine the first string and the first reference address to generate the first sequence, and combine the second string and the second reference address to generate the second sequence.
[0101] In one possible design, the classification module 403 is specifically used to determine the classification result of the malware to be detected based on the similarity between the malware to be detected and each malware if the sequence length value of the common subsequence is greater than the preset length threshold; if the sequence length value of the common subsequence is not greater than the preset length threshold, establish a new software type name for the malware to be detected, and use the new software type name as the classification result.
[0102] In one possible design, the classification module 403 is also used to determine a first position identifier corresponding to a first reference address of the first sequence, sort the first sequence according to the first position identifier to generate a first ascending sequence, and determine a second position identifier corresponding to a second reference address of the second sequence, sort the second sequence according to the second position identifier to generate a second ascending sequence, bring the first ascending sequence and the second ascending sequence into a similarity formula, calculate a similarity value between the malware to be detected and the malware, compare the similarity value with a preset similarity threshold, and determine a classification result.
[0103] In one possible design, the classification module 403 is also used to extract the common increasing subsequence corresponding to the first increasing sequence and the second increasing sequence, determine the increasing sequence length value corresponding to the common increasing subsequence, bring the increasing sequence length value, the first increasing sequence and the second increasing sequence into the similarity formula, and calculate the similarity value between the malware to be detected and the malware.
[0104] In one possible design, the classification module 403 is also used to establish a new software type name for the malware to be detected if the similarity value is lower than the preset similarity threshold, and use the new software type name as the classification result; if the similarity value is not lower than the preset similarity threshold, determine the malware corresponding to the maximum similarity value and the target malware category corresponding to the malware, and use the target malware category as the result, wherein all malware are clustered to obtain the malware category corresponding to the malware.
[0105] In a possible design, the classification module 403 is further used to determine an undirected graph corresponding to all malware, cluster the undirected graph to obtain multiple clusters, and use each cluster as a malware category corresponding to the malware.
[0106] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can realize the function of the aforementioned classification device, referring to Figure 5 , the electronic device comprises:
[0107] At least one processor 501, and a memory 502 connected to the at least one processor 501. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 In the example, the processor 501 and the memory 502 are connected via a bus 500. The bus 500 is Figure 5 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 500 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 501 can also be called a controller, and there is no limitation on the name.
[0108] In the embodiment of the present application, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute a classification method discussed above by executing the instructions stored in the memory 502. The processor 501 can implement Figure 4 The functions of each module in the device shown.
[0109] Among them, the processor 501 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 502 and calling data stored in the memory 502, the various functions of the device and processing data, the device can be monitored as a whole.
[0110] In one possible design, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0111] Processor 501 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of a classification method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware processor execution, or a combination of hardware and software modules in the processor.
[0112] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0113] By programming the processor 501, the code corresponding to a classification method described in the above embodiment can be fixed into the chip, so that the chip can execute the classification method when running. Figure 1 A classification step of the embodiment shown. How to design and program the processor 501 is a technique well known to those skilled in the art and will not be described in detail here.
[0114] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes a classification method discussed above.
[0115] In some possible implementations, various aspects of a classification method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a classification method according to various exemplary implementations of the present application described above in this specification.
[0116] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0117] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0120] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A classification method, characterized in that: include: Obtaining a first sequence of malware to be detected, and obtaining a second sequence corresponding to the malware; Extracting a common subsequence corresponding to the first sequence and the second sequence, and determining a sequence length value corresponding to the common subsequence; A comparison result between the sequence length value and a preset length threshold is determined, and a classification result corresponding to the malware to be detected is determined based on the comparison result.
2. The method according to claim 1, characterized in that The obtaining of a first sequence of malware to be detected and obtaining a second sequence corresponding to the malware includes: Decompiling the malware to be detected and the malware to obtain a first character string and a first reference address corresponding to the malware to be detected, and obtaining a second character string and a second reference address corresponding to the malware; combining the first character string and the first reference address to generate the first sequence; and The second character string and the second reference address are combined to generate the second sequence.
3. The method according to claim 1, characterized in that Determining a comparison result between the sequence length value and a preset length threshold, and determining a classification result corresponding to the malware to be detected based on the comparison result, includes: If the sequence length value of the common subsequence is greater than the preset length threshold, determining the classification result of the malware to be detected based on the similarity between the malware to be detected and each malware; If the sequence length value of the common subsequence is not greater than the preset length threshold, a new software type name is created for the malware to be detected, and the new software type name is used as the classification result.
4. The method according to claim 3, characterized in that The determining the classification result of the malware to be detected based on the similarity between the malware to be detected and each malware includes: Determine a first position identifier corresponding to a first reference address of the first sequence, sort the first sequence according to the first position identifier, and generate a first increasing sequence, wherein the first reference address represents a position of the malware to be detected in the address space; and Determine a second position identifier corresponding to a second reference address of the second sequence, sort the second sequence according to the second position identifier, and generate a second increasing sequence, wherein the second reference address represents a position of the malware in the address space; Substituting the first increasing sequence and the second increasing sequence into a similarity formula, and calculating a similarity value between the malware to be detected and the malware; The similarity value is compared with a preset similarity threshold to determine a classification result.
5. The method according to claim 4, characterized in that Substituting the first increasing sequence and the second increasing sequence into a similarity formula to calculate a similarity value between the malware to be detected and the malware includes: Extracting a common increasing subsequence corresponding to the first increasing sequence and the second increasing sequence; Determining an increasing sequence length value corresponding to the common increasing subsequence; The increasing sequence length value, the first increasing sequence, and the second increasing sequence are put into the similarity formula to calculate the similarity value between the malware to be detected and the malware.
6. The method according to claim 4, characterized in that The comparing the similarity value with a preset similarity threshold to determine a classification result includes: If the similarity value is lower than the preset similarity threshold, a new software type name is created for the malware to be detected, and the new software type name is used as the classification result; If the similarity value is not lower than the preset similarity threshold, the malware corresponding to the maximum similarity value and the target malware category corresponding to the malware are determined, and the target malware category is taken as the result, wherein all malware are clustered to obtain the malware category corresponding to the malware.
7. The method according to claim 6, characterized in that The method of clustering all malware to obtain malware categories corresponding to the malware includes: Determine an undirected graph corresponding to all malware, and cluster the undirected graph to obtain a plurality of clusters; Each cluster is regarded as the malware category corresponding to the malware.
8. A classification device, characterized in that: include: An obtaining module, used for obtaining a first sequence of the malware to be detected, and obtaining a second sequence corresponding to the malware; an extraction module, configured to extract a common subsequence corresponding to the first sequence and the second sequence, and determine a sequence length value corresponding to the common subsequence; The classification module is used to determine a comparison result between the sequence length value and a preset length threshold, and determine a classification result corresponding to the malware to be detected based on the comparison result.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.
