Labs / Security Basics / Security foundations

Lab 4 of 5 · Security foundations

Rules of engagement: the line between a test and a crime

Read a signed scope for a bank's pentest, sweep only what it names, test inside its rules, and stop at the boundary.

Start this lab 4 steps

The idea

Bram has an authorised job: a penetration test of Meridian Credit Union's customer portal, from a test machine on Meridian's DMZ segment (the part of the network that faces the internet). Before any tool runs, he has a signed Rules of Engagement document that says exactly which systems he may touch, from where, and when.

The same scan is a paid service against one host and a criminal offence against the one beside it. What tells them apart is the owner's authorisation, and the signed scope is how Bram proves he has it. So he reads it, then works inside it.

The signed scope is the boundary
The signed scope is the boundary
The tool holds the scope
The tool holds the scope
An in-scope page names an out-of-scope host
An in-scope page names an out-of-scope host
A lead is not a permission
A lead is not a permission

Steps

  1. Read the rules before you touch anything

    A penetration test is authorised access, and the Rules of Engagement write that authorisation down: the hosts in scope, the ones explicitly out of scope, the techniques allowed, the dates, the tester's source address and who to call.

    Running these same tools against a system without its owner's permission is a criminal offence, under laws like the UK Computer Misuse Act and the United States' CFAA, however reachable the system is. The law turns on authorisation; the signed scope is Bram's proof of it, and the limit of it.

    Scope lists names and addresses. A name such as portal.meridian.test can resolve to a shared address that also serves other customers, so each address must be confirmed as the client's own. Open the scope for this engagement.

    tester:~# cat /root/engagement/scope.txt
  2. Sweep only what the scope names

    Discovery is the first active step. A ping sweep asks addresses whether a host is up, touching no services yet. Even that is an active touch: every probe leaves a record on the target's side, so discovery stays inside the scope like everything else.

    Enforce the scope in the tool, not only in your head. Bram copied the scope's in-scope addresses into targets.txt and its out-of-scope ones into exclude.txt. nmap reads its targets from one and refuses the other, so a mistyped range cannot reach the gateway.

    tester:~# cat /root/engagement/targets.txt /root/engagement/exclude.txt
    tester:~# nmap -sn -n -iL /root/engagement/targets.txt --excludefile /root/engagement/exclude.txt
  3. Test only what you're authorised to

    The portal at 10.0.5.10 is in scope, so Bram tests it within the rules: no denial-of-service, inside the dates. Scan its web ports, then read its /status page, the sort of page that often says more than it should.

    This is the work Bram is paid for: probing an authorised host to find what an attacker could.

    tester:~# nmap -n -p 80,443 10.0.5.10
    tester:~# curl -sS -m 3 http://10.0.5.10/status
  4. Stop at the boundary

    The finding is a working lead: a core-banking host at 10.0.6.10. An attacker would pivot to it at once, using what one system gave away as the stepping stone to the next. Bram has a signed scope, so he checks the lead against it before acting on it.

    Look up the core banking network in the scope.

    tester:~# grep -ni 'core banking' /root/engagement/scope.txt

Run these steps on real machines

Keep reading

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab