Lesson map
Lesson 02 published. Map, example, EX014.
flowchart TD
N0["Learning outcomes"]
N1["2.1 What the paper must say"]
N2["2.2 Checking a target list"]
N3["2.3 Stop conditions and out of bounds"]
N4["2.4 When someone asks you to break the rules"]
N5["Synthesis"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5
N5 --> EX["Worked example"]
EX --> Q["Exercise EX014"]
Logical drawing
flowchart LR
N0["Learning outcomes"]
N1["2.1 What the paper must say"]
N2["2.2 Checking a target list"]
N3["2.3 Stop conditions and out of bounds"]
N4["2.4 When someone asks you to break the rules"]
N5["Synthesis"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> Q["EX014"]
[Learning outcomes]
|
v
[2.1 What the paper must say]
|
v
[2.2 Checking a target list]
|
v
[2.3 Stop conditions and out of bounds]
|
v
[2.4 When someone asks you to break the rules]
|
v
[Synthesis]
|
v
[Worked example] --> [Exercise EX014]
Learning outcomes
You will (1) list what a written authorization must contain; (2) check proposed targets against a scope with a short script; (3) explain stop conditions and out-of-bounds rules; and (4) handle a request that would break the rules.
2.1 What the paper must say
Before any testing, a written agreement — sometimes called rules of engagement — must name the systems and people in scope, what is out of scope, which methods are allowed, the start and end times, who to call in an emergency, how findings will be reported, and how data will be handled afterwards. NIST SP 800-115 and PTES both treat scoping as a first-class stage, not a formality.
If any of these items is missing, testing waits until the agreement is corrected and signed again. Maya's classroom pack covers 192.0.2.0/25, excludes the payroll server at 192.0.2.10 and allows only a configuration and policy review.
2.2 Checking a target list
Testers compare every proposed address or hostname with the written scope. Excluded systems — payroll, medical devices, safety systems — must never be touched even if they share a network. A simple local check catches mistakes before anyone sends a packet.
"""Lab 2: check synthetic targets against a written scope (no network traffic is sent)."""
import ipaddress
in_scope = [ipaddress.ip_network("192.0.2.0/25")] # documentation range, synthetic
excluded = {ipaddress.ip_address("192.0.2.10")} # payroll server: owner excluded it
requested = ["192.0.2.5", "192.0.2.10", "192.0.2.130", "198.51.100.7"]
for t in requested:
ip = ipaddress.ip_address(t)
if ip in excluded:
verdict = "EXCLUDED - do not test"
elif any(ip in n for n in in_scope):
verdict = "in scope"
else:
verdict = "OUT OF SCOPE - do not test"
print(f"{t:14} {verdict}")
Run with python3 lab_scope.py. Verified output:
192.0.2.5 in scope
192.0.2.10 EXCLUDED - do not test
192.0.2.130 OUT OF SCOPE - do not test
198.51.100.7 OUT OF SCOPE - do not test
The lab script compares four addresses with one allowed range and one excluded address, and sends no traffic. Only 192.0.2.5 is in scope: 192.0.2.10 is the excluded payroll server, and 192.0.2.130 and 198.51.100.7 fall outside 192.0.2.0/25. Run it whenever the list changes, and keep the output with the plan as a record that the check happened before any work began.
2.3 Stop conditions and out of bounds
Stop conditions are events that end or pause testing at once: the owner asks to stop, an unexpected outage appears, safety systems are involved, or sensitive data is exposed beyond the test's purpose. Out-of-bounds rules list methods that are never allowed, such as denial-of-service or social engineering of students, unless the paper explicitly permits them.
When a stop condition occurs, pause at once, contact the emergency contact named in the agreement and write down the time and what you were doing. Testing resumes only when the authorizing contact says so. For Maya's classroom exercise, a slow staff portal test page is enough reason to pause and call.
2.4 When someone asks you to break the rules
Colleagues sometimes ask for a "quick check" of a system that is not in scope. The answer is always no until the authorization is changed in writing. Being helpful does not create permission.
If the request is genuine, the person should ask the system's owner to change the agreement in writing. In Maya's exercise, a classmate asks her to add a personal blog, and she refuses: the college's authorization covers only agreed college systems, and pressure or friendship does not change that. Record each refused request, so your manager can see that the rules held.
Worked example (synthetic RCC)
Maya is given a draft target list for a classroom exercise that uses documentation addresses only: 192.0.2.5, 192.0.2.10 (payroll, excluded), 192.0.2.130 and 198.51.100.7. She runs the check script. Only 192.0.2.5 is in scope; the others are excluded or outside the agreed network. She removes them from the list before any further work.
Synthetic case — RCC. The addresses come from documentation ranges (RFC 5737); the college and exclusions are invented.
Errors and limits
A script only checks the list you give it; it cannot discover whether the real network matches the paper. Live scanning needs separate, explicit authorization.
Exercises
- EX014 — Rules contents. Name five things a rules-of-engagement document must state.
Show marking criteria
Rubric: 3 = five of scope, exclusions, methods, times, contacts, reporting, data handling; 2 = three; 1 = one; 0 = none. - EX015 — Payroll exclusion. Why is 192.0.2.10 marked EXCLUDED even if it sits in the same /25?
Show marking criteria
Rubric: 3 = owner excluded it (payroll); scope is not only the network range; 2 = partial; 1 = script bug; 0 = none. - EX016 — Out of scope address. What does the lab print for 198.51.100.7, and what must Maya do?
Show marking criteria
Rubric: 3 = OUT OF SCOPE - do not test; remove it and do not contact it; 2 = print only; 1 = test carefully; 0 = none. - EX017 — Adding an address. If Maya adds 192.0.2.20 (not excluded) to
requested, what should the lab print for it?Show marking criteria
Rubric: 3 = "in scope"; 2 = in scope without format; 1 = OUT OF SCOPE; 0 = none. - EX018 — Friend's request. A classmate asks Maya to "quickly check" their personal blog with the college's scanner. What does she say?
Show marking criteria
Rubric: 3 = refuse; no authorization for that system; personal systems out of college scope; 2 = refuse; 1 = do it after hours; 0 = agree. - EX019 — Stop conditions. Give three stop conditions for a test.
Show marking criteria
Rubric: 3 = three specific (owner asks stop, unexpected outage, data exposure, safety issue); 2 = two; 1 = one; 0 = none. - EX020 — Emergency contact. Who does Maya call if the staff portal becomes unavailable during a test?
Show marking criteria
Rubric: 3 = the emergency contact named in the rules; then stop testing; 2 = partial; 1 = social media; 0 = none. - EX021 — Time window. The rules say testing is allowed 09:00–17:00 weekdays. May the firm start at 20:00 to "avoid users"?
Show marking criteria
Rubric: 3 = no; outside agreed window needs written change first; 2 = no; 1 = yes if quieter; 0 = none. - EX022 — Data handling. What should happen to test data after the engagement ends?
Show marking criteria
Rubric: 3 = follow the agreement: retain only as allowed, then delete/return; 2 = partial; 1 = keep forever; 0 = none. - EX023 — Documentation ranges. Why does the lab use 192.0.2.0/24 style addresses?
Show marking criteria
Rubric: 3 = RFC documentation ranges; safe for examples; not real RCC internet; 2 = partial; 1 = real campus; 0 = none. - EX024 — Scope change mid-test. The firm finds a related server and wants to add it. What is the correct process?
Show marking criteria
Rubric: 3 = pause; written scope change from authorizing contact; then resume if approved; 2 = partial; 1 = just add it; 0 = none. - EX025 — PTES and scoping. Where does PTES place scoping among its stages?
Show marking criteria
Rubric: 3 = at the beginning / first-class stage before technical work; 2 = "early"; 1 = at the end; 0 = none. - EX026 — Safe practice summary. State the one-line rule Maya writes on her notepad.
Show marking criteria
Rubric: 3 = if it is not clearly in the written scope, do not test it; 2 = partial; 1 = scan everything; 0 = none.
Synthesis
Written scope, exclusions and stop conditions decide every action; anything unclear is out of bounds.
Continue studying — chapter 02 of 04
← Chapter 01 (draft) · Course chapter index · Chapter 03 (draft) →