Detecting malicious Java']JavaScript code based on semantic analysis

被引:24
作者
Fang, Yong [1 ]
Huang, Cheng [1 ]
Su, Yu [1 ]
Qiu, Yaoyao [2 ]
机构
[1] Sichuan Univ, Coll Cybersecur, Chengdu, Peoples R China
[2] Sichuan Univ, Coll Elect & Informat Engn, Chengdu, Peoples R China
基金
中国国家自然科学基金;
关键词
Malicious [!text type='Java']Java[!/text]Script detection; Abstract syntax tree; Attention mechanism; Static analysis; Bi-LSTM; FastText; ENSEMBLE;
D O I
10.1016/j.cose.2020.101764
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Web development technology has undergone tremendous evolution, the creation of JavaScript has greatly enriched the interactive capabilities of the client. However, attackers use the dynamics feature of JavaScript language to embed malicious code into web pages for the purpose of drive-by-download, redirection, etc. The traditional method based on static feature detection is difficult to detect the malicious code after obfuscation, and the method based on dynamic analysis has low efficiency. To overcome these challenges, this paper proposes a static detection model based on semantic analysis. The model firstly generates an abstract syntax tree from JavaScript source codes, then automatically converts them to syntactic unit sequences. FastText algorithm is introduced to training word vectors. The syntactic unit sequences are represented as word vectors which will be input into Bi-LSTM network with attention mechanism. The detection model with Bi-LSTM network with attention mechanism is the key to detect malicious JavaScript. We experimented with the dataset using a five-fold cross-validation method. Experiments showed that the model can effectively detect obfuscated malicious JavaScript code and improve the detection speed, with a precision of 0.977 and recall of 0.974. (C) 2020 Elsevier Ltd. All rights reserved.
引用
收藏
页数:9
相关论文
共 35 条
  • [1] [Anonymous], HYBRID ANAL DETECTIO
  • [2] [Anonymous], JAV MALW COLL
  • [3] [Anonymous], ALEXA
  • [4] [Anonymous], JAV MALW SPAM SPREAD
  • [5] [Anonymous], 2018, ESPRIMA MASTER DOCUM
  • [6] [Anonymous], ARXIV1608062497
  • [7] [Anonymous], 2019, ABSTR SYNT TREE
  • [8] [Anonymous], 2018 ANN SAFETY REPO
  • [9] [Anonymous], THREATBOOK CLOUD SAN
  • [10] Bojanowski P., 2017, Trans. Assoc. Comput. Linguist., V5, P135, DOI [10.1162/tacla00051, DOI 10.1162/TACL_A_00051]