Jsgraph: Enabling Reconstruction of Web Attacks Via Efficient Tracking Of

Jsgraph: Enabling Reconstruction of Web Attacks Via Efficient Tracking Of

JSgraph: Enabling Reconstruction of Web Attacks via Efficient Tracking of Live In-Browser JavaScript Executions Bo Li, Phani Vadrevu, Kyu Hyung Lee, and Roberto Perdisci Department of Computer Science, University of Georgia fbo,vadrevu,khlee,[email protected] Abstract—In this paper, we propose JSgraph, a forensic engine on JS-driven DOM modifications. Ultimately, our goal is to that is able to efficiently record fine-grained details pertaining enable a detailed, post-mortem reconstruction of ephemeral to the execution of JavaScript (JS) programs within the browser, JS-based web attacks experienced by real network users. with particular focus on JS-driven DOM modifications. JSgraph’s For instance, we aim to enable the reconstruction of social main goal is to enable a detailed, post-mortem reconstruction of engineering attacks that result in the download of malicious ephemeral JS-based web attacks experienced by real network executable files or browser extensions, among other attacks. users. In particular, we aim to enable the reconstruction of social engineering attacks that result in the download of malicious Our main target deployment environment is enterprise executable files or browser extensions, among other attacks. networks, including both mobile and non-mobile network- We implement JSgraph by instrumenting Chromium’s code connected devices. In such networks, it is common practice base at the interface between Blink and V8, the rendering and to perform forensic investigations after a security incident JavaScript engines. We design JSgraph to be lightweight, highly is discovered, and our primary goal is to aid such forensic portable, and to require low storage capacity for its fine-grained investigations by providing fine-grained details about web-born audit logs. Using a variety of both in-the-wild and lab-reproduced attacks to the network’s devices. web attacks, we demonstrate how JSgraph can aid the forensic To achieve our goal, we design JSgraph to satisfy the investigation process. We then show that JSgraph introduces following main requirements: acceptable overhead, with a median overhead on popular website page loads between 3.2% and 3.9%. • Efficient Audit Log Recording. Because we aim to record I. INTRODUCTION web attacks in real time, as they affect real victims, and It is well known that JavaScript (JS, for short) is the in consideration of the fact that most web attacks are main vehicle for web-based attacks, enabling the delivery of both difficult to anticipate and ephemeral, we need audit sophisticated social engineering, drive-by malware downloads, log recording to be always on. Consequently, the main cross-site scripting, and other attacks [20], [26], [29], [8], [14]. challenge we face is whether it is feasible to record It is therefore important to develop systems that allow us to highly detailed information related to in-browser JS code analyze the inner workings of JS-based attacks, so to enable execution without significantly impacting the browser’s the development of more robust defenses. However, while performance and usability. extensive previous work exists on JS code inspection [9], [8], • No Functional Interference. We aim to avoid any mod- [42], [41] and web-based attack analysis [4], [37], [35], [44], ification to the browser’s code base that would alter its [2], an important problem remains: to evade defense systems functionalities. For instance, some debugging tools that and security analysts, web-based attacks are often developed perform in-browser record and replay, such as Time- to be ephemeral and to deliver the actual attack code only if Lapse [4] and ReJS [44], alter the rendering engine to certain restrictive conditions are met by the potential victim force it to effectively run in single-threaded mode. As this environment [26], [20], [45]. Therefore, there is a need for may have an impact on both rendering performance and JS-based attack analysis tools that can enable real-time in- behavior, we deliberately avoid making any such changes. browser recording, and subsequent detailed reconstruction, of • Portability. To make it easily adoptable, we aim to live security incidents that affect real users while they simply implement a system that is highly portable. To this browse the web. end, we build JSgraph by instrumenting Chromium’s In this paper, we aim to meet the above mentioned needs code base at the interface between its rendering engine by proposing JSgraph, a forensic engine that is able to effi- (Blink) and the JavaScript engine (V8). By confining the ciently record fine-grained details pertaining to the execution of core of JSgraph within Blink/V8 (more precisely, within JavaScript programs within the browser, with particular focus Chromium’s content module [6]), we are able to inherit Chromium’s portability, thus making it easier to deploy JSgraph on multiple platforms (e.g., Linux, Android, Mac, Windows), and different Blink/V8-based browsers (e.g., Opera, Yandex, Silk, etc.) with little or no changes. • Limited Storage Requirements. Because security incidents Network and Distributed Systems Security (NDSS) Symposium 2018 are often discovered weeks or even months after the 18-21 February 2018, San Diego, CA, USA fact, we aim to minimize the storage requirements for ISBN 1-891562-49-5 http://dx.doi.org/10.14722/ndss.2018.23319 JSgraph’s audit logs, making it feasible to retain the logs www.ndss-symposium.org for extended periods of time (e.g., one year or longer). In a nutshell, JSgraph works as follows (system details are to start streaming the movie causes a new window to popup, provided in Section II). Given a browser tab, JSgraph monitors under the pressupdateforsafesoft[.]download domain name. An every navigation event, logs all changes to the DOM that occur alert dialog is displayed, with the message “Update the latest for each page loaded within that tab, records how JS code is version of Flash Player. Your current Adobe Flash Player loaded (i.e., whether it is defined “inline” or loaded from an version is out of date.” Notice also that the same page displays external URL), follows the execution of every compiled JS a “Latest version of Adobe Flash Player required [...]” message script, and logs every change that a script (or a callback) makes right under the URL bar. (d) Clicking the OK button causes to the DOM. This enables the reconstruction of how a page’s a download dialog box to be shown. (e) Finally, clicking on DOM evolved in time, and how changes to that DOM exactly the “Download Flash” (or “OK”) button initiates a .dmg file came about. Ultimately, this enables a forensic analyst to trace download. Interestingly, after the download starts, the attack back what JS script or function was responsible for making page also displays the instructions that the user needs to follow a given DOM change, including pinpointing what JS scripts to install the downloaded software. were responsible for presenting a social engineering attack to Attack Properties: Searching for the downloaded file’s SHA1 the victim, and how the attack was actually constructed within hash1 on VirusTotal produced no results. Upon submission, 10 the DOM. out of 56 anti-viruses found the file to be malicious. At the time To make JSgraph efficient, we implement its core logging of writing, Symantec labels the file as OSX.Trojan.Gen. functionalities by extending the DOM and JS code tracing By leveraging a passive DNS database and domain functionalities offered by Chromium’s DevTools. We then registration information, we discovered that the two show that our system introduces acceptable performance over- domain names that are used to deliver the malicious head. For instance, we show that, on the top 1,000 websites binary, namely pressupdateforsafesoft[.]download and according to Alexa, JSgraph running on Linux introduces a pressbuttonforupdate[.]bid, are related to more than 300 median website page load overhead of 3.2%, and a 95th- domain name variations that are highly likely used for a large percentile overhead of 7.4%. Besides building an instrumented malware distribution campaign, because they shared close browser that can efficiently record fine-grained audit logs, name similarity, date of registration, and resolved IP addresses JSgraph also implements a module for abstracting its fine- (e.g., pressandclickforbestupdates[.]download, pressyoourbest- grained logs into more easily interpretable graphs. A moti- button2update [.]download, clickforfreeandbestupdate[.] vating example that illustrates how this can help in analyzing download, click2freeupdatethebest[.]bid, etc.). In addition, we in-the-wild web attacks is provided in the next Section I-B. found that in a time window of about eight days, more than A. Threat Model one thousand clients (roughly one third of which were located JSgraph aims to accurately record information that enables in the US) may have fallen victim to this malware campaign. the reconstruction of web attacks, with an emphasis on social How JSgraph can Help: The question we would like to answer engineering malware attacks, but excluding attacks to the is: “how did this attack work under the hood?” Answering this browser software itself. Namely, we assume the browser’s question is important, because knowing how the attack is deliv- code is part of our trusted computing base (TCB), along with ered can greatly help in developing effective countermeasures. the operating system’s code. As JSgraph is implemented via Below, we discuss how JSgraph can help in answering this lightweight instrumentation of the browser, we also assume question. that JSgraph’s code is part of the TCB. Remember that JSgraph is an always-on in-browser record- This entails that fully recording the behavior of drive-by only system, which aims to perform an efficient recording of exploit kits [16], for example, is outside the scope of this any DOM change, with particular focus on DOM changes paper.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us