GPEN Cheatsheet
GIAC Penetration Tester
Download free PDFEngagement planning and reporting
Authorization and scope
- **Written authorization** precedes testing. Identify permitted targets, owners, techniques, timing and third-party dependencies; a customer's permission does not authorize attacks on someone else's systems.
- **Rules of engagement** define exclusions, source addresses, contacts, stop conditions, data handling and cleanup. Obtain explicit agreement for disruptive, physical, social-engineering or persistence tests.
- **Scope creep** adds targets or activities beyond the agreement. Record and approve changes before testing; discovered connectivity does not expand authorization.
- **Black box** provides little internal knowledge; **white box** provides extensive information; **gray box** provides partial knowledge or limited credentials. These describe visibility, not permission.
Method and operational safety
- **Reconnaissance** identifies assets; **scanning** finds hosts and services; **enumeration** extracts details; **validation** confirms weaknesses; **exploitation** demonstrates agreed impact. Finish with cleanup, reporting and retesting.
- **Vulnerability assessment** identifies and prioritizes weaknesses. **Penetration testing** demonstrates attack paths. Configuration reviews provide useful evidence when exploitation is unsuitable.
- **OSSTMM** is a security-testing methodology. A methodology organizes repeatable work; it does not grant authorization or replace an engagement contract.
- **Safe checks**, exclusions and scan-rate limits reduce disruption without guaranteeing safety. Stop and coordinate if printers, fragile devices or production services behave unexpectedly.
- **Credentialed scans** inspect local configuration and patches more deeply. Refresh plugins through an approved offline transfer when the scanning environment cannot connect externally.
Findings and remediation
- **Scanner results are leads**: banners can be misleading and patches can be backported. Corroborate with configuration, package evidence or a controlled proof before claiming exploitability.
- **Findings** record affected assets, evidence, prerequisites, impact, severity and remediation. Separate confirmed observations from hypotheses and document testing limitations.
- **Executive summaries** explain business exposure and priorities. Technical sections give reproducible evidence and fixes; prioritize by exploitability and business consequence, not finding count alone.
- **Standardized builds** and software inventories reduce patching complexity. Retest remediation and verify removal of test accounts, services, files, scheduled actions and configuration changes.
Evidence and privacy
- **Minimize collection** of secrets and personal data; encrypt evidence, restrict access and follow agreed retention. Preserve logs rather than erase the engagement's audit trail.
- **Forensic acquisition** aims to preserve originals and document custody. Use supported acquisition tools, working copies and hashes; record unavoidable changes to live or mobile devices.
- **Email evidence** can reside in server databases, logs and browser artifacts. Older Exchange environments may include EDB/STM files; device recovery depends on storage, encryption and acquisition support.
- **Legal and contractual constraints** cover access, interception, personal devices, provider infrastructure and information disclosure. Resolve applicable requirements during planning rather than infer authority from network ownership.
Reconnaissance and network enumeration
Footprinting and DNS
- **Passive reconnaissance** uses public records, search results, documents and job postings. Port probes and direct service queries are active interactions; keep their targets within scope.
- **RIR records** help identify address allocations: **ARIN**, **RIPE NCC** and **APNIC** serve different regions. Registration data helps corroborate ownership but does not authorize testing.
- **Search operators** such as **site:**, **filetype:**, **intitle:** and **inurl:** narrow public exposure searches. **HTTrack** mirrors accessible web content; robots.txt is guidance, not access control.
- **DNS records** reveal names, addresses, mail hosts and authoritative servers. A name can resolve to several IPs; record the specific address tested and account for virtual hosting.
- **AXFR** requests a complete DNS zone transfer, normally over TCP 53. **IXFR** requests changes relative to an SOA serial. Use **dig**, **host** or **nslookup**; unauthorized transfers should be restricted.
- **Primary zones** hold authoritative data; **secondary zones** replicate it; **stub zones** retain records used to locate authoritative servers. A zone transfer does not inherently reveal passwords.
Host discovery and path mapping
- **Ping sweeps** seek responsive hosts. No ICMP Echo reply does not prove a host is down; combine permitted TCP, UDP, ICMP and local-link ARP discovery methods.
- **Nmap -sn** performs host discovery without a port scan; **-Pn** skips discovery and treats targets as online. ICMP timestamp and address-mask probes are alternatives with limited support.
- **Traceroute** varies TTL or hop limit; intermediate routers may return Time Exceeded. Missing replies can reflect filtering, rate limits or loss while forwarding still works.
- **Network mapping** relates address ranges, routes, hosts and services. An IPv4 /24 contains 256 addresses; Nmap octet-range targets can include network and broadcast addresses.
TCP and UDP scan interpretation
- **TCP handshake** is SYN, SYN/ACK, ACK. Sequence numbers order bytes; acknowledgment numbers identify the next expected byte. A RST rejects or resets a connection.
- **SYN scan (-sS)** usually receives SYN/ACK from an open port and RST from a closed port, then resets rather than completing the connection. **Connect scan (-sT)** completes the handshake.
- **Filtered** means a filter or missing response prevents a firm port-state decision. **ACK scan (-sA)** maps filtering; it does not directly distinguish open from closed ports.
- **UDP scan (-sU)** treats a UDP reply as open and ICMP Port Unreachable as closed. Silence often means **open|filtered**; ICMP rate limits can make scanning slow.
- **NULL (-sN)** sends no TCP flags; **FIN (-sF)** sends FIN; **Xmas (-sX)** sends FIN, PSH and URG. Silence is often open|filtered, and operating-system behavior varies.
- **Idle scans** infer port state through a suitable zombie's IPID changes. Unrelated zombie traffic or unpredictable IPID allocation undermines the inference; include the intermediate system in authorization.
Service and account enumeration
- **Service detection (-sV)** probes applications instead of trusting default port labels. A web server can listen on TCP 22; encrypted services require suitable TLS negotiation for deeper inspection.
- **OS detection (-O)** actively compares stack responses. Open and closed ports improve fingerprinting; missing probes, firewalls and altered stacks reduce confidence.
- **NSE scripts** automate protocol checks and enumeration. **--script-trace** shows script traffic; verbose output and packet tracing serve different diagnostic purposes. Review script impact before execution.
- **SMB** commonly uses TCP 445 or NetBIOS sessions on TCP 139. Enumerate authorized shares, names and policies; **NBTscan** gathers NetBIOS names and **SID2User** maps accessible security identifiers.
- **SNMP** commonly uses UDP 161. Community strings in v1/v2c are credentials without transport confidentiality; restrict access and prefer **SNMPv3 authPriv** where supported. **Getif** is a legacy enumeration tool.
Packet tools and local observation
- **tcpdump -w capture.pcap** writes packet data; **-r** reads a capture. Capture at the right interface and use filters to limit unrelated traffic and sensitive content.
- **Scapy send/sr** work at Layer 3; **sendp/srp** work at Layer 2. **sr** separates answered and unanswered probes; routing and neighbor resolution influence defaults.
- **tcpdump/Wireshark** inspect packets; **hping** and **Scapy** craft probes. Packet decoders validate protocol structure; a captured symptom alone rarely establishes a unique operating system.
- **Local sockets** complement remote scans: Linux **ss -lntup** or legacy **netstat -anp** lists listeners; Windows **netstat -ano** maps connections to PIDs. **Fport** is a legacy port-to-process mapper.
Credentials and authentication
Password storage and Windows authentication
- **Linux /etc/passwd** normally exposes account names and an x placeholder. Restricted **/etc/shadow** stores password representations and aging fields; hash prefixes identify formats, such as $1$ for md5crypt.
- **Windows SAM** stores local-account password representations; Active Directory uses **NTDS.dit**, normally under %SystemRoot%\NTDS. Access requires appropriate privileges and careful evidence handling.
- **LM hashes** uppercase passwords and split the padded value into two seven-character halves. A password of seven or fewer characters produces the constant second half **AAD3B435B51404EE**.
- **NT hash** is derived from the UTF-16LE password using MD4. **NTLMv1** is a challenge-response protocol using the NT hash; a network response is not the stored hash or plaintext password.
- **Pass-the-hash** uses an available NT hash for compatible authentication without recovering the password. It preserves that account's rights; it is detectable and is not automatic privilege escalation.
Online and offline password attacks
- **Dictionary attacks** try likely words; **rules/hybrid attacks** transform candidates; **brute force** enumerates a defined space. Long, unique, unpredictable passwords resist guessing better than familiar patterns.
- **Online guessing** interacts with a live service and can trigger lockout, throttling and alerts. Coordinate attempt limits; **Hydra** automates protocol login attempts within the agreed rules.
- **Offline cracking** tests captured password representations locally. **John the Ripper**, **Hashcat** and **Ophcrack** support different formats and approaches; choose the exact format and preserve originals.
- **John unshadow** combines passwd and shadow data for suitable cracking inputs. Its **pot file** records recovered results; saved session state and configuration files serve different purposes.
- **Rate limiting**, risk-based controls, MFA and breached-password screening reduce online abuse. CAPTCHA is a supporting control; aggressive lockouts can themselves deny service.
Salts, work factors and cryptographic distinctions
- **Salts** make identical passwords produce different stored representations and defeat reuse of one precomputed table across accounts. Salts are stored with hashes and need not be secret.
- **Rainbow tables** trade precomputation and storage for faster lookup using hash/reduction chains. A **reduction function** maps a hash to a candidate password; it does not invert the hash.
- **Password KDFs** such as Argon2id, scrypt or bcrypt add computational cost; suitable memory cost further limits parallel guessing. Use established implementations rather than repeated ad hoc hashing.
- **Hashing** produces a digest; **encryption** is reversible with a key. **SHA-1** produces 160 bits but has broken collision resistance and is unsuitable for new collision-sensitive designs.
Web and network credential protection
- **HTTP Basic** encodes credentials with Base64; it needs TLS for confidentiality. **Digest** uses challenge-response; **NTLM** uses a different challenge-response exchange. None replaces authorization checks.
- **Single sign-on** reuses an identity session across applications. Protect tokens and validate issuer, audience and expiry; distinguish federated identity from simply reusing the same password.
- **FTP, Telnet and HTTP** can expose credentials or session data on plaintext connections. SSH/SCP, TLS and appropriate VPNs protect transport when peers and certificates are validated.
- **Null sessions** are anonymous SMB sessions, not proof of a blank administrator password. Restrict anonymous enumeration and unnecessary SMB exposure; verify effective permissions rather than rely on one registry setting.
Exploitation and post-exploitation
Exploit and payload roles
- **Server-side exploits** attack exposed services; **client-side exploits** target applications processing content, such as browsers or document readers. **Local privilege escalation** crosses a privilege boundary after access.
- **Exploit** triggers a weakness; **payload** supplies resulting functionality. **Staged payloads** use a small stager to load a larger stage; **single payloads** package their functionality together.
- **Bind payloads** listen on the target; **reverse payloads** connect from the target to a handler. Choose direction using reachability, NAT, filtering and the approved test plan.
- **Metasploit** organizes exploits, payloads and auxiliary modules. Check target version, architecture, execution context and payload compatibility; failed exploitation does not establish that the target is secure.
Meterpreter and privileges
- **Meterpreter** supplies a structured session with commands such as upload, download, getuid and getpid. Historical **stdapi** and **priv** extensions group different capabilities.
- **getuid** reports identity; **getprivs** examines or enables available privileges; **getsystem** attempts supported elevation techniques. Loading an extension does not itself grant administrator or SYSTEM rights.
- **Hash dumping** requires sufficient access to protected credential stores. A successful session in one process does not guarantee access to SAM, LSASS or another process's memory.
- **Process migration** changes session location and must match architecture and access constraints. It can disrupt the target and does not guarantee access to files locked by another process.
- **Timestomping** alters selected file timestamps; it does not erase other evidence. Treat timestamp changes and persistence as controlled activities with documented restoration.
Windows and Linux host essentials
- **Windows discovery**: net user lists local accounts, net localgroup administrators lists that group's membership, and cd %SystemRoot% selects the OS directory in cmd.exe.
- **Windows administration**: sc manages services; legacy **WMIC process call create** invokes a process; **PsExec** supports remote execution. Each depends on permissions, services and network reachability.
- **NTFS Alternate Data Streams** attach named streams to files. They can hide content from simple listings but remain discoverable; ADS is not a FAT filesystem feature.
- **Persistence locations** include services and Run registry entries. Run entries generally execute at user logon; cleanup must remove the exact test changes and verify their effects.
- **Unix permissions** assign read=4, write=2 and execute=1 to owner, group and others. **chmod 741** means rwx for owner, r-- for group and --x for others.
- **CRLF versus LF** can break transferred shell scripts or interpreter paths. Check line endings, executable permission and the shebang; FTP ASCII mode may translate text, while binary transfers preserve bytes.
Raw shells and pivoting
- **Netcat** carries byte streams for connectivity checks, banner requests and file transfer. Common options include -l for listening, -u for UDP and -z for probing; syntax varies by implementation.
- **Raw shells** lack full terminal behavior. Password prompts, sudo, editors and control sequences may require a PTY; commands failing in a raw shell do not necessarily indicate missing privileges.
- **Standard input/output** carries application data; Netcat's diagnostics commonly use **standard error**. Redirect streams deliberately when saving banners or transferring files.
- **Port forwarding** relays traffic to another endpoint; **pivoting** uses a reachable intermediate host to access an approved network. **Fpipe** is a legacy redirector; SSH provides authenticated tunnels.
- **HTTP tunneling** carries other traffic through HTTP exchanges; **HTTPort** is a legacy example. A tunnel does not grant authorization or guarantee encryption, anonymity or firewall bypass.
Web application testing
Interception and request state
- **OWASP ZAP** and similar intercepting proxies sit between the configured browser and application. Set the proxy host and port; HTTPS interception also requires appropriate trust configuration.
- **Breakpoints/interception** pause requests or responses for editing. A page can remain loading while a response awaits release; verify proxy state before concluding the server is unavailable.
- **Browser cookies, cache and history** influence later tests. Use isolated profiles or reset state to distinguish a changed request from cached content or a previous login session.
- **Nikto** checks web-server exposure and known risky resources; mutation expands candidate paths. A status code, banner or default page is a clue to validate, not proof of exploitation.
SQL injection
- **SQL injection** occurs when untrusted input changes query structure. Quotes or database errors are clues; confirm behavior with controlled tests rather than treating every error as proof.
- **Boolean, error-based, time-based and out-of-band** techniques expose different signals. **Blind injection** infers results without directly displaying the database response.
- **UNION queries** combine compatible result sets; **stacked queries** depend on the database and driver. System catalogs such as information_schema expose metadata, not necessarily application secrets.
- **Database-to-OS execution** depends on engine features, configuration and privileges. **Absinthe** is a legacy blind-SQLi tool; **sqlmap** automates testing but still requires careful scope and impact controls.
- **Parameterized queries** separate data from SQL syntax. Allowlist dynamic identifiers and use least-privilege accounts; legacy escaping functions are context-dependent and do not replace parameterization.
XSS and output contexts
- **Reflected XSS** returns input in an immediate response; **stored XSS** persists it for later viewers; **DOM-based XSS** arises through unsafe browser-side data handling.
- **Logs and administration consoles** can become stored-XSS sinks when recorded input is rendered as active HTML. A payload in a plain text file does not execute merely because the file exists.
- **Context-aware output encoding**, safe DOM APIs and HTML sanitization address different sinks. **Content Security Policy** adds defense in depth; input filtering alone is insufficient.
- **document.cookie** exposes cookies available to JavaScript. **HttpOnly** prevents that access, **Secure** restricts transport, and **SameSite** controls some cross-site sending; these controls serve distinct purposes.
CSRF, sessions and access control
- **CSRF/XSRF** causes a victim's browser to submit an unwanted authenticated request. An unsafe state-changing GET can be triggered by an embedded resource when cookies are sent.
- **Anti-CSRF tokens**, suitable SameSite cookies and Origin validation protect state-changing requests. Use appropriate HTTP methods; TLS alone does not prevent CSRF.
- **Session hijacking** reuses a valid session; **sidejacking** steals it from network traffic; **fixation** makes a victim authenticate with a preselected identifier. Regenerate session IDs at authentication boundaries.
- **Authorization checks** belong on every protected object and action. Random session identifiers, expiry and TLS reduce theft and guessing but do not repair missing server-side permission checks.
Command injection and exposed resources
- **OS command injection** changes a system command; **code injection** changes interpreted program logic. Avoid shell invocation, use structured APIs and allowlist necessary arguments.
- **Blind command injection** can be observed through timing or an agreed callback. A missing callback may reflect egress filtering; correlate observations before claiming execution or its absence.
- **Traversal and encoding flaws** let paths escape an intended directory. Normalize consistently and enforce filesystem boundaries; differently decoded paths can bypass naive string filters.
- **CGI diagnostics, directory indexes and public backups** can expose environment variables, usernames or source. Remove unnecessary scripts, enforce authentication and avoid secrets in web-accessible files.
Network attacks and defensive controls
Sniffing, spoofing and session attacks
- **ARP spoofing** poisons IPv4 neighbor mappings on a local segment, enabling redirection or disruption. **CAM-table flooding** stresses a switch's MAC table; flooding behavior depends on the switch and controls.
- **Promiscuous mode** accepts additional frames reaching an Ethernet interface; it does not make a switch forward every conversation there. Mirror ports, taps and authorized traffic redirection change visibility.
- **MITM attacks** interpose between endpoints. **Ettercap**, **dsniff** and legacy **Cain and Abel** support related capture or redirection tasks; valid TLS certificate checking resists impersonation.
- **IP spoofing** forges packet source addresses; **DNS poisoning** corrupts name-resolution data. A spoofed address alone does not give the sender access to returning TCP traffic.
- **TCP session hijacking** requires acceptable sequence/acknowledgment state and usable traffic positioning. Application session theft is a separate mechanism even when both are called hijacking.
Firewalls, IDS and normalization
- **Packet filters** inspect headers; **stateful firewalls** track connection state; **application proxies** terminate or relay higher-level exchanges. A circuit proxy and an application gateway inspect different information.
- **Dual-homed hosts** have two network interfaces; **screened hosts** use a filtering router and bastion; **screened subnets** add an isolated perimeter network. Architecture names alone do not establish policy strength.
- **Firewalking** sends probes with TTL chosen to expire beyond a filtering device, using returned errors to infer permitted traffic. Results depend on routing, filtering and ICMP behavior.
- **IDS insertion** makes the sensor accept data the endpoint rejects; **evasion** makes the endpoint accept data the sensor misses. Fragmentation and stream-reassembly differences can create these mismatches.
- **Session splicing** divides content across packets to challenge simplistic inspection. Robust stream reassembly and normalization reduce ambiguity; neither fragmentation nor bad checksums guarantees successful evasion.
- **NIDS** monitors network traffic; **HIDS** monitors host activity; **IPS** can block. Authentication failures belong in security/audit logs; clearing logs destroys evidence rather than proving stealth.
Availability and troubleshooting
- **SYN floods** exhaust connection-handling resources; **LAND** uses matching source and destination endpoints; **Teardrop** exploits malformed overlapping fragments in vulnerable stacks.
- **Smurf** uses spoofed ICMP Echo toward broadcast networks for amplification. **Ping of Death** concerns oversized or malformed reassembled packets, not simply a high volume of ordinary pings.
- **NAT/PAT state exhaustion**, filtering and rate limits can interrupt a large scan. Compare traffic on both sides of a control before assigning the failure to a target host or ISP.
- **EICAR** is a standard antivirus test string, not ordinary malware. Antivirus detection, heuristics and integrity checks complement patching and host controls; absence of an alert is not proof of safety.
Email, anonymity and legacy terminology
- **Email harvesting** collects addresses; **spam** is unsolicited bulk messaging; **spoofing** forges identity fields. An open relay enables unauthorized relaying but is not required to forge a From header.
- **Received headers** trace mail relay handling; start from trusted infrastructure and account for forged earlier headers. Visible addresses may identify relays, NAT or providers rather than the human sender.
- **Proxies/anonymizers** change visible network paths but can leak identity through application behavior, cookies or active content. A proxy is not an assurance of anonymity or secure transport.
- **Trojans/backdoors** may communicate over TCP, UDP or other channels; default port lists are weak identifiers. **TCSEC** is the Trusted Computer System Evaluation Criteria; its **A1** class denotes verified design.
Wireless and nearby-device security
Radio operation and discovery
- **IEEE 802.11** defines WLAN operation. Legacy **802.11b/g** uses 2.4 GHz; **802.11a** uses 5 GHz. Available channels and transmit limits depend on the regulatory domain.
- **Overlapping channels** create interference; 1, 6 and 11 are a common 2.4 GHz plan for 20 MHz operation. Choose channels using a site survey, occupancy and permitted local settings.
- **Infrastructure mode** uses an access point; **ad hoc** links peers directly. Infrastructure alone does not isolate clients; enforce client isolation and network policy when peer communication is forbidden.
- **SSID** identifies a network, not a secret. Hiding it does not prevent discovery; **MAC filtering** is bypassable because addresses can be observed and spoofed.
- **Monitor mode/RFMON** captures wireless frames on a selected channel without normal association. Managed mode connects as a client; promiscuous mode is not equivalent to radio monitor mode.
- **Omnidirectional antennas** cover around the antenna; **directional antennas** concentrate coverage. Gain redistributes energy rather than creating transmit power; account for coverage shape and regulatory limits.
WEP mechanisms and weaknesses
- **WEP** uses RC4 with a 24-bit transmitted IV. Marketing labels of 64 and 128 bits combine that IV with a 40- or 104-bit secret key; the IV is not secret key material.
- **IV reuse and RC4 weaknesses** enable statistical key recovery. **FMS** names a family of weaknesses in RC4 key scheduling exploited against WEP; required capture volume varies.
- **CRC-32 ICV** detects accidental corruption but is not a cryptographic MAC. WEP's malleability enables modification and injection; longer WEP keys do not repair the design.
- **Shared-key WEP authentication** exposes a challenge and encrypted response, aiding keystream recovery. Discovery, authentication and association are distinct steps; open-system authentication alone provides no confidentiality.
- **Aircrack-ng**, **AirSnort** and **WEPCrack** are associated with legacy WEP analysis. Replay can increase useful traffic, but packet injection is active testing and must be authorized.
WPA, 802.1X and rogue access points
- **WPA/TKIP** was a transition from WEP; **WPA2 with AES-CCMP** uses the 802.11i security design. Recognize these mechanisms separately from WEP; use supported strong configurations.
- **802.1X** separates supplicant, authenticator and authentication server. **EAP-TLS** uses client and server certificates; validate server identity and protect client private keys.
- **PEAP** tunnels an inner method, often EAP-MSCHAPv2, inside TLS. **LEAP** is a legacy password-based method with known weaknesses; server validation is essential against credential capture.
- **Evil twins** impersonate expected networks; automatic connection and unvalidated authentication can expose clients. Validate enterprise certificates, disable unsafe auto-join and protect applications with TLS.
- **WIDS/WIPS**, site surveys and wired-port controls help detect and contain rogue APs. **Kismet** is a wireless discovery/capture tool; **NetStumbler** is a legacy active discovery tool.
Physical and nearby-device exposure
- **Physical access** can bypass OS login through external boot or disk removal. Combine full-disk encryption, protected keys, firmware controls, Secure Boot and physical access restrictions.
- **Bluetooth bluejacking** sends unsolicited content; **bluesnarfing** extracts data; **bluebugging** abuses device control. Disable unnecessary discovery and services, patch devices and restrict pairing.
- **Mobile/media forensics** depends on the actual device, filesystem and encryption. An iPod or phone does not imply one required investigator OS; preserve evidence and choose supported tools.
- **WTLS** belongs to the legacy WAP protocol stack; it is distinct from WLAN link security. **VPNs** protect supported network paths, while endpoint and wireless controls remain necessary.