command injection

command injection

Hi,

This post is regarding Command Injection.


Command injection is an attack in which the goal is execution of arbitrary commands on the host operating system via a vulnerable application.

Command injection attacks are possible when an application passes unsafe user supplied data (forms, cookies, HTTP headers etc.) to a system shell.

The syntax and commands may differ between the Operating Systems (OS), such as Linux and Windows, depending on their desired actions.

Modal:

First we need one vulnerable web application. In this tutorial i am working with DVWA web application. If you need DVWA you can download here http://www.dvwa.co.uk/.

I have host the DVWA on windows. So i am working with windows commands. Do watch below video and check example of payloads.

Example of payloads:

127.0.0.1 && dir

127.0.0.1 | dir

127.0.0.1 & calc

127.0.0.1 & mkdir D:\vegabird

 

Prevention:

We need to sanitize or ban the input which could cause the vulnerability to occur, those are as follows

  • &&
  • |

    • Related Articles

    • Server Side Js Injection

      Hi, in this tutorial we will see how server-side js injection is performed in the Extreme Vulnerable Node Application. As we know the application is running on Nodejs, so we know what are its command or its predefined tags which could be utilized to ...
    • XML Injection

      In this post, we will see about XML injection. XML injection can also be said as XPath injection where we inject our payload which is more or less similar to SQL injection. We could check the availability of XML injection by using single quote. If it ...
    • NoSql Injection

      In this tutorial, we will see how we can bypass NoSQL (MongoDB) in Extreme Vulnerable Node Application (XVNA). In normal SQL injection, we have few special characters which could use to find the vulnerability and so we have for NoSql. Most of the ...
    • OS Injection

      Hi, This post is regarding OS Injection. Injection always possible on user input field only. In OS injection first, we need to determine the Operating System (OS) on which the server running. So we are running on Windows and the payload varies. For ...
    • Error Based SQL Injection

      Hi, In this post, we will learn about Error-based SQL injection. We know that there are three types of SQL injection. Union Based Injection Error Based injection Blind SQL injection Now to find SQL injection we generally use ' single quote, using ...