Abstract:The JavaScript malicious code detection by existing machine learning methods is complex, with large amount of calculation and difficult detection caused by maliciously confused codes. Existing approaches, therefore, fail to realize accurate and real-time detection. For this reason, a method based on Bidirectional Long Short-Term Memory (BiLSTM)-based method for JavaScript malicious code detection is proposed. Firstly, standardized data adapting to be input into the neural network is obtained by code de-obfuscation, data segmentation, and code vectorization. Secondly, the BiLSTM algorithm is used to train the vectorized data and learn the abstract features of JavaScript malicious code. Finally, the abstract features are used to assort codes. The proposed method is compared with deep learning and existing mainstream machine learning approaches, and the results show that this method exhibits a higher accuracy rate and a lower false alarm rate.