Penetration Testing & Security Assessments

Topics Methodology · Footprinting · Scanning · Exploitation · Social Engineering
01 //

Overview

Penetration testing evaluates the strength of all security controls - procedural, operational, and technological. It is the first line of network defense: a systematic way to discover vulnerabilities and demonstrate how threats can materialize.

Benefits

Security Assessment

Network Security

Evaluate how secure the network really is - end-to-end, including mobile and BYOD.

Discovery

Vulnerabilities

Identify weaknesses before attackers do. Prioritize remediation based on real risk.

Demonstration

Threat Reality

Exploit vulnerabilities to show likelihood and impact of real attacks.

Scope & Scale

Scope

Can include social engineering and physical access - not just technical or cyber operations.

Scale

Security of the entire network - servers, clients, mobile devices, BYOD, and infrastructure.

When to Conduct a Pen Test
  • Applications are added or modified
  • End user policies are changed
  • Security patches are installed
  • Infrastructure is added or modified
02 //

Methodology

Penetration testing follows a structured lifecycle. Each phase builds on the previous; the last steps (pilfering, covering tracks, back doors) can be iterated as the tester moves laterally across the network.

8-Phase Penetration Testing Lifecycle
Footprinting
Scanning
Enumeration
Gaining Access
Escalating Privilege
Pilfering
Covering Tracks
Creating Back Doors
Phase Goal Tools (Examples)
Footprinting Recon, IP ranges, namespace, topology whois, nslookup, dig, Sam Spade, Google
Scanning Live hosts, open ports, services, OS nmap, fping, Superscan, queso, siphon
Enumeration User accounts, file shares, banners dumpACL, showmount, legion, rpcinfo, netcat
Gaining Access Exploit vulnerabilities tcpdump, L0phtcrack, legion, pwddump2, ttdb
Escalating Privilege Root/superuser access John the Ripper, Getadmin, sechole
Pilfering Trusts, credentials, config files rhosts, LSA secrets, registry
Covering Tracks Hide evidence Zap, rootkits, file streaming
Creating Back Doors Persistence Netcat, cron, at, startup folder, keystroke loggers
03 //

Footprinting

Reconnaissance

Gather general information: target IP/phone ranges, namespace, network topology. Essential for a surgical attack - you need IP addresses to scan, domain names for DNS, and topology to plan lateral movement.

Techniques & Tools

Open Source

Google, Edgar, search engines - domain name, admins, IP addresses, name servers.

Domain Lookup

whois (Network Solutions, ARIN), nslookup (ls -d), dig - zone transfers.

Topology

VisualRoute, traceroute - map paths and hops to understand network layout.

04 //

Scanning

Discover which machines are up, which ports are open, which services run, and their versions. Look up known vulnerabilities for those versions. Focus on most promising avenues (e.g., always-on web services) while reducing scan frequency and randomizing order to avoid detection.

Scanning Techniques
PING SWEEP
fping, icmpenum, WS_PingProPack - which hosts are alive
PORT SCAN
nmap, Superscan, fscan - TCP/UDP ports, service detection
OS DETECTION
nmap, queso, siphon - OS fingerprinting
nmap

One of the most popular tools - performs ping sweep, port scan, service/version detection, and OS fingerprinting in a single toolkit.

05 //

Enumeration

Identify valid user accounts and poorly protected resource shares. More intrusive than scanning - targeted probing for accounts, file shares, and application info.

User Accounts

Null sessions, dumpACL, Sid2user, onSiteAdmin - list accounts for password spraying or cred stuffing.

File Shares

showmount, NAT, legion - discover NFS/SMB shares, often misconfigured.

Banner Grabbing

telnet, netcat, rpcinfo - identify application versions for vuln lookup.

06 //

Gaining Access

Identify a vulnerability from scanning/enumeration and exploit it. Often with existing tools (Metasploit, custom scripts). Automatic exploit generation from a new vuln is still an open problem - manual work is usually required.

Password Eavesdropping

tcpdump, ssldump - capture cleartext or cracked credentials on the wire.

Brute Force

L0phtcrack, readsmb, legion - file share and password cracking.

Exploitation

Buffer overflow, IIS .HTR/ISM.DLL - exploit vulnerable service versions.

07 //

Post-Exploitation

Escalating Privilege

If only user-level access was obtained, seek root/superuser. Tools: John the Ripper, L0phtcrack (password cracking), Getadmin, sechole (known privilege escalation exploits).

Pilfering

Gather info to access trusted systems: evaluate trusts, search for cleartext passwords in rhosts, LSA secrets, config files, registry.

Covering Tracks

Once total ownership is secured, hide evidence. Clear logs (Zap, Event Log GUI), hide tools (rootkits, file streaming).

Creating Back Doors

Ensure easy re-entry: rogue accounts, cron/at jobs, startup folder/registry, Netcat listeners, keystroke loggers, remote desktop/VNC.

Modern Kill Chain View

Persistence and stealth - iterate: move from one host/account to the next, capture credentials, install backdoors, hide tracks. Insert proxies or MITM to record traffic and identify high-value targets.

08 //

Social Engineering

Users Are the Weakest Link

Social engineering is a fast, low-risk method to gain access. It abuses trusted relationships, requires no specialized equipment, and manipulates users into undermining their own security.

Impersonation Types

Roaming the Halls

Blend in; look for passwords on sticky notes, unattended papers, confidential conversations.

Repairman

Uniform - rarely questioned. May plant surveillance or access sensitive areas.

Trusted Authority

Pretend to be in charge (in person or by phone). Third-party authorization trick.

Snail Mail

Send mail asking for personal info - users tend to trust printed materials more than email.

Computer-Based Attacks

  • Popup Windows - fake login; users must verify security indicators
  • IM / IRC - fake tech support; redirect to malicious sites, Trojan downloads
  • Email Attachments - macros in PDF, camouflaged .exe as .doc
  • Credential Harvesting - prize sites requiring login; reuse creds elsewhere
Social Engineering Training Tools
  • Click Logger - which users click links in emails
  • Reverse Shell Applet - signed Java applet → shell back to server
  • Flash Autoplay - Flash program creates connection to exploit server
  • Download Connection - attachment download triggers connection

Countermeasures

Human Motivations (Social Engineering Leverage)
Liking - desire to fit in, influenced by people you like
Scarcity - pursue limited/exclusive items
Commitment - act consistently with prior actions
Social Proof - look to others for behavior cues
09 //

Summary & Key Takeaways

Methodology

Recon → Scan → Enum

Footprint IP/domain, scan ports/services, enumerate users and shares.

Exploit → Escalate → Pilfer

Gain access, escalate to root, steal credentials for lateral movement.

Cover → Back Door

Hide evidence, create persistence. Iterate across the network.

Key Tools

nmap

Ping sweep, port scan, service detection, OS fingerprinting.

Metasploit / Nessus

Vulnerability exploitation, scanning, reporting.

Social Engineering

Identify policy gaps; users are the weakest link.

Further Reading

Peter Kim - practical guide: Kali setup, scanning, Metasploit, SQLi/XSS/CSRF, lateral movement, social engineering, reporting.

Web app vulns: injection, broken auth, XSS, broken access control, misconfiguration.

Web security audit - reflected/stored XSS, session hijacking, ReDoS, tabnabbing.