<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Hands-on_Command_Injection_Attack_%28en%29</id>
	<title>Hands-on Command Injection Attack (en) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Hands-on_Command_Injection_Attack_%28en%29"/>
	<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Hands-on_Command_Injection_Attack_(en)&amp;action=history"/>
	<updated>2026-05-05T02:30:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=Hands-on_Command_Injection_Attack_(en)&amp;diff=71006&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;==Setting Up the Environment:==  ===Install DVWA:===  * Download the DVWA ZIP file from [https://github.com/digininja/DVWA](https://github.com/digininja/DVWA). * Extract it to...&quot;</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Hands-on_Command_Injection_Attack_(en)&amp;diff=71006&amp;oldid=prev"/>
		<updated>2024-10-20T12:42:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Setting Up the Environment:==  ===Install DVWA:===  * Download the DVWA ZIP file from [https://github.com/digininja/DVWA](https://github.com/digininja/DVWA). * Extract it to...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Setting Up the Environment:==&lt;br /&gt;
&lt;br /&gt;
===Install DVWA:===&lt;br /&gt;
&lt;br /&gt;
* Download the DVWA ZIP file from [https://github.com/digininja/DVWA](https://github.com/digininja/DVWA).&lt;br /&gt;
* Extract it to a directory on the Ubuntu server.&lt;br /&gt;
* Install dependencies:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql&lt;br /&gt;
&lt;br /&gt;
===Configure Apache:===&lt;br /&gt;
* Create a new Apache configuration file (e.g., `dvwa.conf`) in `/etc/apache2/sites-available/`.&lt;br /&gt;
* Fill it with&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
     ServerName dvwa.local&lt;br /&gt;
     DocumentRoot /path/to/dvwa/&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;Directory /path/to/dvwa/&amp;gt;&lt;br /&gt;
          AllowOverride All&lt;br /&gt;
          Require all granted&lt;br /&gt;
     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace `/path/to/dvwa/` with the path/directory of DVWA.&lt;br /&gt;
* Enable the configuration:&lt;br /&gt;
&lt;br /&gt;
 sudo a2ensite dvwa.conf&lt;br /&gt;
&lt;br /&gt;
* Restart Apache:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
===Configure MySQL:===&lt;br /&gt;
&lt;br /&gt;
* Create the DVWA database:&lt;br /&gt;
&lt;br /&gt;
 mysql -u root -p&lt;br /&gt;
 CREATE DATABASE dvwa;&lt;br /&gt;
&lt;br /&gt;
* Import the DVWA database schema:&lt;br /&gt;
&lt;br /&gt;
 mysql dvwa &amp;lt; /path/to/dvwa/dvwa.sql&lt;br /&gt;
&lt;br /&gt;
==Exploit Command Injection:==&lt;br /&gt;
&lt;br /&gt;
===Access DVWA:===&lt;br /&gt;
* Open a web browser and go to `http://dvwa.local`.&lt;br /&gt;
* Log in using the default credentials (`admin`/`password`).&lt;br /&gt;
&lt;br /&gt;
===Select the &amp;quot;Command Injection&amp;quot; Page:===&lt;br /&gt;
* Click the &amp;quot;Command Injection&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
===Identify Vulnerable Input:===&lt;br /&gt;
* The &amp;quot;Command Injection&amp;quot; page will display a form with a text input field. This input field is vulnerable to command injection.&lt;br /&gt;
&lt;br /&gt;
===Inject Command:===&lt;br /&gt;
* Enter the following payload in the text input field:&lt;br /&gt;
&lt;br /&gt;
 ; cat /etc/passwd;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 The payload will execute the `cat` command to display the contents of the `/etc/passwd` file.&lt;br /&gt;
&lt;br /&gt;
===Submit Form:===&lt;br /&gt;
* Click the &amp;quot;Submit&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
'''If the attack is successful, we will see the contents of `/etc/passwd`.'''&lt;br /&gt;
&lt;br /&gt;
==Additional Notes:==&lt;br /&gt;
&lt;br /&gt;
* We can experiment with other payloads to explore various vulnerabilities.&lt;br /&gt;
* Always use a controlled environment with explicit permission from the system owner.&lt;br /&gt;
* Remember that exploiting vulnerabilities is illegal and unethical.&lt;br /&gt;
&lt;br /&gt;
==Interesting Links==&lt;br /&gt;
&lt;br /&gt;
* [[Forensic: IT]]&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>