Proof, not damage
A builder checks a cracked wall by measuring the crack. Nobody knocks the wall down to prove it was weak.
A tester has four possible weaknesses written down. Each needs proof. The proof must leave the college exactly as it was.
The one rule
Warning
Validate only in your own lab copy, inside the written scope. On a real system, using a weakness without written permission can be a crime: in the UK under the Computer Misuse Act 1990. Even with permission, never copy, change or delete data.
Quick check: the rule
Have a go
Quick check: the rule
3 questionsBy the end of this lesson
Note
I can confirm a finding with the least intrusive check that proves it.
Key words
| Word | What it means | Example |
|---|---|---|
| Validate | prove a finding is real | |
| False positive | a finding that turns out not to be real | |
| Least intrusive | the check that disturbs the system least | |
| Evidence | what you saw that proves the finding | |
| Default credentials | the sign-in a product ships with | admin and admin |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
4 questionsCheck a banner's claim before you trust it
Apache 2.4.49 has a known, serious flaw, CVE-2021-41773. A careless tester would fire the exploit at once. A careful one first asks: is this really Apache?
Apache's own "not found" page is HTML that names Apache. Ask for a page that does not exist, and compare.
Ask for a page that does not exist
curl -si http://www:8080/no-such-pageShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsOne listing, one file, then stop
robots.txt pointed at /backup/. Request the folder once. If it lists files, request the one most likely to matter, and read it.
That is enough proof. Downloading everything adds no proof and copies data you have no reason to hold.
Request the backup folder
curl -s http://www:8080/backup/Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Read the one settings file
curl -s http://www:8080/backup/site-config.bakShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsOne sign-in with the known default
The portal's administrator may still have the password it was installed with. The scope allows one try with each known default.
One try proves it or rules it out. If it works, stop: the reply shows what an attacker could do, so you do not need to do it.
Try the installed default once
curl -s -d 'user=admin&pass=admin' http://intranet:8000/loginShown here, not run. Press Start lab to type it into your own lab’s terminal.
Ask the cache who it is, nothing more
The cache answered the version scan without a password. Nmap's redis-info script asks for the server's own information, the INFO command, and stops.
It reads no keys and changes nothing. If it answers, anybody on the network could read every session too.
Ask the cache for its information
docker exec scanner nmap -sT -Pn -p 6379 --script redis-info cacheShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsTry it: choose the least intrusive check
# Ways to check one finding, and how much each one disturbs.
# 0 reads, 1 sends one normal request, 2 changes something, 3 could break it.
checks = [
("read the Server header", 0),
("request a page that does not exist", 1),
("send the exploit the banner suggests", 3),
]
best = min(checks, key=lambda one: one[1])
print("Least intrusive:", best[0])
for name, impact in checks:
print(impact, name, "| allowed" if impact < 2 else "| not without the client")
# Add ("compare with the portal's 404 page", 1). Does the best one change?
Make a free account to save your work and track your progress.
A common mistake
Warning
Many people think proving a weakness means using it as far as it goes. A finding is proved the moment the evidence shows it. Going further risks the client's data and service, and it can take you outside what the agreement allows.
Each finding, its fix and its detection
| Finding | Fix | How a defender detects it |
|---|---|---|
| Banner names a false version | Send no version in the Server header | A scan of their own site shows the header |
| /backup/ lists a settings file | Remove the files and turn listing off | Requests for /backup/ in the web log |
| Administrator kept its default | Set a strong, unique password | A sign-in as admin in the portal log |
| Cache answers without a password | Require a password; let only the portal reach it | Connections from hosts other than the portal |
The cells students fill in are left blank in this preview.
Find your sign-in in the portal's log
docker logs intranet 2>&1 | grep POSTShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check nothing reached the supplier
docker logs hrShown here, not run. Press Start lab to type it into your own lab’s terminal.
Assignment: refuse an unsafe check
A planned check is a dictionary such as {"host": "intranet", "action": "sign in", "tries": 1}. The scope is {"hosts": [...], "forbidden": [...], "max_tries": 1}. Write three functions.
check_ok(check, scope) returns "ok", or the first reason that applies, in this order: "out of scope" (the host is not in hosts), "forbidden action" (the action is in forbidden), "too many tries" (more than max_tries). refused(checks, scope) returns a list of (index, reason) for every check that is not ok, index counting from 0. least_intrusive(options) takes a list of (name, impact) and returns the name with the lowest impact, the first one on a tie.
def check_ok(check, scope):
return "ok"
def refused(checks, scope):
return []
def least_intrusive(options):
return options[-1][0]
Make a free account to save your work and track your progress.
Exit quiz
Have a go