Test everything you can reach?
Fernbrook College asks you to test its network. On the same network sits a payroll gateway that an outside company runs.
The college's IT manager says: "Test everything you can reach." Should you? This lesson answers that before any scan starts.
The one rule
Warning
Test only your own lab copy. Testing a real system needs written permission from someone entitled to give it. Without it, getting into a computer can be a crime: in the UK under the Computer Misuse Act 1990.
Quick check: the rule
Have a go
Quick check: the rule
3 questionsBy the end of this lesson
Note
I can check that a target is inside a written scope before I touch it.
Key words
| Word | What it means | Example |
|---|---|---|
| Penetration test | an attack on a system, with permission, to find weaknesses | |
| Scope | the systems a test may touch | |
| Out of scope | a system the test must leave alone | hr |
| Authorisation | written permission from the system's owner | |
| Rules of engagement | how, when and with what the test may run |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
4 questionsPermission has to come from the owner
The Computer Misuse Act 1990 makes it an offence to access a computer without authorisation (section 1). It is another to impair how one works (section 3).
Authorisation must come from someone entitled to control that system. A college can let you test its own servers. It cannot let you test a supplier's gateway, even on its network.
What a written authorisation holds
| Part | What it says |
|---|---|
| Who | The client, the tester, and a signer with authority over each system |
| What | The hosts in scope, and the hosts out of scope, by name or address |
| When | The dates and hours the test may run |
| How | What is allowed, and what is not: no denial of service, no copying data |
| Contacts | Who to call, and when to stop and call them |
| Evidence | How findings are kept, and when they are deleted |
The cells students fill in are left blank in this preview.
Check
Have a go
Check
3 questionsFernbrook's scope, written down
The college signed for three hosts: www (its public site), intranet (the staff portal) and cache (the portal's session store). The gateway, hr, is out of scope.
You may sign in once with each known default and use your own account, tester. You may not change or copy data. The next Run writes the scope as a file.
Write the scope as a file
printf 'www\nintranet\ncache\n' > scope.txtShown here, not run. Press Start lab to type it into your own lab’s terminal.
List the targets, sending them nothing
docker exec -i scanner nmap -sL -iL - < scope.txtShown here, not run. Press Start lab to type it into your own lab’s terminal.
A list scan only looks the names up
-sL asks for the address of each name and stops there, so it says "0 hosts up". -iL - reads the targets from the file, so only the scope is on the list.
The gateway keeps its own log of every connection. Read it now: it should hold only the line it wrote when it started.
Read the supplier's log
docker logs hrShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsTry it: check a target against the scope
# The written scope, and the hosts somebody wants to test.
scope = {"hosts": ["www", "intranet", "cache"], "exclude": ["hr"]}
asked = ["www", "cache", "hr", "printer"]
for host in asked:
if host in scope["exclude"]:
print(host, "is out of scope: never touch it")
elif host in scope["hosts"]:
print(host, "is in scope")
else:
print(host, "is not in the agreement: ask before you touch it")
# Add "intranet" to the asked list and press Run again.
Make a free account to save your work and track your progress.
A common mistake
Warning
Many people think permission from whoever asks for the test is enough. It is enough only for systems that person controls. The IT manager controls www, intranet and cache, so the gateway needs the supplier's own written permission, or it stays out.
Stop, call, and let the defenders know
Stop and call the contact if a test could harm a service, or you find signs of a real attacker. The agreement says who.
The client's defenders are told the window and your address. Then their logs show a test they expected, not an attack. Lesson 2 reads those logs.
Assignment: check an engagement before it starts
An engagement is a dictionary such as {"signed_by": "a.khan", "owners": ["a.khan"], "scope": {"hosts": ["www"], "exclude": ["hr"]}, "start": "2026-11-23T09:00", "end": "2026-11-23T17:00"}. Write three functions.
in_scope(host, scope) is True only when the host, ignoring case and spaces at either end, is in scope["hosts"] and not in scope["exclude"]. in_window(when, start, end) is True when start <= when < end; every time is written YYYY-MM-DDTHH:MM. problems(engagement, when) returns a list of these strings, in this order, for each that applies: "not signed" (an empty signed_by), "signer cannot authorise" (signed, but not by one of owners), "no hosts in scope", "outside window".
def in_scope(host, scope):
return True
def in_window(when, start, end):
return True
def problems(engagement, when):
return []
Make a free account to save your work and track your progress.
Exit quiz
Have a go