Patent Publication Number: US-9904781-B2

Title: Emulating expected network communications to applications in a virtual machine environment

Description:
BACKGROUND 
     This specification generally relates to emulating expected network communications to applications in a virtual machine environment. 
     Virtual machine environments emulate physical hardware components of a computer system (e.g., processors, memory, network interfaces, etc.) in software. In such environments, executing software applications are isolated from hardware resources that could allow for problematic changes affecting other systems. For example, a malicious software program executing in a virtual machine environment may be able to corrupt the emulated memory resources of its own virtual environment, but it will not permitted to make changes outside this emulated “sandbox.” 
     SUMMARY 
     In general, one aspect of the subject matter described in this specification may be embodied in systems, and methods performed by data processing apparatuses that include the actions of executing a software application within the virtual machine environment. The actions can further include, during execution of the software application, detecting a network request sent from the software application within the virtual machine environment, the network request formatted according to a particular network protocol. The actions can further include, in response to detecting the network request: determining an expected response to the network request based on at least one of information included in the network request or the particular network protocol; and providing the expected response to the software application within the virtual machine environment. 
     Implementations can include any, all, or none of the following features. The particular network protocol is Hypertext Transfer Protocol (HTTP). The network request is an HTTP POST request, and the expected response is an HTTP 200 OK response. The network request is an HTTP GET request, and the expected response is an HTTP 200 OK response and includes a data payload generated based on the information included in the network request. The particular network protocol is a peer-to-peer network protocol. The particular network protocol is BitTorrent, the network request is a first Peer Bitfield message, and the expected response is a second Peer Bitfield message. The particular network protocol is BitTorrent, the network request is a Peer Request message, and the expected response is a Peer Piece message. The particular network protocol is The Onion Router (TOR) Hidden Service Protocol. The network request is a TOR CREATE request, and the expected response is a TOR CREATED response. Details of one or more implementations of the subject matter described in this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and potential advantages of the subject matter will become apparent from the description, the drawings, and the claims. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a diagram of an example environment. 
         FIG. 2  is a message flow diagram of an example interaction between the components of the example environment to emulate expected network communications to applications in a virtual machine environment. 
         FIG. 3  is a flow chart of an example process of emulating expected network communications to applications in a virtual machine environment. 
         FIG. 4  is a diagram of computing devices that may be used to implement the systems and methods described in this document. 
     
    
    
     Like reference numbers and designations in the various drawings indicate like elements. 
     DETAILED DESCRIPTION 
     Virtual machine environments (e.g., “sandbox” environments) may be used to analyze the behavior of executing software applications. The present disclosure describes techniques to selectively trigger capture of a video signal produced by the virtual machine environment (e.g., by a virtual display adapter emulating a physical display adapter to an executing software application). Such a capture may be initiating upon identification of a potentially malicious software application (e.g., a virus). For example, if a potentially malicious program is identified, it may be run in a virtual machine instance to observe its behavior. This behavior may include network activity, file access, registry updates, application launches, use of specific APIs or specific API calls, processor and memory utilization, or other types of behavior. Based on the observed behavior, recording of the video signal of the virtual machine may be triggered. For example, if a potential malicious program attempts to access a particular network address or domain (e.g., an address of a known botnet), recording a video signal produced by the virtual machine may be triggered. In another example, if a potential malicious program attempts to change a particular registry setting within the virtual machine, recording of the video signal may be triggered. If the potential malicious program attempts to access a particular file, recording the video signal may be triggered. In some implementations, recording of the video signal may be triggered by an agent running within the virtual machine as described elsewhere in the present disclosure. In some cases, the potential malicious program may be identified automatically, such as by a software application running on the same computer. In such a case, the potential malicious program may be transferred off the particular computer and a virtual machine environment may be set up automatically to analyze the potential malicious program. The particular computer may be quarantined (e.g. isolated from the rest of the network) while this analysis is occurring. 
     As previously stated, the techniques for triggering and managing recording video described herein with respect to a computer connected to the physical network may be adapted and used with respect to a virtual machine environment. For example, rather than running on a separate server or computer, a monitoring program for triggering recording may run on the same computing device as the virtual machine, and may monitor data sent by potential malicious program on virtual network adapters. In some implementations, the monitoring program may be executed by or integrated with a hypervisor program for managing the virtual machine. In some cases, the monitoring program for triggering the recording may execute inside a separate virtual machine running alongside the virtual machine running the potential malicious program. 
     In such a sandbox environment, a “communication sandboxing” or “request sandboxing” technique may also be implemented. Network requests sent by the virtual machine may be intercepted by an external monitoring program, such as a network monitor running on an external computer, or running on the same computing device as the virtual machine. The monitoring program may emulate the expected behavior of the other side of the connection in order to determine how the potential malicious program will behave. For example, a monitoring program may intercept a Hypertext Transfer Protocol (HTTP) POST request from a malicious program running in the virtual machine. The monitoring program may receive and store the data set with the POST request and store it for later analysis. The monitoring program may also respond to the potential malicious program with an expected response, such as an HTTP 200 OK response. By responding this way, the potential malicious program will continue executing as normal as it will treat the request as having completed successfully. By emulating the server side of this interaction in such a manner, the potential malicious program may execute longer, and produce more data for analysis. Also, the data transferred by the potential malicious program is now stored, and may be analyzed to determine what data the potential malicious program was attempting to transfer. In some cases, the monitoring program may be operable to emulate the server side of the connection for many different communications protocols, such as, for example, HTTP, HTTPS, The Onion Router (TOR) Hidden Service Protocol, File Transfer Protocol (FTP), Secure Shell (SSH), Secure Socket Layer (SSL), Secure Copy (SCP), Remote Copy (RCP), Trivial FTP (TFTP), Apple Filing Protocol (AFP), Server Message Block (SMB), Network File System (NFS), WebDAV, and other protocols. The monitoring program may also be operable to emulate a peer in peer-to-peer communications protocols such as BitTorrent, FastTrack, Skype, or other protocols. 
     Another technique, known as “file baiting,” maybe used to attempt to elicit malicious behavior from a potential malicious program. In file baiting, files or other resources containing certain types of information are inserted into the virtual machine. Some malicious programs may scan the computer on which their executing periodically looking for sensitive or other types of information to transfer off of the computer, such as passwords, Social Security numbers, credit card numbers, or other types of information. File baiting involves inserting files with certain attributes or containing certain information into the virtual machine to elicit this behavior. For example, a file called “password.txt” may be created on the desktop to attempt to elicit behavior from the potential malicious program. If the program access the file, an action can be triggered, such as, for example video recording or logging to observe the behavior. In some cases, these baiting techniques may include configuring the virtual machine with various security flaws or misconfigurations that are likely to be exploited by malicious programs. For example, a virtual machine may be initialized without a specific security update installed in order to elicit behavior from the malicious program. The virtual machine may also be configured with default settings, such as default passwords, known to be exploited by malicious programs. 
       FIG. 1  is a diagram of an example environment for emulating expected network communications to applications in a virtual machine environment. The environment  100  includes a virtual machine environment  102  executing a software application  104 . The virtual machine environment  102  is connected to an application monitor  106 . In operation, the virtual machine environment  102  executes the software application  104 , and provides a stream of network requests  120  sent by the software application  104  to the application monitor  106 . The application monitor  106  analyzes the received network requests  120  to determine an expected response to the network request. The application monitor  106  then sends the generated response to the virtual machine environment  102 . 
     The virtual machine environment  102  may be a software application executing on a computing device, such as a hypervisor brother virtual machine instance manager. The software application  104  may be executed inside a virtual machine instance managed by the virtual machine environment  102 . The virtual machine environment  102  may provide emulated hardware resources to the software application  104 , such as, for example, software components representing processors, memory devices, network adapters, display adapters, or other resources. The virtual machine environment  102  may be operable to provide requests by the software application  104  to use any of these emulated resources to the application monitor  106  as network requests  120 . 
     The application monitor  106  may be a software application executing on the same computing device as the virtual machine environment  102 , or executing on a different computing device and communicating with the virtual machine environment  102  over a network. The application monitor  106  includes a request handler  108  operable to parse the received network requests  120 . In some cases, the request handler  108  identifies a network protocol in which the network request is formatted, and parses the request according to the network protocol. The request handler  108  passes the parsed information to the response generator  110 , which generates an expected response to the received network request. In some cases, the response generator  110  generates the expected response based on the identified network protocol, the parsed information from the network request, parsed information from previous network requests, state information for the application stored by the application state tracker  112 . The application monitor  106  sends the generated response  122  to the software application  104 . In some cases, receiving an expected response to the network request may elicit the software application to continue execution in the virtual machine environment  102  for longer, leading to greater chances for observation of the executing software application  104 . 
       FIG. 2  is a message flow diagram of an example interaction between the components of the example environment to emulating expected network communications to applications in a virtual machine environment. At  205 , the software application  104  sends a network request within the virtual machine environment  102 . At  210 , the virtual machine environment  102  forwards the attempted network request to the application monitor  106 . At  215 , the application monitor  106  determines the protocol and message type of the received network request. In some cases, the application monitor  106  may fully parse the network request. At  220 , the application monitor  106  generates an expected response to the received network request based on the information parsed from the network request, the identified network protocol, previous received requests, state information compiled based on previous received requests, or other information. At  225 , the application monitor  106  provides the expected response to the virtual machine environment  102 , which in turn provides the expected response to the software application  104  ( 230 ). 
       FIG. 3  is a flow chart of an example process  300  of emulating expected network communications to applications in a virtual machine environment. At  305 , a software application is executed within the virtual machine environment. In some cases, the particular network protocol is Hypertext Transfer Protocol (HTTP). In some implementations, the network request is an HTTP POST request, and the expected response is an HTTP 200 OK response. In some cases, the network request is an HTTP GET request, and the expected response is an HTTP 200 OK response and includes a data payload generated based on the information included in the network request. In some cases, the particular network protocol is a peer-to-peer network protocol. In some implementations, the particular network protocol is BitTorrent, the network request is a first Peer Bitfield message, and the expected response is a second Peer Bitfield message. In some implementations, the particular network protocol is BitTorrent, the network request is a Peer Request message, and the expected response is a Peer Piece message. In some cases, the particular network protocol is The Onion Router (TOR) Hidden Service Protocol. In some cases, the network request is a TOR CREATE request, and the expected response is a TOR CREATED response. 
     At  310 , during execution of the software application, a network request sent from the software application within the virtual machine environment is detected, the network request formatted according to a particular network protocol. At  315 , an expected response to the network request is determined based on at least one of information included in the network request or the particular network protocol. At  320 , the expected response is provided to the software application within the virtual machine environment. 
     In some implementations, the network request is a first request and the expected response is a first response, the process  300  includes detecting a second request sent from the software application within the virtual machine environment, wherein the second request is different from the first request and is formatted according to the particular network protocol. In response to detecting the second request, a second response to the second request is determined based on at least one of information included in the first request, information included in the second request, or the particular network protocol; and the second response is provided to the software application within the virtual machine environment. 
       FIG. 4  is a block diagram of computing devices  400 ,  450  that may be used to implement the systems and methods described in this document, as either a client or as a server or plurality of servers. Computing device  400  is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Computing device  450  is intended to represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, and other similar computing devices. Additionally computing device  400  or  450  can include Universal Serial Bus (USB) flash drives. The USB flash drives may store operating systems and other applications. The USB flash drives can include input/output components, such as a wireless transmitter or USB connector that may be inserted into a USB port of another computing device. The components shown here, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed in this document. 
     Computing device  400  includes a processor  402 , memory  404 , a storage device  406 , a high-speed interface  408  connecting to memory  404  and high-speed expansion ports  410 , and a low speed interface  412  connecting to low speed bus  414  and storage device  406 . Each of the components  402 ,  404 ,  406 ,  408 ,  410 , and  412 , are interconnected using various busses, and may be mounted on a common motherboard or in other manners as appropriate. The processor  402  can process instructions for execution within the computing device  400 , including instructions stored in the memory  404  or on the storage device  406  to display graphical information for a GUI on an external input/output device, such as display  416  coupled to high speed interface  408 . In other implementations, multiple processors and/or multiple buses may be used, as appropriate, along with multiple memories and types of memory. Also, multiple computing devices  400  may be connected, with each device providing portions of the necessary operations (e.g., as a server bank, a group of blade servers, or a multi-processor system). 
     The memory  404  stores information within the computing device  400 . In one implementation, the memory  404  is a volatile memory unit or units. In another implementation, the memory  404  is a non-volatile memory unit or units. The memory  404  may also be another form of computer-readable medium, such as a magnetic or optical disk. 
     The storage device  406  is capable of providing mass storage for the computing device  400 . In one implementation, the storage device  406  may be or contain a computer-readable medium, such as a floppy disk device, a hard disk device, an optical disk device, or a tape device, a flash memory or other similar solid state memory device, or an array of devices, including devices in a storage area network or other configurations. A computer program product can be tangibly embodied in an information carrier. The computer program product may also contain instructions that, when executed, perform one or more methods, such as those described above. The information carrier is a computer- or machine-readable medium, such as the memory  404 , the storage device  406 , or memory on processor  402 . 
     The high speed controller  408  manages bandwidth-intensive operations for the computing device  400 , while the low speed controller  412  manages lower bandwidth-intensive operations. Such allocation of functions is exemplary only. In one implementation, the high-speed controller  408  is coupled to memory  404 , display  416  (e.g., through a graphics processor or accelerator), and to high-speed expansion ports  410 , which may accept various expansion cards (not shown). In the implementation, low-speed controller  412  is coupled to storage device  406  and low-speed expansion port  414 . The low-speed expansion port, which may include various communication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet) may be coupled to one or more input/output devices, such as a keyboard, a pointing device, a scanner, or a networking device such as a switch or router, e.g., through a network adapter. 
     The computing device  400  may be implemented in a number of different forms, as shown in the figure. For example, it may be implemented as a standard server  420 , or multiple times in a group of such servers. It may also be implemented as part of a rack server system  424 . In addition, it may be implemented in a personal computer such as a laptop computer  422 . Alternatively, components from computing device  400  may be combined with other components in a mobile device (not shown), such as device  450 . Each of such devices may contain one or more of computing device  400 ,  450 , and an entire system may be made up of multiple computing devices  400 ,  450  communicating with each other. 
     Computing device  450  includes a processor  452 , memory  464 , an input/output device such as a display  454 , a communication interface  466 , and a transceiver  468 , among other components. The device  450  may also be provided with a storage device, such as a microdrive or other device, to provide additional storage. Each of the components  450 ,  452 ,  464 ,  454 ,  466 , and  468 , are interconnected using various buses, and several of the components may be mounted on a common motherboard or in other manners as appropriate. 
     The processor  452  can execute instructions within the computing device  450 , including instructions stored in the memory  464 . The processor may be implemented as a chipset of chips that include separate and multiple analog and digital processors. Additionally, the processor may be implemented using any of a number of architectures. For example, the processor  410  may be a CISC (Complex Instruction Set Computers) processor, a RISC (Reduced Instruction Set Computer) processor, or a MISC (Minimal Instruction Set Computer) processor. The processor may provide, for example, for coordination of the other components of the device  450 , such as control of user interfaces, applications run by device  450 , and wireless communication by device  450 . 
     Processor  452  may communicate with a user through control interface  458  and display interface  456  coupled to a display  454 . The display  454  may be, for example, a TFT (Thin-Film-Transistor Liquid Crystal Display) display or an OLED (Organic Light Emitting Diode) display, or other appropriate display technology. The display interface  456  may comprise appropriate circuitry for driving the display  454  to present graphical and other information to a user. The control interface  458  may receive commands from a user and convert them for submission to the processor  452 . In addition, an external interface  462  may be provided in communication with processor  452 , so as to enable near area communication of device  450  with other devices. External interface  462  may provide, for example, for wired communication in some implementations, or for wireless communication in other implementations, and multiple interfaces may also be used. 
     The memory  464  stores information within the computing device  450 . The memory  464  can be implemented as one or more of a computer-readable medium or media, a volatile memory unit or units, or a non-volatile memory unit or units. Expansion memory  474  may also be provided and connected to device  450  through expansion interface  472 , which may include, for example, a SIMM (Single In Line Memory Module) card interface. Such expansion memory  474  may provide extra storage space for device  450 , or may also store applications or other information for device  450 . Specifically, expansion memory  474  may include instructions to carry out or supplement the processes described above, and may include secure information also. Thus, for example, expansion memory  474  may be provide as a security module for device  450 , and may be programmed with instructions that permit secure use of device  450 . In addition, secure applications may be provided via the SIMM cards, along with additional information, such as placing identifying information on the SIMM card in a non-hackable manner. 
     The memory may include, for example, flash memory and/or NVRAM memory, as discussed below. In one implementation, a computer program product is tangibly embodied in an information carrier. The computer program product contains instructions that, when executed, perform one or more methods, such as those described above. The information carrier is a computer- or machine-readable medium, such as the memory  464 , expansion memory  474 , or memory on processor  452  that may be received, for example, over transceiver  468  or external interface  462 . 
     Device  450  may communicate wirelessly through communication interface  466 , which may include digital signal processing circuitry where necessary. Communication interface  466  may provide for communications under various modes or protocols, such as GSM voice calls, SMS, EMS, or MMS messaging, CDMA, TDMA, PDC, WCDMA, CDMA2000, or GPRS, among others. Such communication may occur, for example, through radio-frequency transceiver  468 . In addition, short-range communication may occur, such as using a Bluetooth, WiFi, or other such transceiver (not shown). In addition, GPS (Global Positioning System) receiver module  470  may provide additional navigation- and location-related wireless data to device  450 , which may be used as appropriate by applications running on device  450 . 
     Device  450  may also communicate audibly using audio codec  460 , which may receive spoken information from a user and convert it to usable digital information. Audio codec  460  may likewise generate audible sound for a user, such as through a speaker, e.g., in a handset of device  450 . Such sound may include sound from voice telephone calls, may include recorded sound (e.g., voice messages, music files, etc.) and may also include sound generated by applications operating on device  450 . 
     The computing device  450  may be implemented in a number of different forms, as shown in the figure. For example, it may be implemented as a cellular telephone  480 . It may also be implemented as part of a smartphone  482 , personal digital assistant, or other similar mobile device. 
     Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device. 
     These computer programs (also known as programs, software, software applications or code) include machine instructions for a programmable processor, and can be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, apparatus and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term “machine-readable signal” refers to any signal used to provide machine instructions and/or data to a programmable processor. 
     To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input. 
     The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (“LAN”), a wide area network (“WAN”), peer-to-peer networks (having ad-hoc or static members), grid computing infrastructures, and the Internet. 
     The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. 
     Although a few implementations have been described in detail above, other modifications are possible. In addition, the logic flows depicted in the figures do not require the particular order shown, or sequential order, to achieve desirable results. Other steps may be provided, or steps may be eliminated, from the described flows, and other components may be added to, or removed from, the described systems. Accordingly, other implementations are within the scope of the following claims.