Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Retesting the fixes

After this lesson: I can retest a fix and say whether it is fixed, partly fixed or not fixed.

50 min lesson11 commandsPenetration testing lab: from scope to retest

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

"All fixed," says the email

Two weeks after the report, the college's IT team writes: "All three fixed." The principal asks you to confirm.

You could take their word for it. Or you could run the same checks again and see.

The one rule

Warning

Retest only your own lab copy, inside the scope. On a real system a retest needs written permission too, often a new agreement with new dates. In the UK, access without it can be a crime under the Computer Misuse Act 1990.

Quick check: the rule

Have a go

Quick check: the rule

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

By the end of this lesson

Note

I can retest a fix and say whether it is fixed, partly fixed or not fixed.

Key words

WordWhat it means
Retestrunning the original checks again after a fix
Partly fixedsome checks now pass and some still fail
Regressiona fixed weakness that comes back
Persistentstill in place after a restart
Clean-upremoving what the test left behind

The cells students fill in are left blank in this preview.

Starter

Have a go

Starter

4 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

The IT team releases its fixes

In the lab you play the IT team for a moment. The site and the portal each have a fix switch. The cache's team sets a password with valkey-cli.

Run the three fixes, then go back to being the tester.

Release the site's fix

Command
docker exec www python3 /tmp/www.py --fix

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Release the portal's fix

Command
docker exec intranet python3 /tmp/intranet.py --fix

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Set a password on the cache

Command
docker exec cache valkey-cli config set requirepass Lantern-Harbour-Kestrel-58

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Retest with exactly the same checks

Use the commands from your evidence, unchanged. A different check would test something else.

Start with the backup finding: the folder and the file.

Retest the backup folder and file

Command
for p in /backup/ /backup/site-config.bak; do curl -s -o /dev/null -w "%{http_code} $p\n" http://www:8080$p; done

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Read robots.txt again

Command
curl -s http://www:8080/robots.txt

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Retest the admin default, once

Command
curl -s -d 'user=admin&pass=admin' http://intranet:8000/login

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Retest the cache

Command
docker exec scanner nmap -sT -Pn -p 6379 --script redis-info cache

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Does the fix survive a restart?

Services restart for updates, power cuts and new versions. A fix that lives only in the running process disappears with it.

Restart the cache, wait a few seconds, and retest it.

Restart the cache

Command
docker restart cache

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Retest the cache after the restart

Command
docker exec scanner nmap -sT -Pn -p 6379 --script redis-info cache

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

A common mistake

Warning

Many people think a finding is closed when the IT team says it is fixed. It is closed when the original checks pass, and still pass after a restart. Report each finding as fixed, partly fixed or not fixed, with the retest's own evidence.

Clean up after yourself

Your own tester account still signs in, and the next Run shows it. Ask the client to remove it when the retest ends, and delete your evidence as the agreement says.

The fixes to recommend: remove the backup files, write the cache's password into its configuration, and let only the portal reach it.

Check your own account still works

Command
curl -s -d 'user=tester&pass=Lab-Tester-26' http://intranet:8000/login

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check nothing reached the supplier, all test long

Command
docker logs hr

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Assignment: decide each finding's status

A retest runs each finding's checks and records whether each check passed. Write three functions.

status(passed) takes a list of True and False and returns "fixed" when all passed, "not fixed" when none did, and "partly fixed" otherwise. retest(results) takes a dictionary from finding id to its list and returns a dictionary from finding id to its status. regressions(rounds) takes a list of such status dictionaries, oldest first, and returns the sorted ids that were "fixed" in an earlier round and are not "fixed" in the last one.

Code: python
def status(passed):
    return "fixed"


def retest(results):
    return {}


def regressions(rounds):
    return []

Make a free account to save your work and track your progress.

Exit quiz

Have a go

Exit quiz

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.