Identifying .NET Malware with "UNMANAGED IMPHASH"

By analyzing the.NET header of files to extract unmanaged API function names and hashes, the system effectively addresses the limitations of existing PE-based detection methods, enhancing malware detection accuracy and preventing network threats.

JP2025502604AActive Publication Date: 2025-01-28PALO ALTO NETWORKS INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024529898
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-12-21
Filing Date
2022-12-05
Publication Date
2025-01-28
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

Existing methods for detecting malicious files, particularly those using machine learning models trained on Microsoft Windows PE installer files, face challenges with high false positives and low detection rates due to the similarity in PE file structures between benign and malicious files, making it difficult to distinguish between them accurately.

Method used

A system and method for detecting malicious files by analyzing the.NET header of files, extracting unmanaged API function names, and determining their hashes (IMPHASH) to identify potential malware, utilizing a sandbox environment and integrating with third-party services for updated threat intelligence.

Benefits of technology

Enhances the accuracy of malware detection by leveraging the unique information present in the.NET header, reducing false positives and improving the detection rate of malicious files, while also preventing network diffusion of such threats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025502604000001_ABST
    Figure 2025502604000001_ABST
Patent Text Reader

Abstract

The present application provides a method, system, and computer system for detecting malicious files, the method including receiving a sample including a .NET file, obtaining imported API function names based at least in part on a .NET header of the .NET file, determining a hash of a list of unmanaged imported API function names, and determining whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names.
Need to check novelty before this filing date? Find Prior Art

Description

[Background technology]

[0001] Malicious individuals attempt to compromise computer systems in a variety of ways. As one example, such individuals may embed or otherwise include malicious software ("malware") in email attachments and send or have the malware sent to unsuspecting users. When executed, the malware compromises the victim's computer. Some types of malware instruct the compromised computer to communicate with a remote host. For example, malware can turn a compromised computer into a "bot" in a "botnet," receiving instructions from and / or reporting data to a command and control (C&C) server under the control of the malicious individual. One approach to mitigating the damage caused by malware is for security companies (or other appropriate entities) to identify and attempt to prevent the malware from reaching / executing on end-user computers. Another approach is to try to prevent the compromised computer from communicating with the C&C server. Unfortunately, malware authors are using increasingly sophisticated techniques to obfuscate how their software works. As one example, some types of malware use Domain Name System (DNS) queries to exfiltrate data. Thus, there is a continuing need for improved techniques to detect malware and prevent its harm. [Brief description of the drawings]

[0002] Various embodiments of the invention are disclosed in the following detailed description and the accompanying drawings. [Figure 1]FIG. 1 is a block diagram of an environment in which malicious files are detected or suspected, according to various embodiments. [Diagram 2] FIG. 2 is a block diagram of a system for detecting malicious files according to various embodiments. [Figure 3A] FIG. 3A is a diagram of the ImplMap table for the .NET header for an example .NET file. [Figure 3B] FIG. 3B is a diagram of a ModuleRef table for an exemplary .NET file. [Figure 3C] FIG. 3C is a diagram of the ImplMap table for the .NET header for an exemplary .NET file. [Figure 3D] FIG. 3D is a diagram of the MethodDef table for an example .NET file. [Figure 3E] FIG. 3E is a diagram of the ModuleRef table for an exemplary .NET file. [Figure 3F] FIG. 3F is a diagram of the Import table for an exemplary .NET file. [Figure 3G] FIG. 3G is a diagram of the MethodDef table for an exemplary .NET file. [Figure 4] FIG. 4 is a flow diagram of a method for detecting malicious files, according to various embodiments. [Diagram 5] FIG. 5 is a flow diagram of a method for determining whether a file is malicious, according to various embodiments. [Figure 6] FIG. 6 is a flow diagram of a method for detecting malicious files, according to various embodiments. [Figure 7A] FIG. 7A is a flow chart of a method for detecting malicious files, according to various embodiments. [Figure 7B] FIG. 7B is a flow chart of a method for detecting malicious files, according to various embodiments. [Figure 8] FIG. 8 is a flow diagram of a method for detecting malicious files, according to various embodiments. [Figure 9] FIG. 9 is a flow chart of a method for detecting malicious files, according to various embodiments. [Figure 10] FIG. 10 is a flow diagram of a method for detecting malicious files, according to various embodiments. [Figure 11] FIG. 11 is a flow diagram of a method for detecting malicious files, according to various embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0003] The present invention can be implemented in numerous ways, including as a process, an apparatus, a system, a composition of matter, a computer program product embodied on a computer-readable storage medium, and / or a processor configured to execute instructions stored on a memory and / or instructions stored and / or provided by a memory coupled to the processor. These implementations, or any other form the present invention may take, may be referred to herein as techniques. In general, the order of steps of a disclosed process may be modified within the scope of the present invention. Unless otherwise specified, components such as a processor or memory described as configured to perform a task may be implemented as general-purpose components temporarily configured to perform the task at a given time, or as specific components manufactured to perform the task. As used herein, the term "processor" refers to one or more devices, circuits, and / or processing cores configured to process data, such as computer program instructions.

[0004] A detailed description of one or more embodiments of the present invention is provided below along with accompanying drawings that illustrate the principles of the invention. While the present invention will be described in connection with such embodiments, the present invention is not limited to any embodiment. The scope of the present invention is limited only by the claims, and the present invention encompasses numerous alternatives, modifications, and equivalents. Numerous specific details are set forth in the following description to provide a thorough understanding of the present invention. These details are provided for the purpose of example, and the present invention may be practiced according to the claims without some or all of these specific details. For the sake of clarity, technical material known in the art related to the present invention has not been described in detail so as not to unnecessarily obscure the present invention.

[0005] As used herein, a security entity is a network node (e.g., a device) that enforces one or more security policies with respect to information such as network traffic, files, etc. As one example, a security entity may be a firewall. As another example, a security entity may be implemented as a router, a switch, a DNS resolver, a computer, a tablet, a laptop, a smartphone, etc. As another example, security may be implemented as an application running on the device, such as an anti-malware application.

[0006] As used herein, malware refers to an application that engages in behavior, covert or not (and illegal or not), that a user would not / would not approve of if fully informed, and examples of malware include Trojan horses, viruses, rootkits, spyware, hacking tools, keyloggers, etc. One example of malware is a desktop application that collects an end user's location and reports it to a remote server (but does not provide the user with location-based services, such as mapping services). Another example of malware is a malicious Android Application Package.apk (APK) file that appears to be a free game to the end user, but stealthily sends SMS premium messages (e.g., costing $10 each), increasing the end user's phone bill. Another example of malware is the Apple iOS flashlight application that covertly collects a user's contacts and sends them to spammers. Other forms of malware may also be detected / thwarted using the techniques described herein (e.g., ransomware). Additionally, although malware signatures are described herein as being generated for malicious applications, the techniques described herein may also be used in various embodiments to generate profiles for other types of applications (e.g., adware profiles, goodware profiles, etc.).

[0007] As used herein, unmanaged code or unmanaged functions refer to imported win32 API functions, as opposed to regular .NET code, which is referred to as “managed code.” As one example, such unmanaged code or functions are generally not reflected / included in the PE header of a .NET file; rather, such unmanaged code or functions are imported via the .NET header of the .NET file.

[0008] According to the prior art, malware is identified using a machine learning model. The machine learning model according to the related art is trained / developed using a portable executable (PE) structure based on features such as imports, headers, and sections. The machine learning model uses such imports, headers, and sections to distinguish between malware and benign files. However, the PE file structure of Microsoft Windows PE installer-based files appears to be very similar between malicious and benign files. Therefore, using the PE file structure for Microsoft Windows PE installer to detect malware is not very reliable because it is very difficult to distinguish between malicious and benign files based on such PE file structure. For example, using the PE file structure for Microsoft Windows PE installer files to detect malicious files leads to higher false positives and low detection rates. One example of a Microsoft Windows PE installer file used for benign purposes is the Microsoft Windows Nullsoft Scriptable Install System (NSIS) installer, which is widely used by legitimate products and in corporate environments. Machine learning models trained to analyze PE structures to distinguish between malicious and benign Microsoft Windows PE Installer files are unable to accurately detect malicious files.

[0009] Disclosed is a system, method, and / or device for detecting malicious files. The system includes one or more processors and a memory coupled to the one or more processors and configured to provide instructions to the one or more processors. The one or more processors are configured to receive a sample including a .NET file, obtain imported API function names based at least in part on a .NET header of the .NET file, determine a hash of a list of unmanaged imported API function names, and determine whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names.

[0010] According to various embodiments, a system for detecting malicious files is implemented by one or more servers. The one or more servers may provide services to one or more customers and / or security entities. For example, the one or more servers detect malicious files or determine / assess whether a file is malicious and provide an indication of whether the file is malicious to one or more customers and / or security entities. The one or more servers provide an indication that a file is malicious to a security entity in response to determining that the file is malicious and / or in conjunction with updating a mapping of the file to an indication of whether the file is malicious (e.g., an update to a blacklist that includes an identifier associated with the malicious file). As another example, the one or more servers determine whether a file is malicious in response to a request from a customer or security for an evaluation of whether the file is malicious, and the one or more servers provide the results of such a determination.

[0011] According to various embodiments, the system for detecting malicious files is implemented by a security entity. For example, the system for detecting malicious files is implemented by a firewall. As another example, the system for detecting malicious files is implemented by an application, such as an anti-malware application, running on a device (e.g., a computer, a laptop, a mobile phone, etc.). According to various embodiments, the security entity receives a .NET file, obtains a .NET header of the .NET file, and determines whether the .NET file is malicious based at least in part on the .NET header of the .NET file. In response to determining that the .NET file is malicious, the security entity applies one or more security entities with respect to the .NET file. In response to determining that the .NET file is not malicious (e.g., the .NET file is benign), the security entity treats the .NET file as non-malicious traffic. In some embodiments, the security entity determines whether a file is malicious based at least in part on determining (e.g., obtaining) imported API function names based at least in part on a .NET header of the .NET file, determining (e.g., calculating) a hash of the list of unmanaged imported API function names, and determining whether the hash of the list of unmanaged imported API function names corresponding to the .NET file matches a hash associated with a file deemed malicious. For example, the security entity performs a lookup for a mapping of hashes (e.g., hashes of unmanaged imported API function names) to malicious files and determines whether the mapping includes a matching hash (e.g., the mapping includes records for files having hashes of unmanaged imported API function names that match the calculated hash of the .NET file).

[0012] Portable executable (PE) files are often coded to import functions from external libraries to interact with various OS components. Related art methods for detecting malware use a sequence of imports, hash the sequence of imports to obtain a hash value, and compare the hash value against a known block list of “Import Table Hashes” (imphash). Related art methods for detecting malware imports obtain the imported API function names and corresponding library names from the PE header of the file being analyzed. However, determining the API function names and corresponding library names from the PE header and using such API function names and corresponding library names to detect malware is not ideal for .NET files because nearly all .NET PE files have similar import tables. As an example, the majority of .NET assemblies have a single imported function named “_CorExeMain” (EXE) or “_CorDllMain” (DLL) in the PE header. Generally, only a small fraction of .NET assemblies have more imports in the PE header. Such .NET files are typically created using Visual C++ and C++ / CLI extensions. The import functions included in the PE header are typically determined by the .NET compiler and are not affected by the code itself. This phenomenon occurs because .NET code is not compiled into native assemblies, but rather into intermediate language or intermediate bytecode (MSIL), which is then executed by the .NET runtime.

[0013] Thus, the use of import functions extracted from the PE header of a .NET file does not provide accurate detection of malware. However, various .NET malware families still need to directly interact with win32 APIs, for example, to inject code into other processes. Although such code can be injected into other processes from .NET, the win32 functions to do so are not reflected in the import table of the PE header for a .NET file. Rather, code injection functions are typically included (or imported) via the .NET header of a .NET file. A .NET header is a header that is included in a .NET file (e.g., in addition to the PE header). For example, a .NET header is different / not the PE header of a .NET file. A .NET file includes both a PE header and a .NET header. A .NET header typically includes data streams and tables that include various information about the .NET assembly. One such data stream included in the .NET header is named "#Strings" and includes a list of strings used within the file. The list included in the #Strings stream also includes the names of any unmanaged win32 API functions used. Additionally, one of the tables contained within the .NET headers is named "ImplMap" and contains various information about any imported unmanaged function.

[0014] Various embodiments parse a .NET header of a .NET file, extract unmanaged imports (e.g., unmanaged functions, libraries, etc.) from one or more fields in the .NET header, and determine whether the .NET file is malicious based at least in part on the extracted unmanaged imports. In some embodiments, the system determines a list of unmanaged imports (e.g., extracted from fields in the .NET header) corresponding to the .NET file and determines (e.g., calculates) a hash of the list of unmanaged imports. The hash of the list of unmanaged imports may be determined based on a predefined hash function. Examples of hash functions include a SHA-256 hash function, an MD5 hash function, a SHA-1 hash function, etc. Various other hash functions may be implemented. As used herein, an unmanaged imphash refers to a value obtained by determining a hash of the list of unmanaged imports (e.g., unmanaged imports extracted from fields in the .NET header).

[0015] According to various embodiments, information contained in the .NET header of a .NET file is used in connection with determining whether the file is malicious. In some embodiments, the system uses information contained in the ImplMap table and information contained in the strings of the "#Strings" data stream to determine a set of unmanaged function<->library name pairs. The system can determine a list of the .NET file's unmanaged import functions (e.g., those imported via the .NET header). In some embodiments, the system determines a hash of the list of the .NET file's unmanaged import functions. For example, the system determines an unmanaged Imphash corresponding to the .NET file. The unmanaged Imphash can be used to determine whether the file is malicious. For example, the system can query a list of files considered malicious (e.g., a blacklist) to determine whether the list includes a record having an unmanaged Imphash that matches the unmanaged Imphash determined for the .NET file.

[0016] According to various embodiments, a system analyzes .NET files in a sandbox environment. For example, the system parses the .NET files and extracts information from .NET headers within the sandbox environment. The system may be implemented by a virtual machine (VM) running in the sandbox environment.

[0017] In some embodiments, the system receives historical information regarding the maliciousness of files (e.g., a historical dataset of malicious files and a historical dataset of benign files) from a third-party service such as VirusTotal®. The third-party service may provide a set of files that are considered malicious and a set of files that are considered benign. As one example, the third-party service may analyze the files and provide an indication of whether the files are malicious or benign and / or a score indicating the likelihood that the files are malicious. The third-party service may provide unmanaged Impashes (e.g., a blacklist of files, a whitelist of files, etc.) that correspond to the files included in the historical dataset, or the list may include an indication of whether the historical unmanaged Impashes are malicious or not. The system may receive updates from the third-party service (e.g., at predefined intervals, when updates are available, etc.), such as newly identified benign or malicious files, corrections to previous mis-classifications, etc. In some embodiments, the indication is whether the file in the historical dataset corresponds to a social score, such as a community-based score or rating (e.g., a reputation score), that indicates that the file is malicious or likely to be malicious.

[0018] According to various embodiments, a security entity and / or network node (e.g., a client, device, etc.) treats a file based at least in part on an indication that the file is malicious and / or that the file matches a file indicated to be malicious. In response to receiving an indication that a file (e.g., a sample) is malicious, the security network and / or network node may update a mapping to indications of whether the corresponding file is malicious and / or a blacklist of files. In some embodiments, the security entity and / or network node receives a signature for a file (e.g., a sample deemed malicious), and the security entity and / or network node stores the signature of the file for use in connection with detecting whether a file obtained via network traffic or the like is malicious (e.g., based at least in part on comparing a signature generated for the file to signatures for files included in the blacklist of files). As one example, the signature may be a hash. In some embodiments, the signature of the file is an unmanaged Imphash corresponding to such file.

[0019] A firewall typically denies or allows network transmissions based on a set of rules. These sets of rules are often referred to as policies (e.g., network policies or network security policies). For example, a firewall can filter inbound traffic by applying a set of rules or policies to prevent unwanted external traffic from reaching a protected device. A firewall can also filter outbound traffic by applying a set of rules or policies (e.g., allow, block, monitor, notify, or log, and / or other actions that may be specified in a firewall rule or firewall policy, which may be triggered based on various criteria, as described herein). A firewall can also filter local network (e.g., intranet) traffic by applying a set of rules or policies as well.

[0020] Security devices (e.g., security appliances, security gateways, security services, and / or other security devices) may perform various security operations (e.g., firewalls, anti-malware, intrusion prevention / detection, proxies, and / or other security functions), network functions (e.g., routing, quality of service (QoS), workload balancing of network-related resources, and / or other network functions), and / or other security and / or network-related functions. For example, routing may be performed based on source information (e.g., IP addresses and ports), destination information (e.g., IP addresses and ports), and protocol information.

[0021] Basic packet filtering firewalls filter network communication traffic by inspecting each individual packet sent across a network (e.g., a packet filtering firewall or first generation firewall, which is a stateless packet filtering firewall). Stateless packet filtering firewalls typically inspect the individual packets themselves and then apply rules based on the inspected packets (e.g., using a combination of the packet's source and destination address information, protocol information, and port numbers).

[0022] Application firewalls can also perform application layer filtering (e.g., using an application layer filtering firewall, or a second generation firewall that functions at the application level of the TCP / IP stack). Application layer filtering firewalls or application firewalls can generally identify predefined applications and protocols (e.g., web browsing using the Hypertext Transfer Protocol (HTTP), Domain Name System (DNS) requests, file transfers using the File Transfer Protocol (FTP), and various other types of applications and other protocols, such as Telnet, DHCP, TCP, UDP, and TFTP (GSS)). For example, an application firewall can block unauthorized protocols that attempt to communicate on standard ports (e.g., unauthorized / out-of-policy protocols that attempt to sneak through by using a non-standard port for that protocol can generally be identified using an application firewall).

[0023] Stateful firewalls can also perform stateful-based packet inspection, where each packet is inspected in the context of the set of packets associated with its network outgoing flow of packets. This firewall technique is commonly referred to as stateful packet inspection, because it keeps a record of every connection that passes through the firewall and can determine whether a packet is the start of a new connection, part of an existing connection, or an invalid packet. For example, the state of a connection can itself be one of the criteria that triggers a rule in a policy.

[0024] Advanced or next-generation firewalls can perform stateless and stateful packet filtering and application layer filtering, as described above. Next-generation firewalls can also perform additional firewall technologies. For example, the new firewalls that are often referred to as advanced or next-generation firewalls can also identify users and content. In particular, the next-generation firewalls that are defaults have expanded the list of applications that they can automatically identify to thousands of applications. Examples of such next-generation firewalls are commercially available from Palo Alto Networks (e.g., Palo Alto Networks PA series firewalls). For example, Palo Alto Networks next-generation firewalls use a variety of identification technologies to enable enterprises and service providers to identify and control applications, users, and content - not just ports, IP addresses, and packets. Various identification techniques are Application-ID (App-ID) for precise application identification, User-ID (User-ID) for user identification (e.g., User ID), Content-ID (Content-ID) for real-time content scanning (e.g., to control web surfing and limit data and file transfer), and Device-ID (e.g., for identifying IoT device types). These identification techniques allow enterprises to safely enable application usage using business-relevant concepts instead of following the traditional approach provided by traditional port-blocking firewalls.Additionally, special-purpose hardware for next-generation firewalls (e.g., implemented as dedicated devices) generally provides higher performance levels for application inspection than software running on general-purpose hardware (e.g., security appliances from Palo Alto Networks, Inc., which utilize dedicated, function-specific processing that is tightly integrated with a single-pass software engine to maximize network throughput while minimizing latency, for Palo Alto Networks' PA Series Next-Generation Firewalls).

[0025] Advanced or next-generation firewalls can also be implemented using virtualized firewalls. An example of such a next-generation firewall is available from Palo Alto Networks (which runs on VMware® ESXi). TM and NSX TM , Citrix(R)Netscaler SDX TM It supports a variety of commercial virtualization environments, including Kubernetes, KVM / OpenStack (Centos / RHEL, Ubuntu®), and Amazon Web Services (AWS). For example, the virtualized firewall can support similar or identical next-generation firewall and advanced threat prevention functions available in physical form factor devices, allowing enterprises to safely enable the influx of applications to private, public, and hybrid cloud computing environments. Automation functions such as VM monitoring, dynamic address groups, and REST-based APIs allow enterprises to dynamically monitor VM changes and update security policies with that context, thereby eliminating policy lag that can occur when VMs change.

[0026] The system improves detection of malicious files. Additionally, the system further improves network traffic handling by preventing (or improving prevention of) malicious files from traversing the network, such as between nodes in the network, or by preventing malicious files from entering the network. The system determines .NET files that are deemed malicious or likely to be malicious, such as based on the .NET headers of the .NET files. Related art detection techniques that use the structure of the PE header for a file may be insufficient / inaccurate for files that have a similar structure / profile among malicious or benign files. Additionally, because .NET files are compiled into an intermediate language, it is difficult to classify the file as malicious / benign using machine learning classifiers or manually written YARA rules. YARA is a tool that is intended to help (but is not limited to) malware researchers identify and classify malware samples. YARA rules are used to classify and identify malware samples by creating descriptions of malware families based on text or binary patterns. Additionally, the system can provide accurate and low latency updates to security entities (e.g., endpoints, firewalls, etc.) to enforce one or more security policies (e.g., pre-defined and / or customer-specific security policies) regarding traffic containing malicious files (e.g., malicious .NET files), thus preventing the spread of malicious traffic (e.g., files) to nodes within the network.

[0027] FIG. 1 is a block diagram of an environment in which a malicious file is detected or suspected, according to various embodiments. In the illustrated example, client devices 104-108 are a laptop computer, a desktop computer, and a tablet (respectively) residing within a corporate network 110 (belonging to “Acme Company”). Data appliance 102 is configured to enforce policies (e.g., security policies) regarding communications between client devices, such as client devices 104 and 106, and nodes external to corporate network 110 (e.g., reachable via external network 118). Examples of such policies include those governing traffic shaping, quality of service, and traffic routing. Other examples of policies include security policies, such as those requiring scanning for threats in incoming (and / or outgoing) email attachments, website content, files exchanged via instant messaging programs, and / or other file transfers. In some embodiments, the data appliance 102 is also configured to enforce policies regarding traffic that stays within (or enters) the corporate network 110 .

[0028] The techniques described herein may be used with a variety of platforms (e.g., desktops, mobile devices, gaming platforms, embedded systems, etc.) and / or a variety of types of applications (e.g., Android .apk files, iOS applications, Windows PE files, Adobe Acrobat PDF files, Microsoft Windows PE installers, etc.). In the example environment shown in Figure 1, client devices 104-108 are a laptop computer, a desktop computer, and a tablet that reside (respectively) within enterprise network 140. Client device 120 is a laptop computer that resides outside enterprise network 110.

[0029] The data appliance 102 may be configured to operate in cooperation with a remote security platform 140. The security platform 140 may provide a variety of services, including performing static and dynamic analysis on malware samples, providing a list of signatures of known malicious files to a data appliance, such as the data appliance 102, as part of a subscription, detecting malicious files (e.g., on-demand detection or periodic based updates to the mapping of files to an indication of whether the file is malicious or benign), providing the likelihood that a file is malicious or benign, providing / updating a whitelist of files that are considered benign, identifying malicious domains, detecting malicious files, predicting whether a file is malicious or benign, and providing an indication that a file is malicious (or benign). In various embodiments, the results of the analysis (and additional information about the application, domain, etc.) are stored in a database 160. In various embodiments, security platform 140 comprises one or more dedicated, off-the-shelf hardware servers (e.g., having multi-core processors, 32G+ RAM, gigabit network interface adapters, and hard drives) running a typical server-class operating system (e.g., Linux). Security platform 140 may be implemented across a scalable infrastructure including multiple such servers, solid-state drives, and / or other applicable high performance hardware. Security platform 140 may comprise several distributed components, including components provided by one or more third parties. For example, some or all of security platform 140 may be implemented using Amazon Elastic Compute Cloud (EC2) and / or Amazon Simple Storage Service (S3).Additionally, similar to data appliance 102, whenever security platform 140 is referred to as performing a task, such as storing data or processing data, it should be understood that a subcomponent or subcomponents of security platform 140 may cooperate (individually or in cooperation with a third-party component) to perform that task. As one example, security platform 140 may cooperate with one or more virtual machine (VM) servers to optionally perform static / dynamic analysis. One example of a virtual machine server is a physical machine that includes commercially available server-class hardware (e.g., multi-core processors, 32+ gigabytes of RAM, and one or more gigabit network interface adapters) running commercially available virtualization software, such as VMware ESXi, Citrix XenServer, or Microsoft Hyper-V. In some embodiments, the virtual machine server is omitted. Additionally, the virtual machine server may be under the control of the same entity that manages security platform 140, but may also be provided by a third party. As one example, the virtual machine servers may rely on EC2, with the remainder of security platform 140 provided by dedicated hardware owned and under the control of the operator of security platform 140.

[0030] According to various embodiments, security platform 140 includes DNS tunneling detector 138 and / or malicious file detector 170. Malicious file detector 170 is used in connection with determining whether a file (e.g., a .NET file) is malicious. In response to receiving a sample, malicious file detector 170 analyzes the file and determines whether the file is malicious. For example, malicious file detector 170 determines whether an unmanaged Imphash corresponding to the file being analyzed matches a file included in a historical dataset (e.g., a list of files considered malicious, a list of files considered benign, etc.). In some embodiments, malicious file detector 170 receives a sample including a .NET file, obtains an imported API function name based at least in part on a .NET header of the .NET file, determines a hash of the list of unmanaged imported API function names (e.g., unmanaged Imphash), and determines whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names. In some embodiments, malicious file detector 170 comprises one or more of a .NET file parser 172 , an unmanaged function extractor 174 , a prediction engine 176 , and / or a cache 178 .

[0031] .NET file parser 172 is used in connection with obtaining information about a sample, such as a .NET file. In some embodiments, .NET file parser 172 obtains information from and / or the .NET header of the .NET file. .NET file parser 172 obtains one or more data streams and / or one or more tables included in (or referenced by) the .NET header. For example, .NET file parser 172 obtains a #Strings stream included in the .NET header. As another example, .NET file parser 172 obtains an ImplMap from the .NET file (e.g., from the .NET header). In some embodiments, .NET file parser 172 determines a set of imported functions (e.g., imported API function names) that are imported into the .NET file.

[0032] The unmanaged function extractor 174 is used in connection with determining (e.g., obtaining) a set of unmanaged import functions imported into a .NET file. For example, the unmanaged function extractor 174 determines a set of unmanaged import functions from a set of import functions (e.g., imported API function names) imported into the .NET file. According to various embodiments, the unmanaged function extractor 174 uses information contained in (or referenced by) a .NET header to determine the unmanaged code or functions (e.g., unmanaged functions and corresponding libraries). In some embodiments, the unmanaged function extractor 174 determines a set of used unmanaged win32 API functions imported into the .NET file. The unmanaged function extractor 174 provides the set of unmanaged import functions (or names of unmanaged functions) and / or corresponding libraries imported into the .NET file to the prediction engine 176.

[0033] The prediction engine 176 is used to determine whether a file (e.g., a .NET file) is malicious. The prediction engine 176 uses information contained in a .NET header in connection with determining whether a corresponding .NET file is malicious. For example, the prediction engine 176 obtains a set of unmanaged import functions (or names of unmanaged functions) and / or corresponding libraries imported into the .NET file from the unmanaged function extractor 174. In some embodiments, the prediction engine 176 determines a hash (e.g., a hash value) for the set of unmanaged import functions (or names of unmanaged functions) and / or corresponding libraries imported into the .NET file. For example, the prediction engine 176 calculates an unmanaged Imphash corresponding to the .NET file. The prediction engine 176 determines a list of the set of unmanaged import functions (or names of unmanaged functions) and / or corresponding libraries imported into the .NET file, and then determines a hash of such list. The list of the set of unmanaged imported functions and / or corresponding libraries is determined according to a predefined order. For example, the ordering of the imported unmanaged functions and / or corresponding libraries corresponds to the order in which the unmanaged functions are included in elements of the .NET header (e.g., the order in which the unmanaged functions are included in #Strings streams and / or tables included in or referenced by .NET tables). Various other orders in which the unmanaged functions are added to the list (or the list is constructed) may be implemented. The prediction engine 176 formats the list and / or the unmanaged functions (e.g., unmanaged function names and / or corresponding libraries) according to a predefined format.Examples of predefined formats include (i) a lowercase alphanumeric string, (ii) removal of the file extension, (iii) removal of the library extension (e.g., removal of .dll from the corresponding library name), (iv) appending the unmanaged function name and the corresponding library, and (v) using a predefined separator between the unmanaged function name and the corresponding library. In some embodiments, the prediction engine 176 appends the function name (e.g., the unmanaged function name) to the corresponding library and separates the function name from the corresponding library by a dot or period (e.g., "."). In response to determining a string by appending the function name and library (e.g., with a predefined separator such as "."), the prediction engine 176 adds such an entry to a list of a set of unmanaged imported functions and / or corresponding libraries.

[0034] According to various embodiments, the prediction engine 176 determines a hash for the list of unmanaged import functions and / or sets of corresponding libraries. Various hash functions can be used in connection with determining the hash. Examples of hash functions include a SHA-256 hash function, an MD5 hash function, a SHA-1 hash function, etc. Various other hash functions can be implemented. The prediction engine 176 uses the hash function to determine an unmanaged Imphash corresponding to the .NET file.

[0035] According to various embodiments, the prediction engine 176 uses information obtained from the .NET header of the .NET file to determine whether the .NET file is malicious. In some embodiments, the prediction engine 176 uses the unmanaged Imphash corresponding to the .NET file in connection with determining whether the .NET file is malicious. As one example, in response to determining the unmanaged Imphash corresponding to the .NET file, the prediction engine 176 determines whether the unmanaged Imphash matches an unmanaged Imphash of a file that is deemed malicious. As one example, in response to determining the unmanaged Imphash corresponding to the .NET file, the prediction engine 176 determines whether the unmanaged Imphash matches an unmanaged Imphash of a file that is deemed benign. In some embodiments, the malicious file detector 170 (e.g., the prediction engine 176) uses information about a particular file (e.g., the unmanaged Imphash corresponding to the .NET file being analyzed) from a dataset of historical files and a dataset of historical data indicating whether a particular file is malicious (e.g., VirusTotal ... TMIn response to determining that information about a particular file is not included or available in the dataset of historical files and historical information, the malicious file detector 170 may consider the file to be benign (e.g., consider the file not malicious). One example of historical information associated with a historical file that indicates whether a particular file is malicious corresponds to a VirusTotal® (VT) score. If the VT score for a particular file is greater than 0, the particular file is considered malicious by the third-party service. In some embodiments, the historical information associated with a historical file that indicates whether a particular file is malicious corresponds to a social score, such as a community-based score or a rating (e.g., a reputation score), that indicates that the file is malicious or likely to be malicious. The historical information (e.g., from a third-party service, a community-based score, etc.) indicates whether other vendors or cybersecurity organizations consider the particular file to be malicious.

[0036] In some embodiments, malicious file detector 170 (e.g., prediction engine 176) determines that the received file is newly analyzed (e.g., the file is not in historical information / dataset, is not on a whitelist or blacklist, etc.). Malicious file detector 170 (e.g., script extraction module 172) may detect that the file is newly analyzed in response to security platform 140 receiving the file from a security entity (e.g., a firewall) or an endpoint in the network. For example, malicious file detector 170 determines that the file is newly analyzed contemporaneously with security platform 140 or malicious file detector 170 receiving the file. As another example, malicious file detector 170 (e.g., prediction engine 176) determines that the file is newly analyzed according to a predefined schedule (e.g., daily, weekly, monthly, etc.), such as in connection with a batch process. In response to determining that such a file has not yet been analyzed for maliciousness (e.g., the system does not have historical information regarding such a file), malicious file detector 170 determines whether to use a .NET header associated with the file in connection with determining whether the file is malicious (e.g., in response to determining that the file is a .NET file), and malicious file detector 170 uses a .NET file parser to parse and / or extract information about the .NET file from the .NET header of the .NET file. In some embodiments, .NET file parser 172 extracts information from the .NET header within the system's sandbox environment.

[0037] According to various embodiments, in response to the prediction engine 176 determining that a file is malicious, the system sends an indication that the file is malicious to a security entity (or an endpoint, such as a client). For example, the malicious file detector 170 sends an indication that the file is malicious to a security entity (e.g., a firewall) or a network node (e.g., a client). The indication that the file is malicious may correspond to an update to a blacklist of files (e.g., corresponding to a malicious file) where the file is deemed malicious, or an update to a whitelist of files (e.g., corresponding to a non-malicious file) where the file is deemed benign. In some embodiments, the malicious file detector 170 sends a hash or signature corresponding to the file in association with the indication that the file is malicious or benign. The security entity or endpoint may calculate a hash or signature of the file and perform a lookup (e.g., query a whitelist and / or blacklist) for a mapping of the hash / signature to an indication of whether the file is malicious / benign. In some embodiments, the hash or signature uniquely identifies the file.

[0038] Cache 178 stores information about files. In some embodiments, cache 178 stores a mapping of an indication of whether a file is malicious (or likely to be malicious) to a particular file, or a mapping of an indication of whether a file is malicious (or likely to be malicious) to a hash or signature corresponding to the file. Cache 178 can store additional information about a set of files, such as script information for files in the set of files, hashes or signatures corresponding to files in the set of files, other unique identifiers corresponding to files in the set of files, executable files called by the files, Bitcoin wallets called by the files, pointers contained in the files, etc.

[0039] Returning to FIG. 1 , assume that a malicious individual (using system 120) has created malware 130. The malicious individual wants a client device, such as client device 104, to run a copy of malware 130, compromising the client device and causing the client device to become a bot in a botnet. The compromised client device can then be commanded to perform a task (e.g., cryptocurrency mining or participating in a denial of service attack) and / or report information to an external entity, such as a command and control (C&C) server 150 (e.g., extracting sensitive corporate data associated with such a task), and, if applicable, to receive instructions from the C&C server 150.

[0040] Malware 130 can attempt to get a compromised client device to communicate directly with C&C server 150 (e.g., by having the client send an email to C&C server 150), but such overt communication attempts can be flagged (e.g., by data appliance 102) as suspicious / harmful and blocked. Increasingly, instead of generating such direct communication, malware authors use a technique referred to herein as DNS tunneling. DNS is a protocol that translates human-friendly URLs, such as paloaltonetworks.com, into machine-friendly IP addresses, such as 199.167.52.137. DNS tunneling exploits the DNS protocol to tunnel malware and other data through a client-server model. In an attachment example, a malicious file (e.g., malware) is sent as an attachment to a message, such as an email, instant message, etc. Once the attachment is selected, a malware program can be installed on the client device. In one example of an attack, an attacker registers a domain, such as badsite.com. The domain's name server points to the attacker's server, where a tunneling malware program is installed. The attacker infects a computer. Because DNS requests are traditionally allowed to travel in and out of security appliances, the infected computer is allowed to send a query to a DNS resolver (e.g., kj32hkjqfeuo32ylhkjshdflu23.badsite.com, where the subdomain portion of the query encodes information for consumption by the C&C server). A DNS resolver is a server that relays requests for IP addresses to root and top-level domain servers. The DNS resolver routes the query to the attacker's C&C server, where a tunneling program is installed. A connection is now established between the victim and the attacker, via the DNS resolver.This tunnel can be used to extract data or for other malicious purposes.

[0041] Detecting and preventing DNS tunneling attacks is difficult for a variety of reasons. Many legitimate services (e.g., content delivery networks, web hosting companies, etc.) legitimately use the subdomain portion of a domain name to encode information to help support the use of those legitimate services. The encoding patterns used by such legitimate services can vary widely between providers, and benign subdomains may appear visually indistinguishable from malicious subdomains. A second reason is that unlike other domains (e.g., computer research) that have large corpuses of both known-benign and known-malicious training set data, the training set data for DNS queries is heavily biased (e.g., with millions of examples of benign root domains and very few malicious examples). Despite such difficulties, and using the techniques described herein, malicious domains can be efficiently and proactively detected (e.g., immediately after the domain is registered) and security policies can be enforced regarding malicious files within or entering a network, and such malicious files can be blocked or otherwise alerted to users or administrators of the malicious files (e.g., sending notifications, providing prompts to users, etc.).

[0042] The environment shown in Figure 1 includes three Domain Name System (DNS) servers (122-126). As shown, DNS server 122 is under the control of ACME (for use by computing assets located within network 110), while DNS server 124 is publicly accessible (and may also be used by other devices, such as computing assets located within network 110, as well as those located within other networks (e.g., networks 114 and 116)). DNS server 126 is publicly accessible, but is under the control of a malicious operator of C&C server 150. Enterprise DNS server 122 is configured to resolve corporate domain names to IP addresses, and is further configured to communicate with one or more external DNS servers (e.g., DNS servers 124 and 126) to resolve domain names, if applicable.

[0043] As discussed above, to connect to a legitimate domain (e.g., www.example.com, shown as site 128), a client device, such as client device 104, needs to resolve the domain to a corresponding Internet Protocol (IP) address. One way such resolution may occur is for client device 104 to forward a request to DNS servers 122 and / or 124 to resolve the domain. In response to receiving a valid IP address for the requested domain name, client device 104 can use the IP address to connect to website 128. Similarly, to connect to malicious C&C server 150, client device 104 needs to resolve the domain "kj32hkjqfeuo32ylhkjshdflu23.badsite.com" to a corresponding Internet Protocol (IP) address. In this example, the malicious DNS server 126 is authoritative for *.badsite.com, and requests from the client device 104 are forwarded to the DNS server 126 for resolution (for example), ultimately allowing the C&C server 150 to receive data from the client device 104.

[0044] Data appliance 102 is configured to enforce policies regarding communications between client devices, such as client devices 104 and 106, and nodes outside enterprise network 140 (e.g., reachable via external network 118). Examples of such policies include those governing traffic shaping, quality of service, and routing of traffic. Other examples of policies include security policies, such as those requiring scanning for threats in incoming (and / or outgoing) email attachments, website content, files exchanged via instant messaging programs, and / or other file transfers. In some embodiments, data appliance 102 is also configured to enforce policies with respect to traffic remaining within enterprise network 140.

[0045] In various embodiments, the data appliance 102 includes a DNS module 134 configured to facilitate determining whether a client device (e.g., client device 104-108) is attempting to engage in malicious DNS tunneling and / or prevent connections (e.g., by client device 104-108) to malicious DNS servers. The DNS module 134 can be integrated into the appliance 102 (as shown in FIG. 1) or can operate as a stand-alone appliance in various embodiments. And, like the other components shown in FIG. 1, the DNS module 134 can be provided by the same entity that provides the appliance 102 (or security platform 140) or can be provided by a third party (e.g., different from the provider of the appliance 102 or security platform 140). Furthermore, in addition to preventing connections to malicious DNS servers, the DNS module 134 can take other actions, such as individualized logging of tunneling attempts made by clients (indicating that a given client has been compromised and should be quarantined or otherwise investigated by an administrator).

[0046] In various embodiments, when a client device (e.g., client device 104) attempts to resolve a domain, DNS module 134 uses the domain as a query to security platform 140. This query may be performed simultaneously with the resolution of the domain (e.g., simultaneously with the request sent to DNS servers 122, 124, and / or 126 and security platform 140). As one example, DNS module 134 may send a query (e.g., in JSON format) via a REST API to front end 142 of security platform 140. Using a process described in more detail below, security platform 140 determines (e.g., using DNS tunneling detector 138) whether the queried domain indicates a malicious DNS tunneling attempt and returns a result (e.g., “malicious DNS tunneling” or “not tunneled”) to DNS module 134.

[0047] In various embodiments, when a client device (e.g., client device 104) attempts to open or receives a file received, such as via email, attachment to an instant message, DNS module 134 uses the file (i.e., the computed hash or signature, or other unique identifier, etc.) as a query to security platform 140. This query may be performed upon receipt of the file or in response to a request from a user to scan the file. As one example, data appliance 102 may send a query (e.g., in JSON format) via a REST API to front end 142 of security platform 140. Using a process described in more detail below, security platform 140 determines (e.g., using malicious file detector 170) whether the queried file is (or is likely to be) malicious and returns a result (e.g., “malicious DNS tunneling” or “non-tunneling”) to DNS module 134.

[0048] In various embodiments, the DNS tunneling detector 138 (implemented either on the security platform 140, on the data appliance 102, or other suitable location / combination of locations) uses a two-pronged approach in identifying malicious DNS tunneling. The first technique uses an anomaly detector 146 (e.g., implemented using python) to build a set of real-time profiles (156) of DNS traffic for the root domain. The second approach uses signature generation and matching (also referred to herein as similarity detection, and implemented using Go, for example). The two approaches are complementary. The anomaly detector acts as a general-purpose detector that can identify previously unknown tunneling traffic. However, the anomaly detector may need to observe multiple DNS queries before detection can be made. To block the first DNS tunneling packets, the similarity detector 144 complements the anomaly detector 146 and extracts signatures from the detected tunneling traffic. It can be used to identify situations where attackers have registered new malicious tunneling root domains and done so using tools / malware similar to a detected root domain.

[0049] When data appliance 102 receives DNS queries (e.g., from DNS module 134), it provides them, respectively, to security platform 140, which performs both anomaly detection and similarity detection. In various embodiments, a domain (e.g., as provided in a query received by security platform 140) is classified as a malicious DNS tunneling root domain if any detector flags the domain.

[0050] The DNS tunneling detector 138 maintains a set of fully qualified domain names (FQDNs) for each device (from which data is received), grouped with respect to their root domain (collectively shown in FIG. 1 as domain profile 156). (Although domains are generally described herein through grouping by root, it should also be understood that the techniques described herein may be extended to any level of domain.) In various embodiments, information about received queries for a given domain is persisted in the profile for a fixed amount of time (e.g., a sliding time window of 10 minutes).

[0051] As an example, DNS query information received from data appliance 102 for various foo.com sites may be grouped (into a domain profile for the root domain foo.com) as follows: G(foo.com)=[mail.foo.com, coolstuff.foo.com,domain1234.foo.com]. A second root domain would have a second profile with similar application information (e.g., G(baddomain.com)=[lskjdf23r.baddomain.com,kj235hdssd233.baddomain.com]). Each root domain (e.g., foo.com or baddomain.com) is modeled with a set of characteristics specific to malicious DNS tunneling, so that even diverse benign DNS patterns (e.g., k2jh3i8y35.legitimatesite.com,xxx888222000444.otherlegitimatesite.com) are highly unlikely to be misclassified as malicious tunneling. The following are example characteristics that may be extracted as features (e.g., into a feature vector) for a given group of domains (i.e., sharing a root domain):

[0052] In some embodiments, malicious file detector 170 provides an indication of whether a file is malicious to a security entity, such as data appliance 102. For example, in response to determining that a file is malicious, malicious file detector 170 sends an indication that the file is malicious to data appliance 102, which may then implement one or more security policies based at least in part on the indication that the file is malicious. The one or more security policies may include quarantining the file, deleting the file, warning or prompting a user of the maliciousness of the file before the user opens / executes the file, etc. As another example, in response to determining that a file is malicious, malicious file detector 170 provides to the security entity an update to a mapping of the file (or hash, signature, unmanaged Impashes, or other unique identifier corresponding to the file) to an indication of whether the corresponding file is malicious or not, or an update to a blacklist of malicious files (e.g., identifying file domains) or a whitelist of benign files (e.g., identifying files that are not considered malicious).

[0053] Figure 2 is a block diagram of a system for detecting malicious files, according to various embodiments. According to various embodiments, system 200 is implemented in conjunction with system 100 of Figure 1, such as with malicious file detector 170. In various embodiments, system 200 is implemented in conjunction with process 400 of Figure 4, process 500 of Figure 5, process 600 of Figure 6, process 700 of Figure 7A, process 750 of Figure 7B, process 800 of Figure 8, process 900 of Figure 9, process 1000 of Figure 10, and / or process 1100 of Figure 11. System 200 may be implemented in one or more servers, security entities such as firewalls, and / or endpoints.

[0054] System 200 may be implemented by one or more devices, such as a server. System 200 may be implemented at various locations on a network. In some embodiments, system 200 implements malicious file detector 170 of system 100 of FIG. 1. As one example, system 200 is deployed as a service, such as a web service (e.g., system 200 determines whether a file is malicious and provides such determination as a service). A service may be provided by one or more servers (e.g., system 200 or the malicious file detector is deployed on a remote server that monitors or receives files sent in or out of the network, such as via attachments to emails, instant messages, etc., and determines whether the file is malicious and sends / pushes notifications or updates regarding the file, such as an indication of whether the file is malicious). As another example, the malicious file detector is deployed on a firewall.

[0055] In the illustrated example, system 200 implements one or more modules associated with predicting whether a file (e.g., a newly received file) is malicious, determining the likelihood that a file is malicious, and / or providing notification or indication of whether a file is malicious. System 200 includes a communications interface 205, one or more processors 210, a storage device 215, and / or a memory 220. One or more processors 210 include one or more of a communications module 225, a .NET header extraction module 230, an unmanaged function extraction module 235, a list generation module 240, a prediction module 245, and / or a notification module 250.

[0056] In some embodiments, the system 200 includes a communications module 225. The system 200 uses the communications module 225 to communicate with various nodes or endpoints (e.g., client terminals, firewalls, DNS resolvers, data appliances, other security entities, etc.) or user systems, such as administrator systems. For example, the communications module 225 provides the communications interface 205 with information to be communicated. As another example, the communications interface 205 provides the communications module 225 with information received by the system 200. The communications module 225 is configured to receive a file to be analyzed, such as from a network endpoint or node, such as a security entity (e.g., a firewall). The communications module 225 is configured to query a third-party service for information about the file (e.g., a service that publishes information about a file, such as a third-party score or rating of the maliciousness of the file, a community-based score, rating, or reputation for the file, a blacklist of the file, and / or a whitelist of the file, etc.). For example, the system 200 uses the communications module 225 to query a third-party service. The communications module 225 is configured to receive one or more settings or configurations from an administrator. Examples of the one or more settings or configurations include configuration of a process for determining whether a file is malicious or not, a format in which information for a .NET file is organized / arranged to determine the unmanaged imphash of the .NET file, a hash function used in connection with determining the unmanaged imphash of the file, information regarding a whitelist of domains (e.g., domains that are not considered suspicious and for which traffic or connections are allowed), and information regarding a blacklist of domains (e.g., domains that are considered suspicious and for which traffic or connections are restricted).

[0057] In some embodiments, the system 200 includes a .NET header extraction module 230. The system 200 uses the .NET header extraction module 230 in connection with determining whether to extract information related to (e.g., from) a header of a file and extracting information of the file (e.g., for analyzing whether the file is malicious). In some embodiments, the .NET header extraction module 230 receives a file to be analyzed, such as a file included as an attachment to an email, an instant message, or otherwise communicated over or from within a network. In response to determining that the file is a .NET file, the .NET header extraction module 230 determines to perform extraction of information related to the header of the file. As one example, the .NET header extraction module 230 determines that the file is a .NET file based on receiving an indication that the file corresponds to a .NET file. As another example, the .NET header extraction module 230 determines that the file is a .NET file based at least in part on a determination that the file includes a .NET header. As another example, the .NET header extraction module 230 determines that a file is a .NET file based at least in part on a determination that a directory item in the PE header has a non-zero value (e.g., the system 200 examines the binary structure of the file and determines whether a value in an optional header value contains a non-zero value / location, and if so, determines that the file is a .NET file). As another example, the .NET header extraction module 230 determines that a file is a .NET file based at least in part on a check to determine if the file imports a "_CorExeMain" or "_CorDllMain" function.

[0058] In some embodiments, the .NET header extraction module 230 obtains a .NET header and / or information from a .NET header of the .NET file. In response to determining that the file is a .NET file, the .NET header extraction module 230 obtains information about (e.g., information from) the header of the file. In some embodiments, the .NET header extraction module 230 determines the .NET header and obtains imported functions imported (or referenced) by the .NET header. For example, the .NET header extraction module 230 obtains imported API function names based at least in part on the .NET header of the .NET file. The .NET header extraction module 230 obtains one or more data streams included in the .NET header and / or one or more tables included in (or referenced by) the .NET header. For example, the .NET header extraction module 230 obtains a #Strings stream included in the .NET header. As another example, the .NET header extraction module 230 obtains an ImplMap from the .NET file (e.g., from the .NET header). The ImplMap may contain various information about the imported unmanaged functions of a .NET file. In some embodiments, the .NET header extraction module 230 determines the set of imported functions (e.g., imported API function names) that are imported into the .NET file.

[0059] According to various embodiments, in response to receiving a file to be analyzed to determine whether the file is malicious, system 200 places the file in a sandbox in which the file is to be analyzed. In some embodiments, .NET header extraction module 230 extracts information related to (e.g., information from) the header of the file. As one example, .NET header extraction module 230 extracts header information from the .NET header and / or PE header for a .NET file in the sandbox. For example, system 200 invokes a sandbox for analysis of a particular file. As another example, system 200 uses a common sandbox for analysis of various files.

[0060] In some embodiments, the system 200 includes an unmanaged function extraction module 235. The system 200 uses the unmanaged function extraction module 235 to determine (e.g., obtain) a set of unmanaged functions contained in or referenced by a .NET file, such as a list of unmanaged functions imported via the .NET header of the .NET file. For example, the unmanaged function extraction module 235 determines a set of unmanaged import functions from a set of import functions (e.g., imported API function names) imported into the .NET file. According to various embodiments, the unmanaged function extraction module 235 uses information contained in (or referenced by) the .NET header to determine the unmanaged code or functions (e.g., unmanaged functions and corresponding libraries). In some embodiments, the unmanaged function extraction module 235 determines a set of used unmanaged win32 API functions imported into the .NET file. The unmanaged function extraction module 235 provides a set of unmanaged import functions (or names of unmanaged functions) imported into the .NET file and / or corresponding libraries to the list generation module 240 and / or the prediction module 245.

[0061] In some embodiments, the system 200 includes a list generation module 240. The system 200 uses the list generation module 240 to generate a list of unmanaged functions and / or corresponding libraries. In some embodiments, the system 200 uses the list generation module 240 to format a set of unmanaged import functions (or names of unmanaged functions) and / or corresponding libraries to be imported into a .NET file. The list generation module 240 formats the list and / or unmanaged functions (e.g., unmanaged function names and / or corresponding libraries) according to a predefined format. Examples of predefined formats include (i) lowercase alphanumeric strings, (ii) removal of file extensions, (iii) removal of library extensions (e.g., removal of .dll from the corresponding library names), (iv) appending the unmanaged function names and the corresponding libraries, and (v) using a predefined separator between the unmanaged function names and the corresponding libraries. In some embodiments, the list generation module 240 appends the function name (e.g., the unmanaged function name) to the corresponding library and separates the function name from the corresponding library by a dot or period (e.g., "."). In response to determining a string by appending the function name and library (e.g., with a default separator such as "."), the list generation module 240 adds such an entry to a list of the set of unmanaged imported functions and / or corresponding libraries. According to various embodiments, in response to determining that there are no more unmanaged functions and / or corresponding libraries to be added to the list, the list generation module 240 provides a list to the prediction module 245.

[0062] In some embodiments, the system 200 includes a prediction module 245. The system 200 uses the prediction module 245 to predict whether a file is malicious or to predict the likelihood that a file is malicious. According to various embodiments, the prediction module 245 determines whether a file is malicious based at least in part on information contained in (or referenced by) a .NET header of the file. For example, the prediction module 245 determines an unmanaged Imphash corresponding to the file and then determines whether the file is malicious based at least in part on the unmanaged Imphash.

[0063] According to various embodiments, the prediction module 245 determines a hash for the list of unmanaged import functions and / or sets of corresponding libraries. Various hash functions may be used in connection with determining the hash. Examples of hash functions include a SHA-256 hash function, an MD5 hash function, a SHA-1 hash function, etc. Various other hash functions may be implemented. The prediction module 245 uses the hash function to determine an unmanaged Imphash corresponding to the .NET file.

[0064] According to various embodiments, the prediction module 245 uses information obtained from the .NET header of the .NET file to determine whether the .NET file is malicious. In some embodiments, the prediction module 245 uses the unmanaged Imphash corresponding to the .NET file in connection with determining whether the .NET file is malicious. As one example, in response to determining the unmanaged Imphash corresponding to the .NET file, the prediction module 245 determines whether the unmanaged Imphash matches the unmanaged Imphash of a file that is deemed malicious. As one example, in response to determining the unmanaged Imphash corresponding to the .NET file, the prediction module 245 determines whether the unmanaged Imphash matches the unmanaged Imphash of a file that is deemed benign. In some embodiments, the prediction module 245 uses information about a particular file (e.g., the unmanaged Imphash corresponding to the .NET file being analyzed) from a dataset of historical files and a dataset of historical data indicating whether a particular file is malicious (e.g., VirusTotal ... TMIn response to determining that information about a particular file is not included or available in the dataset of historical files and historical information, the prediction module 245 may consider the file to be benign (e.g., not malicious). An example of historical information associated with the historical files indicating whether a particular file is malicious corresponds to a VirusTotal® (VT) score. If the VT score for a particular file is greater than 0, the particular file is considered malicious by the third-party service. In some embodiments, historical information associated with the historical files indicating whether a particular file is malicious corresponds to a social score, such as a community-based score or rating (e.g., a reputation score), indicating that the file is malicious or likely to be malicious. The historical information (e.g., from a third-party service, a community-based score, etc.) indicates whether the particular file is considered malicious by other vendors or cybersecurity organizations.

[0065] The system 200 may determine (e.g., calculate) a hash or signature corresponding to a file (e.g., an unmanaged Imphash) and perform a lookup against historical information (e.g., whitelists, blacklists, etc.). In some implementations, the prediction module 245 corresponds to or is similar to the prediction engine 176. The system 200 (e.g., the prediction module 245) may query a third party (e.g., a third-party service) via the communication interface 205 for historical information about a file (or a set of files or hashes / signatures for files previously deemed malicious or benign). The system 200 (e.g., the prediction module 245) may query the third party at predefined intervals (e.g., customer-specified intervals, etc.). As one example, the prediction module 245 may query the third party for registration information for newly analyzed files daily (or every day during the business week).

[0066] In some embodiments, the system 200 includes a notification module 250. The system 200 uses the notification module 250 to provide an indication of whether a file is malicious or not. For example, the notification module 250 obtains an indication of whether a file is malicious or not (or the likelihood that the file is malicious) from the prediction module 245 and provides the indication of whether the file is malicious or not to one or more security entities and / or one or more endpoints. As another example, the notification module 250 provides updates to a file whitelist and / or a file blacklist to one or more security entities (e.g., firewalls), nodes, or endpoints (e.g., client terminals). According to various embodiments, the notification module 250 obtains a hash, signature, or other unique identifier associated with a file (e.g., an unmanaged Imphash corresponding to the file) and provides an indication of whether the file is malicious or not in relation to the hash, signature, or other unique identifier associated with the file.

[0067] According to various embodiments, the hash of the file corresponds to a hash using a default hash function (e.g., an unmanaged Imphash using an MD5 hash function, an MD5 hash of the file, etc.). The security entity or endpoint may calculate a hash of a received file (e.g., an attachment, etc.). The security entity or endpoint may determine whether the calculated hash corresponding to the file is included within a set, such as a whitelist of benign files and / or a blacklist of malicious files. If the signature for the malware (e.g., the hash of the received file) is included in a set of signatures for malicious files (e.g., a blacklist of malicious files), the security entity or endpoint may prevent the malware from being transmitted to the endpoint (e.g., a client device) and / or, accordingly, prevent the malware from being opened or executed.

[0068] According to various embodiments, storage 215 includes one or more of file system data 260, hash data 262, and / or cache data 264. Storage 215 includes shared storage (e.g., a network storage system), and / or database data, and / or user activity data.

[0069] In some embodiments, file system data 260 comprises one or more data sets (e.g., a database of files and / or file attributes, a mapping of malicious indicators to files or hashes, unmanaged Impashes, file signatures or other unique identifiers, a mapping of benign file indicators to files or hashes, file signatures or other unique identifiers, etc.). File system data 260 includes data such as historical information about files (e.g., maliciousness of files), a whitelist of files that are considered safe (e.g., not suspicious), a blacklist of files that are considered suspicious or malicious (e.g., files that exceed a predefined / pre-configured likelihood threshold to be considered malicious), information associated with suspicious or malicious files, etc.

[0070] Hash data 262 includes data about one or more files, such as hash values ​​for the one or more files. In some embodiments, hash data 262 includes unmanaged Impashes for files, such as files being analyzed by system 200 to determine whether the files are malicious, or historical data sets that have previously been evaluated as malicious, such as by a third party. Hash data 262 includes a mapping of hash values ​​(unmanaged Impashes) to malicious indications (e.g., indications that the corresponding is malicious or benign, etc.). In some embodiments, hash data 262 includes relationships and associations between files or information related to files (e.g., attributes such as script, bytes, structure, etc.) and indications or likelihoods that the files are malicious or benign. For example, hash data 262 includes a mapping of hash values ​​(unmanaged Impashes) to indications of maliciousness (e.g., indications that the corresponding is malicious or benign, etc.).

[0071] Cache data 264 includes information regarding predictions of whether a file is malicious or not. In one example, predictive cache data 264 stores an indication of whether one or more files are malicious or not.

[0072] According to various embodiments, memory 220 includes executing application data 270. Executing application data 270 includes data obtained or used in connection with executing an application, such as an application that performs a hash function or an application that extracts information from a file. In embodiments, the applications include one or more applications that perform one or more of: receiving and / or executing a query or task; generating a report and / or configuration of information responsive to the executed query or task; and / or providing information responsive to the query or task to a user. Other applications include any other suitable applications (e.g., index maintenance applications, communication applications, machine learning model applications, applications for detecting suspicious traffic, document creation applications, report creation applications, user interface applications, data analysis applications, anomaly detection applications, user authentication applications, security policy management / update applications, etc.).

[0073] 3A is a diagram of an ImplMap table for a .NET header for an exemplary .NET file. In table 300 shown in FIG. 3A, an ImplMap table for a 32-bit DLL sample is provided. In some embodiments, the ImplMap table for the sample is obtained by inputting the 32-bit DLL sample into a debugger and / or .NET assembly editor. An example of such a debugger and / or .NET assembly editor is dnSpy. Various other debuggers and / or .NET assembly editors may be implemented.

[0074] According to various embodiments, the system determines an index into the #Strings stream based at least in part on the ImplMap table. In some embodiments, the index into the #Strings stream corresponds to the ImportName table. The #Strings stream corresponds to an array of null-terminated strings, which is where the majority of strings in a .NET file typically reside. The system determines the index into the #Strings stream using a column labeled ImportName. The name of the function may be determined using the index value from the ImportName column. In table 300, the name of the function that corresponds to the value of ImportName is provided in the Information column.

[0075] In response to determining the index value from the ImportName and / or the function name of the imported function, the system determines a library name for the corresponding library (e.g., a DLL). In some embodiments, the system determines the library (e.g., library name) based at least in part on the ModuleRef table of the .NET file.

[0076] Figure 3B is an illustration of a ModuleRef table for an example .NET file. Table 310 shown in Figure 3B provides a ModuleRef table for a 32-bit DLL sample that was analyzed with respect to table 300 of Figure 3A. In some embodiments, the ModuleRef table for the sample is obtained by entering the 32-bit DLL sample into a debugger and / or a .NET assembly editor.

[0077] According to various embodiments, the system uses the index value from the ImportName field (e.g., column) of the ImplMap table as an index to determine the corresponding library (e.g., library name). The system uses the index value as a lookup in the Name column of table 310. For example, the Name column is an index into the #Strings stream. The Info column of the ModuleRef table contains an indication of the field. For example, the library name corresponding to index value 0x18F3 in the Name column is kernel32.dll.

[0078] In connection with determining the unmanaged Impash corresponding to the .NET file, the system determines a list of unmanaged functions. The list of unmanaged functions is generated using a predefined format or syntax. For example, the system obtains the library name corresponding to the import function and removes the extension. The system determines whether the library has a ".dll" extension, and if so, the system removes the extension. As another example, the system formats the function name and library name to convert any uppercase characters to lowercase. In some embodiments, the system constructs a string that corresponds to a combination of the function name of the import function (e.g., the unmanaged import function) and the library name corresponding to the import function. For example, the system constructs the string in a manner that appends the library name to the function name, and a predefined separator (e.g., ".") is included between the library name and the function name. According to various embodiments, the system: <libraryname> . <functionname>The system then adds the string to a list of unmanaged import functions (e.g., the list from which unmanaged Imphash is determined).

[0079] Using the exemplary sample corresponding to table 300 of Figure 3A and table 310 of Figure 3B, the list of library-function name pairs is as follows: kernel32.createprocess, kernel32.getthreadcontext, kernel32.wow64getthreadcontext, kernel32.setthreadcontext, kernel32.wow64setthreadcontext, kernel32.readprocessmemory, kernel32.writeprocessmemory, ntdll.ntunmapviewofsection, kernel32.virtualallocex, kernel32.resumethread, kernel32.loadlibrary, kernel32.getprocaddress. Entries in the list may be separated by a predefined separator, such as a comma, semicolon, or colon.

[0080] According to various embodiments, in response to determining the list of unmanaged import functions for the .NET file, the system performs a hash of the list using a predefined hash function (e.g., MD5, SHA1, SHA-256, etc.). As one example, using the samples analyzed in table 300 of FIG. 3A and table 310 of FIG. 3B, an unmanaged Imphash of the list of unmanaged import functions (using SHA-256 as the hash function) is: It is 4b386faf53783c4fd17de6c043fd31374302a4455456b4af3d78abd74c865ff8.

[0081] FIG. 3C is a diagram of an ImplMap table for a .NET header for an exemplary .NET file. In table 320 shown in FIG. 3C, an ImplMap table for a sample 32-bit EXE is provided. The 32-bit EXE was created using the Visual C++ compiler and C++ / CLI extensions. In some embodiments, the sample ImplMap table is obtained by inputting the 32-bit DLL sample into a debugger and / or .NET assembly editor. One example of such a debugger and / or .NET assembly editor is dnSpy. Various other debuggers and / or .NET assembly editors may be implemented.

[0082] As shown in FIG. 3C, the first three rows of table 320 have values ​​included in the Info column. Thus, the process described in connection with table 300 of FIG. 3A and table 310 of FIG. 3B may be performed to determine the function name and corresponding library name (e.g., to determine the library-function name pair) for the first three rows. However, the remaining rows of the ImplMap table of FIG. 3C have null values ​​or zeros. The null values ​​or zero entries in the remaining rows may occur because the corresponding functions are not used by the sample creator, but are instead part of the C++ / CLI-created runtime methods used internally. In some embodiments, the system determines the function name and library name based on the file's MethodDef table. For example, the system uses the value included in the MethodForward column of the ImplMap table (e.g., table 320) as an index into the MethodDef table. As one example, the MemberForward value is referred to as a coded index into the MethodDef table (e.g., coded indexes are defined in the .NET standard ECMA-335).

[0083] According to various embodiments, the system obtains values ​​from the remaining rows of the MethodForward column of the ImplMap table of Figure 3C, decodes the values ​​obtained from the MethodForward column, and uses the decoded values ​​as an index into the MethodDef table. As one example, the value from the fourth row of the MemberForward column is 0x99, which decodes to correspond to 76. Thus, 76 is used as the index value to determine information from the MethodDef table.

[0084] Figure 3D is an illustration of a MethodDef table for an exemplary .NET file. Table 330 shown in Figure 3D provides a MethodDef table for a sample that was analyzed with respect to table 320 of Figure 3C. In some embodiments, the MethodDef table for the sample is obtained by entering the sample into a debugger and / or a .NET assembly editor.

[0085] Using the index value obtained from the MethodForward column of ImplMap, the system determines an index into the #Strings stream. For example, the system uses the index value obtained from the MethodForward column of ImplMap as a lookup in the Name column of the MethodDef table. The index value in the Name column, which corresponds to index 76 from the MethodForward column, is 0x1831. As shown in table 330, the Info column of the MethodDef table indicates that the function name is _amsg_exit.

[0086] Figure 3E is an illustration of a ModuleRef table for an example .NET file. Table 340 shown in Figure 3E provides a sample ModuleRef table that was analyzed with respect to table 320 of Figure 3C. In some embodiments, the sample ModuleRef table is obtained by entering the sample into a debugger and / or a .NET assembly editor.

[0087] According to various embodiments, the system determines the library name in response to determining the function name (e.g., the function name obtained from the MethodDef table). For example, the system performs a lookup in an ImplMap table (e.g., table 320 of FIG. 3C ) and determines that the value in the ImportScope column is 2 for the remaining rows. The system uses the index value 2 from the ImportScope column as an index into the ModuleRef table. In response to performing a lookup in a ModuleRef table (e.g., table 340) using the index value 2 (e.g., from the ImportScope column of the ImplMap table), the system determines that the value in the Name column is also 0. Thus, the system determines that ModuleRef does not provide an indication of a library name.

[0088] According to various embodiments, in response to determining that the ModuleRef does not provide an indication of the library name corresponding to the function, the system determines to use the function name retrieved from the MethodDef table and parse the import table in the PE header. The import table in the PE header contains all statically used functions of the file with their paired corresponding library name (DLL) in which the statically used function resides. For example, the system uses a PE header parser to parse the import table in the PE header. One example of a PE header parser is pefile, a PE header parser coded in Python (e.g., an open source project called pefile). In some embodiments, the system performs a one-to-one (1:1) comparison of the function name retrieved from the MethodDef table with the functions in the import table of the PE header. As one example, a file written in C++ (such as mixed assembly) can have so-called qualified names as function names in the import table. The process of creating these names is known as name mangling. Such qualified function names are automatically created by the C++ compiler for all C++ functions unless the function is defined as extern "C".

[0089] Figure 3F is a diagram of an Import table for an exemplary .NET file. In the example shown in Figure 3F, table 350 is the Import table contained in the PE header of the .NET file.

[0090] 3G is a diagram of a MethodDef table for an exemplary .NET file. In the example shown, table 360 ​​is the MethodDef table of the .NET file. In some embodiments, in response to the system determining that a function name obtained from the MethodDef table matches a function name in an import table included in the PE header, the system obtains a corresponding library name from the import table. According to various embodiments, the system performs a lookup of the matching function name between the MethodDef and the import table included in the PE header to obtain the corresponding library name.

[0091] In connection with determining the unmanaged Impash corresponding to the .NET file, the system determines a list of unmanaged functions. The list of unmanaged functions is generated using a predefined format or syntax. For example, the system obtains the library name corresponding to the import function and removes the extension. The system determines whether the library has a ".dll" extension, and if so, the system removes the extension. As another example, the system formats the function name and library name to convert any uppercase characters to lowercase. In some embodiments, the system constructs a string that corresponds to a combination of the function name of the import function (e.g., the unmanaged import function) and the library name corresponding to the import function. For example, the system constructs the string in a manner that appends the library name to the function name, and a predefined separator (e.g., ".") is included between the library name and the function name. According to various embodiments, the system: <libraryname> . <functionname>The system then adds the string to a list of unmanaged import functions (e.g., the list from which unmanaged Imphash was determined).

[0092] Using the exemplary sample corresponding to table 300 of FIG. 3A and table 310 of FIG. 3B, the list of library-function name pairs is as follows: ntdll.zwallocatevirtualmemory, ntdll.zwfreevirtualmemory, ntdll.ldrgetprocedureaddress, msvcr80.amsg_exit, kernel32.sleep, . <crtimplementationdetails>.throwmoduleloadexception、. <crtimplementationdetails>.throwmoduleloadexception、. <crtimplementationdetails>.dodlllanguagesupportvalidation、. <crtimplementationdetails>.thrownestedmoduleloadexception、. <crtimplementationdetails>.registermoduleuninitializer、. <crtimplementationdetails>.docallbackindefaultdomain, msvcr80._cexit, msvcr80._encode_pointer, msvcr80._decode_pointer, msvcr80._encoded_null, msvcr80._frameunwindfilter. Entries in the list may be separated by a predefined separator, such as a comma, semicolon, colon, etc. Library Function Pairs <crtimplementationdetails>.throwmoduleloadexception is included twice because the functions are so-called overloaded functions. Such functions have the same name but differ in their parameter types, number, or return value. They are therefore different functions.

[0093] According to various embodiments, in response to determining the list of unmanaged import functions for the .NET file, the system performs a hash of the list using a predefined hash function (e.g., MD5, SHA1, SHA-256, etc.). As one example, using the samples analyzed in table 300 of FIG. 3A and table 310 of FIG. 3B, the unmanaged Imphash of the list of unmanaged import functions (using SHA-256 as the hash function) is: It is cd2f27b642a85c3f0c10db4e887d504d3b4c0882f9264994367c0c9b4ea7a537.

[0094] In some embodiments, the system converts or formats the list according to a predefined format. For example, a list of library<->function (<->mappingflags) name pairs is converted into a comma-separated string. The system creates a comma-separated string with a single list item (library<->function pair). In response to converting / creating a comma-separated string with a single list item, the system makes a decision regarding such string (e.g., computes a hash).

[0095] FIG. 4 is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 400 is at least partially implemented by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 400 may be implemented by one or more servers, such as those associated with providing services to a network (e.g., network endpoints such as security entities and / or client devices). In some implementations, process 400 may be implemented by a security entity (e.g., a firewall), such as those associated with enforcing security policies regarding files communicated over or within a network. In some implementations, process 400 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as those associated with executing or opening a file, such as an email attachment.

[0096] At 410, a sample is received. In some embodiments, the system receives a sample (e.g., a .NET file) from a security entity (e.g., a firewall), an endpoint (e.g., a client device), or the like. For example, in response to determining that a file is attached to a communication, such as an email or instant message, the security entity or endpoint provides (e.g., sends) the file to the system. The sample may be received in association with a request to determine whether a file is malicious.

[0097] In cases where process 400 is performed by a security entity, the sample may be received in connection with routing traffic to an applicable network endpoint (e.g., a firewall obtains a sample from an email attachment of an email directed to a client device). In cases where process 400 is implemented by a client device, the sample may be received by an application or layer that monitors incoming / outgoing information. For example, a process (e.g., an application, an operating system process, etc.) may run in the background to monitor and obtain email attachments, files exchanged via instant messaging programs, etc.

[0098] At 420, the imported API function names are obtained using the sample's .NET header. In some embodiments, in response to receiving a sample and / or a request to evaluate whether the sample (e.g., a .NET file) is malicious, the system analyzes the sample to obtain information associated with (e.g., contained in) the sample's .NET header.

[0099] According to various embodiments, the system determines a .NET header and obtains imported functions imported (or referenced) by the .NET header. For example, the system obtains imported API function names based at least in part on the .NET header of the .NET file. The system obtains one or more data streams included in the .NET header and / or one or more tables included in (or referenced by) the .NET header. For example, the system obtains a #Strings stream included in the .NET header. As another example, the system obtains an ImplMap from the .NET file (e.g., from the .NET header). The ImplMap may include various information regarding any imported unmanaged functions of the .NET file. In some embodiments, the system determines a set of imported functions (e.g., imported API function names) that are imported into the .NET file.

[0100] In some embodiments, the system determines (e.g., obtains) a set of unmanaged functions contained in or referenced by a .NET file, such as a list of unmanaged functions imported via the .NET header of the .NET file. For example, the system determines a set of unmanaged imported functions from a set of imported functions (e.g., imported API function names) imported into the .NET file. The system uses information contained in (or referenced by) the .NET header to determine the unmanaged code or functions (e.g., unmanaged functions and corresponding libraries). In some embodiments, the system determines a set of used unmanaged win32 API functions imported into the .NET file.

[0101] At 430, a hash of the list of unmanaged imported API function names is determined. In some embodiments, in response to obtaining the imported API function names, the system determines (e.g., calculates) a hash of the list of unmanaged imported API function names. For example, the system calculates an unmanaged Imphash corresponding to the .NET file.

[0102] In conjunction with determining the hash of the list of unmanaged imported API function names, the system determines a list of the set of unmanaged imported functions (or unmanaged function names) and / or corresponding libraries imported into the .NET file and determines a hash of such list. The list of the set of unmanaged imported functions and / or corresponding libraries is determined according to a predefined order. For example, the ordering of the imported unmanaged functions and / or corresponding libraries corresponds to the order in which the unmanaged functions are included in elements of the .NET header (e.g., the order in which the unmanaged functions are included in #Strings streams and / or tables included in or referenced by .NET tables). Various other orders in which the unmanaged functions are added to the list (or the list is arranged) may be implemented. The system formats the list and / or the unmanaged functions (e.g., unmanaged function names and / or corresponding libraries) according to a predefined format or syntax. Examples of predefined formats include (i) a lowercase alphanumeric string, (ii) removal of the file extension, (iii) removal of the library extension (e.g., removing .dll from the corresponding library name), (iv) appending the unmanaged function name and the corresponding library, and (v) using a predefined separator between the unmanaged function name and the corresponding library. In some embodiments, the system appends the function name (e.g., the unmanaged function name) to the corresponding library and separates the function name from the corresponding library by a dot or period (e.g., "."). In response to determining the string by appending the function name and the library (e.g., with a predefined separator such as "."), the system adds such an entry to a list of the set of unmanaged imported functions and / or corresponding libraries.

[0103] According to various embodiments, the system determines a hash for the list of unmanaged import functions and / or sets of corresponding libraries. Various hash functions can be used in connection with determining the hash. Examples of hash functions include a SHA-256 hash function, an MD5 hash function, a SHA-1 hash function, etc. Various other hash functions can be implemented. The system uses the hash function to determine an unmanaged Imphash corresponding to the .NET file.

[0104] At 440, a determination is made as to whether the sample is malicious. In some embodiments, in response to determining the unmanaged imported API function names, the system uses a hash (e.g., an unmanaged Imphash) in connection with determining whether the sample is malicious.

[0105] In some embodiments, the system uses an unmanaged Imphash corresponding to the .NET file in connection with determining whether the .NET file is malicious. As an example, in response to determining an unmanaged Imphash corresponding to the .NET file, the system determines whether the unmanaged Imphash matches an unmanaged Imphash of a file deemed malicious. If the unmanaged Imphash for the sample (e.g., the file being analyzed) matches an unmanaged blacklist of malicious files (e.g., a record included in an Imphash list of malicious files) in the historical dataset, the system considers the sample malicious. As an example, in response to determining an unmanaged Imphash corresponding to the .NET file, the system determines whether the unmanaged Imphash matches an unmanaged Imphash of a file deemed benign. If the unmanaged Imphash for the sample (e.g., the file being analyzed) matches an unmanaged Imphash of a benign file (e.g., a record included in a whitelist of benign files) in the historical dataset, the system considers the sample benign. In some embodiments, the system determines whether information about a particular file (e.g., an unmanaged Imphash corresponding to a .NET file being analyzed) is included in the historical file dataset, and whether the particular file (e.g., a VirusTotal TM The system may determine historical information associated with the historical dataset that is indicative of whether a particular file is malicious, based on a third-party service (such as VirusTotal). As one example, in response to determining that information about a particular file is not included in or available in the dataset of historical files and historical information, the system may consider the file to be benign (e.g., consider the file to be not malicious). An example of historical information associated with the historical files that is indicative of whether a particular file is malicious is VirusTotal. TM The historical information associated with a historical file corresponds to a social score, such as a community-based score or rating (e.g., a reputation score), that indicates whether a file is malicious or likely to be malicious. The historical information (e.g., from a third-party service, a community-based score, etc.) indicates whether other vendors or cybersecurity organizations consider a particular file to be malicious.

[0106] In response to determining at 440 that the sample is malicious, process 400 proceeds to 450 where an indication that the sample is malicious is provided.

[0107] In response to determining that the sample is malicious at 440, process 400 proceeds to 450 where an indication that the sample is malicious is provided. For example, the indication that the sample is malicious may be provided to a component from which the sample was received. As one example, the system provides the indication that the sample is malicious to a security entity. As another example, the system provides the indication that the sample is malicious to a client device. As one example, security provides the indication that the sample is malicious to a client device. In some embodiments, the indication that the sample is malicious is provided to a user, such as a user of the client device and / or a network administrator.

[0108] According to various embodiments, active measures may be taken in response to receiving an indication that a sample is malicious. The active measures may be taken in accordance with (e.g., based at least in part on) one or more security policies. As one example, the one or more security policies may be pre-configured by a network administrator, a customer (e.g., an organization / company) for a service that provides detection of malicious files, etc. Examples of active measures that may be taken include: isolating the file (e.g., quarantining the file), deleting the file, prompting the user to warn the user that a malicious file has been detected, providing a prompt to the user when the device attempts to open or execute the file, blocking transmission of the file, updating a blacklist of malicious files (e.g., mapping a hash of the file to an indication that the file is malicious, etc.).

[0109] In response to determining that the sample is not malicious at 440, process 400 proceeds to 460. In some embodiments, in response to determining that the sample is not malicious, the mapping of the file (or hash / signature of the file) to an indication that the file is not malicious is updated. For example, a whitelist of benign files is updated to include the sample or a hash, signature, or other unique identifier associated with the sample.

[0110] At 460, a determination is made as to whether process 400 is complete. In some embodiments, in response to determining that no more samples should be analyzed (e.g., no more predictions are required for the file), process 400 is determined to be complete, an administrator indicates that process 400 should be paused or stopped, etc. In response to determining that process 400 is complete, process 400 terminates. In response to determining that process 400 is not complete, process 400 returns to 410.

[0111] FIG. 5 is a flow chart of a method for determining whether a file is malicious, according to various embodiments. In some embodiments, process 500 is implemented, at least in part, by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 500 may be implemented by one or more servers, such as in association with providing services to a network (e.g., security entities and / or network endpoints, such as client devices). In some implementations, process 500 may be implemented by a security entity (e.g., a firewall), such as in association with enforcing security policies regarding files communicated over or within a network. In some implementations, process 500 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in association with executing or opening a file, such as an email attachment.

[0112] According to various embodiments, process 500 is invoked in conjunction with 440 of process 400 of FIG.

[0113] At 510, a hash of the list is obtained. In some embodiments, the system obtains (e.g., receives, determines, etc.) an unmanaged Imphash. For example, the system receives a hash of a list of unmanaged imported API function names.

[0114] At 520, the hash is used in conjunction with a query of the mapping. In response to receiving the hash of the list (e.g., the unmanaged Impashes), the system performs a lookup against a historical dataset of malicious and / or benign files. For example, the historical dataset includes an association between the unmanaged Impashes and an indication of whether the corresponding file is malicious or benign.

[0115] In some embodiments, the system uses an unmanaged Imphash corresponding to the .NET file in connection with determining whether the .NET file is malicious. As one example, in response to determining an unmanaged Imphash corresponding to the .NET file, the system determines whether the unmanaged Imphash matches an unmanaged Imphash of a file deemed malicious. As one example, in response to determining an unmanaged Imphash corresponding to the .NET file, the system determines whether the unmanaged Imphash matches an unmanaged Imphash of a file deemed benign. In some embodiments, the system uses information about a particular file (e.g., an unmanaged Imphash corresponding to the .NET file being analyzed) from a historical file dataset and a historical dataset indicating whether a particular file is malicious (e.g., VirusTotal ... TM As one example, in response to determining that information about a particular file is not included or available in the dataset of historical files and historical information, the system considers the file to be benign (e.g., considers the file not malicious). An example of historical information associated with the historical files indicating whether a particular file is malicious corresponds to a VirusTotal® (VT) score. If the VT score for a particular file is greater than 0, the particular file is considered malicious by the third-party service. In some embodiments, historical information associated with the historical files indicating whether a particular file is malicious corresponds to a social score, such as a community-based score or rating (e.g., a reputation score), indicating that the file is malicious or likely to be malicious. The historical information (e.g., from a third-party service, a community-based score, etc.) indicates whether the particular file is considered malicious by other vendors or cybersecurity organizations.

[0116] At 530, a determination is made as to whether the mapping indicates that the hash corresponds to a malicious file.

[0117] In response to determining at 530 that the mapping indicates that the hash corresponds to a malicious file, process 500 proceeds to 540, where the sample is determined to be malicious.

[0118] In response to determining at 530 that the mapping indicates that the hash does not correspond to a malicious file, process 500 proceeds to 550, where it is determined that the sample is not malicious. In some embodiments, the system determines that the sample is benign in response to determining that the mapping of hashes to files does not include an indication that the hash is mapped to a malicious file. As one example, the system determines that the hash is not included in the mapping of hashes to malicious files. As another example, the system determines that the mapping does not include a record mapped to a malicious file (or an indication of a malicious file).

[0119] If the unmanaged Imphash of a sample (e.g., the file being analyzed) matches an unmanaged blacklist of malicious files in the historical dataset (e.g., records included in the Imphash list of malicious files), the system considers the sample to be malicious.

[0120] If the unmanaged Imphash of a sample (e.g., a file being analyzed) matches the unmanaged Imphash of a benign file in the historical dataset (e.g., a record included in a whitelist of benign files), the system considers the sample to be benign. In some embodiments, in response to determining that information about a particular file is not included or available in the dataset of historical files and information, the system considers the file to be benign (e.g., considers the file to be not malicious).

[0121] At 560, a maliciousness result is provided. In some embodiments, the system provides an indication that the hash corresponds to a malicious file. For example, the system provides an indication that the file corresponding to the hash is malicious.

[0122] At 570, a determination is made as to whether process 500 is complete. In some embodiments, process 500 is determined to be complete in response to determining that no more hashes should be analyzed (e.g., no more predictions are needed for the file), an administrator indicates that process 500 should be paused or stopped, etc. In response to determining that process 500 is complete, process 500 terminates. In response to determining that process 500 is not complete, process 500 returns to 510.

[0123] FIG. 6 is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 600 is implemented, at least in part, by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 600 may be implemented by one or more servers, such as in association with providing services to a network (e.g., security entities and / or network endpoints, such as client devices). In some implementations, process 600 may be implemented by a security entity (e.g., a firewall), such as in association with enforcing security policies regarding files communicated over or within a network. In some implementations, process 600 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in association with executing or opening a file, such as an email attachment.

[0124] At 602, samples are received.

[0125] At 604, a .NET assembly corresponding to the sample is obtained. In some embodiments, the sample is compressed (e.g., in ZIP format, etc.) and the .NET assembly is extracted from the compressed file. In some embodiments, obtaining the .NET assembly includes determining that the sample is a .NET file.

[0126] At 606, a determination is made as to whether the .NET assembly includes a ModuleRef table. In response to determining that the .NET assembly does not include a ModuleRef table, process 600 ends. Conversely, in response to determining that the .NET assembly does include a ModuleRef table, process 600 proceeds to 608.

[0127] At 608, a determination is made as to whether the .NET assembly includes an ImplMap table. In response to determining that the .NET assembly does not include an ImplMap table, process 600 ends. Conversely, in response to determining that the .NET assembly does include an ImplMap table, process 600 proceeds to 610.

[0128] At 610, an ImportName value is obtained. In some embodiments, the system obtains the ImplMap value from the ImportName column of the ImportName table. For example, the system obtains the ImportName value from a corresponding row (e.g., a selected row) of the ImportName column. In some embodiments, the system iterates through the rows of ImportName to obtain the value of each corresponding row of the ImportName column.

[0129] At 612, a determination is made whether the ImportName value obtained at 610 is equal to 0. In response to determining that the ImportName value obtained at 610 is equal to 0, process 600 proceeds to 626. In response to determining that the ImportName value obtained at 610 is not equal to 0, process 600 proceeds to 614.

[0130] The function name is obtained from the #Strings stream at 614. In some embodiments, the system uses the selected line to obtain the function name from the #Strings stream of the .NET assembly.

[0131] At 616, a value from the ImportScope column is obtained. In some embodiments, the system obtains a value from the ImportScope column of the ImplMap table. The system obtains the ImplMap table using the .NET header (e.g., the .NET header includes the ImplMap table). The value of the ImportScope column is obtained from the selected row (e.g., the row in the ImplMap table from which the ImportName value is obtained and / or the row in the Info column from which the #Strings stream information is obtained). In some embodiments, the value from the ImportScope column is used as an index in connection with performing a lookup into the ModuleRef table (e.g., for the name of the corresponding library).

[0132] At 618, the ImportScope value is used as a row index in the ModuleRef table to obtain the value. In some embodiments, the system uses the .NET header to obtain the ModuleRef table (e.g., the .NET header contains the ModuleRef table). The system performs a lookup in the ModuleRef table using the value obtained from the ImportScope column as an index. For example, the system uses the value obtained from the ImportScope column to determine the row in the ModuleRef table from which the system should obtain a value from the name column. In some embodiments, the value obtained from the name column of the ModuleRef table is used as an index into the #Strings stream.

[0133] At 620, the library name is retrieved from the #Strings stream. In some embodiments, the system retrieves the #Strings stream using the .NET header (e.g., the .NET header contains the #Strings stream). The system performs a lookup in the #Strings stream using the value retrieved from the name column as an index.

[0134] At 624, a string corresponding to the library name-function name pair is added to a list. For example, the library name-function name pair is added to a list of unmanaged imported functions. In some embodiments, the system generates the string according to a predefined format or syntax.

[0135] At 626, a determination is made whether the .NET assembly includes a MethodDef table. In response to determining that the .NET assembly does not include a MethodDef table, process 600 proceeds to 6, where the system assumes that the .NET header has an empty function name. Conversely, in response to determining that the .NET assembly does include a MethodDef table, process 600 proceeds to 628.

[0136] At 628, a value is obtained from the MemberForwarded column of the ImplMap table. The system uses the .NET header to obtain the ImplMap table (e.g., the .NET header contains the ImplMap table). The value of the MemberForwarded column is obtained from the selected row (e.g., the row of the ImplMap table from which the MemberForwarded value is obtained). In some embodiments, the value from the MemberForwarded column is used as an index in connection with performing a lookup into the ModuleRef table (e.g., for the name of the corresponding library).

[0137] At 630, the MemberForwarded value is used as a row index in the ModuleRef table to obtain the value. In some embodiments, the system uses the .NET header to obtain the ModuleRef table (e.g., the .NET header contains the ModuleRef table). The system performs a lookup in the ModuleRef table using the value obtained from the MemberForwarded column as the index. For example, the system uses the value obtained from the Name column to determine the row in the ModuleRef table from which the system should obtain the value, from the #Strings stream.

[0138] At 632, the function name is obtained from the #Strings stream. In some embodiments, the system obtains the #Strings stream using the .NET header (e.g., the .NET header contains the #Strings stream). The system performs a lookup in the #Strings stream using the value obtained from the name column of the ModuleRef table as an index.

[0139] At 636, a determination is made whether the PE header has an import table. In some embodiments, the system determines whether the PE header includes an import table in conjunction with determining a library name that corresponds to a function name (e.g., a function name obtained from the #Strings stream).

[0140] In response to determining at 636 that the PE header does not have an import table, process 600 proceeds to 638 where the system considers the library name to be an empty library name. Conversely, in response to determining at 636 that the PE header does have an import table, process 600 proceeds to 640 where a library name corresponding to the function name is obtained. In some embodiments, the system parses the import table to obtain the library name corresponding to the function name. In response to obtaining the library name, process 600 proceeds to 624.

[0141] After the function name and corresponding library name are added to the list at 624 , the process 600 proceeds to 642 .

[0142] At 642, a determination is made as to whether the population (e.g., generation) of the list is complete. In some embodiments, the population / generation of the list is determined to be complete in response to determining that no more import functions and / or corresponding libraries are added to the list (e.g., no more import functions are included or referenced in the .NET header) and the administrator indicates that the process 600 should be paused, stopped, or the like. In response to determining that no more import functions and / or corresponding libraries are added to the list at 642, the process 600 proceeds to 644, where the system determines (e.g., calculates) a hash of the list (e.g., the list of unmanaged import functions). In response to determining that the process 600 is not complete, the process 600 returns to 602. In some embodiments, in response to calculating the hash (e.g., the unmanaged Imphash), the system determines whether the sample is malicious based at least in part on the unmanaged Imphash. For example, in response to computing the hash, process 500 of FIG. 5 is invoked.

[0143] In some embodiments, the system determines the hash of the list by invoking process 700 of FIG. 7A or process 750 of FIG. 7B.

[0144] FIG. 7A is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 700 is at least partially implemented by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 600 may be implemented by one or more servers, such as in association with providing services to a network (e.g., security entities and / or network endpoints, such as client devices). In some implementations, process 700 may be implemented by a security entity (e.g., a firewall), such as in association with enforcing security policies regarding files communicated over or within a network. In some implementations, process 700 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in association with executing or opening a file, such as an email attachment.

[0145] At 702, a library name and / or a function name are obtained. In some embodiments, the function name and corresponding library name are obtained using a .NET header, such as in connection with generating a list of unmanaged imported functions.

[0146] At 704, a determination is made whether the library name has a file extension. In response to determining that the library name has a file extension at 704, process 700 proceeds to 706, where the file extension is removed. In response to determining that the library name does not have a file extension at 704, process 700 proceeds to 708.

[0147] At 708, the function name and library name are formatted. In some embodiments, the system formats the library name-function name pair according to a predefined format or syntax. As another example, the system formats the function name and library name to convert any uppercase characters to lowercase.

[0148] At 710, the function name and library name are combined. In some embodiments, the system constructs a string that corresponds to the combination of the function name of the imported function (e.g., an unmanaged imported function) and the library name that corresponds to the imported function. For example, the system constructs the string by appending the library name to the function name, and including a default separator (e.g., ".") between the library name and the function name. According to various embodiments, the system constructs the string in the format, i.e. <libraryname> . <functionname>, the system determines the string according to the following: Then, the system adds the string to a list of unmanaged import functions (eg, the list from which the unmanaged Imphash was determined).

[0149] According to various embodiments, various formats or syntaxes may be implemented in association with the system for combining function names and library names. Examples of predefined formats include: (i) a lowercase alphanumeric string, (ii) removal of the file extension, (iii) removal of the library extension (e.g., removing .dll from the corresponding library name), (iv) appending the unmanaged function name and the corresponding library, and (v) using a predefined separator between the unmanaged function name and the corresponding library, (vi) determining the order in which the library name and function name are combined to determine the string (e.g., <libraryname> . <functionname>,or <functionname> . <libraryname>). In some embodiments, the system appends the function name (e.g., the unmanaged function name) to the corresponding library and separates the function name from the corresponding library by a dot or period (e.g., "."). In response to determining a string by appending the function name and the library (e.g., with a default separator such as "."), the system adds such an entry to a list of the set of unmanaged imported functions and / or corresponding libraries. Various other default formats / syntaxes may be implemented.

[0150] At 712, the combination of function name and library name is added to a list of unmanaged imported functions.

[0151] At 714, a determination is made as to whether there are more functions to be added to the list. For example, the system determines whether more unmanaged import functions should be added to the list of unmanaged import functions for the file. In response to determining at 714 that there are no more functions to be added to the list, process 700 proceeds to 716. In response to determining that additional functions should be added to the list, process 700 returns to 702.

[0152] At 716, a hash is calculated for the list. According to various embodiments, the system determines a hash for the list of the set of unmanaged import functions and / or corresponding libraries. Various hash functions can be used in connection with determining the hash. Examples of hash functions include a SHA-256 hash function, an MD5 hash function, a SHA-1 hash function, etc. Various other hash functions can be implemented. The system uses the hash function to determine the unmanaged Imphash corresponding to the .NET file.

[0153] In some embodiments, the system converts or formats the list according to a predefined format. For example, a list of library<->function(<->mappingflags) name pairs is converted to a comma-separated string. Following such an example, instead of computing a hash for the following list: kernel32.createprocess kernel32.getthreadcontext kernel32.wow64getthreadcontext kernel32.setthreadcontext kernel32.wow64setthreadcontext kernel32.readprocessmemory The system creates a comma-separated string with a single list item (library<->function pair), i.e. "kernel32.createprocess, kernel32.getthreadcontext, kernel32.wow64getthreadcontext, kernel32.setthreadcontext, kernel32.wow64setthreadcontext, kernel32.readprocessmemory, ..." In response to converting / creating comma-separated strings with a single list item, the system makes decisions regarding such strings (e.g., computes a hash).

[0154] At 718, the hash is provided. In some embodiments, the system provides the hash to another system or module, such as associated with such a system or module that determines whether the file is malicious. For example, the hash is provided in response to an invocation of process 700.

[0155] At 720, a determination is made as to whether process 700 is complete. In some embodiments, process 700 is determined to be complete in response to determining that no further hashes should be calculated (e.g., no further predictions are required for the file) and an administrator indicates that process 700 should be paused, stopped, or the like. In response to determining that process 700 is complete, process 700 terminates. In response to determining that process 700 is not complete, process 700 returns to 702.

[0156] FIG. 7B is a flow chart of a method for detecting malicious files, according to various embodiments.

[0157] In some embodiments, process 700 is at least partially implemented by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 600 may be implemented by one or more servers, such as in association with providing services to a network (e.g., security entities and / or network endpoints, such as client devices). In some implementations, process 700 may be implemented by a security entity (e.g., a firewall), such as in association with enforcing security policies regarding files communicated over or within a network. In some implementations, process 700 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in association with executing or opening a file, such as an email attachment.

[0158] According to various embodiments, 750 includes additional information about the unmanaged function (e.g., information about how the unmanaged function was defined in the code by the author, etc.), making 750 more rigorous than 700 of FIG. 7A. As one example, the final hash of 750 is also more rigorous and potentially less false positive prone. However, a drawback is that the final hash of 750 potentially hits in fewer malware samples than the final hash of 700.

[0159] At 752, a library name and / or a function name are obtained. In some embodiments, a function name and corresponding library name are obtained using a .NET header, such as in connection with generating a list of unmanaged imported functions.

[0160] At 754, a determination is made whether the library name has a file extension. In response to determining at 754 that the library name has a file extension, process 750 proceeds to 756, where the file extension is removed. In response to determining at 754 that the library name does not have a file extension, process 700 proceeds to 760.

[0161] At 758, the function name and library name are formatted. In some embodiments, the system formats the library name-function name pair according to a predefined format or syntax. As another example, the system formats the function name and library name to convert any uppercase characters to lowercase.

[0162] At 760, a MappingFlags value is obtained. In some embodiments, the system obtains the MappingFlags value from the ImplMap table. For example, the system obtains the MappingFlags value from a row in the ImplMap table that corresponds to the function. The MappingFlags value includes a P / Invoke attribute.

[0163] At 762, the MappingFlags value, the function name, and the library name are combined. In some embodiments, the system constructs a string that corresponds to the combination of the MappingFlags value, the function name of the import function (e.g., the unmanaged import function), and the library name that corresponds to the import function. For example, the system constructs the string to append the MappingFlags value and the library name to the function name, and includes a default separator (e.g., ".") between the library name and the function name. According to various embodiments, the system constructs the string in the format, i.e. <libraryname> . <functionname> . <mappingflags>, the system determines the string according to the following: Then, the system adds the string to a list of unmanaged import functions (eg, the list from which the unmanaged Imphash was determined).

[0164] According to various embodiments, various formats or syntaxes may be implemented in association with the system for combining function names and library names. Examples of predefined formats include (i) a lowercase alphanumeric string, (ii) removal of the file extension, (iii) removal of the library extension (e.g., removing .dll from the corresponding library name), (iv) appending the unmanaged function name and the corresponding library, and (v) using a predefined separator between the unmanaged function name and the corresponding library, (vi) determining the order in which the library name and function name are combined to determine the string (e.g., <libraryname> . <functionname> . <mappingflags> 、 <functionname> . <libraryname> . <mappingflags>, etc. In some embodiments, the system appends the function name (e.g., the unmanaged function name) to the corresponding library and separates the function name from the corresponding library by a dot or period (e.g., "."). In response to determining a string by appending the function name and the library (e.g., with a default separator such as "."), the system adds such an entry to a list of the set of unmanaged imported functions and / or corresponding libraries. Various other default formats / syntaxes may be implemented.

[0165] In 764, the combination of function name and library name is added to the list of unmanaged imported functions.

[0166] At 766, a determination is made as to whether there are more functions to be added to the list. For example, the system determines whether more unmanaged import functions should be added to the list of unmanaged import functions for the file. In response to determining at 766 that there are no more functions to be added to the list, process 750 proceeds to 752. In response to determining that additional functions should be added to the list, process 750 returns to 752.

[0167] At 768, a hash is calculated for the list. According to various embodiments, the system determines a hash for the list of the set of unmanaged import functions and / or corresponding libraries. Various hash functions can be used in connection with determining the hash. Examples of hash functions include a SHA-256 hash function, an MD5 hash function, a SHA-1 hash function, etc. Various other hash functions can be implemented. The system uses the hash function to determine the unmanaged Imphash corresponding to the .NET file.

[0168] In some embodiments, the system converts or formats the list according to a predefined format. For example, a list of library<->function(<->mappingflags) name pairs is converted to a comma-separated string. Following such an example, instead of computing a hash for the following list: kernel32.createprocess kernel32.getthreadcontext kernel32.wow64getthreadcontext kernel32.setthreadcontext kernel32.wow64setthreadcontext kernel32.readprocessmemory The system creates a comma-separated string with a single list item (library<->function pair), i.e. "kernel32.createprocess, kernel32.getthreadcontext, kernel32.wow64getthreadcontext, kernel32.setthreadcontext, kernel32.wow64setthreadcontext, kernel32.readprocessmemory, ..." In response to converting / creating comma-separated strings with a single list item, the system makes decisions regarding such strings (e.g., computes a hash).

[0169] At 770, the hash is provided. In some embodiments, the system provides the hash to another system or module, such as one associated with such a system or module that determines whether the file is malicious. For example, the hash is provided in response to the invocation of process 750.

[0170] At 772, a determination is made as to whether process 750 is complete. In some embodiments, process 750 is determined to be complete in response to determining that no more hashes should be calculated (e.g., no more predictions are required for the file) and an administrator indicates that process 750 should be paused, stopped, or the like. In response to determining that process 750 is complete, process 750 terminates. In response to determining that process 750 is not complete, process 750 returns to 752.

[0171] FIG. 8 is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 800 is at least partially implemented by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 800 may be implemented by one or more servers, such as in association with providing services to a network (e.g., security entities and / or network endpoints, such as client devices). In some implementations, process 800 may be implemented by a security entity (e.g., a firewall), such as in association with enforcing security policies regarding files communicated over or within a network. In some implementations, process 800 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in association with executing or opening a file, such as an email attachment.

[0172] At 810, an indication that the sample is malicious is received. In some embodiments, the system receives an indication that the sample is malicious and the sample or a hash, signature, or other unique identifier associated with the sample. For example, the system may receive an indication that the sample is malicious from a service, such as a security or malware service. The system may receive an indication that the sample is malicious from one or more servers.

[0173] According to various embodiments, the indication that the sample is malicious is received in association with an update to a set of previously identified malicious files, for example, the system receives the indication that the sample is malicious as an update to a blacklist of malicious files.

[0174] At 820, an association between the sample and an indication that the sample is malicious is stored. In response to receiving an indication that the sample is malicious, the system stores the indication that the sample is malicious in association with the sample or an identifier corresponding to the sample to facilitate a lookup (e.g., a local lookup) of whether a subsequently received file is malicious. In some embodiments, the identifier corresponding to the sample stored in association with the indication that the sample is malicious includes a hash of the file (or a portion of the file), a signature of the file (or a portion of the file), or another unique identifier associated with the file. In some embodiments, storing the sample in association with the indication of whether the sample is malicious includes storing an unmanaged Imphash for the .NET file in association with the indication of whether the sample is malicious.

[0175] Traffic is received at 830. The system may obtain traffic, such as in connection with routing traffic in / across a network or mediating traffic into / out of a network such as a firewall, or monitoring email or instant message traffic.

[0176] At 840, a determination is made as to whether the traffic includes a malicious file. In some embodiments, the system obtains a file from the received traffic. For example, the system identifies the file as an attachment to an email, identifies the file as being exchanged between two client devices via an instant messaging program or other file exchange program, etc. In response to obtaining the file from the traffic, the system determines whether the file corresponds to a file included in a set of previously identified malicious files, such as a malicious file blacklist. In response to determining that the file is included in a set of files in the malicious file blacklist, the system determines that the file is malicious (e.g., the system may further determine that the traffic includes a malicious file).

[0177] In some embodiments, the system determines whether the file corresponds to a file included in a set of previously identified benign files, such as a whitelist of benign files. In response to determining that the file is included in the set of files in the whitelist of benign files, the system determines that the file is not malicious (e.g., the system may further determine that the traffic contains a malicious file).

[0178] According to various embodiments, in response to determining that the file is not included in a set of previously identified malicious files (e.g., a blacklist of malicious files) or a set of previously identified benign files (e.g., a whitelist of benign files), the system considers the file to be non-malicious (e.g., benign).

[0179] According to various embodiments, in response to determining that the file is not included in a set of previously identified malicious files (e.g., a blacklist of malicious files) or a set of previously identified benign files (e.g., a whitelist of benign files), the system queries a malicious file detector to determine whether the file is malicious. For example, the system may quarantine the file until a response is received from the malicious file detector as to whether the file is malicious. The malicious file detector may perform an evaluation of whether the file is malicious, such as concurrently with the processing of traffic by the system (e.g., in real-time with a query from the system). The malicious file detector may correspond to malicious file detector 170 of system 100 of FIG. 1 and / or system 200 of FIG. 2.

[0180] In some embodiments, the system determines whether a file is included in a set of previously identified malicious or benign files by computing a hash or determining a signature or other unique identifier associated with the file and performing a lookup in the set of previously identified malicious or benign files for files that match the hash, signature, or other unique identifier. Various hashing techniques may be implemented. According to various embodiments, determining whether a file is included in a set of previously identified malicious or benign files includes determining an unmanaged Imphash corresponding to the file and determining whether the unmanaged Imphash is included in a historical dataset (e.g., a dataset including results of previous determinations of maliciousness).

[0181] In response to determining at 840 that the traffic does not contain a malicious file, process 800 proceeds to 850, where the file is treated as non-malicious traffic / information.

[0182] In response to determining at 840 that the traffic contains a malicious file, process 800 proceeds to 860, where the file is treated as malicious traffic / information. The system can handle the malicious traffic / information based at least in part on one or more policies, such as one or more security policies.

[0183] According to various embodiments, handling of malicious traffic / information of a file may include performing active actions. Active actions may be performed according to (e.g., based at least in part on) one or more security policies. As one example, one or more security policies may be pre-configured by a network administrator, a customer (e.g., an organization / company), etc. for a service that provides detection of malicious files. Active actions that may be performed include isolating the file (e.g., quarantining the file), deleting the file, prompting the user to warn the user that a malicious file has been detected, providing a prompt to the user when the device attempts to open or execute the file, blocking transmission of the file, updating a blacklist of malicious files (e.g., mapping a hash of the file to an indication that the file is malicious), etc.

[0184] At 870, a determination is made as to whether process 800 is complete. In some embodiments, in response to determining that no more samples should be analyzed (e.g., no more predictions are required for the file), process 800 is determined to be complete, an administrator indicates that process 800 should be paused or stopped, etc. In response to determining that process 800 is complete, process 800 terminates. In response to determining that process 800 is not complete, process 800 returns to 810.

[0185] 9 is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 900 is at least partially performed by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 900 may be implemented by a security entity (e.g., a firewall), such as in conjunction with enforcing security policies regarding files communicated over or within a network, and / or an anti-malware application running on a client system, etc. In some implementations, process 900 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in conjunction with executing or opening a file, such as an email attachment.

[0186] At 910, a file is obtained from the traffic. The system may obtain traffic, such as in connection with routing traffic in / across a network or mediating traffic in / out of a network such as a firewall, or monitoring email or instant message traffic. In some embodiments, the system obtains a file from the received traffic. For example, the system identifies a file as an attachment to an email, as a file being exchanged between two client devices via an instant message program or other file exchange program, etc.

[0187] At 920, a signature corresponding to the file is determined. In some embodiments, the system calculates a hash or determines a signature or other unique identifier associated with the file. Various hashing techniques may be implemented. For example, the hashing technique may be determining (e.g., calculating) an MD5 hash for the file. In some embodiments, determining the signature corresponding to the file includes calculating an unmanaged Imphash of the .NET file.

[0188] At 930, a dataset of malicious sample signatures is queried to determine whether a signature corresponding to the file matches a signature from a malicious sample. In some embodiments, the system performs a lookup in the dataset for malicious sample signatures for files that match a hash, signature, or other unique identifier. The dataset of malicious sample signatures may be stored locally on the system or remotely on a storage system accessible to the system.

[0189] According to various embodiments, determining whether a file is included in a set of previously identified malicious files or a set of previously identified benign files includes determining an unmanaged Imphash corresponding to the file and determining whether the unmanaged Imphash is included in a historical dataset (e.g., a dataset including results of previous determinations related to maliciousness).

[0190] At 940, a determination is made whether the file is malicious based at least in part on whether the signature of the file matches the signature of the malicious sample. In some embodiments, the system determines whether the malicious signature dataset includes a record that matches the signature of the file obtained from the traffic. In response to determining that the historical dataset includes an indication that the file corresponding to the unmanaged Imphash is malicious (e.g., the unmanaged Imphash is included in the blacklist of fields), the system considers the file obtained from the traffic at 910 to be malicious.

[0191] At 950, the file is treated according to whether the file is malicious or not. In some embodiments, in response to determining that the file is malicious, the system applies one or more security policies with respect to the file. In some embodiments, in response to determining that the file is not malicious, the system treats the file as benign (e.g., the file is treated as normal traffic).

[0192] At 960, a determination is made as to whether process 900 is complete. In some embodiments, process 900 is determined to be complete in response to determining that no more samples should be analyzed (e.g., no more predictions are needed for the file), an administrator indicates that process 900 should be paused or stopped, etc. In response to determining that process 900 is complete, process 900 ends. In response to determining that process 900 is not complete, process 900 returns to 910.

[0193] FIG. 10 is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 1000 is at least partially performed by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 1000 may be implemented by a security entity (e.g., a firewall), such as in conjunction with enforcing security policies regarding files communicated over or within a network. In some implementations, process 1000 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in conjunction with executing or opening a file, such as an email attachment.

[0194] At 1010, traffic is received. The system may obtain the traffic, such as in connection with routing traffic in / across a network or mediating traffic into / out of a network such as a firewall, or monitoring email or instant message traffic.

[0195] At 1020, a file is obtained from the traffic. In some embodiments, the system obtains a file from the received traffic. For example, the system identifies a file as an attachment to an email, as a file being exchanged between two client devices via an instant messaging program or other file exchange program, etc.

[0196] At 1030, the .NET header of the file is used to obtain the imported API function names. In some embodiments, 1030 corresponds to or is similar to 420 of process 400 of FIG.

[0197] At 1040, the unmanaged functions are determined. In some embodiments, the system determines that the set of unmanaged functions from the imported API function names is obtained using the .NET header of the file. For example, the system determines which of the imported API functions correspond to the unmanaged functions. As one example, at least a portion of the process 600 may be invoked in connection with determining the unmanaged functions.

[0198] At 1050, a determination is made as to whether the file is malicious. In some embodiments, the system determines whether the file is malicious based at least in part on unmanaged functions (e.g., a set of unmanaged functions imported into the file, such as via a .NET header). In some embodiments, 1050 corresponds to or is similar to 440 of process 400 of FIG. 4. In some embodiments, process 500 of FIG. 5 is performed in conjunction with 1050.

[0199] In response to determining that the file is malicious at 1050, process 1000 proceeds to 1060, where one or more security policies are applied with respect to the file. In some embodiments, 1060 corresponds to or is similar to 860 of process 800 of Figure 8. Process 1000 then proceeds to 1070.

[0200] In response to determining that the file is not malicious at 1050, process 1000 proceeds to 1070, where the file is treated as non-malicious traffic. In some embodiments, 1070 corresponds to or is similar to 850 of process 800 of FIG. 8.

[0201] At 1080, a determination is made as to whether process 1000 is complete. In some embodiments, process 1000 is determined to be complete in response to determining that no more samples should be analyzed (e.g., no more predictions of files are required), no more traffic should be analyzed, an administrator indicates that process 1000 should be paused or stopped, etc. In response to determining that process 1000 is complete, process 1000 terminates. In response to determining that process 1000 is not complete, process 1000 returns to 1010.

[0202] FIG. 11 is a flow chart of a method for detecting malicious files, according to various embodiments. In some embodiments, process 1100 is at least partially implemented by system 100 of FIG. 1 and / or system 200 of FIG. 2. In some implementations, process 1100 may be implemented by a security entity (e.g., a firewall), such as in conjunction with enforcing security policies regarding files communicated over or within a network, and / or an anti-malware application running on a client system, etc. In some implementations, process 1100 may be implemented by a client device, such as a laptop, smartphone, personal computer, etc., such as in conjunction with executing or opening a file, such as an email attachment.

[0203] Traffic is received at 1110. In some embodiments, 1110 corresponds to or is similar to 1010 of process 1000 of FIG.

[0204] At 1120, a file is obtained from the traffic. In some embodiments, 1120 corresponds to or is similar to 1020 of process 1000 of FIG.

[0205] At 1130, the imported API function names are obtained using the file's .NET header. In some embodiments, 1130 corresponds to or is similar to 1030 of process 1000 of FIG.

[0206] At 1140, a hash of the list of unmanaged imported API function names is determined. In some embodiments, the system determines the unmanaged functions based at least in part on the imported API function names (e.g., via the .NET header of the file). In some embodiments, the system determines from the imported API function names that a set of unmanaged functions is obtained using the .NET header of the file, the system determines a list of the unmanaged functions, and determines a hash based at least in part on the list. As one example, the list includes unmanaged function names that correspond to the set of unmanaged functions.

[0207] At 1150, a mapping of hashes to files is queried. In some embodiments, the system queries a mapping of hashes to files based at least in part on the hash of the list of unmanaged imported API function names. For example, the system performs a lookup on the mapping of hashes to files to determine whether the mapping includes the hash of the list of unmanaged imported API function names (e.g., whether the mapping includes a record that corresponds to the determined / computed hash). In some embodiments, 1150 corresponds to or is similar to 840 of process 800 of FIG. 8 and / or 930 of process 900 of FIG. 9.

[0208] At 1160, a determination is made as to whether the file is malicious. In some embodiments, 1160 corresponds to or is similar to 1050 of process 1000 of FIG.

[0209] In response to determining that the file is malicious at 1160, process 1100 proceeds to 1170, where one or more security policies are applied with respect to the file. In some embodiments, 1170 corresponds to or is similar to 860 of process 800 of Figure 8. Process 1100 then proceeds to 1190.

[0210] In response to determining at 1160 that the file is not malicious, process 1100 proceeds to 1180, where the file is treated as non-malicious traffic. In some embodiments, 1180 corresponds to or is similar to 850 of process 800 of FIG. 8.

[0211] At 1190, a determination is made as to whether process 1100 is complete. In some embodiments, in response to process 1100 determining that no more samples should be analyzed (e.g., no more predictions of files are required), no more traffic should be analyzed, process 1000 is determined to be complete, an administrator indicates that process 1000 should be paused or stopped, etc. In response to determining that process 1100 is complete, process 1100 terminates. In response to determining that process 1100 is not complete, process 1100 returns to 1110.

[0212] Various examples of the embodiments described herein are described with reference to flow charts. Although the examples may include some steps performed in a particular order, according to various embodiments, various steps may be performed in various orders and / or various steps may be combined into a single step or in parallel.

[0213] Although the foregoing embodiments have been described in some detail for purposes of clarity of understanding, the present invention is not limited to the details provided. There are many alternative ways of implementing the present invention. The disclosed embodiments are illustrative and not restrictive.< / mappingflags> < / libraryname> < / functionname> < / mappingflags> < / functionname> < / libraryname> < / mappingflags> < / functionname> < / libraryname> < / libraryname> < / functionname> < / functionname> < / libraryname> < / functionname> < / libraryname> < / crtimplementationdetails> < / crtimplementationdetails> < / crtimplementationdetails> < / crtimplementationdetails> < / crtimplementationdetails> < / crtimplementationdetails> < / crtimplementationdetails> < / functionname> < / libraryname> < / functionname> < / libraryname>

Claims

1. 1. A system including one or more processors and a memory, The one or more processors: Receive a sample containing a .NET file, Obtaining imported API function names based at least in part on a .NET header of the .NET file; Determine a hash of a list of unmanaged imported API function names, and determining whether the sample is malware based at least in part on a hash of the list of unmanaged imported API function names; It is structured as follows: The memory includes: coupled to the one or more processors; and configured to provide instructions to the one or more processors; system.

2. Obtaining the imported API function names includes: Parsing the .NET header of the .NET file; and extracting the imported API function names from the parsed .NET header; The system of claim 1 , comprising:

3. The imported API function names are extracted from the parsed .NET header based at least in part on an index table. The system of claim 2.

4. The index table includes an ImplMap table that indicates a set of unmanaged methods that are imported in association with execution of the .NET file. The system of claim 3.

5. The imported API function names are extracted from the parsed .NET header based at least in part on a MethodDef table. The system of claim 2.

6. Determining a hash of the list of unmanaged imported API function names includes: determining a set of unmanaged imported API functions based on the imported API function names obtained based at least in part on the .NET header; and generating a hash of the list of unmanaged imported API function names based at least in part on a predefined hash function; The system of claim 1 , comprising:

7. The predetermined hash function includes at least one of a SHA-256 hash algorithm, an MD5 hash algorithm, and a SHA-1 hash algorithm. The system of claim 6.

8. The one or more processors: sending an indication to a security entity that the sample is malicious; It is configured as follows: The system of claim 1 .

9. sending an indication to a security entity that the sample is malicious; updating a blacklist of files deemed malicious, the blacklist of files being updated to include an identifier corresponding to the sample; The system of claim 8 , comprising:

10. The security entity corresponds to a firewall. The system of claim 8.

11. determining whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names is performed in a sandbox environment. The system of claim 1 .

12. Determining whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names is performed at a security entity. The system of claim 1 .

13. The imported API function name is obtained based at least in part on a value corresponding to an ImportName field. The system of claim 1 .

14. in response to determining that a value corresponding to the ImportName field is not equal to zero, Obtaining the imported API function names includes: determining a set of one or more library names based at least in part on a #Strings stream of said .NET file; The system of claim 13 , comprising:

15. in response to determining that the value corresponding to the ImportName field is equal to 0, Obtaining the imported application programming interface function names includes: Getting a value from a row in the MethodDef table; obtaining a function name from the #Strings stream based at least in part on the value from the row of the MethodDef table; determining whether the PE header of the .NET file includes an import table; and in response to determining that a PE header of the .NET file does not include an import table, determining a library name corresponding to the function name based at least in part on the import table; The system of claim 13 , comprising:

16. Determining a library name corresponding to the function name based at least in part on the import table includes: parsing the import table to obtain the library name from the corresponding function name; The system of claim 15.

17. The one or more processors further include: Ensuring that the library names corresponding to the unmanaged functions do not have a file extension; determining a string based at least in part on the library name and the unmanaged function; and adding the string to the list of unmanaged imported API function names; It is configured as follows: The system of claim 1 .

18. The string is: Ensuring that the library name and the name of the unmanaged function do not contain uppercase characters; and appending the name of the unmanaged function to the library name with a predefined separator included between the name of the unmanaged function and the library name; Determined by, 20. The system of claim 17.

19. 1. A method comprising: receiving a sample including a .NET file; obtaining imported API function names based at least in part on a .NET header of the .NET file; determining a hash of a list of unmanaged imported API function names; determining whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names; A method comprising:

20. A computer program stored on a non-transitory computer readable storage medium, the computer program comprising a plurality of computer instructions: The computer instructions, when executed by a processor, cause the computer to: receiving a sample including a .NET file; obtaining imported API function names based at least in part on a .NET header of the .NET file; determining a hash of a list of unmanaged imported API function names; determining whether the sample is malware based at least in part on the hash of the list of unmanaged imported API function names; A computer program that causes the

Citation Information

Patent Citations

  • System and method for categorization of .net applications

    US20190243976A1

  • Securing an application framework from shared library sideload vulnerabilities

    US20210073374A1