Ransomware detection method and detection system

Comparing file versions through semantic feature detection solves the problem that traditional backup solutions cannot distinguish between clean and unclean files, effectively resists ransomware attacks, and ensures the reliability and security of the backup system.

WO2024221864A1PCT designated stage expired Publication Date: 2024-10-31DELTA ELECTRONICS INC(CN)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/132565
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-20
Filing Date
2023-11-20
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Traditional backup solutions cannot effectively distinguish between uncorrupted files and damaged files, resulting in a mixture of clean files and unclean files in backup snapshots, making them unable to effectively defend against ransomware attacks.

Method used

Through semantic feature detection, compare the semantic feature differences between the previous and later versions of the file to determine whether the file has been attacked by ransomware, and mark the nature of the backup file as clean or unclean to ensure that the backup solution retains available clean versions.

Benefits of technology

Significantly improves the backup solution's ability to save clean versions, reduces the possibility of paying ransom after a ransomware attack, and effectively resists ransomware attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023132565_31102024_PF_FP_ABST
    Figure CN2023132565_31102024_PF_FP_ABST
Patent Text Reader

Abstract

A ransomware detection method and a detection system. The ransomware detection method is applied to the detection system having at least a semantic extraction module consisting of a plurality of semantic extractors, the detection method comprising: receiving a first file having a first ID; importing the first file into the semantic extraction module, and the semantic extraction module outputting a first semantic feature of the first file; receiving a second file having a second ID; importing the second file into the semantic extraction module, and the semantic extraction module outputting a second semantic feature of the second file; when it is determined that the first ID is consistent with the second ID, calculating a distance between the first semantic feature and the second semantic feature; and giving an alert when the distance exceeds a threshold value.
Need to check novelty before this filing date? Find Prior Art

Description

Ransomware detection method and detection system Technical Field

[0001] The present invention relates to a detection method and a detection system, and in particular to a detection method and a detection system for ransomware. Background Art

[0002] In recent years, the threat of ransomware has been rapidly increasing across all industries. Despite the availability of numerous cybersecurity tools and services, the threat shows no signs of slowing down. Small and medium-sized enterprises (SMEs), due to their flat network structures and simple access control policies, are particularly vulnerable to ransomware attacks.

[0003] Generally, small and medium-sized enterprises lack the resources to implement the complex and expensive cybersecurity solutions used by larger enterprises. Instead, they seek simple, affordable measures to protect their systems. For this reason, SMBs often turn to backup as a last resort. Compared to other more complex and expensive security measures (including advanced firewalls, next-generation antivirus software, intrusion detection systems, and application whitelisting), backup solutions are relatively simple and inexpensive, making them a straightforward and cost-effective means of data protection.

[0004] However, traditional backup solutions cannot determine whether files have been corrupted by malware during file backups. Specifically, traditional backup solutions cannot distinguish between clean and unclean files, resulting in corrupted files being inadvertently backed up, resulting in a mix of clean and corrupted files in backup snapshots. When the number of backup snapshots is capped, traditional backup solutions often simply delete the oldest (but potentially clean) version of the file to receive the newest (but potentially unclean) version. This action may ultimately result in no valid backup snapshots being available when a file needs to be restored.

[0005] Even if a backup solution can retain an unlimited number of backup snapshots, when a file needs to be restored after an attack, the file owner must manually distinguish between clean and dirty files from the numerous backup files. This step alone makes the restoration process a difficult, time-consuming and painful process.

[0006] Therefore, traditional backup solutions will not be able to effectively defend against ransomware attacks if they are not supplemented with effective ransomware detection methods.

[0007] Summary of the Invention

[0008] The main purpose of the present invention is to provide a ransomware detection method and detection system, which can mainly determine whether a file has been attacked by ransomware based on whether at least one semantic feature in the file has been significantly changed.

[0009] Semantic features can be used to distinguish differences in the content of one file from that of other files. In the following description, several examples are provided to illustrate features that can be used as semantic features. These examples are provided for illustrative purposes only and do not limit the present invention in any way.

[0010] To achieve the above objectives, the ransomware detection method of the present invention mainly includes the following steps:

[0011] a) receiving a first file having a first ID;

[0012] b) importing the first file into a semantic extraction module composed of a plurality of semantic extractors, and having the semantic extraction module output a first semantic feature of the first file;

[0013] c) receiving a second file having a second ID;

[0014] d) importing the second file into the semantic extraction module, and having the semantic extraction module output a second semantic feature of the second file;

[0015] e) determining whether the first ID matches the second ID;

[0016] f) when the first ID and the second ID match, determining that the first file and the second file are different versions of the same file, and calculating a distance between the first semantic feature and the second semantic feature; and

[0017] g) issuing an alarm when the distance exceeds a threshold.

[0018] To achieve the above objectives, the ransomware detection system of the present invention includes:

[0019] A file import module is configured to receive a first file with a first ID and a second file with a second ID;

[0020] a semantic extraction module, connected to the file import module, composed of a plurality of semantic extractors, and configured to extract a first semantic feature of the first file and a second semantic feature of the second file;

[0021] a comparison module, connected to the semantic extraction module, configured to determine whether the first ID and the second ID match, and when the first ID and the second ID match, determine that the first file and the second file are different versions of the same file, and calculate a distance between the first semantic feature and the second semantic feature; and

[0022] An alarm module is connected to the comparison module and is configured to generate an alarm when the comparison module determines that the distance exceeds a threshold value.

[0023] The present invention first examines the semantic features of previous and subsequent versions of a file to determine whether the file is clean (uncorrupted) or has been attacked by malware (such as ransomware) and has become unclean (corrupted), thereby detecting whether ransomware has invaded. Compared to related technologies, the present invention enables backup solutions to label the nature (or status) of each backup file as clean or unclean, thereby ensuring that the backup solution always retains at least one clean version of the backup file that can be used to perform the required recovery process, thereby effectively resisting ransomware attacks. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] FIG1 is a schematic diagram of a detection system according to an embodiment of the present invention;

[0025] FIG2 is a flow chart of a detection method according to an embodiment of the present invention;

[0026] FIG3 is a flowchart of extracting semantic features according to an embodiment of the present invention;

[0027] FIG4 is a flowchart of extracting semantic features according to another embodiment of the present invention;

[0028] FIG5 is a schematic diagram of generating semantic features according to an embodiment of the present invention;

[0029] FIG6 is a schematic diagram of comparing semantic features according to an embodiment of the present invention;

[0030] FIG. 7 is a backup flowchart according to an embodiment of the present invention.

[0031] [Explanation of Symbols] 1…Detection system 11…File import module 12…Semantic extraction module 121…Semantic extractor 13…Comparison module 14…Alarm module 2…First file 3…Second file 31…Third file 41…Unique text 42…Mapped value 43…Feature vector 431…Element D…Distance S20-S29…Detection steps S30-S33, S40-S42…Extraction steps S70-S77…Backup step DETAILED DESCRIPTION

[0032] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.

[0033] Commonly used technical solutions for detecting ransomware can be roughly divided into the following types: (1) monitoring abnormal file operations; (2) monitoring abnormal file entropy; (3) observing file metadata; and (4) a combination of the above technical solutions. However, the technical solution of type (1) cannot detect the ransomware's attack method of slowly eroding files. Although the technical solution of type (2) is based on file content, it is easy to send false alarms because the file types of some files have high entropy. The technical solution of type (3) cannot detect the ransomware's attack traces when the ransomware does not modify or destroy the file metadata.

[0034] This invention provides a novel method and system for detecting ransomware, including types that are difficult or impossible to detect with traditional solutions. The technical solution of the present invention can effectively determine whether a file is clean or has been corrupted by ransomware (i.e., dirty). This significantly improves the ability of corresponding backup solutions or backup systems to preserve clean versions of each backup file, thereby reducing the likelihood of having to pay a ransom after a ransomware attack.

[0035] Statistics show that nearly all types of ransomware cause significant semantic changes to the content of victim files, thereby extorting ransom from victims in exchange for file recovery. As a countermeasure, the method and system described in this invention compare semantic changes between previous and subsequent file versions. This technology effectively identifies the presence of ransomware, regardless of its potential for evolution.

[0036] First, please refer to Figure 1, which is a schematic diagram of a detection system according to one embodiment of the present invention. As shown in Figure 1, the detection system 1 of the present invention primarily includes a file import module 11, a semantic extraction module 12, a comparison module 13, and an alarm module 14. Semantic extraction module 12 is connected to file import module 11, comparison module 13 is connected to semantic extraction module 12, and alarm module 14 is connected to comparison module 13.

[0037] In one embodiment, the detection system 1 is implemented as software or firmware and runs on independent hardware. For example, any computing device or server with a processor in a computer environment can run the detection system 1 of the present invention. Thus, the computing device can detect whether the files it provides or runs have been attacked by ransomware, while the server can detect whether the files it backs up have been attacked by ransomware. In this embodiment, the file import module 11, semantic extraction module 12, comparison module 13, and alarm module 14 are all software modules implemented as software code.

[0038] In one embodiment, the detection system 1 receives a first file 2 having an identifiable first ID via the file import module 11. After receiving the first file 2, the detection system 1 analyzes the first file 2 via the semantic extraction module 12 to extract a first semantic feature of the first file 2.

[0039] In one embodiment, the semantic extraction module 12 comprises multiple semantic extractors 121. After receiving the first file 2 from the file import module 11, the semantic extraction module 12 inputs the first file 2 into the multiple semantic extractors 121 for analysis. Each of the multiple semantic extractors 121 outputs a result of the analysis. Finally, the semantic extraction module 12 combines the results from the multiple semantic extractors 121 to obtain a first semantic feature for the first file 2.

[0040] In the present invention, each semantic extractor 121 can be implemented based on various forms of extractors. These semantic extractors 121 can analyze files of various types (but not limited to) such as text, pictures, sounds or videos, and extract at least one semantic feature from the file content (described in detail later).

[0041] In one embodiment, the detection system 1 further receives a second file 3 with a recognizable second ID through the file import module 11 , and analyzes the second file 3 through the semantic extraction module 12 to extract a second semantic feature of the second file 3 .

[0042] If the second file 3 and the first file 2 are previous and subsequent versions of the same file, the detection system 1 of the present invention can determine whether the subsequent version (e.g., the second file 3) has been damaged by ransomware by comparing the differences in semantic features between the second file 3 and the first file 2. Before performing the comparison, the detection system 1 first determines whether the second file 3 and the first file 2 are previous and subsequent versions of the same file.

[0043] In one embodiment, comparison module 13 first determines whether the first ID of first file 2 matches the second ID of second file 3. If the first ID matches the second ID, first file 2 and second file 3 are considered to be successive versions of the same file. It is worth noting that ransomware may or may not modify file names. Therefore, in the present invention, the term "match" can include being identical, similar, meeting specific criteria, or being different but with the difference being less than a threshold.

[0044] The first ID may be the file name or metadata of the first file 2, and the second ID may be the file name or metadata of the second file 3. In one embodiment, the comparison module 13 determines that the first ID and the second ID match when the file names of the first file 2 and the second file 3 are the same. In another embodiment, the comparison module 13 determines that the first ID and the second ID match when the Hamming distance between the file names of the first file 2 and the second file 3 is similar. In yet another embodiment, the comparison module 13 determines that the first ID and the second ID match when the metadata of the first file 2 and the second file 3 are similar.

[0045] In the above embodiments, the file name may be a full-path file name that points to the complete and specific location of a file in the file system. In Windows operating systems, the full-path file name includes the drive letter (e.g., "C:"), the directory (folder) name, and the file name itself. In Unix and similar operating systems, the full-path file name includes the root character (e.g., " / "), the directory (folder) name, and the file name itself.

[0046] However, the above are only some specific implementation examples of the present invention. When the detection system 1 determines whether the first file 2 and the second file 3 are different versions of the same file, the above technical means are not limited.

[0047] After determining that the first and second IDs match, comparison module 13 further calculates the distance between the first semantic feature of first file 2 and the second semantic feature of second file 3. A distance of zero or a small value indicates that the content of first file 2 and second file 3 are identical or have only been modified moderately, indicating normal editing by the user. At this point, detection system 1 can determine that the subsequent version (i.e., second file 3) has not been compromised by ransomware.

[0048] If the distance exceeds the threshold, it indicates a substantial and abnormal change between the contents of first file 2 and second file 3. At this point, detection system 1 determines that the subsequent version (i.e., second file 3) has been attacked by ransomware. In the present invention, detection system 1 uses alarm module 14 to issue an alarm for the subsequent version of the file when comparison module 13 determines that the distance exceeds a preset threshold.

[0049] In the present invention, every version of every file undergoes the aforementioned analysis by detection system 1. If a subsequent version of a file does not trigger an alert from alarm module 14, detection system 1 (or a backup server) will mark that version as clean. Conversely, if a subsequent version of a file does trigger an alert from alarm module 14, detection system 1 (or a backup server) will mark that version as unclean.

[0050] Please also refer to Figure 2, which is a flow chart of a detection method according to an embodiment of the present invention. Figure 2 discloses the detection method according to the present invention, which is mainly applied to the detection system 1 shown in Figure 1.

[0051] As shown in FIG2 , the detection method of the present invention is that the detection system 1 first receives a first file 2 having a first ID (step S20), and imports the first file 2 into the semantic extraction module 12 (step S21), so as to output a first semantic feature of the first file 2 based on the results of multiple semantic extractors 121 in the semantic extraction module 12 (step S22).

[0052] Furthermore, the detection method of the present invention receives a second file 3 having a second ID by the detection system 1 (step S23), and imports the second file 3 into the semantic extraction module 12 (step S24) to output a second semantic feature of the second file 3 based on the results of multiple semantic extractors 121 within the semantic extraction module 12 (step S25).

[0053] Next, the detection system 1 determines whether the first ID of the first file 2 matches the second ID of the second file 3 (step S26). If the first ID and the second ID do not match, it means that the first file 2 and the second file 3 are not previous and next versions of the same file. Therefore, the detection system 1 does not compare the semantic features of the first file 2 and the second file 3.

[0054] If the first ID and the second ID match, detection system 1 determines that first file 2 and second file 3 are previous and subsequent versions of the same file, with first file 2 being the previous version and second file 3 being the subsequent version. At this point, detection system 1 further calculates the distance between the first semantic feature of first file 2 and the second semantic feature of second file 3 (step S27). Furthermore, detection system 1 determines whether the distance calculated in step S27 exceeds a threshold (step S28), and if so, issues an alert for second file 3 (step S29).

[0055] In one embodiment, the alarm is issued to mark the second file 3 as an unclean file that has been attacked.

[0056] In the present invention, the detection system 1 can execute a distance function via the comparison module 13 to calculate the distance between the first semantic feature and the second semantic feature. In one embodiment, the semantic feature is represented in the form of a vector, and the detection system 1 can calculate the L1-norm, L2-norm, or other approximate metric and output the calculated result as the distance between the first semantic feature and the second semantic feature, but the present invention is not limited to this.

[0057] In the present invention, based on the different types or contents of the files processed by the detection system 1 (such as the first file 2 and the second file 3), the detection system 1 can use different semantic extractors 121 to form a semantic extraction module 12, thereby extracting comparable semantic features from the files.

[0058] In one embodiment, the multiple semantic extractors 121 include multiple deep neural networks (DNNs). The semantic extraction module 12 uses the multiple DNNs to extract vector-based semantic features from the contents of the first file 2 and the second file 3, and outputs the extracted features as the first semantic feature of the first file 2 and the second semantic feature of the second file 3. The semantic extractor 121 using the DNN can effectively extract semantic features when the first file 2 and the second file 3 are picture files, video files, or sound files.

[0059] In one embodiment, the semantic extractor 121 can be any type of deep neural network, such as convolutional neural networks (CNNs), recurrent neural networks (RNNs), or feedforward neural networks (FNNs). Furthermore, the multiple semantic extractors 121 within the semantic extraction module 12 can be a combination of these types of networks.

[0060] It is worth mentioning that the purpose of generating semantic features in the present invention is to determine whether the content of the previous and subsequent versions of the same file has changed significantly. In other words, as long as it can be evaluated and compared that there are significant differences in the contents of the two files, the semantic features generated by the detection system 1 do not necessarily need to be interpretable by humans.

[0061] Taking a deep neural network with 50 hidden layers as an example, the semantic features of a file that can be interpreted by humans may not be obtained until the file has been processed through all 50 layers of the deep neural network. In this deep neural network, even if the output generated after the first 20 layers may be difficult for humans to understand, the detection system 1 can still use this output to evaluate and compare whether the content of the previous and next versions of the same file has changed significantly. In some embodiments, by reducing the number of layers of the deep neural network used in the semantic feature acquisition process, the overall processing speed can be improved.

[0062] In one embodiment, the plurality of semantic extractors 121 include one or more different types of language analytical tools. In this embodiment, the semantic extraction module 12 uses the plurality of language analytical tools to convert the contents of the first document 2 and the second document 3 into text summaries, and uses the text summaries as the first semantic feature of the first document 2 and the second semantic feature of the second document 3.

[0063] In one embodiment, the language analysis tool may be, for example, ChatGPT developed by Open AI, Bard developed by Google, Stanford CoreNLP, Amazon Comprehend, Natural Language Toolkit (NLTK), or other natural language suites, without limitation.

[0064] For example, detection system 1 may feed first file 2 and second file 3, along with a query (e.g., "Please describe the content of this file using ten adjectives"), into multiple language analysis tools used by semantic extraction module 12. The query is then used by the multiple language analysis tools to analyze the file contents and generate text summaries based on the query. Detection system 1 then uses the text summaries as the first and second semantic features and determines whether second file 3 is a dirty file based on the semantic distance between the first and second semantic features.

[0065] It's worth noting that different language analysis tools may generate the same or similar semantic features for the same file, but the semantic features generated by different language analysis tools may contain multiple synonyms. In this embodiment, the detection system 1 determines the distance between the first and second semantic features based on the number of missing synonyms between the first and second semantic features.

[0066] For example, if the first semantic feature includes the three words "sad", "serene" and "hopeless", and the second semantic feature includes the three words "glad", "quiet" and "touching", then because synonyms of "sad" and "desperate" cannot be found in the second semantic feature, the detection system 1 can determine that the distance between the first semantic feature and the second semantic feature is 2 (where quiet may be considered a synonym for serene).

[0067] It is worth mentioning that, in one embodiment, the semantic extraction module 12 can mix the aforementioned deep neural network and language analysis tools to implement multiple semantic extractors 121 therein, rather than being limited to using a single type of semantic extractor 121 .

[0068] In one embodiment, the plurality of semantic extractors 121 includes a plurality of different types of file parsers. In this embodiment, the semantic extraction module 12 uses the plurality of file parsers to parse the first file 2 and the second file 3. If the first file 2 can be successfully parsed by at least one of the plurality of file parsers, but the second file 3 cannot, the detection system 1 may determine that the second file 3 has been infected by ransomware and has become unclean.

[0069] Please also refer to Figure 3, which is a flowchart of semantic feature extraction according to an embodiment of the present invention. Figure 3 is used to illustrate how the semantic extraction module 12 of the present invention generates semantic features of a file through multiple different types of file parsers.

[0070] It is important to note that relying solely on the file extension to determine a file's file type is unreliable. In contrast, the present invention uses file parsers to determine file types based on semantic features, which can improve the reliability of the obtained semantic features. Because each file parser analyzes file content based on a known file structure, the semantic features obtained in this way are very useful for detecting ransomware that damages both the file content and the file structure.

[0071] As shown in Figure 3, after the semantic extraction module 12 imports the file (including the first file 2 and / or the second file 3) into multiple file parsers, multiple parsing results can be obtained from the multiple file parsers (step S30). Then, the semantic extraction module 12 determines whether any file parser can correctly parse this file (step S31). If at least one file parser can correctly parse this file, the semantic extraction module 12 outputs a first signal as the semantic feature of this file (step S32). If all file parsers cannot correctly parse this file, the semantic extraction module 12 outputs a second signal as the semantic feature of this file (step S33).

[0072] In one embodiment, the first signal is different from the second signal.

[0073] In one embodiment, the first signal is 1 and the second signal is 0. In another embodiment, the first signal is 0 and the second signal is 1.

[0074] The embodiment of FIG3 is also applicable to the embodiment of FIG2 . For example, when at least one file parser can correctly parse the first file 2, the semantic extraction module 12 outputs a first signal as the first semantic feature of the first file 2; when no file parser can correctly parse the first file 2, the semantic extraction module 12 outputs a second signal as the first semantic feature of the first file 2. When at least one file parser can correctly parse the second file 3, the semantic extraction module 12 outputs the first signal as the second semantic feature of the second file 3; when no file parser can correctly parse the second file 3, the semantic extraction module 12 outputs the second signal as the second semantic feature of the second file 3.

[0075] In the embodiment of FIG. 3 , the semantic features are directly related to whether the document can be correctly parsed by one or more document parsers.

[0076] Specifically, when a previous version of a file (for example, the first file 2) can be parsed by one or more file parsers, but a subsequent version of the same file (for example, the second file 3) cannot be correctly parsed by any file parser, the detection system 1 can determine that the subsequent version of the file has been attacked by ransomware when a significant change is detected (for example, the file structure has been destroyed), and then mark the subsequent version as an unclean version (i.e., a damaged version).

[0077] In this embodiment, since the semantic extraction module 12 only generates a signal that is either 0 or 1 (ie, the first signal or the second signal), the above technical means can be adopted with only low-cost storage requirements.

[0078] Furthermore, the above embodiment can also avoid false alarms when the diversity of file parsers is insufficient to cover all possible file types. For example, if a file's file type is not covered by the file parser employed by the present invention, then both previous and subsequent versions of the file (e.g., first file 2 and second file 3) will not be correctly parsed by either file parser. Therefore, detection system 1 will not deem a file unclean simply due to a deficient file parser.

[0079] In one embodiment, each file parser generates a second signal when it cannot correctly parse a file, and the semantic feature generated by the semantic extraction module 12 is a set of multiple output signals, such as {0, 0, 0, ..., 0}. When a file parser can correctly parse a file, a first signal is generated, and the semantic feature output by the semantic extraction module 12 may be, for example, {0, 0, 1, ..., 0}. By comparing the set of output signals as semantic features, the detection system 1 can determine whether two versions of a file have undergone significant changes.

[0080] In another embodiment, the plurality of semantic extractors 121 include a plurality of file parsers for parsing and extracting text from the content of an input file. For example, each file parser may parse text from a specific type of file, such as Word, Excel, or PowerPoint, but is not limited thereto.

[0081] In this embodiment, semantic extraction module 12 uses multiple file parsers to extract text from the contents of first file 2 and second file 3, respectively, and generates first and second semantic features based on the text in the content. Thus, detection system 1 can determine whether second file 3 has been attacked by ransomware based on the first and second semantic features.

[0082] Please also refer to Figure 4, which is a flowchart of semantic feature extraction according to another embodiment of the present invention. Figure 4 illustrates how the semantic extraction module 12 of the present invention generates semantic features by using multiple file parsers for obtaining text from an input file.

[0083] As shown in FIG4 , after the semantic extraction module 12 imports the files (including the first file 2 and / or the second file 3 ) into multiple file parsers, multiple unique words in the files can be obtained from the multiple file parsers (step S40 ). Next, the semantic extraction module 12 converts the multiple unique words output by each file parser into corresponding mapped values ​​(step S41 ), and then generates a vector used as a semantic feature based on the multiple mapped values ​​(step S42 ). The vector has multiple entries, and each element corresponds to the occurrence count of a mapped value.

[0084] Please refer to FIG. 4 , FIG. 5 and FIG. 6 simultaneously, wherein FIG. 5 is a schematic diagram of generating semantic features according to an embodiment of the present invention, and FIG. 6 is a schematic diagram of comparing semantic features according to an embodiment of the present invention.

[0085] In the embodiment of FIG. 5 , the first file 2 is taken as an example to illustrate how the semantic extraction module 12 generates the first semantic feature.

[0086] As shown in Figure 5 , after the detection system 1 imports the first file 2 into the semantic extraction module 12, multiple file parsers can parse the content of the first file 2 and obtain multiple unique characters 41 in the first file 2. It is worth noting that as long as at least one file parser can parse a file, the characters in the file can be obtained, and the detection system 1 can thus obtain the unique characters 41 from the obtained characters.

[0087] In one embodiment, the unique text 41 refers to a text that appears at least once in the first file 2, and only one of these texts will be retained in the unique text 41. In another embodiment, the unique text 41 excludes stop words, such as "and", "or", and "not". Stop words are common words that are often filtered or ignored when processing natural language text in various text analysis tasks (such as search engines, information retrieval, and text mining). Because these words are generally considered to have no value in conveying meaningful information, the unique text 41 of the present invention can exclude these stop words.

[0088] It is worth noting that the user can pre-set parameter settings for multiple document parsers. When parsing the content of the first document 2, the multiple document parsers can parse the entire text of the first document 2 or only parse a portion of the content of the first document 2 (e.g., the title, the first paragraph, or half of the text), based on the parameter settings. In the embodiment of FIG5 , the first line of text in the first document 2 is pre-parsed, but the parsing of the document parsers is not limited to the example shown in FIG5 .

[0089] In one embodiment, the semantic extraction module 12 converts each unique character 41 into a corresponding mapping value 42 based on a hash function, a keyed hash function, a look-up table (LUT), a linear feedback shift register (LFSR), or the modulo sum of ASCII codes of each character of the unique character 41.

[0090] In the embodiment of FIG5 , after parsing the first file 2 , multiple document parsers obtain six unique characters 41, namely, "Bob," "just," "has," "a," "credit," and "card." Semantic extraction module 12 then converts these six unique characters 41 into corresponding mapping values ​​42, including "1," "0," "3," "1," "1," and "3."

[0091] In one embodiment, the semantic extraction module 12 may reduce the converted mapping value 42 so that the mapping value 42 is no larger than the length of the vector used as the semantic feature.

[0092] Taking a hash function as an example, the semantic extraction module 12 may use, for example, SHA-0, SHA-1, or SHA-256 in the Secure Hash Algorithm (SHA) technology, CRC-32, CRC-16, or CRC-CCITT in the Cyclic Redundancy Check (CRC) technology, or Message Digest technology (e.g., MD5) to convert the unique text 41 into a corresponding mapping value 42.

[0093] Specifically, in the embodiment of FIG5 , the unique text 41 is converted into a simple mapping value 42 (e.g., 1, 0, 3, 1, 1, and 3 in FIG5 ). However, the present invention is not limited to the simple mapping value 42 shown in FIG5 . For example, if the unique text 41 "HELLO" is converted using SHA technology (e.g., SHA-256), the resulting mapping value 42 expressed in hexadecimal is "3733cd977ff8eb18b987357e22ced99f46097f31ecb239e878ae63760e83e4d5".

[0094] The above is only one embodiment of the present invention and is not limited thereto. In one embodiment, the semantic extraction module 12 reduces the mapping value 42 obtained by the conversion, so that the mapping value 42 may not be larger than the length of the vector serving as the semantic feature. For example, a set of example hexadecimal mapping values ​​42 is "3733cd977ff8eb18b987357e22ced99f46097f31ecb239e878ae63760e83e4d5". If the entire set of mapping values ​​42 is regarded as one value, it will be very large. Therefore, the semantic extraction module 12 can only select the last eight bits (i.e., "d5") of this hexadecimal mapping value 42, thereby reducing the size of the mapping value 42 so that it is no larger than a vector of length 256 (256-tuple vector).

[0095] Taking cryptographic hash functions as an example, the semantic extraction module 12 may employ techniques such as HMAC-SHA-0, HMAC-SHA-1, HMAC-SHA-256, or HMAC-MD5 to convert the unique character 41 into a corresponding mapping value 42. Because HMAC can map the same unique character 41 to different hash values ​​based on different keys, the semantic features extracted from the unique character 41 can provide a higher level of privacy protection if an adversary cannot obtain the key.

[0096] In one embodiment, each unique character 41 can be converted into a corresponding mapping value 42 using the ASCII code of the character of each unique character 41. For example, the unique character 41 "HELLO" will be parsed into "72", "69", "76", "76" and "79", and the semantic extraction module 12 can accumulate these output values ​​to obtain the mapping value 42 as "372". In one embodiment, the semantic extraction module 12 performs a modulo operation of 256 on the mapping value 42 "372" to obtain "116", and ensures that the result of this operation is still within the range of the vector of 256 tuples. The modulo sum obtained in this way can be used as the mapping value 42.

[0097] As shown in FIG5 , after obtaining the mapping value 42 of each unique character 41 , the semantic extraction module 12 further generates a vector 43 . The vector 43 includes multiple elements 431 , and the content value of each element 431 corresponds to the number of occurrences of a mapping value 42 .

[0098] In the embodiment of FIG5 , the mapping value 42 includes one "0," three "1s," zero "2s," and two "3s." The multiple elements 431 of the vector 43 generated by the semantic extraction module 12 include a first element (representing 0) having a value of 1, a second element (representing 1) having a value of 3, a third element (representing 2) having a value of 0 (white boxes in the figure indicate empty elements), and a fourth element (representing 3) having a value of 2. By using this vector 43 as the first semantic feature of the first file 2, the detection system 1 can compare the content of the first file 2 with the subsequently received second file 3 and determine whether the content of the second file 3 has changed significantly.

[0099] In the example of FIG6 , the content of the second file 3 has been edited to have different semantics, but it is still a subsequent version of the first file 2, and only a unique character 41, "defaulted," has been added to the content of the second file 3. After the semantic extraction module 12 converts the unique character 41 of the second file 3 into a mapping value 42 and generates a vector 43, the comparison module 13 calculates that the distance D between the vector 43 (1, 3, 0, 2) corresponding to the first file 2 and the vector 43 (1, 3, 1, 2) corresponding to the second file 3 is only 1. In this case, the detection system 1 can determine that this difference is a normal trace of user editing of the second file 3 and therefore mark the second file 3 as a clean file.

[0100] In one embodiment, the third file 31 is a subsequent version of the second file 3 and is assumed to be a dirty file that has been damaged by ransomware. In this embodiment, the file structure of the third file 31 has not been intentionally damaged by the ransomware, but its content text has been distorted, thereby demanding a ransom. As shown in the embodiment of Figure 6, the content of the third file 31 is very different from the content of the second file 3. After the semantic extraction module 12 converts the unique text 41 of the third file 31 into a mapping value 42 and generates a vector 43, the comparison module 13 can calculate that the distance D between the vector 43 (1, 3, 1, 2) corresponding to the second file 3 and the vector 43 (0, 2, 3, 2) corresponding to the third file 31 is as high as 4 (relatively high in this embodiment). In this case, the detection system 1 can determine that the third file 31 has undergone significant changes compared to the second file 3, and therefore marks the third file 31 as a dirty file.

[0101] For clarity, the embodiments of Figures 5 and 6 use a 4-tuple vector 43 as an example. However, to improve accuracy, detection system 1 can utilize vectors 43 with larger tuples, not just 4-tuples. By increasing the length of vector 43, semantic extraction module 12 can take advantage of more mapped values ​​42 when performing the conversion process, thereby improving the accuracy of subsequent comparison operations.

[0102] It is worth noting that if the ransomware does not modify the file's content but simply encrypts the entire file, multiple file parsers may be unable to parse the file and thus be unable to extract any unique text 41 from the file. In this case, all mapping values ​​42 generated by the semantic extraction module 12 are "0," and all elements 431 of the generated vector 43 are 0. Through the above-mentioned technical means of the present invention, because all elements 431 of the subsequent version of the vector 43 are 0, it is significantly different from the content of the previous version of the vector 43. Therefore, based on the distance between the vectors, the detection system 1 can determine that the subsequent version is an unclean file that has been attacked by ransomware.

[0103] The embodiment of FIG. 4 described above is also applicable to the embodiment of FIG. 2 . For example, after a first file 2 is imported into a semantic extraction module 12 having multiple file parsers, the semantic extraction module 12 can obtain multiple unique characters 41 in the first file 2 from the results of parsing by the multiple file parsers. After converting the multiple unique characters 41 into corresponding mapping values ​​42, the semantic extraction module 12 can generate a first vector as a first semantic feature based on the multiple mapping values ​​42, wherein the first vector has multiple elements, and each element corresponds to the number of occurrences of a mapping value 42. Furthermore, after a second file 3 is imported into a semantic extraction module 12 having multiple file parsers, the semantic extraction module 12 can obtain multiple unique characters 41 in the second file 3 from the results of parsing by the multiple file parsers. After converting the multiple unique characters 41 into corresponding mapping values ​​42, the semantic extraction module 12 can generate a second vector as a second semantic feature based on the multiple mapping values ​​42, wherein the second vector has multiple elements, and each element corresponds to the number of occurrences of a mapping value 42.

[0104] Through the above technical means, if the ransomware can attack the content of the file without destroying the file format, the detection system 1 of the present invention can still detect the ransomware attack event.

[0105] The detection system of the present invention can be run in an independent computer device, and can also be run in an existing backup server. The detection system and detection method of the present invention can assist users in detecting each version of a file and marking it as clean or unclean. In this way, even if the backup server backs up an unclean version of the file, when performing system restoration, the backup server can prevent the user from using the unclean version of the file for restoration instead of the clean version of the file based on the mark. In this way, effective system restoration can be achieved. It is worth mentioning that the detection method of the present invention can be applied to an independent computer device. The files in the computer device can be protected without the assistance of any backup server.

[0106] In one embodiment, when a computing device generates a subsequent version of a file, it can immediately check whether the subsequent version is a clean version generated by normal editing or an unclean version generated after an attack through the detection system 1. Based on this, the computing device can decide whether to back up the subsequent version.

[0107] Continuing with Figure 7, a backup flowchart of one embodiment of the present invention is shown. As shown in Figure 7, the computing device receives a file when it is opened (step S70), then generates a first copy of the file and locks the first copy (step S71). Once the first copy is locked, it cannot be edited. In this embodiment, the first copy corresponds to the first file 2 described in the previous embodiment.

[0108] Then, when the same file is opened and modified again, the computing device receives the subsequent version of the file (step S72) and generates a second copy of the subsequent version of the file (step S73). In this embodiment, the second copy corresponds to the second file 3 of the aforementioned implementation side.

[0109] In this embodiment, the computing device uses detection system 1 to check the first and second copies and determine whether the second copy has passed the test (step S74). If the second copy fails the test (i.e., the second copy is alerted by the alarm module 14 of detection system 1), the subsequent version of the file will be detected as an unclean version, which may have been generated after an attack. At this point, the computing device issues an instruction for the user to restore the file based on the first copy (step S75).

[0110] If the second copy passes the test (i.e., the second copy does not generate an alarm by the alarm module 14 of the detection system 1), it means that the subsequent version of the file is still a clean version. In this case, since the second copy is newer and the first copy is older, the computing device deletes the first copy (step S76) and locks the second copy (step S77).

[0111] If the file is opened and modified again, the computing device can further generate a third copy of the subsequent version of the file and perform the above-mentioned detection again. Through the detection system and detection method of the present invention, the computing device can ensure that each file has at least one clean version that can be used for restoration when needed.

[0112] The above description is only a preferred embodiment of the present invention, and does not limit the claims of the present invention. Therefore, all equivalent changes made by applying the content of the present invention are similarly included in the scope of the present invention and are hereby stated.

Claims

1. A method for detecting ransomware, comprising: Step a) receiving a first file having a first ID; Step b) importing the first file into a semantic extraction module composed of a plurality of semantic extractors, and the semantic extraction module outputs a first semantic feature of the first file; Step c) receiving a second file having a second ID; Step d) importing the second file into the semantic extraction module, and the semantic extraction module outputs the second semantic feature of the second file; Step e) determining whether the first ID matches the second ID; Step f) when the first ID matches the second ID, determining that the first file and the second file are different versions of the same file, and calculating the distance between the first semantic feature and the second semantic feature; and Step g) issues an alarm when the distance exceeds a threshold value.

2. The method for detecting ransomware according to claim 1, wherein the first ID and the second ID are file names or metadata of the first file and the second file, and the step e) comprises one or more of the following combinations: determining that the first ID and the second ID match when the file names of the first file and the second file are the same, determining that the first ID and the second ID match when the Hamming distances of the file names of the first file and the second file are similar, determining that the first ID and the second ID match when the metadata of the first file and the second file are similar, and determining that the first ID and the second ID match when the first file and the second file are placed in the same directory and have similar file names.

3. The method for detecting ransomware according to claim 1, wherein the step f) comprises calculating the distance between the first semantic feature and the second semantic feature by using a distance function.

4. The method for detecting ransomware according to claim 1, wherein the multiple semantic extractors include multiple different deep neural networks, and the step b) and the step d) acquire features from the first file and the second file through the multiple deep neural networks and output multiple features in vector form, respectively, to serve as the first semantic feature and the second semantic feature, respectively.

5. The method for detecting ransomware according to claim 1, wherein the plurality of semantic extractors include a plurality of different language analysis tools, and the steps b) and d) convert the contents of the first file and the second file into text summaries as the first semantic feature and the second semantic feature through the plurality of language analysis tools.

6. The method for detecting ransomware according to claim 1, wherein the plurality of semantic extractors include a plurality of file parsers of different types, and the step b) comprises: Step b1) importing the first file into the plurality of file parsers; Step b2) when at least one of the plurality of file parsers is able to parse the first file, outputting a first signal as the first semantic feature; and Step b3) when the plurality of file parsers are unable to parse the first file, outputting a second signal as the first semantic feature, wherein the second signal is different from the first signal; Wherein said step d) comprises: Step d1) importing the second file into the plurality of file parsers; Step d2) when at least one of the plurality of file parsers is capable of parsing the second file, outputting the first signal as the second semantic feature; and Step d3) outputs the second signal as the second semantic feature when none of the multiple file parsers can parse the second file.

7. The method for detecting ransomware according to claim 1, wherein the plurality of semantic extractors include a plurality of different types of file parsers for extracting text in a file, and the step b) comprises: Step b1) importing the first file into the plurality of file parsers; Step b2) obtaining a plurality of unique characters in the first file from the parsing results of the plurality of file parsers; Step b3) converting each of the unique characters into a corresponding mapping value; and Step b4) generating a first vector as the first semantic feature based on the plurality of mapping values, wherein the first vector has a plurality of elements, each of the elements corresponding to the number of occurrences of one of the mapping values; Wherein said step d) comprises: Step d1) importing the second file into the plurality of file parsers; Step d2) obtaining a plurality of unique characters in the second file from the parsing results of the plurality of file parsers; Step d3) converting each of the unique characters into a corresponding mapping value; and Step d4) generates a second vector as the second semantic feature based on the plurality of mapped values, wherein the second vector has a plurality of elements, each of which corresponds to the number of occurrences of one of the mapped values.

8. The method for detecting ransomware according to claim 7, wherein the steps b3) and d3) are based on one or a combination of a hash function, a cryptographic hash function, a lookup table, a linear feedback shift register, and a modulo sum of ASCII codes of each character of each unique word to convert each unique word into a corresponding mapping value.

9. The method for detecting ransomware according to claim 1, further comprising: Step 1) receiving the file by a computing device when the file is opened, and generating a first copy of the file; Step m) locking the first copy; Step n) receiving, by the computing device, a subsequent version of the file when the file is opened again, and generating a second copy of the subsequent version of the file; Step o) If the second copy is warned in step g), the computing device issues an instruction to restore according to the first copy; and Step p) If the second copy is not alerted in step g), the computing device removes the first copy and locks the second copy.

10. A ransomware detection system, comprising: A file import module configured to receive a first file with a first ID and a second file with a second ID; A semantic extraction module, connected to the file import module, composed of a plurality of semantic extractors, and configured to extract a first semantic feature of the first file and a second semantic feature of the second file; a comparison module, connected to the semantic extraction module, configured to determine whether the first ID matches the second ID, and when the first ID matches the second ID, determine that the first file and the second file are different versions of the same file, and calculate the distance between the first semantic feature and the second semantic feature; and The alarm module is connected to the comparison module and is configured to issue an alarm when the comparison module determines that the distance exceeds a threshold value.

11. The ransomware detection system according to claim 10, wherein the first ID and the second ID are file names or metadata of the first file and the second file, and the comparison module is configured to determine that the first ID and the second ID match when any one of the following conditions or a combination of multiple conditions occurs: when the file names of the first file and the second file are the same, when the Hamming distances of the file names of the first file and the second file are close, when the metadata of the first file and the second file are close, and when the first file and the second file are placed in the same directory and the file names of the first file and the second file are close. 12 . The ransomware detection system according to claim 10 , wherein the comparison module is configured to calculate the distance between the first semantic feature and the second semantic feature by using a distance function.

13. The ransomware detection system according to claim 10, wherein the multiple semantic extractors include multiple deep neural networks, and the semantic extraction module is configured to obtain features from the first file and the second file through the multiple deep neural networks and output multiple features in vector form respectively as the first semantic feature and the second semantic feature.

14. The ransomware detection system according to claim 10, wherein the plurality of semantic extractors include a plurality of different language analysis tools, and the semantic extraction module is configured to convert the contents of the first file and the second file into text summaries as the first semantic feature and the second semantic feature through the plurality of language analysis tools.

15. The ransomware detection system according to claim 10, wherein the plurality of semantic extractors include a plurality of file parsers of different types, and the semantic extraction module is configured to perform the following actions to extract the first semantic feature and the second semantic feature: outputting a first signal as the first semantic feature when at least one of the plurality of file parsers is able to parse the first file, and outputting a second signal as the first semantic feature when none of the plurality of file parsers is able to parse the first file, wherein the second signal is different from the first signal; and The first signal is output as the second semantic feature when at least one of the plurality of file parsers can parse the second file, and the second signal is output as the second semantic feature when none of the plurality of file parsers can parse the second file.

16. The ransomware detection system according to claim 10, wherein the plurality of semantic extractors include a plurality of file parsers for extracting text in a file, and the semantic extraction module is configured to perform the following actions to extract the first semantic feature and the second semantic feature: Obtaining a plurality of unique characters in the first file from the parsing results of the plurality of file parsers; Convert each of the unique characters into a corresponding mapping value; generating a first vector as the first semantic feature based on the plurality of mapping values, wherein the first vector has a plurality of elements, each of the elements corresponding to the number of occurrences of one of the mapping values; Obtaining a plurality of unique characters in the second file from the parsing results of the plurality of file parsers; Convert each of the unique characters into a corresponding mapping value; and A second vector as the second semantic feature is generated based on the plurality of mapped values, wherein the second vector has a plurality of elements, each of which corresponds to the number of occurrences of one of the mapped values.

17. The ransomware detection system of claim 16, wherein the semantic extraction module is configured to convert each of the unique words into a corresponding mapping value based on one or a combination of a hash function, a cryptographic hash function, a lookup table, a linear feedback shift register, and a modulus sum of the American Standard Code for Information Interchange of each character of each of the unique words.

18. The ransomware detection system according to claim 10, further comprising a computing device connected to the detection system and configured to perform the following actions: receiving the file and generating a first copy of the file when the file is opened, and locking the first copy; receiving a subsequent version of the file when the file is opened again, and generating a second copy of the subsequent version of the file; When the second copy is alarmed by the alarm module, issuing an instruction to restore according to the first copy; and When the second copy is not alarmed by the alarm module, the first copy is removed and the second copy is locked.

Citation Information

Patent Citations

  • Software homology detection method and device based on abstract syntax tree and semantic matching

    CN101894236A

  • Code risk detection method and device

    CN103870382A

  • Ransomware detection method based on file status analysis

    CN107403096A

  • Method and Device for Detecting Encryption, in particular for Anti-Ransomware Software

    US20200342104A1