Systems and methods for remote detection of software through browser webinjects

Computer-implemented methods and systems are provided for the detection of software presence remotely through the web browser by detecting the presence of webinjects in a web browser that visits a detection webpage. The methods can include delivering a detection webpage to a web browser, in which the detection webpage has detection code configured to detect a presence of the webinject in the detection webpage; and inspecting, by the detection code, rendering of content of the detection webpage in the browser to detect webinject content in the detection webpage by the webinject, the webinject content including one or more Hypertext Markup Language (HTML) components. The method can further include, if webinject content is detected, generating a fingerprint for each of the one or more HTML components; transmitting the one or more fingerprints to an external server; and classifying, by the external server, the webinject based on the one or more fingerprints.

TECHNICAL FIELD

The following disclosure is directed to methods and systems for the detection of software remotely through a web browser and, more specifically, methods and systems for detection of software remotely through a web browser by detecting the presence of webinjects in a web browser.

BACKGROUND

Modern software often uses webinjects to change with a user's web browsing experience. Examples of such software include malware, adware, browser extensions, and anti-virus programs. Webinjects are pieces of foreign code, e.g., Hypertext Markup Language (HTML) or JavaScript elements, that can be locally injected into webpages visited by the user. These webinjects can be injected through several techniques, for example, through a browser extension application programming interface (API), browser process memory injection, or local network proxies. The webinjects can change the webpage to steal information (e.g., passwords, personal data, etc.), present additional content to the user (e.g., advertising), and/or improve the user's browsing experience (e.g., by blocking advertising, presenting useful information, improving functionality, etc.). Motives for inserting webinjects into webpages can range from stealing information to displaying advertising, or even improving the user's experience.

SUMMARY

Disclosed herein are systems and methods to detect webinjects, and their sources, in webpages. Some approaches for detecting software presence remotely include (i) scanning the Internet for systems that publicly expose services and (ii) using a sinkhole to isolate a domain and receive software connections as the software reaches the sinkhole, which, in some instances requires the subject domain to be expired or otherwise available. Another approach uses crawlers in a peer-to-peer (P2P) configuration, where the crawler joins the P2P network and receives connections from other peers. However, this approach is limited to P2P-enabled software. This method, if deployed through advertising networks or other partners that can provide large amounts of traffic, can detect a considerable number of software installations by detecting the presence of webinjects in the browser. The exemplary methods and systems described herein can be used alone or complement any one or more of the above methods to detect webinjects.

In a first aspect, a computer-implemented method is provided for the detection of webinjects. The method includes delivering a detection webpage to a web browser. The detection webpage has detection code configured to detect a presence of the webinject in the detection webpage. The method further includes inspecting, by the detection code, rendering of content of the detection webpage in the browser to detect webinject content inserted into the detection webpage by the webinject. The webinject content includes one or more Hypertext Markup Language (HTML) components. The method further includes, if webinject content is detected, generating, by the detection code, a fingerprint for each of the one or more HTML components; transmitting, by the detection code, the one or more fingerprints to an external server; and classifying, by the external server, the webinject based on the one or more fingerprints.

Embodiments of the method can include any one or more of the below features. The method can include transmitting to the external sever, by the detection code, one or more HTML components of the detected webinject content. The transmission can be on a portion of the executions of the detection code. The transmission can be on a small sample of the executions. For example, the transmission can be on 1% or less of the executions of the detection code. These HTML component(s) can be transmitted with their respective fingerprints. The method can include identifying the origin software of the HTML component(s) by (i) searching for the HTML component(s) in sandboxed executions of software and/or (ii) searching through privately- and/or publicly-available data sources. The sandboxed executions of software may be associated with, may be related to, or possibly be the origin software. The method can further include generating a database including (a) the fingerprint(s), (b) the name of the origin software, (c) one or more features of the detected webinject content, and/or (d) one or more capabilities (e.g., intercepting communication or changing form contents) of the detected webinject content. This database can be used to classify webinject(s) detected on remote systems.

Delivering the detection webpage having detection code can further include configuring the detection code such that at least one of a source domain, a path, or an HTML structure of the detection webpage is configured to trigger an injection of the webinject content by the webinject. The detection code can include JavaScript or Content Security Policy (CSP). The detection webpage can be inserted into an Hypertext Markup Language (HTML) inline frame. The method can further include generating a classification of the one or more webinjects. Classifying the webinject based on the one or more fingerprints can further include determining an originating software of the webinject based on the one or more fingerprints. Classifying the webinject based on the one or more fingerprints can further include mapping the one or more fingerprints to a feature set of the webinject. The detection webpage can be delivered by a traffic generating entity. Delivering a detection webpage to a web browser can further include embedding, by the traffic generating entity, the detection webpage into an external webpage. Delivering a detection webpage to a web browser can occur upon receiving an indication of a user interaction with the content of a webpage, wherein the webpage is separate from the detection webpage. The webinject content can include added or modified content by the webinject.

In a second aspect, a system is provided for detection of webinjects. The system includes one or more computer systems programmed to perform operations that include delivering a detection webpage to a web browser. The detection webpage has detection code configured to detect a presence of the webinject in the detection webpage. The operations further include inspecting, by the detection code, rendering of content of the detection webpage in the browser to detect webinject content inserted into the detection webpage by the webinject. The webinject content includes one or more Hypertext Markup Language (HTML) components. The operations further include, if webinject content is detected, generating, by the detection code, a fingerprint for each of the one or more HTML components; transmitting, by the detection code, the one or more fingerprints to an external server; and classifying, by the external server, the webinject based on the one or more fingerprints.

Embodiments of the system can include any one or more of the below features. The operations can include transmitting to the external sever, by the detection code, one or more HTML components of the detected webinject content. The transmission can be on a portion of the executions of the detection code. The transmission can be on a small sample of the executions. For example, the transmission can be on 1% or less of the executions of the detection code. These HTML component(s) can be transmitted with their respective fingerprints. The operations can include identifying the origin software of the HTML component(s) by (i) searching for the HTML component(s) in sandboxed executions of software and/or (ii) searching through privately- and/or publicly-available data sources. The sandboxed executions of software may be associated with, may be related to, or possibly be the origin software. The operations can further include generating a database of (a) the fingerprint(s), (b) the name of the origin software, (c) one or more features of the detected webinject content, and/or (d) one or more capabilities (e.g. intercepting communication or changing form contents) of the detected webinject content. This database can be used to classify webinject(s) detected on remote systems.

Delivering the detection webpage having detection code can further include configuring the detection code such that at least one of a source domain, a path, or an HTML structure of the detection webpage is configured to trigger an injection of the webinject content by the webinject. The detection code can include JavaScript or Content Security Policy (CSP). The detection webpage is inserted into an Hypertext Markup Language (HTML) inline frame. The system can further include generating a classification of the one or more webinjects. Classifying the webinject based on the one or more fingerprints can further include determining an originating software of the webinject based on the one or more fingerprints. Classifying the webinject based on the one or more fingerprints can further include mapping the one or more fingerprints to a feature set of the webinject. The detection webpage can be delivered by a traffic generating entity. Delivering a detection webpage to a web browser can further include embedding, by the traffic generating entity, the detection webpage into an external webpage. Delivering a detection webpage to a web browser can occur upon receiving an indication of a user interaction with the content of a webpage, wherein the webpage is separate from the detection webpage. The webinject content can include added or modified content by the webinject.

DETAILED DESCRIPTION

Disclosed herein are exemplary embodiments of systems and methods for the remote detection of software, specifically by the detection of webinjects in a web browser. The detection and classification of webinjects can be particularly useful in researching how to better secure and protect computer systems, especially those connected to the Internet. In some instances, the automatic classification of webinjects enabled by the systems and methods described herein provides significant increases in processing efficiencies over conventional techniques. Remote detection can be achieved without the use of installed detection software on a system. For example, instead of installed detection software, software can be remotely detected on any web browser that visits an detection webpage. For the purposes of clarity and conciseness, the methods and systems ofFIGS. 1-3are described together herein below.

FIG. 1is a flowchart of an exemplary embodiment of a computer implemented method100for the remote detection of webinjects.FIGS. 2A-2Bare diagrams of exemplary embodiments of systems200and201, respectively, for the remote detection of webinjects.

In step102of the method100, one or more detection webpages204are delivered to one or more web browser. In some embodiments, the one or more detection webpages204can be distributed by a third party traffic generating entity206with access to a high volume of web traffic (e.g., an advertising network, a website with a large number of daily visitors, etc.) that enables the one or more detection webpages204to reach a large number of browsers208across the Internet. In some embodiments, the system200may receive an indication of a user interaction with the content of a webpage in a browser. For example, the one or more detection webpages204can be delivered to a web browser208after a user clicks an advertisement in a webpage. The advertisement in the webpage can link to the detection webpage(s)204and may be acquired for the purpose of generating traffic to the detection webpage(s)204. For instance, the advertisement can be configured such that, once a user clicks on an advertisement in the webpage, the browser is redirected to the detection webpage. In some embodiments, the one or more detection webpages204are not delivered directly as the main page of the web browser208. Instead, the one or more webpages204can be embedded by a traffic generating entity206into an external main webpage209(e.g., a third-party webpage that is not part of the detection system), as one or more HTML inline frames (also referred to as an “iframe”). Iframes enable the embedding and/or displaying of a first HTML page into a second HTML page. One advantage of using iframes is that, because iframes can be made invisible to the user (and can be sandboxed and isolated from the external main webpage209), there is minimal to zero impact to the user's navigation experience and/or to the operation of the traffic generating entity.

While some webinjects are injected into as many webpages209as possible (and therefore, into every detection webpage204associated with the webpage), some software (“webinject originator”216) may only inject its webinject(s)212when a specific website is visited (e.g., online banking websites, social media websites, etc.). To detect this webinject212, one or more source domains, one or more paths, and/or an HTML structure of the detection webpage204is configured to match the webinject targets (i.e., the online banking website, etc.). For example, the webinject212may only be injected by the originator216if the browser208is visiting the site:

Further, the originator216may be using a rule (e.g., a regular expression) to search for the target domain of a webpage while the browser208is loading the webpage. In many instances, this rule is not sufficiently specific to the term “webinjecttarget.com”. The uniform resource locator (URL) and/or content of the detection webpage(s)204can be configured such that, the detection webpage204can “bait” or trigger the webinject212to be injected into the detection webpage204itself. An example of such an URL of the detection webpage204used in an iframe inserted by a traffic generating entity206on an external webpage209is:

In step104, the detection code202is executed during and/or after the rendering of the detection webpage204in the browser208, to detect the webinject212content on the detection webpage204Document Object Model (DOM). The detection code can inspect the rendering of the detection webpage204by using JavaScript functions that are triggered on specific webpage rendering events. The webinject content can include one or more Hypertext Markup Language (HTML) components. The detection code inspects the rendering of the detection webpage204in the web browser208. This inspection can be done through the use of a JavaScript function that compares the content of the detection webpage204after the content is rendered with the content that were delivered, through monitoring specific JavaScript function calls that are commonly used by webinjects212or through using content security policy (CSP) rules that trigger an action on any change to the original delivered detection webpage204.

In step106, if detection code202detects webinject content in the detection webpage204, the detection code202generates a set of fingerprints based on the webinject content. These fingerprints are generated using an algorithm that selects one or more webinject blocks of code. and normalizes the one or more blocks of code. An example of a webinject block of code is an inline HTML script tag added to the webpage. There may be one or more blocks of code belonging to one or more webinjects. For example, normalization of the blocks include removing parts of the blocks that are specific to the browser instance (such as unique identifiers), normalizing character case, etc. The algorithm then creates a unique identifier of each block's contents that can be smaller than the webinject content itself and that is unique for a particular content. This unique identifier, also referred to as fingerprint in this document, can be calculated using hashing functions or even simpler cyclic redundancy check (CRC) algorithms that produce a unique number for a given input content.

In step108, code202transmits the fingerprints to one or more server(s)214where they are stored and/or processed. Additionally, on a small sample of the executions of the detection code202, the detected webinject content is transmitted to an external server, along with the respective fingerprints. In an exemplary embodiment utilizing CSP, CSP reports are sent by browser208to server214if a webinject is detected, the fingerprint is then calculated by a method similar to the one described above but on the server214and using the contents of the CSP report.

The one or more fingerprints can be used to classify the webinject212and/or identify the originator216of the webinject212. Thus, in step110, server214classifies the webinject212based on the received fingerprints. The server214can classify the detected webinject into a specific category, based on a database that maps each of the fingerprints to details about the webinject212and/or originator216. In some embodiments, method100can include generating a database including the fingerprint(s), the name of the origin software, and/or a list of features and/or capabilities of the detected webinject content. For example, features or capabilities can include intercepting communication or changing form contents. This database can be built manually and/or by automated processing of the webinject content blocks that are sent, along with the respective fingerprints, to the server214in step108. Once these samples are received in server214, they are used to identify the originator216of the webinject, by searching for the presence of the same blocks of webinject code in the sandboxed execution of the software and by searching other, open or commercially available data sources.

In some examples, some or all of the processing described above can be carried out on a personal computing device, on one or more centralized computing devices, or via cloud-based processing by one or more servers. In some examples, some types of processing occur on one device and other types of processing occur on another device. In some examples, some or all of the data described above can be stored on a personal computing device, in data storage hosted on one or more centralized computing devices, or via cloud-based storage. In some examples, some data are stored in one location and other data are stored in another location. In some examples, quantum computing can be used. In some examples, functional programming languages can be used. In some examples, electrical memory, such as flash-based memory, can be used.

FIG. 3is a block diagram of an example computer system300that may be used in implementing the technology described in this disclosure. General-purpose computers, network appliances, mobile devices, or other electronic systems may also include at least portions of the system300. The system300includes a processor310, a memory320, a storage device330, and an input/output device340. Each of the components310,320,330, and340may be interconnected, for example, using a system bus350. The processor310is capable of processing instructions for execution within the system300. In some implementations, the processor310is a single-threaded processor. In some implementations, the processor310is a multi-threaded processor. The processor310is capable of processing instructions stored in the memory320or on the storage device330.

The memory320stores information within the system300. In some implementations, the memory320is a non-transitory computer-readable medium. In some implementations, the memory320is a volatile memory unit. In some implementations, the memory320is a non-volatile memory unit.

The storage device330is capable of providing mass storage for the system300. In some implementations, the storage device330is a non-transitory computer-readable medium. In various different implementations, the storage device330may include, for example, a hard disk device, an optical disk device, a solid-date drive, a flash drive, or some other large capacity storage device. For example, the storage device may store long-term data (e.g., database data, file system data, etc.). The input/output device340provides input/output operations for the system300. In some implementations, the input/output device340may include one or more of a network interface devices, e.g., an Ethernet card, a serial communication device, e.g., an RS-232 port, and/or a wireless interface device, e.g., an 802.11 card, a 3G wireless modem, or a 4G wireless modem. In some implementations, the input/output device may include driver devices configured to receive input data and send output data to other input/output devices, e.g., keyboard, printer and display devices360. In some examples, mobile computing devices, mobile communication devices, and other devices may be used.

In some implementations, at least a portion of the approaches described above may be realized by instructions that upon execution cause one or more processing devices to carry out the processes and functions described above. Such instructions may include, for example, interpreted instructions such as script instructions, or executable code, or other instructions stored in a non-transitory computer readable medium. The storage device330may be implemented in a distributed way over a network, such as a server farm or a set of widely distributed servers, or may be implemented in a single computing device.

The term “system” may encompass all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. A processing system may include special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). A processing system may include, in addition to hardware, code that creates an execution environment for the computer program in question, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.

Terminology