9 Hacking Web Applications LabManual
9 Hacking Web Applications LabManual
Applications
Lab Manual
Hacking with
Page | 1
Practical 2: Identifying web application firewall (WAF) using wafw00f
Execute wafw00f command followed by target domain name (website address) to gather
fingerprint of WAF running on the target.
wafw00f <domain address>
In the above result it is identified that example.com is behind a WAF or running some sort of
security solution to detect malicious activities.
Page | 2
Practical 3: Web Application Vulnerability Scanning using Vega
Vega Vulnerability Scanner installation
apt-get install vega –y
among them the first command will update your Kali Linux and the second one will install the Vega
vulnerability scanner.
Page | 3
Start new scan and select the Enter base URI for scan option and provide your target website
address and then click on next button
In the next step you need to select whatever vulnerability tests you want to perform on the target,
these are categorized as injection modules and response processing modules.
Page | 4
You can click on the plus button to expand the sections, and you can choose whatever you want to
test but for this practical make sure you select all of them. Once you have selected all the modules
click on next button to proceed.
If you want to exclude any kind of specific parameters enable this option
Page | 5
Scanner will start finding vulnerabilities on the target website.
Select severity under scan alerts section for detailed information related to identified
vulnerabilities.
Page | 6
Practical 4: Web application Scanning using OWASP-ZAP
(Passive and Active)
Passive Scanning:
Configure a manual proxy in Firefox browser as shown in below image.
Page | 7
As we start visiting pages, we can observe a list of crawled pages under sites tab (on the left
panel). In the bottom panel we can see list of vulnerabilities identified on previously visited pages.
Page | 8
Active scanning:
To perform active scan, select Active Scan option as shown in below image.
Page | 9
Under Active Scan, select New Scan and provide necessary details and click on start scan
Page | 10
Page | 11
Select Report options on top left corner and export results a HTML document.
Page | 12
Practical 5: Web Application Scanning using Netsparker
Install and run Netsparker web application scanner on Windows OS.
Select Scan Policy Editor and configure required options as shown below
Page | 13
Page | 14
Page | 15
Page | 16
Select Start New Scan and add website details, choose name of the policy created before and click
on Start Scan
Page | 17
Page | 18
After completing scan, select Reporting option on top left corner to generate report
Page | 19
Practical 6: XSS (Cross Site Scripting) Attack
In this practical we will test reflected XSS vulnerability on web application (altoromutual.com). Let
us start by creating some JavaScript payloads.
<script>alert(“Hello”)</script> this script will pop alert message.
<script>alert(document.cookie)</script> this script will display existing browser cookies.
We can test XSS on input fields in any website. We can find an input field (search bar) on top right
corner of www.altormutual.com. Paste the above scripts in that input field to trigger reflected XSS
as shown in the below images.
We can also test reflected XSS with the help of HTML tags
<iframe src=’http://espncricinfo.com/’></iframe>
In user’s profile, we can observe that account have been pre-approved for an Altoro Gold Visa with
a credit limit of $10000. Let us modify those card details and credit limit to fool the web server. To
perform this job, launch Burp Proxy and capture the web request to modify the content.
Start Burp Suite and configure proxy in firefox browser to capture web request as shown in the
below images
Page | 22
After configuration, reload the website to allow burp interceptor to capture the request.
Under params tab modify the above highlighted values according to your interest and click on
forward to see the modified value on web page.
Page | 23
Page | 24
Practical 8: Command Execution on vulnerable web application
In this practical, we will test command execution vulnerability on DVWA web application running
on Metasploitable2 OS. Set security to low, before starting execution of below steps.
Now click on command execution button to load that page.
Most of the command execution vulnerable sites will have these kinds of input field. If you closely
observe this webpage allows, execution of ping command. If this input field is not validating the
user input then we can execute any command feeling like it is a terminal.
Page | 25
Attacker can execute any commands like wget to download Trojans, nc to start netcat etc.
Page | 26
Practical 9: Directory Traversal or Path Traversal Attack
To test directory traversal attack, visit different links on website www.altoromutual.com and
observe URL’s in the browser.
Page | 27
Page | 28