Scope, Rules of Engagement, and Reconnaissance
Turn an authorised engagement into a safe test plan, then gather information without crossing boundaries.
By the end, you’ll be able to…
- Write scope, objectives, and rules of engagement for an authorised assessment.
- Distinguish passive and active reconnaissance and their legal implications.
- Use DNS, certificate, and public-source data to map an attack surface.
- Record evidence and stay inside the agreed scope at every step.
01Authorisation Is the First Control
A penetration test is an authorised simulation of an attacker. Without explicit, documented authorisation, the same actions are computer crime. The client must have the authority to approve testing of every target, including third-party hosted services. A signed statement of work, scope, and rules of engagement protects the tester, the client, and any bystanders.
Scope answers 'what may be tested?'. It should list domains, IP ranges, applications, environments, accounts, and testing windows. Out-of-scope items are just as important: production payment systems, third-party APIs, employee devices, and social engineering may be excluded. If you discover an asset that appears related but is not listed, stop and ask. Do not assume permission.
Rules of engagement define how testing happens. Include allowed techniques, prohibited techniques, emergency contacts, data handling, evidence retention, reporting timelines, and stop conditions. Agree on how a critical finding is escalated immediately, not saved for the final report. Good paperwork is not bureaucracy; it is how trust is maintained when something goes wrong.
02Passive Reconnaissance Comes First
Passive reconnaissance uses public information without directly touching the target's systems. It includes domain registration records, DNS history, certificate transparency logs, public code repositories, job postings, documentation, and search engines. The goal is to understand the organisation's technology, naming conventions, exposed services, and people without generating suspicious traffic.
Certificate transparency logs are especially useful. Every publicly trusted certificate is logged, often revealing subdomains such as staging, vpn, or admin that are not linked from the main site. DNS records reveal mail providers, verification tokens, and sometimes internal naming. Public repositories can expose internal hostnames, cloud account IDs, and configuration mistakes. None of this requires exploitation, but it still needs to be handled responsibly.
Passive data is a hypothesis, not proof. A subdomain may be retired, a certificate may cover a name that no longer resolves, and a repository may belong to a different organisation with a similar name. Validate ownership before active testing. Record the source and timestamp for every finding.
# Registration and delegation data.whois example.com | head -40dig +short NS example.comdig +short MX example.comdig +short TXT example.com# Certificate transparency search (web UI or API).# Query: https://crt.sh/?q=%25.example.com# Check public DNS history with a provider you are authorised to use.# Treat historical records as leads, not current facts.# Review public code only within the engagement's rules.# Look for accidental hostnames, keys, and internal documentation.NS ns1.example.net. NS ns2.example.net. MX 10 mail.example.com. TXT "v=spf1 include:_spf.example.net -all"
03Active Reconnaissance Within Scope
Active reconnaissance sends traffic to the target. It can reveal live hosts, open ports, service versions, web technologies, and content paths. Because it is visible and can affect availability, it must be rate-limited, scheduled, and explicitly allowed. Start with low-impact checks and escalate only as the rules of engagement permit.
Host discovery and port scanning should be deliberate. Scan only the in-scope addresses. Use a conservative timing profile on production systems. Record the command, start and end time, source address, and results. If a scan causes an outage or unusual behaviour, stop and contact the client. A tester who ignores availability is not doing professional security work.
Web reconnaissance includes fetching pages, inspecting headers, mapping routes, and identifying frameworks. Directory brute-forcing can be noisy and may trigger defences. Prefer manual exploration and the application's own navigation first. When you do use automation, choose a wordlist appropriate to the target, limit concurrency, and exclude destructive paths. Every request is part of the evidence trail.
# Lab target only, explicitly in scope.TARGET=10.10.10.30nmap -sn "$TARGET"nmap -sV --top-ports 100 -T3 "$TARGET"# Web fingerprinting with a single request.curl -sS -I "http://$TARGET/"curl -sS "http://$TARGET/" | head -40# DNS and virtual-host checks in a lab.dig @"$TARGET" version.bind chaos txt 2>/dev/null || trueNmap scan report for 10.10.10.30 Host is up (0.0012s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.6 80/tcp open http nginx 1.24.0
04Build a Target Map, Not a Tool Dump
Reconnaissance produces a lot of raw output. The useful product is a map: domains, hosts, services, versions, authentication surfaces, third parties, and potential trust relationships. Group assets by owner and environment. Mark what is confirmed versus inferred. Note which assets are out of scope and why.
Prioritise the map for testing. Public login pages, exposed administrative interfaces, file uploads, APIs, and integrations with other systems usually deserve attention before a random high port. Consider the business context: a staging server with synthetic data may be lower impact than a production admin console, even if both have the same software version.
The final reconnaissance note should let another tester continue without repeating your work. Include commands, timestamps, source addresses, results, and open questions. This is also the evidence base for the report. Professional offensive work is judged as much by discipline and documentation as by technical cleverness.
The ideas worth keeping.
- Written authorisation and a precise scope are non-negotiable.
- Passive reconnaissance uses public data; active reconnaissance sends traffic and needs explicit permission.
- A target map with confirmed and inferred assets is more useful than raw tool output.
- Documentation and rate control are part of professional testing, not optional extras.
Make it yours.
Type and test your code right here in the interactive workspace. Run your solution, check the output, and compare with the worked guide when ready.
Exercise 1: Write a scope section
A client asks you to test 'the website and anything related'. Write a scope and rules-of-engagement section with at least five inclusions, three exclusions, a testing window, and an escalation path.
Explore a worked solution
In scope: www.example.com, app.example.com, the staging environment at staging.example.com, the documented API at api.example.com, and two test accounts supplied by the client. Out of scope: third-party payment processing, employee email accounts, social engineering, denial-of-service testing, and any subdomain not listed. Window: weekdays 09:00-17:00 UTC, with a pause during the client's month-end freeze. Escalation: critical findings reported within one hour to the named security contact by phone and encrypted email; stop testing if availability is affected. Data: synthetic test data only; evidence encrypted at rest and deleted 30 days after report acceptance.A scope that says 'anything related' is not a scope. Explicit inclusions, exclusions, timing, and escalation protect everyone.
Exercise 2: Separate passive from active
Classify each activity as passive or active and explain the risk: reading certificate transparency logs, querying the target's DNS server directly, browsing the public marketing site, running a port scan, and searching a public code repository.
Explore a worked solution
Passive: certificate transparency logs, browsing the public marketing site, and searching a public code repository, because they use public information or ordinary visitor traffic. Active: querying the target's DNS server directly and running a port scan, because they send unusual traffic to the target and may be logged, rate-limited, or disruptive. Even passive activity can be risky if it involves authentication or accessing non-public data; stay within the agreed scope.The passive/active distinction is about direct interaction with the target, not about whether the data is public. Active tests require explicit permission and rate control.
What stayed with you?
Check the ideas while they’re fresh. Your answers stay in this page and feedback appears as you go.
Keep exploring.
The official references behind this lesson, when you want a second angle or the full details.
One lesson closer.
Reading is a start. Trying it yourself makes the connection.