Font Size: a A A

Design And Implementation Of JavaScript Malicious Code Detection Technology Based On Machine Learning

Posted on:2022-08-27Degree:MasterType:Thesis
Country:ChinaCandidate:Y MengFull Text:PDF
GTID:2518306338968129Subject:Computer technology
Abstract/Summary:PDF Full Text Request
With the development of the Internet,JavaScript,as a fully functional scripting language,is widely used in Web site development.However,due to the dynamic execution and platform-independent characteristics of this scripting language,it brings convenience to development work.At the same time,it also brings serious security risks,making it easier for hackers to use browser and plug-in vulnerabilities to write and run malicious code.The rapid update and proliferation of Network attacks have seriously endangered the security of Web users.Therefore,in the face of the severe cyberspace security situation,we urgently need to conduct in-depth research on the security of JavaScript code to improve the detection capabilities of JavaScript malicious code,so as to protect the Internet security.JavaScript malicious code detection methods are mainly divided into two categories,one is static detection methods based on code text and structure,and the other is dynamic detection methods based on dynamic execution results of JavaScript code.At present,most of the related work is expanded on the basis of these two methods.However,these methods usually regard JavaScript as a natural language rather than a programming language,to some extent ignoring the unique grammatical and semantic information of programming languages.Focusing on the deep program analysis of source code,this paper proposes a JavaScript malicious code detection scheme based on machine learning.The main research contents include:1.JavaScript program dependency graph generation technology.The program dependency graph of code is a graph structure that can express program data dependency and control dependency,and contains rich program syntax information.This paper studies the generation principle of the program dependency graph.By traversing the abstract syntax tree of the program,adding data dependency and control dependency information to obtain the program dependency graph,a universal JavaScript program dependency graph generation technology is realized,which can represent the program to the greatest extent.Grammatical and semantic information.2.Feature extraction and selection technology based on program dependency graph.The deep traversal program relies on the graph for feature extraction based on the N-gram algorithm,and retains the highly correlated feature sequence through the chi-square test method.3.Malicious code detection technology based on XGBoost algorithm.The extracted JavaScript code features are applied to the XGBoost machine learning algorithm for parameter optimization,so as to obtain the classification model for the discrimination of benign and malicious code,and finally implement the detection system of JavaScript malicious code based on machine learning.Compared with the traditional vulnerability detection scheme,the static detection scheme in this paper can effectively solve the problem of low manual detection efficiency and the high false alarm rate of defect detection based on defect mode,and fully cover various malicious attack methods.The final experimental results show that compared with the existing detection tools,the JavaScript malicious code detection system based on machine learning implemented in this paper has a better detection effect,and has a wide range of practical application value in the enterprise production environment.
Keywords/Search Tags:javascript, malicious code detection, machine learning, program dependency graph, xgboost
PDF Full Text Request
Related items