Ethical Hacking and Legal Considerations
Core Domain — Every penetration tester, regardless of technical skill, must operate within legal and ethical boundaries. Violating these boundaries can result in criminal prosecution, civil liability, and permanent career damage. This topic establishes the foundation for all offensive security work.
Table of Contents
- Ethical Hacking Principles
- Types of Penetration Testing
- Legal Frameworks
- Rules of Engagement (RoE)
- Responsible Disclosure
- OSCP Exam Relevance
- Professional Ethics
- Practical Examples
- Lab Exercises
- Exam Tips
- Cross-References
1. Ethical Hacking Principles
Ethical hacking (also called “white-hat hacking”) is the authorized practice of bypassing or circumventing system security for the purpose of assessing the security of a system, network, or application. The word “ethical” is not merely descriptive — it is the legal and professional distinction between a criminal act and a legitimate security assessment.
1.1 Authorization: The Foundation
Authorization is the single most important element of ethical hacking. Without proper authorization, any security testing activity is illegal, regardless of intent.
Written Permission Requirements
| Requirement | Description | Why It Matters |
|---|---|---|
| Signed Contract | Formal agreement between tester and client | Legal protection for both parties |
| Scope Document | Detailed list of authorized targets | Prevents scope creep and unauthorized access |
| Named Authorizer | Specific individual with authority to grant permission | Ensures the authorizer has legal standing |
| Effective Dates | Start and end dates for the engagement | Limits the temporal window of authorization |
| Emergency Contacts | Designated contacts for urgent issues | Enables rapid response to critical findings |
Authorization Letter Essentials
A valid authorization letter must contain:
AUTHORIZATION FOR PENETRATION TESTING
Date: [YYYY-MM-DD]
FROM:
[Authorized Signatory Name]
[Title]
[Organization]
[Contact Information]
TO:
[Penetration Tester / Company Name]
[Contact Information]
1. PURPOSE
This letter authorizes [Tester/Company] to conduct penetration testing
against the systems and networks specified below.
2. SCOPE
In-Scope Targets:
- IP Addresses: [List specific IPs or CIDR ranges]
- Domains: [List domains]
- Applications: [List applications]
- Physical Locations: [If applicable]
Out-of-Scope Targets:
- IP Addresses: [List excluded IPs]
- Domains: [List excluded domains]
- Third-party systems
- Production databases containing PII
3. TESTING PERIOD
Start Date: [YYYY-MM-DD HH:MM Timezone]
End Date: [YYYY-MM-DD HH:MM Timezone]
4. RESTRICTIONS
- No denial-of-service attacks
- No social engineering of employees
- No testing against third-party systems
- No data exfiltration beyond proof-of-concept
5. LIABILITY
[Organization] assumes all liability for authorized testing activities
conducted within the defined scope and timeframe.
6. DATA HANDLING
All findings and data collected must be handled according to the
attached NDA and data handling policy.
Signed: _________________________
Name: [Authorized Signatory]
Title: [Title]
Date: [YYYY-MM-DD]
Critical Point: Verbal authorization is NOT sufficient. Always obtain written authorization before beginning any testing activity. In a legal proceeding, a signed document is the primary defense against criminal charges.
1.2 Scope: Defining Boundaries
Scope defines the boundaries of the engagement. A well-defined scope protects both the tester and the client.
Scope Components
scope:
targets:
in_scope:
- type: "ip_range"
value: "192.168.1.0/24"
description: "Internal network segment A"
- type: "domain"
value: "example.com"
description: "Primary corporate domain"
- type: "application"
value: "https://app.example.com"
description: "Customer-facing web application"
out_of_scope:
- type: "ip_range"
value: "10.0.0.0/8"
description: "Production database network"
- type: "domain"
value: "partner.example.com"
description: "Third-party partner portal"
- type: "system"
value: "All cloud infrastructure"
description: "AWS, Azure, GCP resources"
techniques:
allowed:
- "Network scanning (Nmap)"
- "Vulnerability scanning (Nessus, OpenVAS)"
- "Exploitation of discovered vulnerabilities"
- "Privilege escalation"
- "Post-exploitation (within scope)"
prohibited:
- "Denial of Service (DoS/DDoS)"
- "Social engineering"
- "Physical security testing"
- "Destructive payloads"
- "Data destruction or modification"
timing:
start: "2026-09-01 09:00 UTC"
end: "2026-09-15 17:00 UTC"
maintenance_windows:
- "Sundays 02:00-06:00 UTC (avoid testing)"
notifications:
immediate:
- "Critical vulnerabilities (CVSS 9.0+)"
- "Active data breach indicators"
- "System instability caused by testing"
weekly:
- "Progress reports"
- "Findings summary"
Scope Creep Prevention
Scope creep occurs when testing activities expand beyond the original authorization. Common causes:
| Cause | Example | Prevention |
|---|---|---|
| Discovery of new targets | Finding a subdomain not in scope | Document and report; do not test without re-authorization |
| Lateral movement | Pivoting from in-scope to out-of-scope network | Define pivot rules in RoE upfront |
| Third-party systems | Customer data hosted on external provider | Explicitly exclude third-party systems |
| Cloud environments | Discovering cloud resources linked to target | Define cloud scope explicitly |
| Emergency findings | Critical vuln found on out-of-scope system | Report immediately; request scope amendment |
1.3 Confidentiality
Confidentiality obligations protect sensitive information discovered during testing.
NDA (Non-Disclosure Agreement) Key Elements
NON-DISCLOSURE AGREEMENT
1. DEFINITION OF CONFIDENTIAL INFORMATION
"Confidential Information" includes but is not limited to:
- Network architecture and topology
- Vulnerability findings and exploit details
- System configurations and credentials
- Customer data and business logic
- Security controls and countermeasures
- All reports, notes, and documentation
2. OBLIGATIONS OF THE RECIPIENT
The Recipient agrees to:
a) Use Confidential Information solely for the authorized engagement
b) Not disclose Confidential Information to any third party
c) Protect Confidential Information using industry-standard security
d) Return or destroy all Confidential Information upon engagement completion
e) Not use Confidential Information for personal gain or competitive advantage
3. DURATION
This NDA shall remain in effect for [X] years from the date of signing.
4. EXCLUSIONS
Information is not confidential if it:
a) Was publicly known before disclosure
b) Becomes publicly known through no fault of the Recipient
c) Was independently developed by the Recipient
d) Is required to be disclosed by law (with prior notice to Discloser)
5. REMEDIES
Breach of this NDA may result in:
- Immediate termination of the engagement
- Civil liability for damages
- Criminal prosecution where applicable
Data Handling Best Practices
| Phase | Action | Tool/Method |
|---|---|---|
| Collection | Encrypt data at rest | GPG, AES-256 encryption |
| Storage | Secure, access-controlled storage | Encrypted volume, dedicated secure server |
| Transfer | Encrypted channels only | SFTP, HTTPS, PGP-encrypted email |
| Processing | Isolated environment | Air-gapped or segmented lab |
| Reporting | Redact sensitive data | Remove credentials, PII, internal IPs |
| Retention | Defined retention period | Per contract terms (typically 1-3 years) |
| Destruction | Secure deletion | shred, srm, cryptographic erasure |
# Secure deletion of test data
# Linux - shred with 3 passes
shred -vfz -n 3 /path/to/sensitive_data.txt
# Linux - secure wipe of entire file
shred -vfzu /path/to/file
# Alternative - overwrite with random data then delete
dd if=/dev/urandom of=/path/to/file bs=1M count=1
rm /path/to/file
# Verify deletion
ls -la /path/to/file # Should return "No such file or directory"
1.4 Non-Malicious Intent
The principle of “do no harm” guides all ethical hacking activities.
Harm Prevention Measures
| Risk | Mitigation | Example |
|---|---|---|
| System instability | Test during maintenance windows; use rate limiting | nmap --max-rate 100 |
| Data corruption | Read-only access where possible; avoid write operations | Use --no-defeat-rst-ratelimit carefully |
| Service disruption | Avoid aggressive scanning; respect rate limits | nmap -T2 instead of -T5 |
| Log flooding | Limit scan intensity; coordinate with SOC | Pre-engagement briefing with security team |
| Backdoor creation | Remove all access after testing; document all changes | Maintain change log |
Safe Exploitation Practices
# BEFORE exploitation:
# 1. Verify target is in scope
grep "192.168.1.100" scope_document.txt
# 2. Check for backup/restore capability
echo "Backup verified? [Y/N]"
read backup_status
# 3. Document current system state
nmap -sV -oA pre_exploit_192.168.1.100 192.168.1.100
# DURING exploitation:
# 4. Use non-destructive exploits where possible
# Prefer information disclosure over code execution
# Prefer low-privilege access over root/admin
# 5. Limit impact
# Use --smoke test mode first
msfconsole -q -x "use exploit/target; set RHOSTS 192.168.1.100; run"
# AFTER exploitation:
# 6. Document all changes
nmap -sV -oA post_exploit_192.168.1.100 192.168.1.100
# 7. Remove any backdoors or persistent access
# 8. Restore system to original state if modified
# 9. Report findings immediately
1.5 Reporting
Professional reporting is a core ethical obligation. Findings must be documented clearly, accurately, and responsibly.
Report Structure Standards
PENETRATION TEST REPORT
========================
EXECUTIVE SUMMARY
- High-level findings for management
- Risk ratings and business impact
- Recommended priorities
TECHNICAL SUMMARY
- Methodology used
- Tools and techniques
- Scope and limitations
DETAILED FINDINGS
For each finding:
1. Title
2. Severity (Critical/High/Medium/Low/Info)
3. CVSS Score
4. Description
5. Proof of Concept
6. Impact
7. Remediation Recommendations
8. References
APPENDICES
- Scan results
- Screenshots
- Tool output
- Rules of Engagement copy
- Authorization letter
Severity Classification
| Severity | CVSS Range | Response Time | Description |
|---|---|---|---|
| Critical | 9.0 - 10.0 | Immediate (24h) | Remote code execution, complete system compromise |
| High | 7.0 - 8.9 | 48 hours | Significant data exposure, privilege escalation |
| Medium | 4.0 - 6.9 | 1 week | Limited information disclosure, minor privilege escalation |
| Low | 0.1 - 3.9 | 1 month | Informational findings, best practice violations |
| Informational | N/A | As available | Configuration notes, observations |
1.6 Data Handling Lifecycle
┌─────────────────────────────────────────────────────────────┐
│ DATA HANDLING LIFECYCLE │
├──────────────┬──────────────┬──────────────┬────────────────┤
│ COLLECTION │ STORAGE │ REPORTING │ DESTRUCTION │
├──────────────┼──────────────┼──────────────┼────────────────┤
│ • Encrypt │ • Encrypted │ • Redact │ • Secure │
│ at source │ volume │ PII │ deletion │
│ • Minimize │ • Access │ • Sanitize │ • Verify │
│ collection │ control │ examples │ destruction │
│ • Log access │ • Audit trail│ • Limit │ • Document │
│ │ │ distribution│ process │
└──────────────┴──────────────┴──────────────┴────────────────┘
2. Types of Penetration Testing
Different testing approaches simulate different threat scenarios and provide varying levels of insight.
2.1 Black Box Testing
Definition: The tester has no prior knowledge of the target system, simulating an external attacker with no insider information.
Characteristics
| Aspect | Description |
|---|---|
| Knowledge Level | Zero — no documentation, no credentials, no architecture diagrams |
| Perspective | External attacker |
| Time Required | Longest — must discover everything from scratch |
| Cost | Highest — more time and resources needed |
| Realism | High for external threat simulation |
| Coverage | Limited to what can be discovered externally |
Typical Workflow
Phase 1: Reconnaissance (Passive)
├── OSINT gathering
├── Domain enumeration
├── Search engine reconnaissance
├── Social media analysis
└── Public record searches
Phase 2: Reconnaissance (Active)
├── DNS enumeration
├── Port scanning
├── Service identification
├── Technology fingerprinting
└── Network mapping
Phase 3: Vulnerability Discovery
├── Automated scanning
├── Manual analysis
├── Configuration review
└── Attack surface mapping
Phase 4: Exploitation
├── Vulnerability exploitation
├── Credential attacks
├── Web application attacks
└── Post-exploitation
Phase 5: Reporting
├── Findings documentation
├── Risk assessment
└── Remediation recommendations
When to Use
- Assessing external attack surface
- Simulating real-world external attacks
- Testing incident response capabilities
- When budget allows for thorough assessment
- Annual external assessments
2.2 White Box Testing
Definition: The tester has complete knowledge of the target system, including source code, architecture diagrams, credentials, and configuration details.
Characteristics
| Aspect | Description |
|---|---|
| Knowledge Level | Complete — full access to documentation, code, and credentials |
| Perspective | Insider with full access / comprehensive auditor |
| Time Required | Shortest — can focus on specific areas |
| Cost | Lowest per finding — more efficient |
| Realism | Low for attack simulation, high for compliance |
| Coverage | Most thorough — can test all components |
Typical Workflow
Phase 1: Documentation Review
├── Architecture diagram analysis
├── Source code review
├── Configuration file review
├── Policy and procedure review
└── Previous assessment review
Phase 2: Static Analysis
├── Code analysis (SAST)
├── Dependency review
├── Configuration auditing
└── Access control review
Phase 3: Dynamic Analysis
├── Targeted vulnerability scanning
├── Focused exploitation
├── Logic flaw testing
└── Business logic validation
Phase 4: Comprehensive Testing
├── All attack vectors tested
├── Edge case analysis
├── Integration testing
└── End-to-end validation
Phase 5: Detailed Reporting
├── Code-level findings
├── Architecture recommendations
├── Policy gaps
└── Comprehensive remediation plan
When to Use
- Compliance requirements (PCI DSS, SOC 2)
- New application before deployment
- Critical system assessment
- When thorough coverage is required
- Development team integration
2.3 Gray Box Testing
Definition: The tester has partial knowledge of the target system, typically simulating an insider threat or an attacker who has obtained some internal information.
Characteristics
| Aspect | Description |
|---|---|
| Knowledge Level | Partial — some credentials, limited documentation |
| Perspective | Insider threat / attacker with some intelligence |
| Time Required | Moderate — balance between discovery and directed testing |
| Cost | Moderate — efficient but thorough |
| Realism | High for insider threat scenarios |
| Coverage | Good — combines discovery with directed testing |
Common Gray Box Scenarios
| Scenario | Knowledge Provided | Rationale |
|---|---|---|
| Employee credentials | Standard user account | Simulates compromised employee account |
| Network diagram | High-level architecture | Simulates OSINT + some insider info |
| Application docs | API documentation | Simulates developer leak or public docs |
| Partial source code | Public repositories | Simulates GitHub exposure |
| Limited network access | VPN access | Simulates remote employee |
When to Use
- Insider threat assessment
- Most common enterprise engagement type
- Balance between realism and thoroughness
- When some internal access is realistic
- Regular security assessments
2.4 Double Blind Testing
Definition: Neither the tester nor the defenders know about the assessment. This tests the organization’s detection and response capabilities.
Characteristics
| Aspect | Description |
|---|---|
| Knowledge Level | Tester: None; Defenders: None |
| Perspective | Real-world attack with live defense |
| Time Required | Variable — depends on detection |
| Cost | High — requires coordination and monitoring |
| Realism | Highest — real-world simulation |
| Coverage | Detection and response focus |
Double Blind Engagement Structure
┌─────────────────────────────────────────────────────────────┐
│ DOUBLE BLIND ENGAGEMENT STRUCTURE │
├─────────────────┬─────────────────┬─────────────────────────┤
│ SPONSOR │ TESTER │ DEFENDERS │
│ (Executive) │ (Red Team) │ (Blue Team / SOC) │
├─────────────────┼─────────────────┼─────────────────────────┤
│ • Authorizes │ • Conducts │ • Unaware of │
│ engagement │ attacks │ assessment │
│ • Sets rules │ • Follows RoE │ • Monitors normally │
│ • Receives │ • Reports to │ • Responds to alerts │
│ final report │ sponsor only │ • Logs all activity │
│ • Not aware of │ │ │
│ timing │ │ │
└─────────────────┴─────────────────┴─────────────────────────┘
When to Use
- Testing incident response capabilities
- Evaluating SOC effectiveness
- Measuring detection and response times
- Annual red team exercises
- When defense maturity needs assessment
2.5 Comparison of Testing Approaches
| Feature | Black Box | White Box | Gray Box | Double Blind |
|---|---|---|---|---|
| Tester Knowledge | None | Complete | Partial | None |
| Defender Awareness | Yes | Yes | Yes | No |
| Time Required | Long | Short | Medium | Variable |
| Cost | High | Low-Medium | Medium | High |
| Coverage | External only | Complete | Balanced | Detection focus |
| Realism | High (external) | Low | High (insider) | Highest |
| Best For | External assessment | Compliance | Enterprise assessment | IR testing |
| Findings Depth | Surface level | Deep | Moderate | Detection gaps |
| Risk Level | Medium | Low | Medium | High |
2.6 Choosing the Right Approach
Decision Tree for Testing Approach Selection:
What is the primary goal?
/ | \
/ | \
External Compliance Defense
Assessment / Audit Testing
| | |
Black Box White Box Double Blind
| | |
| Need insider Need balance?
| perspective? |
| | ┌─────┴─────┐
| | Yes No
| | | |
| | Gray Box Double Blind
| |
| Have internal
| access?
| / \
| Yes No
| | |
| Gray Black
| Box Box
3. Legal Frameworks
Understanding the legal landscape is essential for any penetration tester. Unauthorized testing is a criminal offense in most jurisdictions.
3.1 CFAA — Computer Fraud and Abuse Act (USA)
Enacted: 1986, amended multiple times Jurisdiction: United States federal law Key Citation: 18 U.S.C. § 1030
Key Provisions
| Section | Provision | Penalty |
|---|---|---|
| § 1030(a)(1) | Classified national defense information | Up to 10 years imprisonment |
| § 1030(a)(2) | Unauthorized access to obtain information | Up to 5 years (first offense) |
| § 1030(a)(3) | Accessing non-public government computers | Up to 1 year |
| § 1030(a)(4) | Unauthorized access with intent to defraud | Up to 5 years |
| § 1030(a)(5) | Damage to protected computers | Up to 10 years (or 20 for aggravated) |
| § 1030(a)(6) | Traffic in computer passwords | Up to 5 years |
| § 1030(a)(7) | Computer threats | Up to 5 years |
| § 1030(a)(8) | Damage to computer with loss | Up to 10 years |
| § 1030(a)(9) | Extortion relating to computers | Up to 5 years |
“Exceeding Authorized Access”
The CFAA criminalizes not just unauthorized access, but also exceeding authorized access:
Authorized Access Examples:
✓ Accessing systems within scope of written authorization
✓ Using credentials provided for testing purposes
✓ Testing during authorized time windows
Exceeding Authorized Access Examples:
✗ Accessing systems outside the defined scope
✗ Using testing credentials for non-testing purposes
✗ Continuing testing after authorization expires
✗ Accessing data not relevant to the assessment
✗ Sharing access with unauthorized parties
Notable CFAA Cases
| Case | Year | Outcome | Relevance |
|---|---|---|---|
| United States v. Nosal | 2016 | Narrowed “exceeding authorized access” | Limits CFAA scope to authorization boundaries |
| Van Buren v. United States | 2021 | Access must be to restricted areas, not just misuse | Important for defining “unauthorized” |
| United States v. Au | 2015 | MIT student sentenced for network attacks | Shows severity for unauthorized testing |
3.2 GDPR — General Data Protection Regulation (EU)
Enacted: 2016, effective 2018 Jurisdiction: European Union (and organizations processing EU citizen data) Key Citation: Regulation (EU) 2016/679
Key Provisions Relevant to Penetration Testing
| Article | Provision | Relevance to Pentesting |
|---|---|---|
| Art. 5 | Data processing principles | Testing must minimize data exposure |
| Art. 6 | Lawfulness of processing | Authorization provides lawful basis |
| Art. 32 | Security of processing | Pentesting supports compliance |
| Art. 33 | Breach notification (72 hours) | Test findings may trigger notification |
| Art. 34 | Breach communication to data subjects | Critical findings require communication |
| Art. 35 | Data Protection Impact Assessment | Required for high-risk processing |
| Art. 83 | Penalties | Up to €20M or 4% global revenue |
GDPR Fines Structure
| Violation Type | Maximum Fine |
|---|---|
| Less severe violations (Articles 5, 15-24, 32-36, 37, 38, 42, 43) | €10 million or 2% of annual global turnover |
| More severe violations (Articles 5, 6, 7, 8, 15-24, 32-36) | €20 million or 4% of annual global turnover |
| Whichever is higher | Applied per violation |
Pentesting and GDPR Compliance
GDPR-Compliant Penetration Testing Checklist:
□ Data Minimization
- Limit data collection to what is necessary
- Avoid accessing personal data unless in scope
- Document all data accessed during testing
□ Lawful Basis
- Written authorization serves as lawful basis
- Document the legal basis for data processing
- Ensure authorization covers data handling
□ Security Measures
- Encrypt all collected data
- Store data securely during engagement
- Destroy data after engagement completion
□ Breach Notification
- Define what constitutes a "breach" during testing
- Establish notification procedures
- Coordinate with Data Protection Officer (DPO)
□ Documentation
- Record all data processing activities
- Maintain audit trail
- Update Record of Processing Activities (ROPA)
3.3 Computer Misuse Act 1990 (UK)
Enacted: 1990, amended by Police and Justice Act 2006 and Legal Aid, Sentencing and Punishment of Offenders Act 2012 Jurisdiction: United Kingdom
Key Offenses
| Section | Offense | Maximum Penalty |
|---|---|---|
| Section 1 | Unauthorized access to computer material | 2 years imprisonment + fine |
| Section 2 | Unauthorized access with intent to commit further offenses | 5 years imprisonment + fine |
| Section 3 | Unauthorized acts with intent to impair, or with recklessness as to impairing, operation of computer | 10 years imprisonment + fine |
| Section 3ZA | Unauthorized access to data with intent to commit trafficking offenses | 10 years imprisonment + fine |
| Section 3A | Making, supplying, or obtaining articles for use in computer misuse offenses | 10 years imprisonment + fine |
Section 1 — Unauthorized Access
Elements of Section 1 Offense:
1. The defendant did any act in relation to a computer
2. The effect of that act was to secure access
3. The access was to any program or data held in the computer
4. The access was unauthorized
5. The defendant knew that the access was unauthorized
6. The defendant intended to secure access
DEFENSE: Authorization
- Written permission from the data owner
- Must be specific and current
- Must cover the specific systems accessed
Section 3 — Unauthorized Acts Impairing Operation
This section is particularly relevant to penetration testers:
Section 3 covers:
✓ Intentionally causing impairment of computer operation
✓ Intentionally causing impairment of data reliability
✓ Intentionally causing impairment of data access
✓ Recklessly causing any of the above
Penetration Testing Implications:
- DoS attacks during testing = Section 3 offense
- System instability caused by aggressive scanning = potential offense
- Data corruption during exploitation = Section 3 offense
- Even "accidental" disruption can be "reckless"
3.4 Other Relevant Jurisdictions
Canada — Criminal Code
| Section | Offense | Penalty |
|---|---|---|
| s. 342.1 | Unauthorized access to computer system | 10 years (indictable) or summary |
| s. 342.2 | Mischief in relation to data | 10 years (indictable) or summary |
| s. 342.3 | Trafficking in computer passwords | 2 years (indictable) or summary |
| s. 342.4 | Possession of device for committing offense | 2 years (indictable) or summary |
| s. 342.5 | Mischief in relation to computer system | 10 years (indictable) or summary |
Australia — Criminal Code Act 1995
| Section | Offense | Penalty |
|---|---|---|
| s. 477.1 | Unauthorized access, modification, or impairment | 10 years imprisonment |
| s. 477.2 | Unauthorized impairment by denial of service | 10 years imprisonment |
| s. 478.1 | Possession of electronic surveillance device | 2 years imprisonment |
Singapore — Computer Misuse Act
| Section | Offense | Penalty |
|---|---|---|
| Section 3 | Unauthorized access to computer material | 2 years + fine |
| Section 4 | Unauthorized access with intent | 7 years + fine |
| Section 5 | Unauthorized impairment of data | 7 years + fine |
| Section 6 | Unauthorized control of computer | 7 years + fine |
India — Information Technology Act 2000
| Section | Offense | Penalty |
|---|---|---|
| s. 43 | Damage to computer, computer systems | Up to ₹5 lakh + 1 year |
| s. 66 | Hacking and computer related offenses | Up to 3 years + ₹5 lakh |
| s. 66A | Offensive messages through communication services | Struck down by Supreme Court (2015) |
| s. 66C | Identity theft | 3 years + ₹1 lakh |
| s. 66D | Cheating by personation | 3 years + ₹1 lakh |
3.5 Legal Consequences of Unauthorized Testing
Criminal Consequences
| Jurisdiction | Potential Charges | Maximum Penalty |
|---|---|---|
| USA (CFAA) | Unauthorized access, computer fraud | 10-20 years imprisonment |
| UK (CMA) | Unauthorized access, mischief | 10 years imprisonment |
| EU (GDPR) | Data protection violations | €20M or 4% revenue |
| Canada | Unauthorized access, mischief | 10 years imprisonment |
| Australia | Unauthorized access/modification | 10 years imprisonment |
Civil Consequences
| Claim Type | Description | Potential Damages |
|---|---|---|
| Trespass to chattels | Unauthorized use of computer systems | Actual damages + punitive |
| Conversion | Misappropriation of data or systems | Value of property + punitive |
| Breach of contract | Violation of ToS or EULA | Contract damages |
| Negligence | Failure to exercise reasonable care | Actual damages |
| Trade secret misappropriation | Unauthorized access to proprietary data | Actual + punitive damages |
Career Consequences
| Consequence | Impact | Duration |
|---|---|---|
| Criminal record | Background check failure | Permanent |
| License revocation | Loss of professional certifications | Permanent or long-term |
| Employment termination | Immediate dismissal | Permanent |
| Industry blacklisting | Difficulty finding employment | Long-term |
| Reputation damage | Loss of professional credibility | Long-term |
4. Rules of Engagement (RoE)
The Rules of Engagement document is the operational contract between the penetration tester and the client. It defines exactly what can and cannot be done during the assessment.
4.1 Complete RoE Template
# RULES OF ENGAGEMENT
## Engagement Information
| Field | Value |
|---|---|
| **Engagement ID** | PT-2026-001 |
| **Client** | [Client Organization Name] |
| **Tester** | [Tester/Company Name] |
| **Engagement Type** | [Black Box / White Box / Gray Box] |
| **Start Date** | YYYY-MM-DD HH:MM Timezone |
| **End Date** | YYYY-MM-DD HH:MM Timezone |
| **Version** | 1.0 |
| **Last Updated** | YYYY-MM-DD |
---
## 1. OBJECTIVE
The objective of this engagement is to assess the security posture of
[Client Organization] by conducting a [type] penetration test against
the systems and networks defined in Section 2.
## 2. SCOPE
### 2.1 In-Scope Targets
#### Networks
| Network | CIDR | Description |
|---|---|---|
| Corporate LAN | 192.168.1.0/24 | Internal corporate network |
| DMZ | 10.0.1.0/24 | Demilitarized zone |
| Test Environment | 172.16.0.0/16 | Non-production systems |
#### Domains
| Domain | Type | Description |
|---|---|---|
| example.com | Primary | Corporate domain |
| app.example.com | Subdomain | Application domain |
| test.example.com | Subdomain | Test environment |
#### Applications
| Application | URL | Type |
|---|---|---|
| Customer Portal | https://app.example.com | Web Application |
| API Gateway | https://api.example.com | REST API |
| Admin Panel | https://admin.example.com | Web Application |
#### Credentials (if applicable)
| Account | Username | Access Level | Purpose |
|---|---|---|---|
| Standard User | test_user@example.com | User | Gray box testing |
| Service Account | svc_test | Limited | API testing |
### 2.2 Out-of-Scope Targets
The following targets are EXPLICITLY OUT OF SCOPE:
| Target | Reason |
|---|---|
| 10.0.0.0/8 | Production database network |
| partner.example.com | Third-party partner systems |
| All AWS infrastructure | Cloud services managed by third party |
| Employee personal devices | Not owned by organization |
| Physical security | Not included in this engagement |
### 2.3 Scope Exceptions
Any target not explicitly listed in Section 2.1 is considered OUT OF SCOPE.
If a new target is discovered during testing that may be relevant, the
tester MUST:
1. Document the finding
2. Report to the client immediately
3. Obtain written scope amendment before testing
---
## 3. TESTING METHODOLOGY
### 3.1 Allowed Techniques
The following techniques are AUTHORIZED:
- [x] Network scanning (Nmap, masscan)
- [x] Vulnerability scanning (Nessus, OpenVAS, Qualys)
- [x] Web application testing (Burp Suite, OWASP ZAP)
- [x] Exploitation of discovered vulnerabilities
- [x] Privilege escalation (local and remote)
- [x] Post-exploitation activities (within scope)
- [x] Password cracking (offline, using harvested hashes)
- [x] SQL injection
- [x] Cross-site scripting (XSS)
- [x] Directory traversal
- [x] Authentication bypass testing
- [x] Session manipulation
- [x] API security testing
### 3.2 Prohibited Techniques
The following techniques are STRICTLY PROHIBITED:
- [ ] Denial of Service (DoS) or Distributed DoS (DDoS)
- [ ] Social engineering (phishing, vishing, pretexting)
- [ ] Physical security testing
- [ ] Destructive payloads or wiper malware
- [ ] Data destruction or modification
- [ ] Testing against third-party systems
- [ ] Brute force attacks exceeding 100 attempts per account
- [ ] Any activity that could cause service disruption
- [ ] Any activity that could result in data loss
- [ ] Use of exploits known to cause system crashes
### 3.3 Rate Limiting
| Activity | Rate Limit | Rationale |
|---|---|---|
| Port scanning | 100 packets/second | Prevent network congestion |
| Login attempts | 10 per minute per account | Prevent account lockout |
| API requests | 60 per minute | Prevent rate limiting triggers |
| Vulnerability scanning | Standard (T3) | Balance speed and safety |
---
## 4. TIMELINE
### 4.1 Testing Windows
| Phase | Dates | Hours (UTC) | Description |
|---|---|---|---|
| Reconnaissance | Sep 1-2 | 09:00-17:00 | Passive and active recon |
| Scanning | Sep 3-5 | 09:00-17:00 | Vulnerability scanning |
| Exploitation | Sep 6-10 | 09:00-17:00 | Active exploitation |
| Post-Exploitation | Sep 11-12 | 09:00-17:00 | Lateral movement, data mapping |
| Reporting | Sep 13-15 | 09:00-17:00 | Report preparation |
### 4.2 Maintenance Windows
The following times are MAINTENANCE WINDOWS — no testing should occur:
| Day | Time (UTC) | Reason |
|---|---|---|
| Sunday | 02:00-06:00 | Backup window |
| Sunday | 06:00-08:00 | Patch deployment |
### 4.3 Milestones
| Milestone | Due Date | Deliverable |
|---|---|---|
| Kick-off meeting | Sep 1 | Meeting notes |
| Initial findings | Sep 5 | Email summary |
| Critical findings | Immediate | Phone + email |
| Draft report | Sep 14 | PDF document |
| Final report | Sep 15 | PDF + executive summary |
| Debrief meeting | Sep 16 | Presentation |
---
## 5. EMERGENCY CONTACTS
### 5.1 Primary Contacts
| Role | Name | Email | Phone | Availability |
|---|---|---|---|---|
| Project Sponsor | John Smith | john.smith@example.com | +1-555-0101 | Business hours |
| Technical Lead | Jane Doe | jane.doe@example.com | +1-555-0102 | Business hours |
| Security Lead | Bob Wilson | bob.wilson@example.com | +1-555-0103 | 24/7 |
| Tester Lead | [Your Name] | tester@company.com | +1-555-0104 | Business hours |
### 5.2 Escalation Procedure
Level 1: Technical Issue ├── Contact: Technical Lead ├── Response Time: 1 hour └── Examples: Scan causing alerts, access issues
Level 2: Critical Finding ├── Contact: Security Lead ├── Response Time: 30 minutes └── Examples: Active exploit, data exposure
Level 3: Emergency ├── Contact: Project Sponsor + Security Lead ├── Response Time: 15 minutes └── Examples: System instability, data breach, DoS condition
Level 4: Stop Condition ├── Contact: All stakeholders ├── Response Time: Immediate └── Examples: Testing causing production impact
---
## 6. STOP CONDITIONS
Testing MUST STOP immediately if any of the following occur:
| Condition | Action |
|---|---|
| Client requests stop | Stop all testing immediately |
| Production system impact | Stop testing; notify emergency contact |
| Data breach discovered | Stop testing; notify emergency contact |
| System instability | Stop testing; notify emergency contact |
| Unauthorized access detected | Stop testing; cooperate with investigation |
| Scope violation discovered | Stop testing; notify project sponsor |
| Legal request received | Stop testing; consult legal counsel |
| Authorization expires | Stop all testing activities |
### Stop Procedure
- Cease all testing activities immediately
- Document current state and findings
- Notify emergency contact within 15 minutes
- Provide status report of activities performed
- Await further instructions from client
- Do NOT resume testing without written authorization
---
## 7. DATA HANDLING
### 7.1 Data Collection
- Collect only data necessary for the assessment
- Minimize collection of personal data (PII)
- Document all data collected during testing
### 7.2 Data Storage
- All data stored on encrypted volumes (AES-256)
- Access restricted to authorized team members
- Audit logging enabled for all data access
### 7.3 Data Transfer
- All transfers via encrypted channels (SFTP, HTTPS)
- No data transfer via email without encryption
- No data stored on personal devices
### 7.4 Data Retention
- Data retained for [X] months after engagement completion
- Data destroyed using secure deletion methods
- Destruction verified and documented
### 7.5 Data Destruction
```bash
# Secure deletion procedure
# 1. Shred all files
shred -vfz -n 3 /path/to/engagement_data/*
# 2. Remove directory
rm -rf /path/to/engagement_data
# 3. Verify deletion
ls -la /path/to/engagement_data # Should not exist
# 4. Document destruction
echo "Data destroyed on $(date) by $(whoami)" >> destruction_log.txt
8. LIABILITY AND INSURANCE
8.1 Liability
- [Client] assumes liability for authorized testing activities
- [Tester] assumes liability for activities outside scope
- Both parties agree to hold each other harmless for authorized activities
8.2 Insurance
| Type | Coverage | Provider |
|---|---|---|
| Professional Liability | $2,000,000 | [Insurance Provider] |
| Cyber Liability | $5,000,000 | [Insurance Provider] |
| Errors & Omissions | $1,000,000 | [Insurance Provider] |
8.3 Indemnification
[Tester] agrees to indemnify [Client] for any damages resulting from:
- Activities outside the defined scope
- Negligence or willful misconduct
- Violation of applicable laws
[Client] agrees to indemnify [Tester] for any claims arising from:
- Authorized testing activities within scope
- Pre-existing vulnerabilities
- Third-party claims related to authorized testing
9. REPORTING
9.1 Report Deliverables
| Deliverable | Format | Due Date |
|---|---|---|
| Executive Summary | Sep 15 | |
| Technical Report | Sep 15 | |
| Raw Scan Results | CSV/JSON | Sep 15 |
| Presentation | PPTX | Sep 16 |
9.2 Finding Classification
| Severity | CVSS Range | Response Time |
|---|---|---|
| Critical | 9.0-10.0 | Immediate (24h) |
| High | 7.0-8.9 | 48 hours |
| Medium | 4.0-6.9 | 1 week |
| Low | 0.1-3.9 | 1 month |
| Informational | N/A | As available |
10. ACCEPTANCE
By signing below, both parties acknowledge and agree to the terms of this Rules of Engagement document.
Client Representative: Signature: _________________________ Name: [Name] Title: [Title] Date: [YYYY-MM-DD]
Tester Representative: Signature: _________________________ Name: [Name] Title: [Title] Date: [YYYY-MM-DD]
### 4.2 RoE Checklist
Before starting any engagement, verify:
RULES OF ENGAGEMENT CHECKLIST
Pre-Engagement: □ Written authorization obtained and signed □ Scope document reviewed and approved □ NDA signed by all parties □ Emergency contacts identified and verified □ Testing windows confirmed □ Allowed/prohibited techniques documented □ Stop conditions defined □ Data handling procedures agreed □ Liability and insurance confirmed □ Report deliverables and timeline agreed
During Engagement: □ All activities within defined scope □ Testing within authorized time windows □ Rate limits observed □ Critical findings reported immediately □ Data handled per agreed procedures □ All activities documented □ Changes to scope documented and approved
Post-Engagement: □ All backdoors and test accounts removed □ All test data destroyed □ Final report delivered □ Debrief meeting conducted □ Data destruction verified and documented □ Engagement closure confirmed
---
## 5. Responsible Disclosure
Responsible disclosure is the practice of reporting security vulnerabilities to the affected organization in a responsible manner, allowing time for remediation before public disclosure.
### 5.1 What Is Responsible Disclosure?
Responsible disclosure balances three interests:
┌─────────────────────────────────────────────────────────┐ │ RESPONSIBLE DISCLOSURE TRIANGLE │ │ │ │ Researcher │ │ (Reporter) │ │ /\ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │ / \ │ │/ \ │ │─────────────────────────────────────────────────────────│ │ Organization (Vendor) Public (Affected Users) │ │ (Fix the vulnerability) (Protected from exploitation)│ └─────────────────────────────────────────────────────────┘
#### Disclosure Types
| Type | Description | Timeline | Risk |
|---|---|---|---|
| **Full Disclosure** | Public release immediately | Immediate | High — exploits may be used before patch |
| **Responsible Disclosure** | Private report, public after fix | 30-90 days | Medium — balanced approach |
| **Private Disclosure** | Private report, no public release | Ongoing | Low for org, researcher gets no recognition |
| **Coordinated Disclosure** | Collaborative public release | Agreed timeline | Low — all parties aligned |
### 5.2 Bug Bounty Programs
Bug bounty programs formalize responsible disclosure by offering rewards for valid vulnerability reports.
#### Major Platforms
| Platform | URL | Features |
|---|---|---|
| **HackerOne** | https://hackerone.com | Largest platform, 1000+ programs |
| **Bugcrowd** | https://bugcrowd.com | Enterprise focus, managed services |
| **Intigriti** | https://intigriti.com | EU-based, growing platform |
| **YesWeHack** | https://yeswehack.com | European platform |
| **Open Bug Bounty** | https://www.openbugbounty.org | Non-paid, responsible disclosure |
#### HackerOne Program Structure
```yaml
program:
name: "Example Corp Bug Bounty"
status: "Active"
scope:
in_scope:
- "*.example.com"
- "api.example.com"
- "app.example.com"
out_of_scope:
- "blog.example.com"
- "careers.example.com"
- All third-party domains
policies:
allowed_activities:
- "Non-destructive reading of data"
- "Automated scanning of non-production"
- "Manual testing of all in-scope assets"
prohibited_activities:
- "Denial of Service"
- "Social engineering"
- "Physical security testing"
- "Automated scanning of production"
- "Testing of third-party services"
safe_harbor: true
safe_harbor_text: >
Example Corp will not pursue legal action against
researchers who comply with this policy.
rewards:
critical: "$10,000 - $50,000"
high: "$5,000 - $10,000"
medium: "$1,000 - $5,000"
low: "$500 - $1,000"
informational: "$0 - $500"
response_times:
triage: "24 hours"
acknowledgment: "48 hours"
resolution_target: "90 days"
Bug Bounty vs. Responsible Disclosure
| Aspect | Bug Bounty | Responsible Disclosure |
|---|---|---|
| Compensation | Yes (bounty) | No (usually) |
| Scope | Defined by program | Any vulnerability |
| Legal Protection | Safe harbor clause | No formal protection |
| Response Time | Defined SLA | No guaranteed response |
| Recognition | Public Hall of Fame | Optional acknowledgment |
| Structure | Formal program | Informal process |
5.3 Safe Harbor Provisions
Safe harbor provisions protect researchers from legal action when reporting vulnerabilities in good faith.
Standard Safe Harbor Language
SAFE HARBOR POLICY
[Organization] will not pursue civil or criminal action, or ask other
entities to refrain from pursuing civil or criminal action, against
individuals who identify and report vulnerabilities to [Organization]
in good faith.
Conditions for Safe Harbor Protection:
1. You make a good faith effort to avoid privacy violations,
disruption to production systems, and destruction of data.
2. You only access systems and data explicitly in scope for this
program.
3. You report any vulnerability you have discovered promptly and
exclusively to [Organization].
4. You allow [Organization] a reasonable amount of time to resolve
the vulnerability before disclosing it publicly.
5. You do not use a vulnerability to access or modify data that does
not belong to you.
6. You cease testing activities once [Organization] acknowledges
your report.
Activities that VOID Safe Harbor Protection:
- Accessing, modifying, or deleting user data
- Performing automated scanning of non-scope assets
- Causing denial of service
- Social engineering employees
- Physical security testing
- Public disclosure before remediation
5.4 Timeline for Responsible Disclosure
RESPONSIBLE DISCLOSURE TIMELINE
Day 0: Vulnerability Discovered
│
├── Verify vulnerability is valid and reproducible
├── Assess severity and impact
├── Check if organization has a bug bounty or disclosure policy
└── Prepare disclosure report
Day 1-3: Initial Contact
│
├── Send disclosure email to security team
├── Include proof of concept (non-destructive)
├── Request acknowledgment
└── If no security contact, use general contact + CISO
Day 3-7: Acknowledgment
│
├── Organization acknowledges receipt
├── Assign ticket/ID for tracking
├── Begin internal triage
└── Researcher provides additional info if requested
Day 7-30: Remediation Development
│
├── Organization develops fix
├── Researcher may be asked for clarification
├── Regular status updates exchanged
└── Researcher does NOT disclose publicly
Day 30-60: Fix Deployment
│
├── Organization deploys fix
├── Researcher verifies fix is effective
├── Organization may request extension
└── If no response, consider escalation
Day 60-90: Public Disclosure
│
├── If fix deployed: coordinated public disclosure
├── If no fix: consider full disclosure
├── Publish advisory (if agreed)
└── Update CVE if applicable
After 90 Days: Escalation (if needed)
│
├── Send follow-up reminder
├── Contact higher management if no response
├── Consider third-party mediation
└── As last resort: full disclosure with warning
5.5 How to Write a Responsible Disclosure Report
Report Template
# Vulnerability Disclosure Report
## Summary
**Title**: [Brief, descriptive title]
**Severity**: [Critical/High/Medium/Low]
**CVSS Score**: [Score if calculated]
**CVE ID**: [If assigned]
**Date Reported**: YYYY-MM-DD
**Reporter**: [Your name/handle]
## Vulnerability Description
[Brief description of the vulnerability in plain language]
## Affected Systems
| System | Version | URL/IP |
|---|---|---|
| [System Name] | [Version] | [URL or IP] |
## Proof of Concept
### Steps to Reproduce
1. [Step 1]
2. [Step 2]
3. [Step 3]
### Request/Response Examples
```http
# Malicious Request
GET /vulnerable?page=../../../etc/passwd HTTP/1.1
Host: target.example.com
User-Agent: Mozilla/5.0
# Response
HTTP/1.1 200 OK
Content-Type: text/plain
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
Impact
- Confidentiality: [What data can be accessed?]
- Integrity: [What data can be modified?]
- Availability: [Can service be disrupted?]
Remediation Recommendations
- [Specific recommendation 1]
- [Specific recommendation 2]
- [Specific recommendation 3]
References
- [CVE reference if applicable]
- [OWASP reference]
- [Vendor advisory if available]
Researcher Contact
- Name: [Your name]
- Email: [Your email]
- PGP Key: [Your PGP key ID]
#### Sample Responsible Disclosure Email
Subject: Security Vulnerability Report - [Brief Description]
Dear [Organization] Security Team,
I am writing to responsibly disclose a security vulnerability I have discovered in [system/application].
Vulnerability Summary:
- Type: [Vulnerability type, e.g., SQL Injection]
- Severity: [High/Medium/Low]
- Affected System: [URL or system name]
- Impact: [Brief impact description]
I have attached a detailed report with proof of concept and remediation recommendations. I have not disclosed this vulnerability to any third party and am willing to cooperate with your team to ensure a proper fix is deployed.
I request acknowledgment of this report within [X] days. I am happy to provide additional information or clarification as needed.
Please feel free to contact me at [email] or [PGP key] for secure communication.
Best regards, [Your Name] [Your Title/Affiliation] [Contact Information] [PGP Key ID]
---
## 6. OSCP Exam Relevance
The OSCP exam has strict rules and boundaries. Understanding and respecting these boundaries is essential for passing the exam and maintaining your certification.
### 6.1 OSCP Exam Rules
#### What Is Allowed
| Activity | Status | Notes |
|---|---|---|
| **Exploiting target machines** | ✅ Allowed | Only machines listed in exam target list |
| **Privilege escalation** | ✅ Allowed | On target machines only |
| **Lateral movement** | ✅ Allowed | Between target machines only |
| **Password cracking** | ✅ Allowed | Hashes from target machines only |
| **Social engineering (exam targets)** | ✅ Allowed | Only against exam-provided targets |
| **Using provided tools** | ✅ Allowed | Tools available in exam VM |
| **Using personal tools** | ✅ Allowed | Must be installed on exam VM |
| **Taking notes** | ✅ Allowed | Encouraged for 24-hour writeup |
| **Using documentation** | ✅ Allowed | Offline docs on exam VM |
#### What Is NOT Allowed
| Activity | Status | Consequence |
|---|---|---|
| **Attacking non-target systems** | ❌ Prohibited | Immediate disqualification |
| **Attacking OffSec infrastructure** | ❌ Prohibited | Immediate disqualification |
| **Denial of Service attacks** | ❌ Prohibited | Disqualification |
| **Brute force against exam portal** | ❌ Prohibited | Disqualification |
| **Sharing exam content** | ❌ Prohibited | Certification revocation |
| **Collaborating with others** | ❌ Prohibited | Certification revocation |
| **Using AI/LLM assistance** | ❌ Prohibited | Certification revocation |
| **Accessing exam answers** | ❌ Prohibited | Certification revocation |
| **Modifying exam monitoring** | ❌ Prohibited | Disqualification |
| **Using cloud resources** | ❌ Prohibited | Disqualification |
### 6.2 OSCP Target Scope
#### Exam Network Architecture
┌─────────────────────────┐
│ EXAM TARGET NETWORK │
│ (Isolated Lab) │
│ │
│ ┌─────────┐ │
│ │ DC/AD │ 10.x.x.1 │
│ └────┬────┘ │
│ │ │
│ ┌────┴────┐ │
│ │ Switch │ │
│ └────┬────┘ │
│ │ │
│ ┌────┴────┬────┬────┐ │
│ │ │ │ │ │
│ ▼ ▼ ▼ ▼ │
│ ┌───┐ ┌───┐ ┌───┐ ┌───┐│
│ │ M1│ │ M2│ │ M3│ │ M4││
│ │ │ │ │ │ │ │ ││
│ └───┘ └───┘ └───┘ └───┘│
│ 10.x 10.x 10.x 10.x │
└─────────────────────────┘
▲
│ SSH (Provided)
│
┌─────────────────────────┐
│ EXAM ATTACK VM │
│ (Kali Linux) │
│ │
│ • All tools pre-installed│
│ • Monitoring software │
│ • Note-taking tools │
└─────────────────────────┘
#### Target Identification
EXAM TARGET LIST (Example Format):
Target Machines: ┌──────┬────────────────┬──────────────────┬──────────────┐ │ # │ IP Address │ Hostname │ Points │ ├──────┼────────────────┼──────────────────┼──────────────┤ │ 1 │ 10.10.10.1 │ dc.example.local │ 30 (Domain) │ │ 2 │ 10.10.10.2 │ web.example.local│ 20 │ │ 3 │ 10.10.10.3 │ app.example.local│ 20 │ │ 4 │ 10.10.10.4 │ db.example.local │ 20 │ │ 5 │ 10.10.10.5 │ file.example.loc │ 10 │ └──────┴────────────────┴──────────────────┴──────────────┘
Total Points Needed: 70/100
IMPORTANT:
- ONLY attack the machines listed above
- Do NOT scan or attack any other IP addresses
- Do NOT attack the OffSec lab infrastructure
- Do NOT attack the exam monitoring system
### 6.3 OSCP Exam Boundaries
#### Network Boundaries
| Boundary | Rule | Reason |
|---|---|---|
| **Target IPs only** | Only attack listed IPs | Prevents collateral damage |
| **No external scanning** | Do not scan external networks | Legal and ethical compliance |
| **No OffSec systems** | Do not attack lab infrastructure | Protects exam integrity |
| **No internet abuse** | Do not use exam network for external attacks | Legal compliance |
#### Tool Boundaries
| Boundary | Rule | Reason |
|---|---|---|
| **Exam VM only** | All tools must run on exam VM | Monitoring and integrity |
| **No external tools** | Cannot use cloud-based tools | Fairness and security |
| **No AI assistance** | Cannot use LLMs or AI tools | Academic integrity |
| **No collaboration** | Cannot consult others | Individual assessment |
#### Time Boundaries
| Boundary | Rule | Details |
|---|---|---|
| **24-hour exam** | 24 consecutive hours | Clock starts when you start |
| **24-hour writeup** | 24 hours after exam | For submitting report |
| **No pause** | Cannot pause the clock | Continuous assessment |
| **Grace period** | Limited extensions available | For technical issues only |
### 6.4 Consequences of Violating Exam Rules
| Violation | Consequence | Appeal Possible? |
|---|---|---|
| **Attacking non-target systems** | Immediate disqualification | No |
| **Using AI/LLM assistance** | Certification revocation | No |
| **Collaborating with others** | Certification revocation | No |
| **Sharing exam content** | Permanent ban | No |
| **Modifying monitoring software** | Immediate disqualification | No |
| **DoS against targets** | Disqualification | No |
| **Brute forcing exam portal** | Disqualification | No |
### 6.5 How OSCP Enforces Ethical Boundaries
#### Monitoring Mechanisms
OSCP EXAM MONITORING LAYERS
Layer 1: Network Monitoring ├── All traffic monitored and logged ├── Destination IP validation ├── Protocol analysis └── Anomaly detection
Layer 2: System Monitoring ├── Process monitoring ├── File access logging ├── Network connection tracking └── Screenshot capture (periodic)
Layer 3: Behavioral Analysis ├── Unusual activity detection ├── Pattern analysis ├── Time-based anomaly detection └── Cross-exam correlation
Layer 4: Post-Exam Review ├── Log analysis ├── Report verification ├── Finding validation └── Proctor review
#### Proctor Responsibilities
| Responsibility | Description |
|---|---|
| **Pre-exam verification** | Identity verification, environment check |
| **During-exam monitoring** | Real-time monitoring of exam activity |
| **Incident response** | Handle technical issues and violations |
| **Post-exam review** | Review logs and validate results |
| **Violation reporting** | Report any suspected violations |
---
## 7. Professional Ethics
Professional ethics frameworks provide guidance for ethical decision-making in cybersecurity.
### 7.1 (ISC)² Code of Ethics
The (ISC)² Code of Ethics is one of the most widely recognized ethical frameworks in cybersecurity.
#### Canonical Rules
| Priority | Rule | Description |
|---|---|---|
| **1** | Protect society, the common good, necessary public trust and confidence, and the infrastructure | Society first |
| **2** | Act honorably, honestly, justly, responsibly, and legally | Professional conduct |
| **3** | Provide diligent and competent service to principals | Competence and diligence |
| **4** | Advance and protect the profession | Professional growth |
#### Application to Penetration Testing
(ISC)² Code Applied to Pentesting:
Rule 1: Protect Society ✓ Obtain proper authorization before testing ✓ Report critical vulnerabilities promptly ✓ Do not exploit vulnerabilities for personal gain ✓ Protect discovered data from exposure
Rule 2: Act Honorably and Legally ✓ Follow all applicable laws and regulations ✓ Be honest about findings and limitations ✓ Do not exaggerate or minimize vulnerabilities ✓ Maintain integrity in all communications
Rule 3: Provide Diligent Service ✓ Perform thorough and professional assessments ✓ Document findings accurately and completely ✓ Provide actionable remediation guidance ✓ Maintain professional competence through training
Rule 4: Advance the Profession ✓ Share knowledge responsibly ✓ Contribute to security communities ✓ Mentor junior professionals ✓ Promote ethical practices
### 7.2 EC-Council Ethical Guidelines
EC-Council (creator of CEH certification) maintains specific ethical guidelines for ethical hackers.
#### Core Principles
| Principle | Description |
|---|---|
| **Legal Compliance** | Always operate within legal boundaries |
| **Authorization** | Never test without written permission |
| **Confidentiality** | Protect all discovered information |
| **Professionalism** | Maintain professional conduct at all times |
| **Competence** | Only perform work within your skill level |
| **Integrity** | Be honest and transparent in all dealings |
#### EC-Council Code of Ethics
I. I will safeguard the general public and will only conduct authorized activities.
II. I will advance the practice of Ethical Hacking by maintaining and improving my knowledge and skills at all times.
III. I will represent the EC-Council in a positive and ethical manner.
IV. I will be an agent for collecting and disseminating accurate and ethical warning and advisory information concerning cyber threats.
V. I will act in a professional manner and will conduct themselves in an ethical, professional, and lawful manner.
VI. I will not engage in any activity that is deceptive, fraudulent, or dishonest.
VII. I will not use my skills to intentionally cause harm to any individual, organization, or system.
### 7.3 OffSec Acceptable Use Policy
OffSec (creator of OSCP) has specific policies for certification holders.
#### Key Policies
| Policy | Description |
|---|---|
| **Exam Integrity** | No cheating, collaboration, or unauthorized assistance |
| **Content Protection** | No sharing of exam questions, targets, or solutions |
| **Professional Conduct** | Maintain ethical standards in all security work |
| **Continuing Professional Education** | Maintain CPE credits for certification |
| **Code of Conduct** | Follow OffSec's code of conduct as a certified professional |
#### OffSec Certification Obligations
OSCP CERTIFICATION OBLIGATIONS:
-
Exam Integrity
- Complete exam independently
- Do not share exam content
- Do not use unauthorized resources
- Accept exam results without dispute
-
Professional Conduct
- Use skills ethically and legally
- Maintain professional standards
- Report unethical behavior when observed
- Represent the certification positively
-
Continuing Education
- Maintain 40 CPE credits every 3 years
- Stay current with security knowledge
- Participate in security community
- Share knowledge responsibly
-
Recertification
- Complete recertification on time
- Maintain active certification status
- Follow recertification requirements
### 7.4 Career Implications of Unethical Behavior
#### Short-Term Consequences
| Consequence | Impact | Timeline |
|---|---|---|
| **Job loss** | Immediate termination | Days |
| **Certification revocation** | Loss of credentials | Weeks |
| **Legal action** | Fines or prosecution | Months |
| **Industry notification** | Other employers informed | Weeks |
#### Long-Term Consequences
| Consequence | Impact | Duration |
|---|---|---|
| **Criminal record** | Background check failure | Permanent |
| **Industry blacklisting** | Difficulty finding employment | Years |
| **Reputation damage** | Loss of professional credibility | Years |
| **Legal precedent** | Future cases may cite your case | Permanent |
#### Real-World Examples
| Case | What Happened | Consequence |
|---|---|---|
| **Hackers selling vulnerabilities** | Sold 0-day exploits to highest bidder | Criminal prosecution, prison time |
| **Pentester exceeding scope** | Accessed systems outside authorization | Criminal charges, certification revoked |
| **Researcher full disclosure** | Published exploit before vendor patch | Lawsuit, industry backlash |
| **Employee data theft** | Stole customer data during employment | Criminal prosecution, civil damages |
---
## 8. Practical Examples
### 8.1 Sample RoE Document (Condensed)
```markdown
# RULES OF ENGAGEMENT - CONDENSED
## Engagement Details
- **Client**: Acme Corporation
- **Tester**: SecureTest LLC
- **Type**: Gray Box Penetration Test
- **Duration**: September 1-15, 2026
## Scope
### In-Scope
- IP Range: 192.168.1.0/24
- Domain: acme-corp.com
- Application: https://portal.acme-corp.com
### Out-of-Scope
- IP Range: 10.0.0.0/8 (Production)
- Domain: partner.acme-corp.com
- All cloud infrastructure
## Allowed Techniques
- Network scanning
- Vulnerability scanning
- Exploitation
- Privilege escalation
- Post-exploitation (within scope)
## Prohibited Techniques
- Denial of Service
- Social engineering
- Physical testing
- Destructive payloads
## Emergency Contacts
- Security Lead: security@acme-corp.com | +1-555-0100
- Project Sponsor: sponsor@acme-corp.com | +1-555-0101
## Stop Conditions
- Client request
- Production impact
- Data breach discovery
- System instability
8.2 Sample Authorization Letter
AUTHORIZATION FOR PENETRATION TESTING
Date: September 1, 2026
FROM:
John Smith
Chief Information Security Officer
Acme Corporation
john.smith@acme-corp.com
+1-555-0100
TO:
SecureTest LLC
Attn: Jane Doe, Lead Penetration Tester
jane.doe@securetest.com
+1-555-0200
AUTHORIZATION
This letter authorizes SecureTest LLC to conduct a gray box penetration
test against Acme Corporation's systems as defined below.
SCOPE
In-Scope Targets:
- IP Addresses: 192.168.1.0/24
- Domain: acme-corp.com
- Application: https://portal.acme-corp.com
Out-of-Scope Targets:
- IP Addresses: 10.0.0.0/8
- Domain: partner.acme-corp.com
- All AWS infrastructure
TESTING PERIOD
Start: September 1, 2026 at 09:00 UTC
End: September 15, 2026 at 17:00 UTC
RESTRICTIONS
- No denial-of-service attacks
- No social engineering
- No physical security testing
- No testing against third-party systems
- No data exfiltration beyond proof-of-concept
LIABILITY
Acme Corporation assumes all liability for authorized testing activities
conducted within the defined scope and timeframe. SecureTest LLC assumes
liability for activities outside the defined scope.
DATA HANDLING
All findings and data collected must be handled according to the attached
NDA and data handling policy. All data must be destroyed within 90 days
of engagement completion.
ACKNOWLEDGMENT
By signing below, both parties acknowledge and agree to the terms of
this authorization.
Signed: _________________________
John Smith
Chief Information Security Officer
Acme Corporation
Date: September 1, 2026
Signed: _________________________
Jane Doe
Lead Penetration Tester
SecureTest LLC
Date: September 1, 2026
8.3 Sample Responsible Disclosure Email
Subject: Security Vulnerability Report - SQL Injection in Customer Portal
Dear Acme Corporation Security Team,
I am writing to responsibly disclose a security vulnerability I have
discovered in your customer portal application.
Vulnerability Summary:
- Type: SQL Injection (Authenticated)
- Severity: High
- Affected System: https://portal.acme-corp.com/account/settings
- Impact: Potential unauthorized access to customer account data
I have attached a detailed report with proof of concept and
remediation recommendations. The proof of concept demonstrates the
vulnerability without accessing any sensitive data.
I have not disclosed this vulnerability to any third party and am
willing to cooperate with your team to ensure a proper fix is deployed.
I request acknowledgment of this report within 5 business days. I am
happy to provide additional information or clarification as needed.
For secure communication, my PGP public key is available at:
https://example.com/pgp-key.txt
Best regards,
Jane Doe
Security Researcher
jane.doe@example.com
PGP Key: 0x1234ABCD
9. Lab Exercises
Exercise 1: Drafting Rules of Engagement
Objective: Create a complete RoE document for a mock penetration testing engagement.
Scenario: You have been hired by “TechCorp Industries” to perform a gray box penetration test of their internal network and web application.
Requirements:
- Define the scope (in-scope and out-of-scope targets)
- Specify allowed and prohibited techniques
- Define the testing timeline
- Identify emergency contacts
- Define stop conditions
- Specify data handling procedures
Deliverable: A complete RoE document following the template in Section 4.1.
Hints:
- Use realistic IP ranges and domain names
- Consider what techniques might cause disruption
- Think about what data might be collected during testing
- Define clear escalation procedures
Exercise 2: Writing Authorization Documentation
Objective: Create an authorization letter for the TechCorp engagement.
Requirements:
- Write a formal authorization letter
- Include all necessary legal elements
- Define scope clearly
- Include liability provisions
- Include data handling requirements
Deliverable: A signed authorization letter (use placeholder signatures).
Hints:
- Use formal business letter format
- Be specific about what is authorized
- Include clear boundaries and limitations
- Reference the RoE document
Exercise 3: Responsible Disclosure Practice
Objective: Write a responsible disclosure report for a hypothetical vulnerability.
Scenario: You discovered a cross-site scripting (XSS) vulnerability in a public web application. The vulnerability allows stored XSS in the user profile description field.
Requirements:
- Write a disclosure email
- Create a detailed vulnerability report
- Include proof of concept
- Provide remediation recommendations
Deliverable: A complete responsible disclosure package.
Hints:
- Be professional and respectful
- Provide clear, reproducible steps
- Suggest specific fixes
- Include severity assessment
Exercise 4: Scope Analysis
Objective: Analyze a scenario and determine what is in scope and out of scope.
Scenario: You are testing a company with the following infrastructure:
- Corporate network: 192.168.1.0/24
- DMZ: 10.0.1.0/24
- Cloud infrastructure (AWS): Various IPs
- Partner portal: partner.example.com
- Employee VPN: 172.16.0.0/16
The authorization covers “all corporate-owned systems.”
Questions:
- Is the cloud infrastructure in scope?
- Is the partner portal in scope?
- Is the VPN in scope?
- What additional clarification is needed?
Deliverable: Written analysis with recommendations.
10. Exam Tips
10.1 Staying Within OSCP Exam Boundaries
Pre-Exam Preparation
| Action | Description |
|---|---|
| Read the rules carefully | Review all exam rules before starting |
| Understand the scope | Know exactly which machines are targets |
| Prepare your environment | Install all tools before the exam |
| Test your setup | Verify everything works before exam day |
| Review ethical guidelines | Refresh your knowledge of exam boundaries |
During the Exam
| Action | Description |
|---|---|
| Verify targets | Confirm target IPs before attacking |
| Document everything | Keep detailed notes of all activities |
| Stay focused | Work only on target machines |
| Monitor time | Manage your 24 hours effectively |
| Report responsibly | Submit findings through proper channels |
Common Mistakes to Avoid
| Mistake | Consequence | Prevention |
|---|---|---|
| Scanning non-target IPs | Disqualification | Verify IPs before scanning |
| Using AI tools | Disqualification | Do not use any AI assistance |
| Asking for help | Disqualification | Work independently |
| Sharing exam content | Permanent ban | Keep all content private |
| Modifying monitoring | Disqualification | Do not tamper with monitoring |
10.2 Avoiding Disqualification
Red Flag Activities
ACTIVITIES THAT TRIGGER DISQUALIFICATION:
🚩 Network Activity
- Scanning IPs outside the target list
- Connecting to external services
- Attacking OffSec infrastructure
- High-volume scanning (potential DoS)
🚩 System Activity
- Modifying monitoring software
- Attempting to disable monitoring
- Installing unauthorized software
- Accessing exam answer files
🚩 Behavioral
- Leaving the exam environment
- Consulting external resources
- Communicating with others
- Using AI/LLM tools
🚩 Post-Exam
- Sharing exam questions
- Publishing target information
- Discussing exam content publicly
- Helping others with exam answers
Safe Practices
SAFE EXAM PRACTICES:
✅ Before Starting
- Read all exam instructions carefully
- Verify your environment is ready
- Have all tools installed and tested
- Prepare note-taking templates
✅ During Exam
- Work only on listed target machines
- Document all commands and outputs
- Take screenshots of successful exploits
- Keep notes organized for writeup
✅ After Exam
- Submit writeup within 24 hours
- Follow report format requirements
- Do not discuss exam content
- Wait for results patiently
10.3 Exam Day Checklist
OSCP EXAM DAY CHECKLIST
Pre-Exam (Day Before):
□ Read exam rules and guidelines
□ Verify exam VM is ready
□ Test all tools and utilities
□ Prepare note-taking templates
□ Ensure stable internet connection
□ Have backup plan for connectivity issues
□ Get adequate rest
Exam Start:
□ Verify identity with proctor
□ Confirm exam environment
□ Review target list
□ Start exam clock
□ Begin with reconnaissance
During Exam:
□ Work only on target machines
□ Document all activities
□ Take screenshots of findings
□ Manage time effectively
□ Stay focused and calm
Exam End:
□ Submit all findings
□ Start writeup immediately
□ Follow report format
□ Submit within 24 hours
□ Do not discuss exam content
11. Cross-References
Related Topics
| Topic | Relationship | Reference |
|---|---|---|
| Penetration Testing Methodology | Ethical hacking is the foundation of all pentesting | See Penetration Testing Methodology |
| Report Writing | Responsible disclosure requires professional reporting | See Report Writing Guide |
| Reconnaissance | Must be conducted within authorized scope | See Reconnaissance Techniques |
| Vulnerability Assessment | Legal framework applies to all scanning activities | See Vulnerability Assessment |
| Exploitation | Must follow RoE and ethical guidelines | See Exploitation Techniques |
| Post-Exploitation | Data handling and scope boundaries apply | See Post-Exploitation |
| Web Application Testing | Bug bounty programs and disclosure policies | See Web Application Security |
| Network Security | Legal frameworks for network testing | See Network Security Assessment |
Key Documents to Maintain
| Document | Purpose | When to Use |
|---|---|---|
| Rules of Engagement | Define scope and boundaries | Before every engagement |
| Authorization Letter | Legal permission to test | Before every engagement |
| NDA | Protect confidential information | Before every engagement |
| Data Handling Policy | Secure data management | Throughout engagement |
| Incident Response Plan | Handle emergencies during testing | During engagement |
| Report Template | Standardize findings documentation | After engagement |
Quick Reference: Legal Checklist
BEFORE ANY TESTING ACTIVITY:
□ 1. Written authorization obtained?
□ 2. Scope clearly defined?
□ 3. NDA signed?
□ 4. Legal jurisdiction identified?
□ 5. Applicable laws reviewed?
□ 6. Emergency contacts identified?
□ 7. Stop conditions defined?
□ 8. Data handling procedures agreed?
□ 9. Insurance coverage verified?
□ 10. Report deliverables agreed?
IF ANY ANSWER IS "NO" — DO NOT BEGIN TESTING
Summary
Ethical hacking is not just a technical skill — it is a professional responsibility. The distinction between an ethical hacker and a criminal is authorization. Without proper authorization, even the most well-intentioned security testing is illegal.
Key Takeaways
- Authorization is everything — Always obtain written permission before testing
- Scope defines boundaries — Never exceed the defined scope
- Legal frameworks vary — Understand the laws in your jurisdiction
- RoE is your contract — Follow the Rules of Engagement exactly
- Responsible disclosure protects everyone — Report vulnerabilities responsibly
- OSCP has strict rules — Violating exam rules results in disqualification
- Professional ethics matter — Your reputation is your most valuable asset
- Document everything — Proper documentation protects you legally
Final Thought
“With great power comes great responsibility.” — The ability to bypass security controls is a powerful skill. Use it ethically, legally, and professionally. The cybersecurity community depends on ethical practitioners to improve security, not undermine it.
Last Updated: 2026-09-01 For OSCP Exam Preparation — Introduction to CyberSecurity Domain