Back to Cybersecurity

Module 5: Penetration Testing

Master ethical hacking techniques, tools, and methodologies for security testing.

What is Penetration Testing?

Penetration testing (pen testing) is authorized simulated cyberattacks to find vulnerabilities before malicious hackers do. Think of it as hiring a burglar to test your home security.

⚖️ Legal & Ethical Considerations:

  • Always get written permission before testing
  • Define scope clearly - what systems can you test?
  • Follow rules of engagement - timing, methods allowed
  • Report responsibly - disclose vulnerabilities properly
  • Never cause damage - test safely

Penetration Testing Phases

1. Reconnaissance

Gather information about target (OSINT, DNS, WHOIS, social media).

2. Scanning

Identify live hosts, open ports, services (Nmap, Nessus).

3. Gaining Access

Exploit vulnerabilities to gain entry (Metasploit, custom exploits).

4. Maintaining Access

Establish persistence, escalate privileges.

5. Covering Tracks

Clear logs (for testing purposes only!).

6. Reporting

Document findings, provide remediation recommendations.

Essential Pen Testing Tools

Nmap

Network scanning and port discovery

# Scan ports

nmap -sV 192.168.1.1

# OS detection

nmap -O 192.168.1.1

Metasploit

Exploitation framework

# Start Metasploit

msfconsole

# Search exploits

search apache

Burp Suite

Web application testing proxy

Wireshark

Network protocol analyzer

John the Ripper

Password cracking tool

Hydra

Network login cracker

Privilege Escalation

Gaining higher-level permissions after initial access.

Linux Techniques:

  • • SUID binaries
  • • Kernel exploits
  • • Sudo misconfigurations
  • • Cron jobs
  • • Writable /etc/passwd

Windows Techniques:

  • • Unquoted service paths
  • • DLL hijacking
  • • Token impersonation
  • • Registry keys
  • • Scheduled tasks

Penetration Test Reporting

A good report is crucial - it's how you communicate findings to stakeholders.

Report Structure:

  1. 1. Executive Summary: High-level overview for management
  2. 2. Methodology: Tools and techniques used
  3. 3. Findings: Vulnerabilities discovered (severity ratings)
  4. 4. Evidence: Screenshots, logs, proof of concept
  5. 5. Recommendations: How to fix each issue
  6. 6. Conclusion: Overall security posture

📚 Module Summary

You've mastered penetration testing fundamentals:

  • ✓ Pen testing methodology and phases
  • ✓ Essential tools (Nmap, Metasploit, Burp Suite)
  • ✓ Reconnaissance and scanning techniques
  • ✓ Exploitation and privilege escalation
  • ✓ Report writing
  • ✓ Legal and ethical considerations

Next: Learn vulnerability assessment!