Defence Against Command Injection Attacks
Defence Against Command Injection Attacks
Subject Areas
Cloud Computing
Keywords
SQL Injection, Shell Command on Unix-Based Systems, Operating System,
Input Validation, Web Vulnerability, COMMIX
1. Introduction
1.1. Context of the Research
The term “command injection” refers to a broad category of attack methods
wherein specific code is injected and the vulnerable (web) application then ex-
ecutes it [2]. According to the 2013 OWASP Top Ten Web Security Risks, this
kind of attack has been identified as a major security issue and is ranked first [3].
An attacker can introduce arbitrary code or commands into an application
through a code injection vulnerability, which takes advantage of careless han-
dling of untrusted data and causes unexpected execution behaviour. Code injec-
tion attacks come in a variety of forms, such as SQL injections, LDAP injections,
XPATH injections, and cross-site scripting assaults [1] [2] [4]. We will just ad-
dress command injection attacks in this paper [2] [4]. The objective of a com-
mand injection attack, according to OWASP, is to use a vulnerable application
to execute arbitrary commands on the host operating system. The main cause of
command injection attacks is inadequate input validation [2] [4].
Because these attacks take place when an application invokes the operating sys-
tem shell (command prompt shell on Windows, shell command on Unix-based
systems), they are also referred to in the literature as “shell command injection” or
“OS (OPERATING SYSTEM) command injection” [2] [4]. We will simply refer to
these assaults as “command injection” in this third section [2].
solve:
Information Theft: Web applications can be vulnerable to attacks that steal
user data or other sensitive information.
Web Server Infiltration: Hackers can gain unauthorized access to the web server
that runs the web application.
System File Corruption: Malicious actors can corrupt system files, causing the
web application or underlying system to malfunction.
Data Manipulation: Attackers can tamper with data stored within the web ap-
plication.
1.4. Techniques
This project’s methodology, which consists of 5 steps, is presented here. con-
structing a website that is vulnerable or utilizing a website that is vulnerable and
accepts user input, such as ping; configuring a preferred user and tester inter-
face; or utilizing a server-side scripting language (such as Python, PHP, etc.) that
acts as a bridge to the terminal. Any tool can be used to test for vulnerabilities in
a web application; however, the Commix tool is suggested for this project. Com-
ix tools are useful because they are dependable, adaptable, and a command in-
jection dictation tool for all time.
1.5. Methods
This document outlines the five stages of the methodology used to carry out this
project: creating or utilizing a susceptible website that takes user input, such as
ping; configuring a preferred user and tester interface; or utilizing a server-side
scripting language (such as PHP, Python, etc.) that acts as a bridge to the ter-
minal Tools are used to test web applications for vulnerabilities; any tool can be
used, however, the Commix tool is suggested for this project. Because Comix
Tools are reliable, adaptable, and an ever-present command injection dictation
tool, they are an important tool for work.
1.6. Procedure
The project was conducted in five steps, which are shown here as the approach
used: establishing a website that is vulnerable or utilizing one that is insecure
and accepts human input, such as ping; configuring a desired user interface for
testers; or employing a server-side scripting language (such as PHP, Python,
and so on) that acts as a bridge to the terminal. A web application’s vulnerabil-
ities can be tested using a variety of tools; however, the Commix tool is sug-
gested for this project. Due to its stability, flexibility, and constant command
injection dictation capabilities, Comix Tools are an indispensable tool for
work.
1.7. Approaches
This project’s methodology, which consists of five steps, is presented here:
creating a website that is vulnerable or utilizing a website that is vulnerable and
accepts user input, such as ping; configuring a preferred user and tester inter-
face; or utilizing a server-side scripting language (such as Python, PHP, etc.) that
acts as a bridge to the terminal. Any tool can be used to test vulnerabilities in a
web application; however, the Commix tool is suggested for this project. Comix
Tools is a useful tool since it is a command injection dictation tool that is always
reliable, adaptable, and current.
tions [3]. Together, its numerous tools make testing easier at every stage, from
the initial mapping and analysis of the application attack surface to the detection
and exploitation of security vulnerabilities [3]. It was created by Portswigger
Web Security and is Java-based [3].
• The following parameters should be used to validate the arguments given for
this command.
• Positive or white list input validation: specifies exactly where an argument is
allowed.
• White list regular expression: this defines the maximum string length as well
as a white list of acceptable characters.
PLUS DEFENSE
We advise implementing all of these extra defenses in addition to the funda-
mental defenses of parameterization and input validation. These are:
The application should operate with the least amount of privilege necessary to
do the task at hand.
If at all possible, establish a single-task isolated environment with restricted
privileges.
Continued
5. Summary
Web-based applications are essential in helping people in the twenty-first century
complete tasks that can occasionally be highly difficult and time-consuming.
It is for this reason that web application security is crucial. An insecure online
application may cause data leaks or illegal computer access.
5.1. Recommendation
Web developers now have a platform to learn about command injections and
how to defend against them, thanks to this initiative. To guarantee seamless
deployment and robust security for the school web application that is uploaded
on a server, it is advised that the IT department engage in the practices outlined
in this project and also involve the staff and students in his practices.
5.2. Conclusion
Because web applications are now the primary means of communication be-
tween clients and service providers, skilled hackers target their targets for finan-
cial or personal advantage.
Acknowledgements
I am greatly indebted to God Almighty for His grace and mercy that saw me
through to the crucial attainment of achieving the aim of writing this article
alongside all other authors. I cannot but praise His Holy Name for the unusual
favour, spirit of understanding, and inspiration we received from Him, even
when we did not believe we could pursue this article title to attain this level of
success. Blessed be His Holy Name forever and ever.
I am particularly grateful to my article editors, Professor O. Awodele who
would stop at nothing to insist on the best of the best. I immensely appreciate
Professor C. Ogbonna for his fatherly advice, mentorship and contributions to
my work which was remarkably a compass to the successful direction of the
study. I am indebted to all my lecturers in the Department of Cybersecurity and
other departments of the University from whose wealth of knowledge I benefited
immensely. I am also grateful to the founding fathers of Augustine University,
Ilara-Epe, Lagos, Nigeria, for this great institution that has sharpened my aca-
demic prowess.
I cannot but also be grateful to my academic mentors, senior colleagues, and
friends who were in no small measure instrumental to my success during the
course of writing this paper. These associates include Dr. C. Okunnbor, Dr. J.
Akinsola, Dr. O. Kalesanwo, Dr. C. Ajaegbu, Prof. A. Simpson, Dr. D. Aleburu,
Mrs. A. Mamza, Dr. C. Ogu, Prof. M. Eze, Mr. A. Oyebode, Mr. O. Alowosile,
Mr. O. Blaise, Dr. O. Abiodun, Dr. O. Ebiesuwa and Dr. A. Omotunde
My undiminished gratitude goes to my parents, Pastor F. Akinmerese and
Mrs. M. Akinmerese for bringing me forth and training me to be bold and cou-
rageous, and to go for the best education I can get. My gratitude goes to my
brothers’ in-law, Mr. O. Ayodele and Mr. O. Olagbemiro and all my siblings
Mrs. O. Ayodele and Mrs. F. Olagbemiro for their support all the time. My
heartfelt appreciation goes to my wife—Mrs. E. Akinmerese who has proved
herself a worthy pillar of support since I met her. Her steadfast perseverance,
care, understanding and support kept me moving. Words cannot express my
gratitude to my children E. Akinmerese, T. Akinmerese and O. Akinmerese, may
God bless them all abundantly.
Conflicts of Interest
The authors declare no conflicts of interest.
References
[1] Ali, S., Rauf, A. and Javed, H. (2019) SQLIPAI: An Authentication Mechanism
against SQL Injection. Journal of Scientific Research in Europe, 38, 604-611.
https://www.academia.edu/9892425/SQLIPA_An_Authentication_Mechanism_Aga
inst_SQL_Injection
[2] Meijer, E. and Schulte, W. (2017) Unifying Tables, Objects and Documents.
https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=cdcd6b67a0b7ea
867bb43e5fbb36679ad936b8cc#page=149
[3] Prokhorenko, V., Choo, K.-K.R. and Ashman H. (2016) Web Application Protec-
tion Techniques: A Taxonomy. Journal of Network and Computer Applications, 60,
95-112. https://www.sciencedirect.com/science/article/pii/S1084804515002908
https://doi.org/10.1016/j.jnca.2015.11.017
[4] Scott, D. and Sharp, R. (2003) Establishing and Putting into Practice Applica-
tion-Level Web Security Policies. IEEE Transactions on Knowledge and Data Engi-