Enhancing SQL Injection Attack Detection Using Naïve Bayes and SMOTE Method on Imbalanced Datasets
DOI:
https://doi.org/10.59934/jaiea.v4i1.559Keywords:
SQL Injection Detection, Naive Bayes, Data Imbalance, SMOTE (Synthetic Minority Over-sampling Technique), Machine LearningAbstract
SQL injection attack detection is a crucial aspect of cybersecurity, considering the potential damage that such attacks can cause. This study aims to evaluate the effectiveness of the Naive Bayes model in detecting SQL injection attacks on an imbalanced dataset. To address the data imbalance issue, the SMOTE (Synthetic Minority Over-sampling Technique) method was applied. The study consists of two phases: first, training and testing the Naive Bayes model on the original dataset without SMOTE, and second, training and testing on the dataset with SMOTE applied. The results indicate that the Naive Bayes model on the dataset without SMOTE achieved an accuracy of 0.9948, F1 Score of 0.9885, Precision of 0.9906, and Recall of 0.9946. After applying SMOTE, the model's performance improved significantly, with an accuracy of 0.9950, F1 Score of 0.9950, Precision of 0.9950, and Recall of 0.9950. This improvement suggests that SMOTE effectively enhanced class balance in the dataset, improving the model's ability to detect both malicious and safe queries. The study recommends exploring other resampling methods, feature engineering analysis, and testing on more diverse datasets as well as implementation in real-world environments for future research.
Downloads
References
D. Putra Purbawa, A. J. Ulhaq, G. Ikhsan, A. M. Shiddiqi, D. Ary, and M. Shiddiqi, “An Enhanced SQL Injection Detection using Ensemble Method,” JUTI: Jurnal Ilmiah Teknologi Informasi , vol. 21, no. 1, pp. 1–9, 2023, doi: 10.12962/j24068535.v21i1.a1060.
A. Sunyoto and E. Pramono, “Deteksi Serangan SQL Injection Menggunakan Hidden Markov Model,” TECNOSCIENZA, vol. 5, no. 2, 2021.
OWASP, “Introduction: Welcome to the OWASP Top 10 - 2021.” Accessed: Jul. 18, 2024. [Online]. Available: https://owasp.org/Top10/
J. Friadi and S. Septian, “Aplikasi Machine Learning Untuk Deteksi Serangan Code Injection,” pp. 443–451, 2021, doi: 10.37776/zt.vxix.xxx.
H. B. Jatmiko, N. T. Kurniadi, and D. Maulana, “Optimasi Naïve Bayes Dengan Particle Swarm Optimization Untuk Analisis Sentimen Formula E-Jakarta,” JACIS : Journal Automation Computer Information System, vol. 2, no. 1, pp. 22–30, 2022.
V. Puspaning Ramadhan, F. Yulian Pamuji, and A. History, “Analisis Perbandingan Algoritma Forecasting dalam Prediksi Harga Saham LQ45 PT Bank Mandiri Sekuritas (BMRI),” Jurnal Teknologi dan Manajemen Informatika, vol. 8, pp. 39–45, 2022, [Online]. Available: http://http://jurnal.unmer.ac.id/index.php/jtmi
W. Rahayu, D. Jollyta, A. Hajjah, Y. Nora Marlim, and Y. Desnelita, “Synthetic Minority Oversampling Technique (SMOTE) for Boosting the Accuracy of C4.5 Algorithm Model,” Journal of Artificial Intelligence and Engineering Applications, vol. 3, no. 3, pp. 2808–4519, 2024, [Online]. Available: https://ioinformatic.org/
J. H. Joloudari, A. Marefat, M. A. Nematollahi, S. S. Oyelere, and S. Hussain, “Effective Class-Imbalance Learning Based on SMOTE and Convolutional Neural Networks,” Applied Sciences (Switzerland), vol. 13, no. 6, Mar. 2023, doi: 10.3390/app13064006.
T. Wongvorachan, S. He, and O. Bulut, “A Comparison of Undersampling, Oversampling, and SMOTE Methods for Dealing with Imbalanced Classification in Educational Data Mining,” Information (Switzerland), vol. 14, no. 1, Jan. 2023, doi: 10.3390/info14010054.
D. Dablain, B. Krawczyk, and N. V. Chawla, “DeepSMOTE: Fusing Deep Learning and SMOTE for Imbalanced Data,” IEEE Trans Neural Netw Learn Syst, vol. 34, no. 9, pp. 6390–6404, Sep. 2023, doi: 10.1109/TNNLS.2021.3136503.
D. K. Fitri, N. Sri, M. Lestari, J. Ilmu, K. Jurusan, and I. Komputer, “Implementasi Algoritma Naïve Bayes Menggunakan Feature Forward Selection dan SMOTE Untuk Memprediksi Ketepatan Masa Studi Mahasiswa Sarjana,” 2022.
G. Gumelar, Q. Ain, R. Marsuciati, S. Agustanti Bambang, A. Sunyoto, and M. Syukri Mustafa, “Kombinasi Algoritma Sampling dengan Algoritma Klasifikasi untuk Meningkatkan Performa Klasifikasi Dataset Imbalance,” Prosiding Seminar Nasional Sistem Informasi dan Teknologi (SISFOTEK), vol. 5, 2021.
F. Yulian Pamuji, S. Dwi Arma Putri, F. Teknologi Informasi, and U. Malang, “Komparasi Metode SMOTE dan ADASYN Untuk Penanganan Data Tidak Seimbang MultiClass,” JIP (Jurnal Informatika Polinema) , vol. 9, no. 3, pp. 331–338, 2023.
A. N. Hermana, M. Gustiana Husada, and O. Kurniawan, “Penerapan SMOTE Untuk Mengatasi Data Imbalance pada Identifikasi Originalitas Sepatu Converse Menggunakan CNN Arsitektur VGG-16,” Jurnal Pendidikan Tambusai, vol. 8, no. 1, pp. 10710–10722, 2024, [Online]. Available: https://www.converse.id/
A. Muneer, R. F. Ali, A. Alghamdi, S. M. Taib, A. Almaghthawi, and E. A. Abdullah Ghaleb, “Predicting customers churning in banking industry: A machine learning approach,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 26, no. 1, pp. 539–549, Apr. 2022, doi: 10.11591/ijeecs.v26.i1.pp539-549.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2024 Journal of Artificial Intelligence and Engineering Applications (JAIEA)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.