Pentesting
Follow an authorised penetration-test workflow: scope, reconnaissance, scanning, validation, reporting and retesting, with a practical local project.
A penetration test is a scoped assessment that investigates whether weaknesses can produce meaningful security impact. Its output is evidence and useful remediation, not simply a list of tools or a count of open ports.
This beginner project assesses a local learning server and a fictional notes application. It develops the habits needed for later labs without treating public systems as practice targets.
Before You Start
- Linux, networking, HTTP and basic scripting fundamentals.
- An isolated lab or application you own, plus written scope for any shared environment.
- Python 3 and curl are enough for the core lab. Nmap is optional. The lab uses invented users and notes and binds only to 127.0.0.1:8765.
YOUR PRACTICAL PROJECT
A Small Assessment and Retest Report
Assess a tiny loopback-only notes API supplied in this guide. Write scope, inventory it, demonstrate one synthetic cross-user access flaw, fix the ownership check and produce a report with before/after evidence. The project includes its complete Python lab and regression tests.
SECTION 01
Know What an Assessment Can Tell You
A vulnerability scan looks for patterns that may indicate weaknesses. A penetration test combines discovery, reasoning and controlled validation within an agreed scope. A red-team exercise usually pursues a broader objective and evaluates detection and response under its own rules. These activities can overlap, but they are not interchangeable products.
A test observes a particular environment under particular constraints. It cannot prove that a system has no vulnerabilities. Explain coverage, exclusions and uncertainty in the report. A negative result can still be useful when it names the exact control tested and the evidence collected.
A penetration test asks whether a security requirement can be violated under stated conditions. Here the requirement is simple: learner-a must not read learner-b’s note. An open HTTP port is only an observation; a request returning the other user’s synthetic note is evidence of the requirement failing. Black-box testing begins with limited implementation knowledge, white-box testing includes source or design access, and grey-box testing falls between. This course uses source access so you can connect the symptom to its cause.
Write the Assessment Question
# Local Notes Assessment
Requirement: each lab user reads only their own note.
Method: compare permitted and cross-user GET requests.
Evidence: HTTP status and synthetic response body.
Fix target: the server-side ownership decision.
Limits: no real login system, external targets or production deployment.Expected Result
Save as assessment.md in a new notes-assessment folder. It defines what the final finding must prove.
Build Your Project · Step 1
Write a goal for the local project: “Understand which service is exposed and whether the fictional app enforces note ownership.” Add what the assessment will not cover.
- Write the requirement in your own words.
- Distinguish vulnerability assessment, penetration testing and remediation verification.
- List what this small lab cannot establish about a real production application.
Keep This Deliverable
A testable assessment question and explicit limits.
Common Mistakes and Fixes
- If a proposed finding describes only a tool name or an open port, add the security requirement and evidence needed to show a failure.
Check Your Understanding
What separates a scan observation from a confirmed finding?
Reveal the explanation
A scan result is a lead. A confirmed finding connects an actual behaviour to a violated requirement under reproducible conditions.
Useful Links for This Step
SECTION 02
Define Scope and Rules of Engagement
List systems, accounts, permitted methods, test windows, rate limits, evidence handling and emergency contacts. Identify actions that require separate agreement, such as social engineering, availability testing or accessing production data. Permission to assess one web application does not automatically include its cloud provider or employees.
For a beginner lab, keep the scope concrete: 127.0.0.1 on one chosen port and synthetic accounts in a training application. Use snapshots or a restorable copy before changing vulnerable systems. A clear stop condition helps you respond if testing causes instability or returns unexpected sensitive data.
Scope has boundaries in both space and behaviour. localhost:8765 belongs to this lab only after you have started the supplied process; another service on the same computer is not automatically in scope. Record which methods, accounts and data are permitted. A stop condition matters even for a small exercise: stop when a request reaches an unexpected application, exposes non-synthetic data or requires actions outside the plan. Keep the lab read-only so the demonstration does not depend on destructive changes.
Rules of Engagement for This Lab
## In Scope
Service: the supplied Python process at 127.0.0.1:8765
Routes: /health, /notes/1, /notes/2 and one missing-note test
Identities: learner-a and learner-b, supplied by a test header
Actions: manual GET requests and optional one-port service discovery
## Out of Scope
Other local processes, LAN devices, public sites and real accounts
## Stop Conditions
Unexpected data, wrong service, instability or a changed target
## Cleanup
Stop the Python process; retain only synthetic evidenceExpected Result
Save as scope.md. No permission to test unrelated services follows from this exercise.
Build Your Project · Step 2
Save the scope before running discovery commands. Make sure every later command can be traced back to an allowed target and method.
- Confirm you can identify and stop your own lab process.
- Add a table of planned tests before running them.
- Record which optional tools you will skip and why.
Keep This Deliverable
scope.md and a small bounded test plan.
Common Mistakes and Fixes
- If port 8765 is occupied, do not probe the unknown process. Choose a free port for your own lab and update the scope and all requests consistently.
Check Your Understanding
Does access to one account permit testing every reachable service?
Reveal the explanation
Authorisation covers specific assets and actions. Access to a machine or an account does not imply permission to test every service reachable from it.
Useful Links for This Step
SECTION 03
Build the Deliberately Flawed Notes Lab
Create policy.py and lab_server.py in notes-assessment. The server holds two invented notes in memory and uses X-Lab-User to select a fixture identity. This header is intentionally not real authentication: any caller can choose either lab user. It isolates the ownership decision so you can study one flaw at a time. Never use this identity mechanism for a deployed application.
The initial policy accepts any recognised lab user without comparing the note owner. That is the defect you will investigate. The server reads no personal files, exposes no write route and listens only on loopback. Run python3 lab_server.py, or py lab_server.py on Windows, and keep its terminal visible. Stop it with Ctrl+C before changing the policy and restart it afterwards.
policy.py - Intentionally Incorrect
def can_read(user, note):
# Deliberately flawed: membership is not ownership.
return user in ("learner-a", "learner-b")Expected Result
Save this first. Both fixture users will be allowed to read both notes until you repair the policy.
lab_server.py
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlsplit
from policy import can_read
NOTES = {
"1": {"owner": "learner-a", "text": "A's fictional study note"},
"2": {"owner": "learner-b", "text": "B's fictional study note"},
}
class Handler(BaseHTTPRequestHandler):
def send_json(self, status, value):
body = json.dumps(value).encode("utf-8")
self.send_response(status)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
def do_GET(self):
path = urlsplit(self.path).path
if path == "/health":
self.send_json(200, {"service": "notes-lab"}); return
user = self.headers.get("X-Lab-User")
if user not in ("learner-a", "learner-b"):
self.send_json(401, {"error": "Choose a lab identity"}); return
parts = path.split("/")
note = NOTES.get(parts[2]) if len(parts) == 3 and parts[1] == "notes" else None
if note is None:
self.send_json(404, {"error": "Not found"}); return
if not can_read(user, note):
self.send_json(403, {"error": "Forbidden"}); return
self.send_json(200, {"text": note["text"]})
def log_message(self, format, *args):
pass # The learner records controlled request/response evidence.
if __name__ == "__main__":
print("Notes lab: http://127.0.0.1:8765/health")
HTTPServer(("127.0.0.1", 8765), Handler).serve_forever()Expected Result
The health URL returns {"service":"notes-lab"}. Keep the server running for the following requests. It is a teaching fixture, not a secure application template.
Build Your Project · Step 3
Create and verify the exact process named in your scope.
- Save both files and start the server from their directory.
- Open /health and confirm the notes-lab marker before doing other tests.
- Record the binding, source filenames and stop command in scope.md.
Keep This Deliverable
A reproducible, isolated service containing only synthetic data.
Common Mistakes and Fixes
- ModuleNotFoundError for policy means the files are not together or the name is wrong. A different health response means you reached the wrong service; stop and check the setup.
Check Your Understanding
Why is X-Lab-User unsuitable as production authentication?
Reveal the explanation
The caller controls the header. A real server must establish identity using a validated authentication mechanism before applying the ownership policy.
Useful Links for This Step
SECTION 04
Reconnaissance and Enumeration
Reconnaissance gathers context; enumeration asks more specific questions about something observed. Begin by using the application normally, reading available documentation and identifying its roles, routes and data. Separate a direct observation from an assumption such as “this version is probably vulnerable”.
Passive sources can reveal public information, but they can also be stale. Active requests interact with the target and may create logs, load or state changes. Record where each fact came from and why it matters to the assessment. A concise inventory is more useful than an enormous unreviewed scan output.
For this project, inventory /health and the two documented note routes rather than discovering random paths. Use the source to identify the data flow: request header → fixture identity → note lookup → can_read decision → JSON response. Write a hypothesis at the decision point. The policy file is evidence of an implementation problem, but you still need an HTTP demonstration to connect that code to observable application behaviour.
Confirm the Intended Service
curl -i http://127.0.0.1:8765/health
curl -i -H "X-Lab-User: learner-a" http://127.0.0.1:8765/notes/1Expected Result
Use curl.exe in Windows PowerShell if needed. Both return 200; the note response contains only learner-a’s fictional note.
Build Your Project · Step 4
Inventory the supplied Notes lab rather than the separate Networking server.
- Record each known route, method, identity requirement and response type.
- Draw the request-to-policy data flow.
- Write a hypothesis that predicts what will happen for learner-a requesting note 2.
Keep This Deliverable
An endpoint inventory and one explicit ownership hypothesis.
Common Mistakes and Fixes
- Do not infer authentication from a successful header. It selects a fixture identity; record that limitation in the inventory.
Check Your Understanding
Which inventory observations require more evidence before they become findings?
Reveal the explanation
The response type and open port describe behaviour. The weakness is only established when the behaviour violates the ownership requirement.
Useful Links for This Step
SECTION 05
Scan Only What You Can Explain
A port scan observes how endpoints respond; it does not automatically identify every service or prove exploitability. States such as open, closed and filtered describe the scanner’s observations from its vantage point. Service detection can send extra probes, so understand the options and scope before enabling it.
The example targets one loopback port. It requires Nmap to be installed from its official project or a trusted package repository. Keep the local server running. Avoid broad address ranges and aggressive scripts while learning; they obscure the relationship between a request and its result.
A bounded scan answers a narrow question: is the expected TCP service listening on the one permitted port, and what does it appear to be? Version detection is a clue, not proof that a public exploit applies. A scanner may label Python’s basic HTTP handler differently across versions. Save raw observations and verify them manually with /health. If Nmap is unavailable, the HTTP checks are enough to continue the core project.
Optional One-Port Lab Scan
nmap -sT -sV -p 8765 127.0.0.1Expected Result
With your Notes lab running and Nmap installed, the permitted port should appear open. No broad subnet scan or exploit script is required. The exact service label can vary.
Build Your Project · Step 5
Stop the server and repeat the single-port check. Record the difference, then restart it. Keep the two outputs alongside an explanation.
- Predict the expected port state before running the optional command.
- Compare the result with /health and your scope.
- Record any uncertain version inference as a hypothesis, not a vulnerability.
Keep This Deliverable
One bounded service observation or a documented decision to skip the optional tool.
Common Mistakes and Fixes
- Closed means a host answered without an accepting listener on that port; filtered or timeout states need more evidence. Check your own process before changing network controls.
Check Your Understanding
Does a detected version prove an exploitable vulnerability?
Reveal the explanation
Service detection identifies likely software behaviour. It does not demonstrate an exploitable configuration or prove that an advertised version is accurate.
Useful Links for This Step
SECTION 06
Separate Authentication from Object Ownership
Authentication establishes who a caller is; authorisation decides what that caller may do. The lab’s header simulates the first part and deliberately does not secure it. The policy under test is the second part: which fixture user may read which note. Keep that distinction visible so the final report does not describe the header as a real login session.
Build a matrix before testing. Include each owner reading their own note, each user requesting the other note, an absent identity and a missing object. The desired behaviour is not “deny everything”: owners must still be able to work. The matrix becomes both your test plan and the regression evidence after the fix.
Expected Access Matrix
identity,path,expected_status
learner-a,/notes/1,200
learner-a,/notes/2,403
learner-b,/notes/2,200
learner-b,/notes/1,403
missing,/notes/1,401
learner-a,/notes/999,404Expected Result
Save as expected-access.csv. The incorrect policy will fail the two cross-user rows by returning 200.
Build Your Project · Step 6
Define the positive and negative cases before collecting evidence.
- Explain the difference between the missing-identity and wrong-owner rows.
- Write which part of the test is a fixture assumption.
- Keep the expected matrix unchanged while measuring actual results.
Keep This Deliverable
An access matrix covering allowed, denied and missing cases.
Common Mistakes and Fixes
- Do not change expected values to match an incorrect server response. Preserve the failed requirement and investigate the implementation.
Check Your Understanding
Would hiding another user’s note link in the browser fix the server weakness?
Reveal the explanation
No. A caller can request a URL directly. The server must enforce the ownership decision for every protected object request.
Useful Links for This Step
SECTION 07
Validate a Weakness with Minimum Impact
Exploitation means using a weakness to demonstrate an effect. In an authorised assessment, select the smallest proof that answers the security question. For the fictional notes app, one controlled cross-account read demonstrates an authorisation problem without collecting unrelated records or changing other users’ data.
Before running a public proof of concept, read its code, identify required conditions and consider side effects. A matching banner can be misleading because patches may be backported or features disabled. Prefer a non-destructive validation and stop when the evidence is sufficient. Record the exact boundary crossed, not just a tool’s success message.
Use the minimum request that demonstrates the issue. First show learner-a accessing their own note; then keep the identity the same and change only the object ID. Receiving learner-b’s invented note proves the lab’s ownership requirement failed. Do not enumerate extra IDs or add destructive behaviour. The point is the controlled comparison. In a real engagement, the allowed evidence and data handling would come from the rules of engagement, not from the convenience of a script.
Demonstrate the Lab Ownership Flaw
curl -i -H "X-Lab-User: learner-a" http://127.0.0.1:8765/notes/1
curl -i -H "X-Lab-User: learner-a" http://127.0.0.1:8765/notes/2Expected Result
Before the fix, both return 200 and the second reveals B’s fictional study note. The expected result for the second request is 403. This discrepancy is the finding.
Build Your Project · Step 7
Use the supplied Notes lab and its two fixture identities. Compare the own-note and cross-user requests, record the actual responses and explain the missing ownership check.
- Run exactly the two planned requests and save the synthetic responses.
- Repeat once to establish reproducibility.
- Explain the violated boundary without claiming impacts you did not test.
Keep This Deliverable
A minimal, reproducible before-fix demonstration.
Common Mistakes and Fixes
- If you already get 403, inspect whether policy.py was previously fixed and the server restarted. Do not manufacture a failure to match a walkthrough.
Check Your Understanding
Why keep the caller fixed while changing only the note ID?
Reveal the explanation
Keeping the same caller while changing only the object isolates the ownership decision. A single screenshot without the identity and request context would be ambiguous.
Useful Links for This Step
SECTION 08
Keep Evidence Small, Traceable and Useful
Evidence should let another reviewer reproduce the conclusion without collecting unnecessary data. Save the request method, path, fixture identity, expected status and actual response. Use filenames that describe the test case. Since this lab contains only invented notes, the evidence can remain small; do not introduce personal tokens or real user records just to make a report look realistic.
A hash helps detect changes to an evidence file after collection. It does not prove that the original observation was true or that the test was authorised. Keep interpretation separate from the raw response so you can correct your explanation without silently editing the evidence. Record skipped tests and environmental limitations alongside successful results.
Record One Finding Observation
{
"case": "A-reads-B",
"target": "127.0.0.1:8765",
"identity": "learner-a (test fixture)",
"request": "GET /notes/2",
"expectedStatus": 403,
"actualStatus": 200,
"dataClass": "synthetic notes only"
}Expected Result
Save as observation.json and adjust actualStatus only to match what you observed.
Hash the Saved Observation
from pathlib import Path
import hashlib
data = Path("observation.json").read_bytes()
print(hashlib.sha256(data).hexdigest())Expected Result
Save as hash_evidence.py and run from the assessment folder. The output is a SHA-256 digest of your exact file, so whitespace edits change it.
Build Your Project · Step 8
Organise evidence so it supports rather than obscures the finding.
- Save the controlled response and observation record with descriptive names.
- Compute the hash and explain its limited purpose.
- Keep a separate analysis note that connects the response to the requirement.
Keep This Deliverable
A small evidence set and an interpretation note.
Common Mistakes and Fixes
- A different hash may simply mean the file was reformatted. Preserve the original bytes and record transformations separately.
Check Your Understanding
Does hashing a response prove the tester’s claim?
Reveal the explanation
It supports later integrity comparisons for those bytes. It does not establish the source, permission or meaning of the observation by itself.
Useful Links for This Step
SECTION 09
Fix the Decision and Add Regression Tests
Repair the policy at the server’s decision point. Recognising a user is not enough; the requested note must belong to that user. Replace policy.py with the corrected function, then restart the server so it imports the new code. Testing a stale running process is a common reason a correct source change appears ineffective.
Unit tests check the policy directly, while HTTP tests check how the server uses it. Keep both positive and negative cases: a fix that returns False for everyone blocks the issue by breaking the product. This simple owner comparison is appropriate to the toy data model. Real applications may also need roles, organisation boundaries, sharing rules and checks on updates or deletion.
policy.py - Corrected Ownership Check
def can_read(user, note):
return user in ("learner-a", "learner-b") and note.get("owner") == userExpected Result
Replace the earlier file, stop the server with Ctrl+C and restart it. Owners remain allowed; cross-user requests should now return 403.
test_policy.py
import unittest
from policy import can_read
class OwnershipTests(unittest.TestCase):
def test_owner_can_read(self):
self.assertTrue(can_read("learner-a", {"owner": "learner-a"}))
def test_other_user_is_denied(self):
self.assertFalse(can_read("learner-a", {"owner": "learner-b"}))
def test_missing_identity_is_denied(self):
self.assertFalse(can_read(None, {"owner": "learner-a"}))
def test_unknown_identity_is_denied(self):
self.assertFalse(can_read("someone-else", {"owner": "someone-else"}))
if __name__ == "__main__":
unittest.main()Expected Result
Run python3 -m unittest -v (Windows: py -m unittest -v) in the assessment folder. All four tests pass after the fix; the cross-user test fails against the original policy.
Build Your Project · Step 9
Connect a concrete remediation to the failed requirement.
- Run the tests against the flawed policy first and record the failing case.
- Apply the fix, rerun tests and restart the HTTP server.
- Repeat the complete access matrix and compare before/after statuses.
Keep This Deliverable
A corrected policy plus unit and HTTP regression evidence.
Common Mistakes and Fixes
- If unit tests pass but HTTP still returns old results, verify the running process and restart it from the correct project directory.
Check Your Understanding
Why test an allowed request after fixing an access-control issue?
Reveal the explanation
Security and functionality both matter. The owner must retain legitimate access while unrelated users are denied.
Useful Links for This Step
SECTION 10
Understand Social Engineering as a Separate Scope
Social engineering attempts to influence a person into an action, such as revealing information, approving access or opening a link. It involves people, trust and organisational processes, so it requires explicit agreement beyond ordinary technical scanning. A beginner can study the concepts without sending deceptive messages or collecting credentials.
Use a tabletop exercise instead: review a fictional suspicious request, identify pressure tactics and define how a support team should verify identity through an independent channel. Measure whether the process is clear and usable. A good defensive outcome is a repeatable verification habit, not embarrassment for a participant.
Human-focused assessments require their own objectives, approved audiences, communication plan and stop conditions. They are not automatically covered by permission to test an API. For this beginner project, use a tabletop scenario without sending messages or collecting credentials. Discuss how someone should verify an unexpected request, where to report it and which organisational control would help. The result is an assessment of a process, not a campaign against actual people.
Run a Tabletop Scenario
Scenario: an unexpected message requests a sign-in code.
Prompt: what independent channel verifies the request?
Expected response: do not share the code; follow the reporting process.
Evidence: notes about the process, not real credentials.
Improvement: make the reporting route easy to find.
Scope: discussion only; no messages are sent.Expected Result
Add a tabletop appendix to the report. It remains separate from the technical access-control finding.
Build Your Project · Step 10
Write a one-page verification checklist and walk through the fictional scenario. Identify how the team can escalate an uncertain request.
- Describe the approved verification and reporting route for a fictional team.
- Identify a process improvement without blaming an individual.
- Mark social-engineering execution as out of scope for the Notes lab.
Keep This Deliverable
A discussion-only process assessment with clear boundaries.
Common Mistakes and Fixes
- Do not infer that a technical engagement permits impersonation or collection of real authentication factors.
Check Your Understanding
Why does a human-focused exercise need separate scope?
Reveal the explanation
An API test and a human-focused exercise affect different people and systems. Each needs its own explicit scope and safeguards.
Useful Links for This Step
SECTION 11
Make Findings Actionable
A report should explain the asset, security requirement, evidence, realistic impact, remediation and remaining uncertainty. Severity depends on context: reachability, required privileges, data sensitivity and business consequences matter. If you use a scoring framework, document its inputs rather than treating the number as self-explanatory.
Group repeated symptoms by root cause when that helps remediation. Include an executive explanation for the owner and enough technical detail for an engineer to reproduce the result. Redact secrets, distinguish simulated examples from executed tests and preserve the evidence securely.
Lead the finding with the observable problem: the API returns another fixture user’s note because the policy checks recognised membership but not ownership. Then show the two requests, explain the limited demonstrated impact and point to the exact fix. Severity should reflect the affected data and scope, not the dramatic name of a technique. For this lab, state that the data is fictional and the identity mechanism is a test fixture; do not present it as a production breach.
Write a Finding a Developer Can Use
## Missing Per-Note Ownership Check
Requirement: a fixture user can read only their own note.
Affected route: GET /notes/{id}
Precondition: running the supplied local Notes lab.
Reproduction: keep learner-a fixed; request /notes/1 then /notes/2.
Observed before fix: both return 200; note 2 belongs to learner-b.
Impact demonstrated: cross-user disclosure of synthetic note text.
Root cause: can_read checks membership but ignores note.owner.
Remediation: compare the owner on the server for every read.
Retest: owner 200; other user 403; missing identity 401; unknown note 404.
Limits: fixture identity is not production authentication.Expected Result
Replace any observation that differs in your environment. Attach the minimal evidence and the test results, not a large unreviewed tool dump.
Build Your Project · Step 11
Add the service inventory, one finding, one non-finding and the scope limitations to your report. Explain why the non-finding did not justify an impact claim.
- Write the finding with exact reproduction steps.
- Have a second reader identify the root cause and fix from the report alone.
- List any tests you skipped and avoid claims beyond the evidence.
Keep This Deliverable
An actionable finding, executive summary and technical appendix.
Common Mistakes and Fixes
- If a report says “critical” without explaining data, access and impact, revisit the reasoning before assigning a severity.
Check Your Understanding
What must a developer be able to do with your finding?
Reveal the explanation
A useful report lets the reader reproduce the behaviour, understand the violated requirement and verify a targeted remediation.
Useful Links for This Step
SECTION 12
Retest and Close the Loop
A retest repeats the relevant scenario after a change and checks legitimate behaviour too. A patch that blocks every user may stop the demonstration but also break the application. Keep both positive and negative cases: the owner can read their note, another account cannot, and unauthenticated access follows the intended policy.
Close the lab by stopping services, removing temporary test data where appropriate and keeping a sanitised report. Record unresolved issues and the limits of your retest. The most valuable habit is connecting observation, hypothesis, evidence, remediation and verification into one coherent chain.
Retesting repeats the original failing request against the changed system, then checks nearby legitimate behaviour. Keep the original expected matrix so the test does not drift. The script below uses only Python’s standard library and the fixed loopback target. It treats HTTP errors as responses to examine and connection errors as a setup failure. A failed assertion means the expected security behaviour was not observed; it is not a reason to alter the expectation without analysis.
retest.py - Verify the Fixed Lab
from urllib.request import Request, urlopen
from urllib.error import HTTPError
cases = [
("learner-a", "1", 200), ("learner-a", "2", 403),
("learner-b", "2", 200), ("learner-b", "1", 403),
(None, "1", 401), ("learner-a", "999", 404),
]
for user, note_id, expected in cases:
headers = {"X-Lab-User": user} if user else {}
request = Request("http://127.0.0.1:8765/notes/" + note_id, headers=headers)
try:
with urlopen(request, timeout=3) as response:
status = response.status
except HTTPError as error:
status = error.code
error.close()
print(user or "missing", note_id, status)
assert status == expected, (user, note_id, status, expected)
print("All six access checks passed")Expected Result
After restarting the corrected server, run python3 retest.py. Six statuses match the matrix and the final message appears. Against the flawed version, the first cross-user case fails.
Build Your Project · Step 12
Complete a before-and-after table for each tested control. Recreate the lab from your notes and confirm the commands still target only loopback.
- Run the unit tests and HTTP retest against the same fixed source.
- Record the actual result and any remaining limitations in the report.
- Stop the lab server and confirm it is no longer available before closing the project.
Keep This Deliverable
A complete assessment package with scope, evidence, remediation, retest and cleanup.
Common Mistakes and Fixes
- Connection refused means the lab is not listening; it is not a passing authorisation result. A 403 for every request may indicate a broken fix.
Check Your Understanding
Does a successful retest establish that the whole application is secure?
Reveal the explanation
A retest confirms the reported issue and adjacent allowed behaviours under the stated conditions. It does not establish that the entire application is secure.
Useful Links for This Step
Check Your Finished Project
- Every action has a target and method covered by scope.
- Open ports and scanner alerts are not mislabelled as confirmed vulnerabilities.
- The report includes realistic impact and limitations.
- The retest verifies both security and legitimate functionality.
- Follow the numbered project tasks and retain the named deliverable from each step.
- Record actual example results, failed cases and any environment-dependent tests you could not perform.
Access and Offline Reading
The complete guide is free to read here. Linked providers may require accounts or offer paid features; check their own access conditions.
The guide text, examples and illustrations are included in this website’s local copy. External documentation, platform accounts, downloads and hosted labs need an internet connection.
References and Further Learning
- OWASP Web Security Testing Guide
- Nmap Reference Guide
- NIST Technical Guide to Security Testing
- PortSwigger Learning Paths
- OWASP ASVS
- OWASP Web Security Testing Guide
- PortSwigger: Access Control
- Python: Local HTTP Server
- OWASP Authorization Cheat Sheet
- Python: hashlib
- Python: unittest
- Python: urllib.request

