Malicious web script-based cyber attack protection technology

JongHun Jung, Hwankuk Kim, Soojin YoonarXiv 2015

Abstract

This paper proposes a real-time protection system designed to detect and block malicious JavaScript-based attacks that bypass traditional firewalls. By combining static analysis, dynamic execution in a sandboxed engine, and automated signature generation via machine learning clustering (BIRCH and SimHash), the system achieves high detection rates for sophisticated threats like script-based DDoS and port scanning.

Introduction

The modern web has evolved from static pages to complex, dynamic environments powered by Ajax and HTML5. While these technologies enhance user experience, they have introduced a significant security gap: script-based cyber attacks. Unlike traditional malware, these attacks do not require a file download; instead, malicious code is injected directly into the JavaScript of legitimate webpages.

Because these scripts are delivered via standard HTTP response messages, traditional security equipment like Firewalls and Intrusion Prevention Systems (IPS) often fail to detect them. Furthermore, attackers frequently employ obfuscation and traffic encryption to evade signature-based detection. This research aims to close this gap by creating a system capable of real-time web content analysis and automated signature generation for new attack variants.

System Architecture and Methods

The proposed Script-based Attack Detection System (SADS) utilizes a multi-layered architecture to intercept and analyze web traffic before it reaches the client.

The SADS architecture featuring a Traffic-Modulating System and a Detection System.

Workflow Stages

  1. Traffic Collection: A forward proxy (using Squid) intercepts HTTP traffic, utilizing the Internet Content Adaptation Protocol (ICAP) to pass content to the analysis module.
  2. Static Analysis: The system performs a rapid check using Yara-RuleSet to match known patterns. It also calculates an "Obfuscation Score" based on string entropy, N-grams, and abnormal string lengths. Highly obfuscated scripts are flagged for deeper inspection.
  3. Dynamic Analysis: Suspicious scripts are executed in a sandboxed Rhino JavaScript Engine. The system records an "API Call Trace"—a log of every function the script calls—and converts it into an XML format for structured analysis.
  4. Automated Signature Generation: To handle the volume of new scripts, the system employs a sophisticated clustering pipeline.
The automated signature generation workflow using JavaScript clustering and refinement.

This core innovation uses TF-IDF to vectorize script tokens and the SimHash algorithm to compare the similarity of API call traces. A modified BIRCH algorithm (hierarchical clustering) then groups similar malicious scripts based on both code similarity and metadata (IP, port, protocol). Finally, "Conjunction Signatures" are extracted from these clusters to create robust detection rules.

Experimental Evaluation

The authors evaluated the system using seven types of malware samples, including XHR DoS, IP/Port Scanners, and Geolocation exploits. The test bed simulated real-world traffic by accessing the Top 10 Alexa websites while distributing malicious scripts.

Key Results

  • Detection Accuracy: The system achieved an average detection rate of 89% for obfuscated scripts and 97% for modified attack code.
  • Attack-Specific Performance: XHR DoS was detected at a 91% rate, while IP Scans and Geolocation exploits were detected at 86% and 88%, respectively.
  • Network Efficiency: In a virtual environment with 20 simultaneous browsers, the system successfully handled 1Gbps of bandwidth with a manageable web access latency of approximately 2.95 seconds.

Discussion and Future Work

By focusing on API call traces rather than static code, SADS can identify malicious behavior even when variable names are changed or junk code is added. The inclusion of metadata in the clustering process further helps group attacks that are part of the same campaign.

Future work will focus on expanding the malware sample size beyond the initial seven types and optimizing the analysis engine for enterprise-scale traffic volumes exceeding 1Gbps. Additionally, as HTML5 continues to evolve, the dynamic analysis module must be updated to monitor for new types of "jacking" and cross-site scripting (XSS) behaviors.

Summary updated

BibTeX
@misc{jung2015malicious,
  author = {JongHun Jung and Hwankuk Kim and Soojin Yoon},
  title = {{Malicious web script-based cyber attack protection technology}},
  year = {2015},
  eprint = {1502.03872},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1502.03872},
}
Figure