File processing method, device, electronic device and storage medium
By setting words to split code segments and determine file characteristic information and identification, the problem of meaningless virus names in malicious code detection is solved, accurate judgment and classification of malicious codes is achieved, and analysis efficiency is improved.
Patent Information
- Application Number
- CN202210487447.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-05-06
AI Technical Summary
In the existing technology, it is difficult to accurately judge and classify malicious code based on virus names. Especially when malicious code packaging, transformation, and polymorphic technologies are widely used, virus names are often meaningless, leading to difficulties in analysis and statistics.
By setting words as end nodes, the code of the file to be processed is split to obtain several code segments, and the file characteristic information and file identification are determined based on these code segments to ensure that the file identification contains characteristic information and avoid characteristics caused by fixed-length splitting. Information is missing.
It achieves a more intuitive and rapid judgment and classification of malicious codes, ensures that file identification contains characteristic information, supports the identification of malicious event types and application platforms, and improves the efficiency of data statistics and analysis.
Smart Images

Figure CN114881018B_ABST
Abstract
Description
Background Art
[0002] Malicious code analysts and ordinary users often have the most intuitive understanding of malicious code through virus names. At the same time, in the process of statistical analysis of malicious code data, they are often classified and merged by virus names. However, with the increasing number of malicious code packing, deformation, polymorphism and other technologies, virus detection can no longer rely solely on feature detection, dynamic behavior and some heuristic detection. The virus names are mostly meaningless catch-all names, such as Agent, Malicious, Gen, Malware, Suspicious, etc., or meaningless strings of numbers. This results in analysts being unable to make accurate judgments on samples at the first time when they first come into contact with the malicious code. In terms of data statistics, they are also unable to quickly classify the same family and conduct overall analysis. Summary of the invention
[0003] In view of this, the present invention provides a file processing method, device, electronic device and storage medium, which at least partially solve the problems existing in the prior art.
[0004] According to one aspect of the present application, a file processing method is provided, comprising:
[0005] The code of the file to be processed is split with the set word as the end node to obtain several code segments;
[0006] Determining file feature information of the file to be processed according to the plurality of code segments;
[0007] The file identifier of the file to be processed is determined according to the file characteristic information.
[0008] In an exemplary embodiment of the present application, the code of the file to be processed is split with the set word as the end node to obtain several code segments, including:
[0009] According to the file to be processed, obtaining the assembly code of the file to be processed;
[0010] The assembly code is split with the setting words as the end nodes to obtain a plurality of the code segments.
[0011] In an exemplary embodiment of the present application, there are multiple setting words, each code segment only includes one setting word, and the last word of each code segment is the setting word.
[0012] In an exemplary embodiment of the present application, determining the file feature information of the to-be-processed file according to the plurality of code segments includes:
[0013] Clustering the plurality of code segments to obtain at least one code segment set;
[0014] Determine the set feature information corresponding to each set of code segments;
[0015] According to each set of feature information, file feature information corresponding to the file to be processed is determined.
[0016] In an exemplary embodiment of the present application, each code segment in the same set of code segments is the same;
[0017] The determining of the set feature information corresponding to each set of code segments includes:
[0018] For each of the code segment sets, determine the number of the code segments within the set and code feature information corresponding to any of the code segments;
[0019] According to the number of the code segments and the code feature information, the set feature information of the corresponding code segment set is determined.
[0020] In an exemplary embodiment of the present application, determining the file identifier of the to-be-processed file according to the file feature information includes:
[0021] Determine the threat event type information and application platform information of the file to be processed;
[0022] The threat event type information, application platform information and feature information are spliced in a set order to obtain a file identifier of the file to be processed.
[0023] In an exemplary embodiment of the present application, the code of the file to be processed is split with the set word as the end node to obtain several code segments, including:
[0024] Determining the target code type according to the file information of the file to be processed;
[0025] Processing the file to be processed to obtain a code of the file to be processed, wherein the type of the code is the target code type;
[0026] Determine a set of words according to the target code type;
[0027] The assembly code is split with any setting word in the setting word set as an end node to obtain a plurality of the code segments.
[0028] According to one aspect of the present application, there is provided a file processing device, comprising:
[0029] A splitting module, used to split the code of the to-be-processed file with a set word as the end node to obtain a number of code segments;
[0030] A first determining module, used for determining the file characteristic information of the to-be-processed file according to the plurality of code segments;
[0031] The second determining module is used to determine the file identifier of the to-be-processed file according to the file characteristic information.
[0032] According to one aspect of the present application, there is provided an electronic device, including a processor and a memory;
[0033] The processor is used to execute the steps of any of the above methods by calling the program or instruction stored in the memory.
[0034] According to one aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute the steps of any one of the above methods.
[0035] The file processing method provided by the present application splits the code of the file to be processed by using set words as the end node, so that the several code segments obtained by splitting are of different lengths. Then, the file feature information of the file to be processed is determined based on the several code segments, and the file identifier of the file to be processed is determined based on the feature information, so that the file identifier contains the feature information of the file to be processed, and the features of the file to be processed can be obtained more intuitively. At the same time, compared with the general use of fixed-length splitting by lines or a fixed number of words, the present application splits the code of the file to be processed by setting words as the end node, and the several code segments obtained are of indefinite length, that is, the length of each code segment is not a fixed length, which can effectively avoid the long code segment composed of multiple words from being split into multiple, resulting in the continuous features being destroyed during feature extraction, resulting in the problem of missing final feature information. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A flowchart of a file processing method provided in this embodiment;
[0038] Figure 2 This is a structural block diagram of a file processing device provided in this embodiment. DETAILED DESCRIPTION
[0039] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0040] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.
[0041] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0042] Please refer to Figure 1 According to one aspect of the present application, a file processing method is provided, comprising the following steps:
[0043] Step S100 , splitting the code of the file to be processed with the set word as the end node to obtain a plurality of code segments.
[0044] Step S200: determining the file feature information of the file to be processed according to the plurality of code segments.
[0045] Step S300: determining the file identifier of the file to be processed according to the file characteristic information.
[0046] Among them, the set words are pre-set words, and there can be multiple words. The code of the file to be processed is split with the set words as the end node, that is, the code of the file to be processed is traversed in a certain order (such as from front to back). Whenever any set word is detected, the set word is used as the last word of the current code segment for interception, and the traversal continues from the next word until the entire code is traversed, thereby obtaining several code segments. Splitting in this way can make each code segment contain only one of the set words, and the last word of each of the code segments is the set word. In this way, it can be ensured that each code segment can execute a complete function (that is, it contains sufficient information for code feature analysis).
[0047] In general code splitting methods, a fixed value is often used for splitting, such as a fixed value of 3, which means that a completed code will be split into multiple code segments with each segment consisting of 3 code words. This method can easily split a long code block into multiple code segments, and it is difficult to accurately determine the complete information in each code segment, which can easily lead to missing or inaccurate feature information in the end.
[0048] The method used in this embodiment does not require the length of each code segment to be specified during the splitting. Instead, the code of the file to be processed is split into multiple code segments of different lengths by setting words, thereby avoiding splitting a longer code block (a code segment composed of multiple code words used to complete a function) into multiple code segments.
[0049] The file identifier may be in the form of a label, annotation or remark information. Since it is obtained based on the file feature information, it will carry the features of the file to be processed, so that the staff can quickly obtain some information about the file to be processed through the file identifier. At the same time, in order to enable the staff to obtain the information of the file to be processed more intuitively and quickly, in this embodiment, the file identifier is set as the file name, that is, after the file identifier is determined, the file identifier will be set as the file name of the file to be processed.
[0050] The file processing method provided in this embodiment splits the code of the file to be processed by using set words as the end node, so that the several code segments obtained by splitting are of different lengths. Then, the file feature information of the file to be processed is determined based on the several code segments, and the file identifier of the file to be processed is determined based on the feature information, so that the file identifier contains the feature information of the file to be processed, and the features of the file to be processed can be obtained more intuitively. At the same time, compared with the general use of fixed-length splitting by lines or a fixed number of words, this embodiment splits the code of the file to be processed by setting words as the end node, and the several code segments obtained are of indefinite length, that is, the length of each code segment is not a fixed length, which can effectively avoid the long code segment composed of multiple words from being split into multiple pieces, resulting in the continuous features being destroyed during feature extraction, resulting in the problem of missing final feature information.
[0051] In an exemplary embodiment of the present application, the code of the file to be processed is split with the set word as the end node to obtain several code segments, including:
[0052] According to the file to be processed, obtaining the assembly code of the file to be processed;
[0053] The assembly code is split with the setting words as the end nodes to obtain a plurality of the code segments.
[0054] Generally, the files to be processed are mostly compiled executable files. The code cannot be directly obtained from such executable files, so the characteristic information of the files to be processed cannot be directly obtained. In this application, the files to be processed of the executable files are disassembled to obtain the assembly code of the files to be processed. Specifically, the buf information and size information of the files to be processed can be obtained by preprocessing the files to be processed. The integrity of the files to be processed is determined by the buf information and the size information, and when the files are complete, the disassembly operation is performed according to the buf information to obtain the assembly code of the files to be processed.
[0055] In this embodiment, multiple words are set, specifically, ret (code word), jmp (code word), jnz (code word), etc. The applicant has analyzed and processed a large number of samples, and by setting the above words as ending words, the assembly code is split into indefinite lengths, and can effectively and quickly obtain indefinite length code segments, and the feature information obtained from these code segments will not have a large number of feature missing problems.
[0056] In an exemplary embodiment of the present application, the code of the to-be-processed file is split with the set word as the end node to obtain several code segments, and the following method can also be used:
[0057] Determining the target code type according to the file information of the file to be processed;
[0058] Processing the file to be processed to obtain a code of the file to be processed, wherein the type of the code is the target code type;
[0059] Determine a set of words according to the target code type;
[0060] The assembly code is split with any setting word in the setting word set as an end node to obtain a plurality of the code segments.
[0061] In this embodiment, the file to be processed is an executable file, that is, a file whose original code cannot be directly obtained. For such files, in the previous embodiment, they are uniformly converted into assembly code and then processed. However, in some cases, the restored assembly code cannot well express the characteristics of malicious attacks, resulting in that even if feature extraction is performed on the code segments composed of assembly code, subsequent malicious event classification and other tasks cannot be well performed. In this embodiment, the target code type such as ".NET" will be determined based on the file information of such files to be processed. And the files to be processed are processed into codes of high-level languages of the target code type.
[0062] Then, the code is split using the set words in the set word set corresponding to the selected target code type to obtain code segments.
[0063] It is understandable that in this embodiment, each code type has a corresponding set of set words for splitting processing. For example, the set of set words for assembly code is {ret, jmp, jnz}; the set of set words for C language is {end, return, endif}, etc.
[0064] In an exemplary embodiment of the present application, the code of the to-be-processed file is split with the set word as the end node to obtain several code segments, and the following method can also be used:
[0065] Determining the code type of the file to be processed; the file to be processed is written in a high-level computer language;
[0066] Determine a set of words according to the code type;
[0067] The assembly code is split with any setting word in the setting word set as an end node to obtain a plurality of the code segments.
[0068] In this embodiment, the file to be processed is not an executable file, but an uncompiled file written in a plain text high-level computer language (such as C language, etc.).
[0069] At this time, there is no need to convert the code in the executable file into assembly code. Instead, the corresponding set of set words can be directly determined according to the corresponding code type for subsequent splitting work. This avoids the processing workload of language conversion. At the same time, it also avoids the problem of feature reduction caused by language conversion.
[0070] In an exemplary embodiment of the present application, determining the file feature information of the to-be-processed file according to the plurality of code segments includes:
[0071] Clustering the plurality of code segments to obtain at least one code segment set;
[0072] Determine the set feature information corresponding to each set of code segments;
[0073] According to each set of feature information, file feature information corresponding to the file to be processed is determined.
[0074] The clustering of the code segments may be performed by using clustering methods such as similar clustering or identical clustering. In this embodiment, in order to make the set feature information more accurate, the clustering method used is identical clustering, that is, completely identical code segments are clustered to form a code segment set.
[0075] The code segment set can be extracted by using a hash algorithm, and the same hash algorithm is used to operate each code segment set to obtain a set hash value (i.e., set feature information) of each code segment set. Each set feature information can represent the overall features of all code segments in the corresponding code segment set.
[0076] According to each of the set feature information, the file feature information corresponding to the to-be-processed file is determined. Specifically, multiple set feature information are accumulated to obtain accumulated feature information, and the accumulated feature information is subjected to dimensionality reduction processing to obtain the file feature information.
[0077] For example, there are three code segment sets, the set feature information of set 1 is 11100101, the set feature information of set 2 is 10100101, and the set feature information of set 3 is 11100111.
[0078] Then the accumulated feature information after the three sets of feature information are accumulated is 32300313.
[0079] The purpose of dimensionality reduction is to process feature information into a string consisting of "0" and "1". The specific method is to set a threshold, record the bits greater than the threshold as 1, and record the bits less than or equal to the threshold as 0.
[0080] In this embodiment, the threshold is 1, and the file feature information of the dimension reduction processing is 11100101. The file feature information is used to characterize the feature information of the file to be processed. Due to the accumulation and dimension reduction processing, different files to be processed may have the same file feature information. Since the meaning algorithm used for feature extraction is the same, if the file feature information of two files to be processed is the same, it means that the two feature files are the same or similar, and they can be judged as the same category or family.
[0081] In an exemplary embodiment of the present application, each code segment in the same code segment set is the same.
[0082] The determining of the set feature information corresponding to each set of code segments includes:
[0083] For each of the code segment sets, determine the number of the code segments within the set and code feature information corresponding to any of the code segments;
[0084] According to the number of the code segments and the code feature information, the set feature information of the corresponding code segment set is determined.
[0085] In this embodiment, a hash algorithm may be used to extract code feature information from a code segment. The feature extraction hash algorithms used by different code segment sets are the same to ensure data uniformity. The number of code segments is used to characterize how many code segments there are in the corresponding code set. The code feature information is a hash value obtained by processing the code segment using a hash algorithm.
[0086] Since each code segment in the same code segment set is the same in this embodiment, when extracting code feature information, it is only necessary to perform feature extraction on any one code segment in the code segment set.
[0087] According to the number of the code segments and the code feature information, the set feature information of the corresponding code segment set is determined, specifically:
[0088] Use a preset hash algorithm to calculate any code segment in the code segment set to obtain a hash value (code feature information) of the code segment.
[0089] The number of code segments in the code segment set is used as a weight to perform weighted processing on the code feature information to obtain set feature information.
[0090] Examples of weighted processing are as follows:
[0091] The code segments in code segment set A are “push, push, jmp” and the number is 3.
[0092] The code segments in code segment set B are “push, mov, add, ret” and the number is 1.
[0093] The push, push, jmp code segment is 101011 after hash calculation, and its quantity (weight) is 3, so its weighted value (collective feature information) is 3-33-333 (for ease of understanding, it can be expressed as 3, -3, 3, -3, 3, 3).
[0094] The push, mov, add, and ret code segments are calculated as 100101 through hashing, and their quantity (weight) is 1, so their weighted value (collective feature information) is 100101.
[0095] Correspondingly, according to each of the set feature information, the file feature information corresponding to the to-be-processed file is determined, which may be:
[0096] Accumulating feature information of each set to obtain accumulated feature information;
[0097] Perform dimensionality reduction processing on the accumulated feature information to obtain file feature information.
[0098] Taking the above example for description, the accumulated feature information is 4-34-234. At this time, the threshold used in the dimensionality reduction process is 0, and the file feature information obtained after the dimensionality reduction process is 101011.
[0099] In an exemplary embodiment of the present application, determining the file identifier of the to-be-processed file according to the file feature information includes:
[0100] Determine the threat event type information and application platform information of the file to be processed;
[0101] The threat event type information, application platform information and feature information are spliced in a set order to obtain a file identifier of the file to be processed.
[0102] The threat event type information may be any of the following: Virus, Worm, Trojan, HackTool, Riskware, Grayware, Ransom, Miner.
[0103] The application platform information can be any of the following: Win32, Win64, Linux, Java, Html, Perl, etc., a total of 119 common platforms.
[0104] Specifically, the threat event type may be determined based on feature information of the file to be processed, or may be determined based on information contained in the file to be processed.
[0105] The platform type can be determined based on the information in the buf information of the file to be processed.
[0106] The format of the file identifier formed after splicing is "threat event type information. application platform information. feature information".
[0107] When the file identifier is set to the file name of the file to be processed, when the staff obtains the processed file to be processed, they can directly determine the characteristics of the file through the file name, such as what type of malicious file it is, on which platform it is running, and some basic characteristic information.
[0108] At the same time, when conducting subsequent statistical analysis, families and clusters can be determined directly based on the file name, without the need for staff to analyze the processed files again, making subsequent work more convenient and faster. It is also possible to quickly confirm some characteristics of the file directly through the file feature information in the file name.
[0109] This embodiment also provides a method for clustering the processed files to be processed.
[0110] Specifically:
[0111] Obtaining file feature information from the file identifier of each processed file to be processed;
[0112] According to the file feature information, the density clustering method DBSCAN with the Hamming distance of different files to be processed as the metric is used for clustering.
[0113] In this way, when performing statistical analysis on the processed files, family clustering can be quickly performed without further in-depth analysis of the files to be processed.
[0114] Please refer to Figure 2 According to one aspect of the present application, a file processing device is provided, comprising:
[0115] A splitting module, used to split the code of the to-be-processed file with a set word as the end node to obtain a number of code segments;
[0116] A first determining module, used for determining the file characteristic information of the to-be-processed file according to the plurality of code segments;
[0117] The second determining module is used to determine the file identifier of the to-be-processed file according to the file characteristic information.
[0118] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0119] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0120] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0121] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0122] The electronic device according to this embodiment of the present invention is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0123] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).
[0124] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0125] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).
[0126] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0127] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0128] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device (e.g., routers, modems, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0129] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0130] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0131] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0132] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0133] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0134] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0135] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0136] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0137] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A file processing method, characterized in that: include: The code of the file to be processed is split with the set word as the end node to obtain several code segments; Determining file feature information of the file to be processed according to the plurality of code segments; Determine the file identifier of the file to be processed according to the file characteristic information; The step of determining the file feature information of the file to be processed according to the plurality of code segments includes: Clustering the plurality of code segments to obtain at least one code segment set; Determine the set feature information corresponding to each set of code segments; Determining file feature information corresponding to the to-be-processed file according to each set of feature information; Each code segment in the same set of code segments is the same; The determining of the set feature information corresponding to each set of code segments includes: For each of the code segment sets, determine the number of the code segments within the set and code feature information corresponding to any of the code segments; According to the number of the code segments and the code feature information, the set feature information of the corresponding code segment set is determined.
2. The file processing method according to claim 1, characterized in that: The code of the file to be processed is split by taking the set word as the end node to obtain several code segments, including: According to the file to be processed, obtaining the assembly code of the file to be processed; The assembly code is split with the setting words as the end nodes to obtain a plurality of the code segments.
3. The file processing method according to claim 1, characterized in that: There are multiple setting words, each code segment only includes one setting word, and the last word of each code segment is the setting word.
4. The file processing method according to claim 1, characterized in that: The step of determining the file identifier of the file to be processed according to the file characteristic information includes: Determine the threat event type information and application platform information of the file to be processed; The threat event type information, application platform information and feature information are spliced in a set order to obtain a file identifier of the file to be processed.
5. The file processing method according to claim 2, characterized in that: The code of the file to be processed is split by taking the set word as the end node to obtain several code segments, including: Determining the target code type according to the file information of the file to be processed; Processing the file to be processed to obtain a code of the file to be processed, wherein the type of the code is the target code type; Determine a set of words according to the target code type; The assembly code is split with any setting word in the setting word set as an end node to obtain a plurality of the code segments.
6. A file processing device, characterized in that: include: A splitting module, used to split the code of the to-be-processed file with a set word as the end node to obtain a number of code segments; A first determining module, used for determining the file characteristic information of the to-be-processed file according to the plurality of code segments; A second determining module, used to determine the file identifier of the to-be-processed file according to the file characteristic information; The step of determining the file feature information of the file to be processed according to the plurality of code segments includes: Clustering the plurality of code segments to obtain at least one code segment set; Determine the set feature information corresponding to each set of code segments; Determining file feature information corresponding to the to-be-processed file according to each set of feature information; Each code segment in the same set of code segments is the same; The determining of the set feature information corresponding to each set of code segments includes: For each of the code segment sets, determine the number of the code segments within the set and code feature information corresponding to any of the code segments; According to the number of the code segments and the code feature information, the set feature information of the corresponding code segment set is determined.
7. An electronic device, characterized in that: including a processor and a memory; The processor is used to execute the steps of the method according to any one of claims 1 to 5 by calling the program or instruction stored in the memory.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 5.
