Detection_of_SQL_Injection_Attacks
Detection_of_SQL_Injection_Attacks
Tiruchengode, Tamilnadu
Tiruchengode, Tamilnadu
[email protected]
[email protected]
4th Ms.A.DIVYA
3rd Mr.M.M.CIBI
Department of Information Technology
Department of Information Technology
K. S. Rangasamy College of Technology
K. S. Rangasamy College of Technology
Tiruchengode, Tamilnadu
Tiruchengode, Tamilnadu
[email protected]
[email protected]
SQL allows analysts, administrators, and developers to work E. Difficulties in reducing sql injection
with databases more effectively. As the research has shown, there are a number of intrinsic
problems and obstacles that make mitigating SQL injection a
II. LITERATURE REVIEW
persistent task, which is what Muntasir Mamun has
A. Overview of sql injection recommended in this work. Mitigating SQL injection presents
In this work, Timothy J. has suggested. The swift persistent challenges due to intrinsic issues and practical
development of online applications across several areas is barriers. Legacy code prevalent in many companies lacks robust
mirrored in the rise of SQL injection as a cybersecurity issue. security measures, rendering older systems and apps more
The risks linked to insufficient input validation have become vulnerable. Addressing these legacy systems demands
more noticeable as systems become more interconnected. There significant resources and expertise, hindering businesses'
percussions of SQL injection attacks go beyond the efforts to enhance security. Moreover, a lack of understanding
compromising of individual user accounts as our dependence among developers and IT specialists poses another obstacle.
on web services grows. The core pillars of data confidentiality Despite available preventive measures, critical security
and integrity in organizational databases might be compromised practices may be neglected due to insufficient awareness of
by these assaults. The fundamental aspect of SQL injection is evolving attack methods. To counter these risks, various
the misuse of user input trust. Malevolent attackers use online preventive measures can be adopted. Employing input
applications' failure to thoroughly verify or sanitize user validation techniques like parameterized queries and stored
submitted data to modify the underlying SQL queries. procedures significantly reduces vulnerabilities. Additionally,
regular updating and patching of database systems and utilizing
B. The evolution of sql injection techniques through history web application firewalls are crucial. Educating developers on
In this work, Oliver Y has proposed Of course! SQL secure coding practices and implementing strict access controls
injection techniques developed to get around new security further strengthens defenses against SQL injection attacks.
protections as they became more advanced. Attackers now have
F. Role of machine learning in sql injection detection
more ways to insert malicious code into database operations
thanks to stored procedures. The study emphasizes a thorough In this study, Aleksei Shcherbak has put out Researchers are
evaluation methodology, discussing performance metrics like exploring the possibility of machine learning (ML) methods for
precision, recall, and F1-score. It scrutinizes experimental early detection of SQL injection attempts in response to the
design elements, such as dataset diversity and cross-validation increasing complexity of cyber-attacks. In this instance,
techniques, to establish credibility and generalizability. machine learning is being applied by analyzing query behavior
Through this detailed discussion, the study aims to validate the and user input patterns to distinguish between fraudulent and
proposed SQL injection detection approach with a rigorous and legitimate activity. Machine learning (ML) has the potential to
well-structured assessment. be a proactive defense against the ever evolving techniques of
SQL injection, since it can leverage enormous datasets and train
C. Sql injection's effect on data security algorithms to identify odd patterns.
In this research, Parul Sharma et al. have proposed. The
G. Regulatory frameworks and compliance
consequences of successful SQL injection attacks on businesses
go much beyond the original security breach. Financially, a In this research, Rachneet Kaur et al. have proposed
SQL injection-related data breach can be extremely expensive, Regulatory organizations are taking proactive steps to create
involving costs for forensic examinations, court cases, and the frameworks and compliance requirements in response to the
installation of additional security measures. Furthermore, the serious consequences of data breaches caused by SQL injection
loss of confidential information may result in identity theft, and other cyber threats. The Health Insurance Portability and
financial fraud, and a reduction in client confidence, all of Accountability Act (HIPAA) and the General Data Protection
which may have long term negative financial effects. Regulation (GDPR) are two well-known examples that are
essential in motivating corporations to prioritize and have
D. Best practices and preventive measures strong defenses in place. The effects of GDPR, a
In this research, Dr. Pooja Raundale has suggested In comprehensive law intended to safeguard the personal
addition to examining the effects of SQL injection, the literature information of people of the European Union (EU), have been
focuses a great deal of attention on proactive steps that widely studied in the literature.
strengthen digital defenses. A key weapon in this fight is input
validation, which serves as the first line of defense by carefully H. Social engineering aspects of sql injection
examining user inputs to check for harmful information. In this work, S. Saravanan et al. have proposed. The
Organizations may greatly decrease the attack surface and resist literature looks at how social engineering plays a part in these
efforts to introduce malicious SQL code by putting strong input exploits to highlight how complex SQL injection assaults are.
validation rules in place. In the continuous battle against SQL Psychological manipulation is a common tool used by attackers
injection, the usage of prepared statements and parameterized to trick administrators or users, taking advantage of human
queries are essential strategies. psychology as a weak spot. Comprehending these techniques is
essential for formulating allen compassing security plans that
tackle cyber security's human element in addition to its role, the study aims to improve SQL injection detection
technological weaknesses. methodologies. SMO's nuanced approach contributes
significantly to the overall robustness of cyber security
I. Global patterns and trends in sql injection attacks measures against evolving threats.
In this research, Lerina Aversano et al. have suggested The
literature provides a macroscopic perspective that reveals the
changing landscape of cyber risks by painstakingly analyzing V. MODULES
worldwide patterns and trends in SQL injection attacks. One
important factor that sticks out is geographic dispersion, which A. Data collection
shows how often SQL injection attacks vary by location. When The query tree log collector, the regular query generator,
examining the differences in attack rates, researchers frequently and the malicious query generator module make up the data
attribute them to infrastructure weaknesses, inequalities in collecting phase. The query trees produced by the PostgreSQL
cyber security knowledge, and the general digital maturity of database system are gathered by the query tree log collector
various nations. module. A collection of standard SQL queries is created using
the usual query generator module and used to train the SVM
J. Educational initiatives and awareness programs classification algorithm. In order to assess how well the
In this research, SURA MAHMOOD ABDULLAH et al. suggested framework detects SQLIAs, a collection of malicious
have proposed Certain literature highlights educational SQL queries is generated using the malicious query generator
activities and awareness campaigns as effective strategies in
module. Following their collection, the proposed method
minimizing SQL injection attacks, acknowledging the crucial
applies the unique technique outlined in the study to transform
role that education plays in strengthening digital defenses.
the query trees into an n-dimensional feature vector. Both
Developers are frequently the intended audience for these
programs since they are at the forefront of developing and syntactic and semantic characteristics are retrieved, and many
maintaining software. statistical models are used to convert the features into numerical
values. Efficient data collection is vital for the proposed
III. EXISTING SYSTEM methodology's success. The study emphasizes a systematic
Attackers can have free access to the databases that support approach to gathering network traffic data, focusing on real-
applications and the potentially sensitive information the world scenarios. It discusses selecting appropriate datasets and
databases hold; SQL injection attacks result in a severe security considering diverse network environments to ensure data
risk to Web applications. While several techniques to solving representativeness. By addressing challenges and
the SQL injection problem have been offered by researchers considerations in data collection, the study enhances the
and practitioners, the existing options either do not fully solve robustness and applicability of the SQL injection detection
the problem or have drawbacks that hinder their acceptance and approach.
usage.
IV. PROPOSED SYSTEM
The proposed method as shown in figure 1 offers a state-of-
the-art defense against the increasingly dangerous threat of
SQL injection attacks in the dynamic world of web
applications. Our approach, which makes use of the Sequential
Minimal Optimization (SMO) technique, is centered on
identifying and reducing SQL injection risks in network traffic
data. Understanding how important it is to have reliable and
efficient detection methods, our approach makes use of Figure 1 Proposed System Architecture
machine learning's built-in strengths. The proposed method An attacker can impede an application's database
leverages a wealth of data to spot unusual patterns suggestive requests by using the SQL injection vulnerability depicted
of SQL injection attacks by focusing on network flow data,
in figure 1 above, which is a net security vulnerability. In
which captures the series of exchanges between hosts. One key
characteristic of the SMO algorithm is its ability to handle large, most cases, it gives an attacker access to data that they
complicated datasets with ease. This allows for increased wouldn't usually be able to obtain.
detection speed and accuracy while reducing false positives.
B. Data preprocessing
The Sequential Minimal Optimization (SMO) algorithm is
pivotal in identifying SQL injection attacks within network The three parts of the proposed framework's data
traffic data. As a machine learning technique, SMO discerns preprocessing module are the vector generator, feature
patterns indicative of potential attacks, enhancing detection extractor, and feature transformer. Syntactic and semantic
accuracy. Its ability to handle large datasets with ease ensures characteristics are extracted from the query tree log that the
efficient analysis of network flow data. By clarifying SMO's query tree log collector module has gathered by the feature
extractor component. Data types, table connections, and query model generator trains the SVM algorithm to recognize
structure are among the aspects that have been retrieved. The normal queries using the feature vectors from the normal
feature extractor component makes sure that the pertinent data query generator module. Next, the trained SVM model is
is collected and utilized in the next stages in order to identify applied to categorize incoming SQL queries as malicious or
legitimate. The trained SVM model's performance is assessed
SQL queries as malicious or legitimate. The extracted
using the model evaluator component. To be more precise, the
characteristics are converted into numerical values that the model evaluator assesses how well the SVM model detects
SVM classification algorithm may utilize by using the feature SQLIAs using feature vectors produced by the malicious
transformer component. The feature transformer converts the query generator module.Because they might not have as strong
extracted features into numerical values that may be used for of security safeguards as modern frameworks, older systems
classification since Support Vector Machines (SVMs) require and apps are more vulnerable to SQL injection attacks.
numerical inputs. This study delves into the rationale behind Ensuring the reliability of the proposed methodology involves
choosing SVM for SQL injection detection and elucidates how careful consideration of multiple factors. Rigorous testing and
its unique characteristics align with the objectives of the validation procedures, including cross-validation techniques,
research. By offering a clear justification for the selection of are employed to assess the model's performance under various
conditions. Additionally, the study explores the impact of
SVM over alternative machine learning algorithms, the study
different parameters on the reliability of results, offering
aims to enhance the understanding of the decision-making insights into potential challenges and strategies for addressing
process, ensuring transparency and confidence in the chosen them. By emphasizing transparency and reproducibility in the
approach. experimental design, the study aims to establish the reliability
of its proposed approach to SQL injection detection.
MALICIOUS QUERY
GENERATOR D. Attack detecting
The part in charge of categorizing incoming SQL queries
DATA COLLECTION as malicious or legitimate is the SQLIA classifier. The feature
vectors produced by the vector generator component in the
QUERY TREE created during the training phase are used by the classifier. To
create a feature vector, the feature extractor, feature
transformer, and vector generator components first convert is
FEATURE EXTRACTOR
then fed this feature vector to determine if the query is
malicious or not. The suggested framework's detection phase
DATA
PREPROCESSING
seems simple enough, with the SQLIA classifier serving as the
primary element in charge of categorizing incoming SQL
FEATURE VECTOR queries. The classifier is made to be as effective as possible at
identifying SQLIAs and reducing false positives by utilizing
MODEL GENERATOR
the trained SVM model in conjunction with the feature vectors
created during the data pre-processing stage.
TRAINING VI. RESULTS AND DISCUSSION
DATA
Promising outcomes were obtained from the experimental
MODEL EVALUATION
assessment of the suggested SQL injection attack detection
framework using real world network traffic data and the
DETECT SQL INJECTION Sequential Minimal Optimization (SMO) method. The
ATTACK
efficacy of the system in precisely detecting and averting
ATTACK
SQL injection attacks was highlighted by its high recall rate
DETECTION and precision. The SMO algorithm's capacity to manage
SQL INJECTION
intricate and multidimensional information resulted in
ATTACK DETECT improved detection accuracy and a reduction in false
positives.
Figure 2. block diagram The study shows a significant increase in accuracy when
The block diagram used to identify SQL injection attacks comparing the two systems: the proposed method performs
is shown in figure 2. When the query generator generates a better with an accuracy level of 81%, while the old system only
query, the data is gathered and educated using machine learning achieves a rate of 75% as shown in Table I and figure 3. This
methods. If a malicious question is discovered, the trained distinction highlights how well the suggested algorithm
model recognizes the attack. addresses the issues or difficulties found in the system. The
C. Training data increase in accuracy shows that the suggested system may be
able to offer a more dependable and efficient solution than the
The feature vectors produced in the data preprocessing
module are used by the model generator component to train current system, probably by utilizing innovations like new
the SVM classification algorithm. To be more precise, the features, algorithms, or techniques. This encouraging result
represents significant progress in the field under investigation
and illustrates the possibility of improving system robustness VIII. FUTURE WORK
and performance by implementing the suggested algorithmic Future research may investigate how to make the SQL
improvements. injection attack (SQLIA) detection framework more versatile
to accommodate a wider variety of database management
TABLE I. PERFORMANCE COMPARISON systems and platforms. Feature extraction enhances the
detection model's discriminative capabilities. The process for
identifying SQL injection threats in network traffic data,
emphasizing the significance of various features and their
algorithm accuracy relevance to attack patterns. Discussions cover feature
selection criteria, dimensionality reduction techniques, and
the rationale behind chosen features, bolstering the proposed
Existing system 75 approach's efficacy. Improving the feature extraction
procedure to take into account changing syntactic and
semantic properties of SQL queries will strengthen the
Proposed system 81
system's defences against new attack methods.
REFERENCES
[1] "Introduction to SQL Injection," by R. Spreitzer, v. Moonsamy, t. Korak,
82 and s. Mangard, IEEE Computer Society Survey Tutorials, vol. 20, no. 1,
pp. 465–488, 1stn quarter, 2017.
80
Existing [2] Historical Development of SQL Injection Techniques by M. Guerar, M.
78 system Migliardi, F. Palmieri, L. Verderame, and A. Merlo, concurrent
76 computing, pract. Exper., vol. 32, no. 18, p. E5549, Sep. 2020.
Proposed [3] "Impact of SQL Injection on Data Security," by Maiti, o. Armbruster, m.
74 system Jadliwala, and j. He, in proceedings of the 11th Asian Conference on
Computer-Mediated Communication Security, 2016, pp. 795/806.
72 accuracy
[4] "Preventive Measures and Best Practices," R. Zhao, C. Yue, and Q. Han,
IEEE Trans. Inf. Forensics Security, vol. 14, no. 1, pp. 75–89, Jan. 2019.
Figure 3. Performance Comparison graph
[5] Challenges in Mitigating SQL Injectionsensors, vol. 22, no. 13, p. 4857,
June 2022, M. Nerini, E. Favarelli, and M. Chiani. 6. "Role of Machine
VII. CONCLUSION Learning in SQL Injection Detection:," T. Van Nguyen, N. Sae-bae, and
To conclude, the proposed system for detecting SQL N. Memon, Compute Security, vol. 66, pp. 115– 128, May 2017.
injection attacks (SQLIAs) is a major advancement in [6] Regulatory Frameworks and Compliance," J. Kim and P. Kang, Appl.
protecting database-driven websites from hostile invasions. Sci., vol. 12, no. 15, p. 7590, July 2022.
SVM classification, multi-dimensional sequences, and a [7] "Social Engineering Aspects of SQL Injection," by E. Ivannikova, G.
David, and T. Hamalainen, in Proceedings of the IEEE Symposium on
sophisticated feature extraction method are all smoothly Computer-Media Communication (iscc), July 2017, pp. 885–889.
integrated by the system, which shows remarkable accuracy [8] "Role of Machine Learning in SQL Injection Detection:," T. Van Nguyen,
in detecting SQL injection assaults at the database level. N. Sae-bae, and N. Memon, Compute Security, vol. 66, pp. 115– 128,
Extensive testing on PostgreSQL's internal query trees May 2017.
validates the methodology's resilience and results in a [9] "Global Patterns and Trends in SQL Injection Attacks," B. Ayotte, M.
detection rate of at least 99.6% with few false positives. The Banavar, D. Hou, and S. Schuckers, IEEE Transactions on Biometrics,
suggested methodology provides a workable and efficient fix Behavior, and Identity Science, vol. 2, no. 4, pp. 377–387, June 2020.
for real-world implementation in addition to addressing [10] "Educational Initiatives and Awareness Programs," sensors, vol. 20, no.
11, p. 3015, may 2020; S. Panda, y. Liu, g. P. Hancke, and u. M. Qureshi.
the drawbacks of current application-level detection
techniques. Because of its effectiveness in strengthening [11] C. Gould, Z. Su, and P. Devanbu. JDBC Checker: A Static Analysis Tool
for SQL/JDBC Applications. In Proceedings of the 26 th International
database systems' security posture, it is positioned to be a Conference on Software Engineering (ICSE 04) –Formal Demos, pages
useful weapon in the continuous fight against changing cyber 697–698, 2021
threats that target critical data repositories. Performance [12] C. Gould, Z. Su, and P. Devanbu. Static Checking of Dynamically
improvement in SQL injection detection is addressed through Generated Queries in Database Applications. In Proceedings of the 26th
strategic choices in algorithm selection and parameter tuning. International Conference on Software Engineering (ICSE 04), pages 645–
The study investigates the optimization of the SMO algorithm 654, 2021.
to enhance its efficiency in identifying attack patterns within [13] N. W. Group. RFC 2616 – Hypertext Transfer Protocol – HTTP/1.1.
Request for comments, The Internet Society, 2021.
network traffic data. Moreover, the impact of data pre-
[14] V. Haldar, D. Chandra, and M. Franz. Dynamic Taint Propagation for
processing techniques on performance is explored. By Java. In Proceedings 21st Annual Computer Security Applications
providing a detailed analysis of the steps taken to boost the Conference, Dec. 2021
overall performance of the proposed methodology, the study [15] W. G. Halfond and A. Orso. AMNESIA: Analysis and Monitoring for
aims to contribute valuable insights for optimizing NEutralizing SQL-Injection Attacks. In Proceedings of the IEEE and
cybersecurity practices. ACM International Conference on Automated Software Engineering
(ASE 2005), Long Beach, CA, USA, Nov 2021. To appear.
[16] W. G. Halfond and A. Orso. Combining Static Analysis and Runtime
Monitoring to Counter SQL-Injection Attacks. In Proceedings of the
Third International ICSE Workshop on Dynamic Analysis (WODA of the 11th International World Wide Web Conference (WWW 03), May
2021), pages 22–28, St. Louis, MO, USA, May 2005. 2021.
[17] M. Howard and D. LeBlanc. Writing Secure Code. Microsoft Press, [19] Y. Huang, F. Yu, C. Hang, C. H. Tsai, D. T. Lee, and S. Y. Kuo. Securing
Redmond, Washington, second edition, 2021. Web Application Code by Static Analysis and Runtime Protection. In
[18] Y. Huang, S. Huang, T. Lin, and C. Tsai. Web Application Security Proceedings of the 12th International World Wide Web Conference
Assessment by Fault Injection and Behavior Monitoring. In Proceedings (WWW 04), May 2020