Computer and Modernization ›› 2022, Vol. 0 ›› Issue (06): 122-126.

Previous Articles    

A SQL Injection Attack Detection Algorithm Based on Improved TF-IDF

  

  1. (1. College of Computer Science and Technology, Shenyang University of Chemical Technology, Shenyang 110142, China;
    2. Key Laborotary of Industrial Intelligence Technology on Chemical Process, Liaoning Province, Shenyang 110142, China)
  • Online:2022-06-23 Published:2022-06-23

Abstract: Because the traditional TF-IDF algorithm does not allocate the weight of feature words well, there will be problems of insufficient feature extraction and low efficiency, resulting in the results not in line with the actual situation. In order to solve the limitations of this method in SQL injection attack detection, this paper improves TF-IDF by adding text quantity ratio factor and Chi statistics to the traditional TF-IDF algorithm, which can well improve the weight of some important words. The detection of SQL injection attacks is realized by selecting different classifiers, so as to obtain different classification results. The experimental results show that the combination of boosted decision tree and improved TF-IDF has higher accuracy, recall and F1 value than other similar methods. In addition, compared with the traditional TF-IDF algorithm, the correctness, accuracy, recall and F1 value of the proposed algorithm are improved by about 5%, which has a certain practical application value.

Key words: SQL injection, TF-IDF, chi-square statistics, text vectorization