本研究旨在運用機器學習技術偵測SQL注入式攻擊,機器學習技術可通過分析大量資料,學習和識別SQL注入式攻擊的特徵,具有更高準確度。 本文介紹了SQL注入式攻擊的背景、危害及常見類型,回顧了現有的檢測方法,包括靜態分析、動態分析和機器學習方法,並提出一個基於機器學習的SQL注入式攻擊偵測模型,利用SQL語句中的關鍵特徵進行分類。 本文選用支持向量機(SVM)、隨機森林(RF)和梯度提升決策樹(GBDT)三種機器學習演算法進行訓練和超參數調優。實驗結果顯示,這三種模型均能有效地檢測SQL注入式攻擊,表現出色,在準確率、召回率及F1分數等方面均達到較高水準。
This study aims to use machine learning techniques to detect SQL injection attacks. Machine learning can analyze large amounts of data to learn and identify the characteristics of SQL injection attacks, offering higher accuracy. This paper introduces the background, harms, and common types of SQL injection attacks, reviews existing detection methods, including static analysis, dynamic analysis, and machine learning methods, and proposes a machine learning-based SQL injection attack detection model that utilizes key features in SQL statements for classification. The study employs three machine learning algorithms: Support Vector Machine (SVM), Random Forest (RF), and Gradient Boosting Decision Tree (GBDT) for training and hyperparameter tuning. Experimental results show that all three models effectively detect SQL injection attacks, demonstrating excellent performance in terms of accuracy, recall, and F1 score.