Lab 03 β Web Application Penetration Testing
Mission: You are assessing an intentionally vulnerable web application in an isolated lab. Your job is to understand how the application works, map its attack surface, identify weaknesses, validate selected issues safely, and document findings without performing destructive testing.
Mission Information
Section titled βMission Informationβ| Item | Details |
|---|---|
| Certification | CompTIA PenTest+ |
| Difficulty | Intermediate |
| Estimated Time | 3β4 hours |
| Primary Skills | Web enumeration, HTTP analysis, authentication testing, input validation |
| Attacker System | Kali Linux |
| Target Application | OWASP Juice Shop, DVWA, WebGoat, or similar intentionally vulnerable application |
| Primary Tools | Browser, Burp Suite Community, curl, Nmap |
| Input | Labs 01β02 findings |
| Output | Web Application Penetration Test Report |
Learning Objectives
Section titled βLearning ObjectivesβBy the end of this lab, you should be able to:
-
identify a web applicationβs attack surface;
-
understand HTTP requests and responses;
-
intercept traffic using Burp Suite;
-
identify parameters, cookies, tokens, and headers;
-
map application functionality;
-
evaluate authentication behavior;
-
evaluate session management;
-
identify input-validation weaknesses;
-
safely validate SQL injection;
-
safely validate cross-site scripting;
-
recognize directory traversal and file-related weaknesses;
-
identify information disclosure;
-
distinguish vulnerability discovery from impact validation;
-
collect evidence suitable for professional reporting;
-
recommend remediation.
1. Scenario
Section titled β1. ScenarioβYour organization has completed initial reconnaissance and vulnerability scanning.
The target web application has now been approved for focused application-layer testing.
Example scope:
Authorized Application:http://192.168.56.110
Permitted:- Application mapping- HTTP interception- Parameter manipulation- Authentication testing- Session analysis- Input validation testing- Non-destructive vulnerability validation- Testing intentionally vulnerable functionality
Not Permitted:- Denial of service- Destructive data modification- Persistent compromise- Testing systems outside the labUse only an intentionally vulnerable application that you control.
2. Recommended Lab Environment
Section titled β2. Recommended Lab EnvironmentβA simple architecture is sufficient:
Isolated Lab Network | +-------+-------+ | | +-------------+ +-------------+ | Kali Linux | | Vulnerable | | Tester | | Web App | +-------------+ +-------------+ | | +-------HTTP----+Recommended applications:
-
OWASP Juice Shop
-
DVWA
-
OWASP WebGoat
For a PenTest+ lab, DVWA or Juice Shop works very well because both expose common web vulnerability classes.
3. Prepare the Workspace
Section titled β3. Prepare the WorkspaceβCreate a directory:
mkdir -p ~/pentest-lab/web-appcd ~/pentest-lab/web-appCreate notes:
nano web-assessment-notes.mdUse:
# Web Application Assessment Notes
## Target
URL:IP:Application:
## Scope
Authorized Functions:Restricted Actions:
## Technology Stack
Web Server:Framework:Language:Database:Authentication:
## Endpoints
## Parameters
## Cookies
## Authentication Findings
## Session Findings
## Input Validation Findings
## Confirmed Vulnerabilities
## Evidence4. Phase 1 β Confirm Web Services
Section titled β4. Phase 1 β Confirm Web ServicesβBegin by validating the exposed application service.
Run:
nmap -sV -p 80,443,3000,8080 192.168.56.110Use the actual application port.
You may identify:
80/tcp HTTP443/tcp HTTPS3000/tcp Node.js application8080/tcp Alternate HTTPRecord:
| Port | Protocol | Service | Product | Version |
|---|---|---|---|---|
5. Inspect HTTP Headers
Section titled β5. Inspect HTTP HeadersβUse:
curl -I http://192.168.56.110Look for:
ServerContent-TypeSet-CookieLocationX-Powered-ByContent-Security-PolicyStrict-Transport-SecurityDo not assume a header value is always accurate.
Headers are useful clues.
Record:
Server:Framework Indicators:Security Headers:Cookies:Redirects:6. Understand the HTTP Request
Section titled β6. Understand the HTTP RequestβA basic request may look like:
GET /login HTTP/1.1Host: 192.168.56.110User-Agent: Mozilla/5.0Cookie: session=...Important components:
MethodPathHeadersCookiesParametersBodyA response might contain:
HTTP/1.1 200 OKContent-Type: text/htmlSet-Cookie: session=abc123For PenTest+, understand common methods:
GETPOSTPUTPATCHDELETEOPTIONSHEAD7. Phase 2 β Configure Burp Suite
Section titled β7. Phase 2 β Configure Burp SuiteβLaunch:
burpsuiteUse Burpβs built-in browser where possible.
This avoids manually configuring your browser proxy.
Navigate to:
Proxyβ Interceptβ Open BrowserVisit your vulnerable application.
Burp now sits between:
Browser βBurp Proxy βWeb Application8. Intercept Your First Request
Section titled β8. Intercept Your First RequestβEnable:
Intercept is ONRefresh the application.
You should see something similar to:
GET / HTTP/1.1Host: 192.168.56.110User-Agent: Mozilla/5.0Accept: text/htmlIdentify:
Method:Path:Host:Parameters:Cookies:Headers:Click:
Forwarduntil the page loads.
9. Burp HTTP History
Section titled β9. Burp HTTP HistoryβGo to:
Proxyβ HTTP historyThis provides a record of application traffic.
Look for endpoints such as:
/login/register/account/api/search/profile/adminCreate an endpoint inventory:
| Endpoint | Method | Authentication | Parameters | Notes |
|---|---|---|---|---|
| /login | POST | No | username, password | Authentication |
| /profile | GET | Yes | β | User data |
| /search | GET | No | q | Input handling |
10. Phase 3 β Map the Application
Section titled β10. Phase 3 β Map the ApplicationβBrowse every visible application function.
Visit:
HomeLoginRegisterSearchProfilePassword ResetAccountUploadsAdministrationAPI functionsDo not immediately attack inputs.
First understand the application.
Think:
Application βPages βFunctions βEndpoints βParameters βTrust Boundaries11. Identify Input Points
Section titled β11. Identify Input PointsβCommon input points include:
Login formsSearch fieldsRegistration formsURL parametersCookiesHTTP headersJSON fieldsFile uploadsAPI parametersHidden fieldsExamples:
/search?q=test
/product?id=10
/profile?user=5Record all discovered inputs.
12. Phase 4 β Test Client-Side vs Server-Side Validation
Section titled β12. Phase 4 β Test Client-Side vs Server-Side ValidationβSuppose a form requires a specific value.
Browser validation may prevent certain input.
Inspect the request using Burp and modify it after the browser has accepted the form.
This demonstrates a critical concept:
Client-Side Validation β Security ControlSecurity decisions must be enforced server-side.
13. Phase 5 β Authentication Testing
Section titled β13. Phase 5 β Authentication TestingβIdentify the applicationβs login endpoint.
Example:
POST /login HTTP/1.1Content-Type: application/x-www-form-urlencoded
username=user@example.com&password=password123Analyze:
Does the application use HTTPS?
Does it reveal whether a username exists?
Does it provide different error messages?
Does login create a session cookie?
Does logout invalidate the session?Avoid high-volume password attacks unless the lab explicitly requires them.
14. Authentication Error Analysis
Section titled β14. Authentication Error AnalysisβTry two invalid scenarios manually.
Example:
Known username + wrong password
Unknown username + wrong passwordCompare responses.
If the application says:
User does not existfor one case, but:
Incorrect passwordfor another, it may enable username enumeration.
Record this as a potential information-disclosure issue.
15. Phase 6 β Session Management
Section titled β15. Phase 6 β Session ManagementβLog in using your lab account.
Inspect:
Set-CookieExample:
Set-Cookie: session=abc123; HttpOnlyEvaluate flags such as:
SecureHttpOnlySameSiteUnderstand their purpose:
| Attribute | Security Purpose |
|---|---|
| Secure | Restricts cookie transmission to HTTPS |
| HttpOnly | Reduces JavaScript access to cookie |
| SameSite | Helps reduce cross-site request risks |
16. Test Logout Behavior
Section titled β16. Test Logout BehaviorβCapture an authenticated request.
Log out.
Then replay the old request using Burp Repeater.
If the application still accepts the old session after logout, this may indicate weak session invalidation.
Record:
Session before logout:Session after logout:Old token accepted?:17. Burp Repeater
Section titled β17. Burp RepeaterβSelect a request in HTTP history.
Right-click:
Send to RepeaterIn Repeater, you can modify requests manually and resend them.
This is one of the most useful tools in web application testing.
Use it for controlled testing of:
ParametersCookiesHeadersRequest bodiesAuthentication tokens18. Phase 7 β Input Validation Testing
Section titled β18. Phase 7 β Input Validation TestingβChoose a simple parameter, such as:
/search?q=testBegin with harmless changes:
test123special-characters'"<>Observe:
Does the application return an error?Does the page reflect input?Does behavior change?Does the server reject malformed input?Avoid immediately jumping into complex payloads.
The goal is to understand input handling.
19. SQL Injection Concepts
Section titled β19. SQL Injection ConceptsβSQL injection can occur when untrusted input is incorporated into a database query unsafely.
Conceptually:
User Input βApplication βSQL Query βDatabaseAn unsafe application might conceptually create:
SELECT * FROM users WHERE username = '<input>';If input is handled incorrectly, an attacker may alter query logic.
20. Phase 8 β Controlled SQL Injection Validation
Section titled β20. Phase 8 β Controlled SQL Injection ValidationβPerform this only against your intentionally vulnerable application.
Start with a simple syntax probe in an injectable lab field:
'Observe the response.
Possible indicators include:
SQL errorDatabase exception500 responseDifferent application behaviorIf the training application is explicitly designed for SQL injection practice, you can test a basic authentication-bypass pattern such as:
' OR '1'='1Use this only in the local intentionally vulnerable lab.
Your goal is to demonstrate:
Input βChanges Query Logic βApplication behaves unexpectedlyDocument what changed.
21. SQL Injection Evidence
Section titled β21. SQL Injection EvidenceβRecord:
Endpoint:Parameter:Original Input:Test Input:Response Difference:Database Error:Authentication Impact:Validation Status:Do not collect unnecessary data from the database.
Proving that the weakness exists is sufficient for this lab.
22. SQL Injection Remediation
Section titled β22. SQL Injection RemediationβRecommended controls include:
Parameterized queriesPrepared statementsInput validationLeast-privilege database accountsGeneric error handlingThe most important defense is generally avoiding dynamic query construction with untrusted input.
23. Phase 9 β Cross-Site Scripting
Section titled β23. Phase 9 β Cross-Site ScriptingβCross-site scripting occurs when untrusted content is rendered in a browser without appropriate encoding or sanitization.
There are commonly:
Reflected XSSStored XSSDOM-based XSSFor PenTest+, understand the difference.
24. Test Reflection
Section titled β24. Test ReflectionβFind a harmless input such as search.
Enter:
GHC_TEST_123Determine whether the exact value appears in the response.
If it is reflected, inspect where it appears:
<p>Search: GHC_TEST_123</p>Reflection alone does not prove XSS.
25. Controlled XSS Validation
Section titled β25. Controlled XSS ValidationβOn an intentionally vulnerable XSS training function, you can test a harmless browser-execution payload:
<script>alert(1)</script>If the training applicationβs intended exercise executes the JavaScript, the vulnerability is demonstrated.
Do not use payloads that steal cookies, credentials, or data.
Record:
Endpoint:Input:Where reflected:Execution observed:Stored or reflected:26. Reflected vs Stored XSS
Section titled β26. Reflected vs Stored XSSβReflected
Section titled βReflectedβUser input βImmediate server response βBrowser executesTypically requires the victim to access a crafted request.
Input submitted βStored by application βLater delivered to users βBrowser executesStored XSS may affect multiple users.
27. XSS Remediation
Section titled β27. XSS RemediationβRecommendations include:
Context-aware output encodingInput validationHTML sanitizationContent Security PolicySecure framework templatingAvoid recommending only βblock <script>.β
XSS has many contexts and possible representations.
28. Phase 10 β Directory Traversal Concepts
Section titled β28. Phase 10 β Directory Traversal ConceptsβDirectory traversal can occur when a user-controlled file path allows access outside the intended directory.
Conceptually:
Application expects:
/files/report.txtBut unsafe input handling may allow navigation outside that directory.
Indicators include application parameters such as:
?file=report.txt?page=home.html?template=default29. Controlled Traversal Testing
Section titled β29. Controlled Traversal TestingβUse only the intentionally vulnerable applicationβs dedicated traversal exercise.
Begin with harmless path manipulation.
Observe whether the application normalizes or rejects unexpected path values.
Do not access sensitive host files beyond what the training exercise explicitly expects.
Record:
Parameter:Normal request:Test request:Application behavior:Validation status:30. File Upload Assessment
Section titled β30. File Upload AssessmentβIf your application includes file upload functionality, examine:
Allowed extensionsMIME-type checksFile renamingStorage locationDirect accessibilityMaximum sizeExecutable handlingFor this lab, use harmless files such as:
test.txttest.jpgDo not upload executable web shells.
The objective is to understand upload validation.
31. Phase 11 β IDOR and Authorization Testing
Section titled β31. Phase 11 β IDOR and Authorization TestingβApplications frequently use identifiers:
/profile?id=101/order?id=200/document?id=300An authorization weakness may exist if changing an identifier exposes another userβs resource without proper permission checks.
In your lab, create two test accounts if supported.
Example:
Student-AStudent-BLog in as Student-A.
Capture a request for Student-Aβs resource.
Change only the test resource identifier to one belonging to Student-B.
If the intentionally vulnerable application returns another userβs lab data without proper authorization, record the issue.
This demonstrates Broken Object Level Authorization / IDOR-type behavior.
32. Authentication vs Authorization
Section titled β32. Authentication vs AuthorizationβKnow this distinction.
Authentication:Who are you?
Authorization:What are you allowed to do?A user can be successfully authenticated but still gain unauthorized access because of broken authorization.
33. Phase 12 β HTTP Method Testing
Section titled β33. Phase 12 β HTTP Method TestingβCheck supported methods where appropriate:
curl -i -X OPTIONS http://192.168.56.110/A response might show:
Allow: GET, POST, OPTIONSDo not assume every listed method is vulnerable.
Your job is to determine whether dangerous functionality is unnecessarily available.
34. Information Disclosure
Section titled β34. Information DisclosureβLook for information such as:
Software versionsStack tracesDatabase errorsInternal pathsDebug messagesInternal IP addressesAPI keys in frontend codeDeveloper commentsBackup filesExample:
Fatal error:Database connection failed at /var/www/app/config.phpThis may expose valuable internal information.
35. Security Headers Review
Section titled β35. Security Headers ReviewβUse:
curl -I http://192.168.56.110Look for:
Content-Security-PolicyX-Content-Type-OptionsStrict-Transport-SecurityReferrer-PolicyPermissions-PolicyMissing headers do not automatically mean severe vulnerability.
Treat them as part of the applicationβs broader security posture.
36. Phase 13 β API Enumeration
Section titled β36. Phase 13 β API EnumerationβModern applications often communicate with backend APIs.
In Burp HTTP history, identify endpoints such as:
/api/users/api/login/api/products/rest/accountInspect:
HTTP methodJSON bodyAuthorization headerTokensIDsParametersExample:
POST /api/login HTTP/1.1Content-Type: application/json
{ "email": "student@example.com", "password": "..."}37. JSON Parameter Manipulation
Section titled β37. JSON Parameter ManipulationβSend an API request to Repeater.
Modify only one field at a time.
For example:
{ "productId": 10}change to:
{ "productId": 11}Observe whether authorization checks are enforced.
Controlled single-variable changes make analysis much clearer.
38. Build the Web Attack Surface Map
Section titled β38. Build the Web Attack Surface MapβYour final map might look like:
Web Applicationββββ Authenticationβ βββ /loginβ βββ /registerβ βββ /resetββββ User Functionsβ βββ /profileβ βββ /accountββββ Input Functionsβ βββ /searchβ βββ /feedbackβ βββ /uploadββββ API βββ /api/login βββ /api/users βββ /api/productsThis is far more useful than simply saying:
Port 80 is open.39. Phase 14 β Prioritize Findings
Section titled β39. Phase 14 β Prioritize FindingsβCreate a table:
| Finding | Impact | Exploitability | Authentication Required | Priority |
|---|---|---|---|---|
| SQL Injection | High | High | Depends | Critical/High |
| Stored XSS | Medium/High | Medium | Depends | High |
| IDOR | High | Low/Medium | Yes | High |
| Information Disclosure | Low/Medium | Low | No | Medium |
Use the actual context of your lab.
40. Create Finding Files
Section titled β40. Create Finding FilesβCreate:
findings/βββ WEB-01.mdβββ WEB-02.mdβββ WEB-03.mdβββ WEB-04.mdUse this template:
# WEB-01 β Vulnerability Name
## Severity
## Endpoint
## Parameter
## Description
## Preconditions
## Steps to Reproduce
## Evidence
## Security Impact
## Likelihood
## Remediation
## Validation Status41. Example Finding Structure
Section titled β41. Example Finding Structureβ# WEB-01 β Reflected Cross-Site Scripting
## Severity
Medium
## Endpoint
/search
## Parameter
q
## Description
User-controlled input is returned in an executable browser contextwithout sufficient output encoding.
## Evidence
A controlled JavaScript test executed within the intentionallyvulnerable training application.
## Impact
An attacker who can convince another user to access a crafted requestmay be able to execute attacker-controlled JavaScript in that user'sapplication context.
## Remediation
Apply context-aware output encoding and use secure framework templating.Consider Content Security Policy as an additional defense.42. Student Challenge
Section titled β42. Student ChallengeβWithout following the step-by-step commands, identify and document at least four different vulnerability classes in your intentionally vulnerable application.
Try to include:
1 Authentication or session weakness
2 Input validation weakness
3 Authorization weakness
4 Information disclosure or security misconfigurationFor each one, answer:
Where is the vulnerability?
What input triggers it?
What behavior proves it?
What is the potential impact?
How should it be remediated?43. Required Deliverables
Section titled β43. Required DeliverablesβSubmit:
01-web-service-scan.txt02-endpoint-inventory.md03-http-analysis.md04-authentication-session-notes.md05-web-vulnerability-register.md06-web-application-report.mdAlso include your individual finding files.
44. Web Vulnerability Register
Section titled β44. Web Vulnerability RegisterβCreate:
# Web Vulnerability Register
| ID | Finding | Endpoint | Severity | Validation ||---|---|---|---|---|| WEB-01 | | | | || WEB-02 | | | | || WEB-03 | | | | || WEB-04 | | | | |45. Final Report Structure
Section titled β45. Final Report Structureβ# Web Application Penetration Test Report
## 1. Executive Summary
## 2. Scope
## 3. Rules of Engagement
## 4. Methodology
## 5. Application Attack Surface
## 6. Authentication Assessment
## 7. Session Assessment
## 8. Input Validation Assessment
## 9. Authorization Assessment
## 10. Detailed Findings
## 11. Risk Prioritization
## 12. Remediation Recommendations
## 13. Evidence
## 14. Conclusion46. PenTest+ Exam Checkpoints
Section titled β46. PenTest+ Exam CheckpointsβKnow these relationships.
Authentication vs Authorization
Section titled βAuthentication vs AuthorizationβAuthentication"Who are you?"
Authorization"What can you access?"HTTP GET vs POST
Section titled βHTTP GET vs POSTβGETCommonly retrieves resources
POSTCommonly submits data or invokes processingDo not assume POST is inherently secure.
Cookie security
Section titled βCookie securityβUnderstand:
SecureHttpOnlySameSiteSQL Injection
Section titled βSQL InjectionβRemember:
Untrusted input βUnsafe query construction βDatabase query manipulationRemember:
Untrusted input βUnsafe output βBrowser executionIDOR / Broken Access Control
Section titled βIDOR / Broken Access ControlβRemember:
Valid user βChanges resource identifier βServer fails authorization check βUnauthorized resource access47. Knowledge Check
Section titled β47. Knowledge CheckβQuestion 1
Section titled βQuestion 1βWhy use Burp Repeater?
Answer: To manually modify and resend individual HTTP requests for controlled vulnerability analysis.
Question 2
Section titled βQuestion 2βWhat is the major security difference between client-side and server-side input validation?
Answer: Client-side controls can generally be bypassed by modifying the request. Security decisions must be enforced server-side.
Question 3
Section titled βQuestion 3βWhy does seeing your search term in a webpage not automatically prove XSS?
Because reflection alone does not demonstrate executable browser context.
Question 4
Section titled βQuestion 4βWhat is the difference between authentication and authorization?
Authentication verifies identity.
Authorization determines permitted actions and resources.
Question 5
Section titled βQuestion 5βWhich cookie attribute reduces direct access from client-side JavaScript?
HttpOnlyQuestion 6
Section titled βQuestion 6βShould a penetration tester dump an entire database to prove SQL injection?
Answer: Usually no.
Demonstrate the vulnerability with the minimum evidence necessary within the agreed Rules of Engagement.
48. Lab Completion Checklist
Section titled β48. Lab Completion Checklistβ-
I verified the authorized web application.
-
I identified its exposed web services.
-
I inspected HTTP headers.
-
I configured Burp Suite.
-
I intercepted HTTP traffic.
-
I mapped major application endpoints.
-
I identified application input points.
-
I assessed authentication behavior.
-
I reviewed session cookies.
-
I tested session invalidation.
-
I used Burp Repeater.
-
I evaluated input handling.
-
I safely validated an intended SQL injection exercise.
-
I safely validated an intended XSS exercise.
-
I evaluated authorization behavior.
-
I inspected API requests where present.
-
I reviewed information disclosure.
-
I documented at least four findings.
-
I created a vulnerability register.
-
I produced a web assessment report.
-
I stayed within the isolated authorized lab.
Key Takeaways
Section titled βKey TakeawaysβWeb penetration testing is not simply:
Find form βSend payloadA professional workflow is:
Understand Application βMap Attack Surface βCapture HTTP Traffic βIdentify Inputs βForm Hypothesis βPerform Controlled Test βCompare Responses βValidate Vulnerability βAssess Impact βDocument EvidenceFor PenTest+, pay particular attention to:
HTTP β Authentication β Sessions β Input Validation β Authorization β Evidence
You should be able to explain not only what vulnerability exists, but also:
Where does trust fail, how was the weakness validated, what could an attacker gain, and how should the organization fix it?
Whatβs Next?
Section titled βWhatβs Next?ββ‘οΈ Lab 04 β Network Exploitation and Post-Exploitation
Section titled ββ‘οΈ Lab 04 β Network Exploitation and Post-ExploitationβIn the next lab, you will move from discovery and vulnerability validation into controlled exploitation inside the isolated PenTest+ environment.
You will work through:
Validate Target β Select Exploit β Gain Initial Access β Verify Context β Perform Local Enumeration β Identify Privilege-Escalation Opportunity β Collect Minimal Evidence β Cleanup
The lab will cover:
-
exploit selection and validation;
-
Metasploit fundamentals;
-
payload and session concepts;
-
shell handling;
-
post-exploitation enumeration;
-
local privilege-escalation analysis;
-
credential exposure concepts;
-
lateral-movement concepts;
-
maintaining scope during post-exploitation;
-
evidence collection;
-
cleanup and restoration.
This becomes the practical bridge between finding vulnerabilities and understanding their real security impact.