Skip to main content
Pentesting Methodology, Rules of Engagement and Ethics
Lesson 1 of 11

Pentesting Methodology, Rules of Engagement and Ethics

Plan and execute an authorized penetration test using Rules of Engagement, PTES phases, Black/Gray/White Box models, core assessment tools, and CVSS-prioritized reporting.

Intermediate 24 min Pentesting
Authorised environments only — The techniques described here are used only in training labs and on systems you own or have written permission to test.

Learning objectives

  • Define the legal prerequisites and Rules of Engagement (RoE) required before any active testing begins
  • Compare penetration testing with vulnerability assessment and contrast Black Box, Gray Box, and White Box models
  • Apply the five-phase PTES methodology from reconnaissance through reporting using authorized lab tools
  • Structure a professional pentest report with an Executive Summary, technical evidence, and CVSS-based remediation priorities

Recommended first: Network Scanning & Service Enumeration with Nmap

#Why this matters

Organizations deploy firewalls and automated scanners, yet attackers still chain small misconfigurations into full compromises. A penetration test (pentest) evaluates whether defences hold under realistic pressure and gives defenders clear evidence to fix weaknesses before real adversaries exploit them.

#Authorization, Rules of Engagement, and testing models

Every engagement starts with written approval and a Rules of Engagement (RoE) document defining:

  • In-scope and out-of-scope assets: Exact IP ranges (10.10.10.0/24), domains (portal.example.test), and excluded third-party systems.
  • Testing windows and restrictions: Approved hours, rate limits, and bans on denial-of-service or destructive actions.
  • Emergency contacts and data handling: Escalation contacts for active breaches and rules for encrypting and deleting sensitive evidence after delivery.
yaml
# Example Rules of Engagement scope excerpt (lab engagement)
engagement: CyberSamSU-Internal-2026-01
authorized_targets:
  - 10.10.10.0/24
  - portal.example.test
excluded_targets:
  - 10.10.10.1   # Core gateway (out of scope)
prohibited_actions:
  - denial_of_service
  - destructive_payloads
emergency_contact: soc-lead@example.test
Penetration Test vs Vulnerability Assessment (VA)
Penetration Test
  • Finds and actively exploits weaknesses to prove impact
  • High depth showing real attack chains
  • Takes weeks and costs more
  • Delivers PoC steps and impact analysis
Vulnerability Assessment (VA)
  • Identifies potential weaknesses without exploitation
  • Medium depth with broad scan coverage
  • Takes days and costs less
  • Delivers a prioritized findings list

Testers operate under one of three knowledge models:

  • Black Box: Zero prior information beyond a domain or IP; simulates an outsider closely but takes longer.
  • White Box: Full information (source code, architecture, credentials), enabling the deepest vulnerability discovery.
  • Gray Box: Partial information (such as a user account or API docs), balancing realism and efficiency.

#The five-phase PTES methodology

The Penetration Testing Execution Standard (PTES) structures technical testing into five stages:

  1. ReconGather OSINT, domains, and exposed assets
  2. ScanningEnumerate live hosts, ports, and services (Nmap, Nessus)
  3. AccessSafely exploit authorized findings to prove risk
  4. Post-ExploitAssess privilege escalation and lateral movement impact
  5. ReportDocument evidence, CVSS risk, and remediation steps
  1. Recon (OSINT): Collect public DNS records, subdomains, and technology stacks within scope.
  2. Scanning: Map open ports and versions using Nmap or vulnerability scanners like Nessus.
  3. Access (Exploitation): Safely confirm exploitability to prove real risk rather than reporting raw scanner alerts.
  4. Post-Exploit (Privilege Escalation): Within strict RoE limits, evaluate privilege escalation or lateral movement impact without damaging systems or exfiltrating real user data.
  5. Report: Deliver actionable remediation guidance. Deploying patches is the defending organization's responsibility, not a PTES testing phase.

#Core assessment tools in authorized labs

  • Nmap + NSE: Identifies service versions (-sV) and runs default Nmap Scripting Engine scripts (-sC).
  • Burp Suite: Web testing workbench with Proxy (intercepting HTTP traffic), Repeater (manually editing and resending individual requests), Intruder (automated fuzzing), and Decoder (encoding/decoding).
  • Specialized tools: gobuster (directory discovery), wireshark (packet analysis), sqlmap (authorized SQLi verification), hydra/hashcat (authorized credential audits), bloodhound (Active Directory paths), and Metasploit strictly inside authorized lab scopes.
Running a scoped service and script scan against a lab host
$ nmap -sV -sC lab.local
PORT    STATE SERVICE VERSION
22/tcp  open  ssh     OpenSSH 9.2p1 Debian
80/tcp  open  http    nginx 1.24.0
443/tcp open  https   nginx 1.24.0

#Reporting, CVSS risk tiers, and bug bounty ethics

A professional pentest report serves both management and engineers across five sections:

  1. Executive Summary: Non-technical overview of overall risk and business impact for management.
  2. Scope and Methodology: Tested assets, dates, exclusions, and methods used.
  3. Vulnerabilities Found: Each finding with CVSS score, impact, reproducible PoC steps, and screenshots.
  4. Recommendations and Remediation: Concrete fixes prioritized by risk.
  5. Appendices: Raw logs, scan tables, and supporting data.
CVSS Score Risk Tier Typical Remediation Target
9.0 - 10.0 Critical Fix immediately
7.0 - 8.9 High Fix quickly
4.0 - 6.9 Medium Next sprint
0.1 - 3.9 Low Planned maintenance

Outside formal contracts, bug bounty programs (HackerOne, Bugcrowd, Intigriti) grant legal safe harbor only for assets explicitly listed in each program's scope policy.

#Defending and common mistakes

  • Skipping written authorization: Verbal permission or using a VPN never legalizes unauthorized testing.
  • Confusing scanner output with a pentest: Raw Nessus or Nmap dumps contain false positives and miss business-logic flaws.
  • Omitting the Executive Summary: Leadership needs a non-technical risk summary to fund Critical fixes.
  • Forgetting post-test cleanup: Always remove test accounts and proof files after the engagement.

#Summary

  • Written authorization and signed Rules of Engagement (RoE) are mandatory before any active testing begins.
  • A penetration test actively exploits weaknesses to prove impact, unlike a vulnerability assessment; Black, Gray, and White Box models trade off realism against depth.
  • The five-phase PTES lifecycle (Recon, Scanning, Access, Post-Exploit, Report) guides authorized testing end to end.
  • Strong reports pair a management Executive Summary with reproducible findings prioritized by CVSS tiers (Critical 9.0-10.0, High 7.0-8.9, Medium 4.0-6.9, Low 0.1-3.9).

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge