SQL injection detection using machine learning

dc.contributor.authorMuriungi, A. M.
dc.date.accessioned2026-04-20T14:24:34Z
dc.date.issued2025
dc.descriptionFull - text thesis
dc.description.abstractWeb applications have become prime targets for cyberattacks due to their accessibility and the sensitive information they handled. SQL injection was a prevalent attack technique that exploited vulnerabilities in input validation to execute malicious SQL queries, potentially compromising application security and integrity. Traditional SQL injection detection methods, which relied on predefined patterns and rules, struggled to adapt to the evolving tactics of attackers. The purpose of this study was to design and implement a machine learning (ML)-based SQL injection detection system utilizing convolutional neural networks (CNNs). CNNs were selected due to their proven effectiveness in identifying complex patterns and anomalies, making them suitable for detecting union-based, error-based, and blind SQL injection attacks. An analytical prototyping methodology was employed to develop and evaluate the system. The model was trained on a diverse dataset of benign and malicious SQL queries and assessed using standard performance metrics. The CNN model achieved an accuracy of 98.21%, with macro-averaged precision, recall, and F1-score all at 0.98. These results demonstrated the model’s robustness and effectiveness in distinguishing between legitimate and malicious input. The findings of this study indicated that CNN-based detection systems can significantly enhance the security of web applications by providing an adaptive and reliable defense against SQL injection attacks. Keywords: SQL injection, Machine Learning, Convolutional Neural Networks, Anomaly Detection, Cybersecurity, Input Validation.
dc.identifier.citationMuriungi, A. M. (2025). SQL injection detection using machine learning [Strathmore University]. https://hdl.handle.net/11071/16399
dc.identifier.urihttps://hdl.handle.net/11071/16399
dc.language.isoen
dc.publisherStrathmore University
dc.titleSQL injection detection using machine learning
dc.typeThesis

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
SQL injection detection using machine learning.pdf
Size:
9.46 MB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
1.71 KB
Format:
Item-specific license agreed upon to submission
Description: