9 - Notes
Nice General Cheatsheets
0) Troubleshooting & Snippets
Random fixes, one-liners, and useful commands for lab machines and general fuckery.
Fix Go
When system Go is broken or missing (HTB / online lab VMs)…
…Install a local Go and wire it into PATH:
DNS Server Reconfig
Authentication Process - Kerberos
WIP: currently this is AI slop distilled from handouts and notes
Core Concepts & Flow
Kerberos is a ticket-based authentication protocol. It relies on a trusted third party, the Key Distribution Center (KDC), which resides on the Domain Controller (DC).

- AS-REQ (Authentication Service Request): User encrypts a timestamp with their password hash and sends it to the KDC.
- AS-REP (Authentication Service Reply): KDC validates the hash. If correct, issues a TGT (Ticket Granting Ticket). The TGT is valid for a specific time (default 10 hours) and is signed by the KRBTGT account.
- TGS-REQ (Ticket Granting Service Request): User presents the TGT to the KDC and requests access to a specific service (e.g., SQL, CIFS).
- TGS-REP (Ticket Granting Service Reply): KDC validates the TGT. Issues a TGS (Service Ticket). This ticket is encrypted using the Service Account’s password hash (Machine account or User account).
- AP-REQ (Application Request): User presents the TGS to the Application Server/Service. Service decrypts the ticket using its own hash to validate access.
- AP-REP (Application Reply): Access Granted
Ticket Forgery Attacks
Golden Tickets (Forged TGT)
A Golden Ticket is a forged TGT. It bypasses the authentication step (AS-REQ) entirely.
- Requirement: The NTLM hash of the
KRBTGTaccount. - Scope: Complete Domain Compromise. You can request a TGS for any service on any machine.
- Mechanics:
- You are forging the proof of identity that the KDC trusts.
- You can impersonate non-existent users (as long as the ticket timestamp is >20 mins old).
- You can set the ticket validity to 10+ years.
- Bypasses Smart Card requirements (since TGT issuance is the result of SC checks).
- Persistence:
- Access remains valid until the
KRBTGTpassword is rotated twice (AD keeps the current and previous hash valid). - Detection is difficult as TGT generation can occur off-domain.
- Access remains valid until the
Silver Tickets (Forged TGS)
A Silver Ticket is a forged Service Ticket. It bypasses the KDC entirely and interacts directly with the target server.
- Requirement: The NTLM hash of the Target Service Account (usually the Computer Account hash).
- Scope: Limited. Grants administrative access only to the specific service on the specific host targeted.
- Mechanics:
- You are skipping the KDC/DC steps (1-4). There is no network traffic to the DC.
- Logs only appear on the target server, making detection difficult for centralized SIEMs.
- Can create non-existent users with custom SIDs (e.g., Domain Admin SID) inside the ticket.
- Persistence:
- Valid until the Machine Account password rotates (default 30 days).
- Attackers may disable machine password rotation in the registry to maintain access.
Account & Attribute Persistence
SID History Injection
The sidHistory attribute is designed for domain migrations to allow users to retain access to resources in their old domain.
- Attack: Injecting the SID of a privileged group (e.g., Enterprise Admins) into the
sidHistoryof a low-privileged account. - Mechanism: When a user logs in, the PAC (Privilege Attribute Certificate) includes SIDs from their own groups AND their SID History.
- Stealth: The user does not appear in the “Domain Admins” group in AD Users and Computers. Detection requires filtering specific user attributes.
- Removal: Difficult; requires clearing the protected attribute via AD-RSAT tools.
Certificate Persistence (AD CS)
Forging authentication certificates using a compromised Certificate Authority (CA).
- Mechanism: Exporting the CA certificate and private key to mint new user certificates.
- Impact: Allows requesting TGTs indefinitely.
- Severity: Critical/Nuclear.
- Persists through user password changes.
- Persists through
KRBTGTrotation. - The rogue certificates are not in the CA’s issued list, so they cannot be individually revoked.
- Remediation: Requires revoking the Root CA, effectively breaking the entire trust infrastructure of the domain.
Structural Persistence
AdminSDHolder & SDProp
A mechanism to ensure protected groups (Domain Admins, etc.) stay secure, often abused for “self-healing” persistence.
- Mechanism: The
AdminSDHoldercontainer acts as a template. Every 60 minutes, the SDProp process copies permissions fromAdminSDHolderto all protected groups. - Attack: An attacker modifies the ACL of
AdminSDHolderto give a low-priv user “Full Control.” - Persistence: Even if an admin manually removes the attacker’s permissions from the Domain Admin group, SDProp will automatically re-add them within an hour.
Group Nesting & Modification
Hiding access in plain sight by manipulating group structures.
- Nesting: Adding a compromised account to a mundane group (e.g., “Printer Admins”), which is nested inside “IT Support,” which is nested inside “Domain Admins.” Bypasses shallow monitoring alerts.
- Shadow Groups: Leveraging groups with indirect access, such as groups that have write access to GPOs or password reset rights on Admin accounts.
GPO Implants
Using Group Policy Objects to deploy persistence across the fleet.
- Restricted Groups: Pushing a policy that adds a compromised domain user to the Local Administrators group of every PC.
- Logon Scripts: Configuring a GPO to run a reverse shell script every time a user (or specifically an Admin) logs in.
Machine/Host Persistence
DSRM (Directory Services Restore Mode)
Every DC has a local administrator account used for recovery (DSRM).
- Attack: Dumping this local hash (often set at DC promotion and never changed).
- Persistence: Configuring the DC to allow DSRM login via network (registry key
DsrmAdminLogonBehavior). Allows persistent local admin access to the DC essentially independent of AD.
MOSTLY DEAD TECHNIQUES
Skeleton Keys
Patching the lsass.exe process on a Domain Controller memory to accept a “Master Password.”
- Effect: The attacker can authenticate as any user using the master password.
- Stealth: The real user passwords still work normally.
- Limitation: Persistence is lost if the DC reboots.
Malicious SSP (Security Support Provider)
Registering a malicious DLL (like mimilib.dll) as a security provider on the DC.
- Effect: Logs cleartext passwords of every user authenticating against that DC to a local file or network share.
- Persistence: Survives reboots and operates as part of the OS authentication subsystem.
Authentication Process - Kerberos
- Knowledge Consistency Checker (KCC) generates a replication topology for the AD forest and automatically connects to other domain controllers through Remote Procedure Calls (RPC) to synchronise information… DC Synchronisation
- High value (near-privileged) accounts since
Domain Adminswould technically be the goal but get creds rotated quickly- Credentials that have local administrator rights on several machines. Usually, organisations have a group or two with local admin rights on almost all computers. These groups are typically divided into one for workstations and one for servers. By harvesting the credentials of members of these groups, we would still have access to most of the computers in the estate.
- Service accounts that have delegation permissions. With these accounts, we would be able to force golden and silver tickets to perform Kerberos delegation attacks.
- Accounts used for privileged AD services. If we compromise accounts of privileged services such as Exchange, Windows Server Update Services (WSUS), or System Center Configuration Manager (SCCM), we could leverage AD exploitation to once again gain a privileged foothold.
we often want to persist through service accounts with delegation permissions to forge silver and golden tickets

TGT
TGS
AS-REQ
TGS-REQ
AP-REQ
Golden Tickets are forged TGT for the
AS-REQ, which allow the request of TGS. Skips steps 1-2- ONLY NEED:
KRBTGTaccount’s password hash, we only need the domain name, domain SID, and user ID for the person we want to impersonate… if we have said hash we can get the other info - dont need password of user account impersonated
- the KDC will only validate the user account specified in the TGT if it is older than 20 minutes. This means we can put a disabled, deleted, or non-existent account in the TGT, and it will be valid as long as we ensure the timestamp is not older than 20 minutes.
- we could overwrite the values pushed by the KDC, such as, for example, that tickets should only be valid for 10 hours. We could, for instance, ensure that our TGT is valid for 10 years, granting us persistence.
- By default, the
KRBTGTaccount’s password never changes, meaning once we have it, unless it is manually rotated, we have persistent access by generating TGTs forever. - The blue team would have to rotate the KRBTGT account’s password twice, since the current and previous passwords are kept valid for the account. This is to ensure that accidental rotation of the password does not impact services.
- Rotating the KRBTGT account’s password is an incredibly painful process for the blue team since it will cause a significant amount of services in the environment to stop working. They think they have a valid TGT, sometimes for the next couple of hours, but that TGT is no longer valid. Not all services are smart enough to release the TGT is no longer valid (since the timestamp is still valid) and thus won’t auto-request a new TGT.
- Golden tickets would even allow you to bypass smart card authentication, since the smart card is verified by the DC before it creates the TGT.
- We can generate a golden ticket on any machine, even one that is not domain-joined (such as our own attack machine), making it harder for the blue team to detect.
- ONLY NEED:
Silver Tickets are forged TGS tickets. Skips steps 1-4
- The generated TGS is signed by the machine account of the host we are targeting.
- The main difference between Golden and Silver Tickets is the number of privileges we acquire. If we have the KRBTGT account’s password hash, we can get access to everything. With a Silver Ticket, since we only have access to the password hash of the machine account of the server we are attacking, we can only impersonate users on that host itself. The Silver Ticket’s scope is limited to whatever service is targeted on the specific server.
- Since the TGS is forged, there is no associated TGT, meaning the DC was never contacted. This makes the attack incredibly dangerous since the only available logs would be on the targeted server. So while the scope is more limited, it is significantly harder for the blue team to detect.
- Since permissions are determined through SIDs, we can again create a non-existing user for our silver ticket, as long as we ensure the ticket has the relevant SIDs that would place the user in the host’s local administrators group.
- The machine account’s password is usually rotated every 30 days, which would not be good for persistence. However, we could leverage the access our TGS provides to gain access to the host’s registry and alter the parameter that is responsible for the password rotation of the machine account. Thereby ensuring the machine account remains static and granting us persistence on the machine.
- While only having access to a single host might seem like a significant downgrade, machine accounts can be used as normal AD accounts, allowing you not only administrative access to the host but also the means to continue enumerating and exploiting AD as you would with an AD user account.
WARNING
The techniques discussed from this point forward are incredibly invasive and hard to remove. Even if you have signoff on your red team exercise to perform these techniques, you must take the utmost caution when performing these techniques. In real-world scenarios, the exploitation of most of these techniques would result in a full domain rebuild.
- Make sure you fully understand the consequences of using these techniques and only perform them if you have prior approval on your assessment and they are deemed necessary. In most cases, a red team exercise would be dechained at this point instead of using these techniques. Meaning you would most likely not perform these persistence techniques but rather simulate them.
- We can continue requesting TGTs no matter how many rotations they do on the account we are attacking. The only way we can be kicked out is if they revoke the certificate we generated or if it expires. Meaning we probably have persistent access by default for roughly the next 5 years.
- Certificate Authority (CA) itself
Authentication Process - Linux
1. Core Architecture: PAM
Pluggable Authentication Modules (PAM) manage the authentication, session setup, and password changes.
- Key Module:
pam_unix.so(Standard Unix auth). - Location:
/usr/lib/x86_64-linux-gnu/security/ - Function: Bridges the gap between user input (e.g.,
passwdcommand) and flat files (/etc/passwd,/etc/shadow).
2. Critical Files & Storage
A. The User Registry (/etc/passwd)
- Permissions: World-Readable.
- Format:
Username:Password:UID:GID:GECOS:Home:Shell - Key Fields:
- Password (
x): Indicates the hash is actually in/etc/shadow. - Exploit: If writeable, deleting the
xremoves the password requirement for that user (e.g.,root::0:0...allows passwordless login).
- Password (
B. The Secrets (/etc/shadow)
- Permissions: Root-Readable only.
- Format:
Username:Hash:LastChange:Min:Max:Warn:Inactive:Expire:Reserved - Status Flags:
!or*: Account is locked (cannot login via password).- Note: SSH Key auth or
sumight still work even if locked.
C. Password History (/etc/security/opasswd)
- Permissions: Root-Readable.
- Function: Stores previously used password hashes to enforce history policies (prevent reuse).
- Value: Often contains older, weaker hashes (MD5) useful for pattern analysis.
3. Hash Formats & Algorithms
Linux hashes follow the format: $<id>$<salt>$<hash>
| ID | Algorithm | Notes |
|---|---|---|
| $1$ | MD5 | Weak. Fast to crack. |
| $2a$ | Blowfish | Slower (Bcrypt). |
| $5$ | SHA-256 | Standard. |
| $6$ | SHA-512 | Standard / Strong. |
| $y$ | Yescrypt | Modern Default (Debian/Kali). Harder to crack. |
| $7$ | Scrypt | Memory hard. |
4. Cracking Workflow
1. Prepare the File (Unshadow)
Combine passwd and shadow to give the cracker the necessary context (Usernames, GECOS, and Hash).
2. Crack (Hashcat)
- Format: SHA-512 (Mode 1800) is the most common legacy default.
3. Crack (John the Ripper)
- Mode:
--singleis highly effective here becauseunshadowprovides the GECOS fields for guessing.
Authentication Process - Windows

1. Key Processes & Architecture
WinLogon (WinLogon.exe)
- Role: The “orchestrator.” Intercepts keyboard input (
Ctrl+Alt+Del), manages the workstation lock status, and handles password changes. - Workflow: Launches
LogonUI-> Collects Creds -> Sends toLSASS. - Legacy Note (GINA): In older Windows (NT/XP),
msgina.dllhandled this. Replaced by Credential Providers in modern Windows.
LogonUI (LogonUI.exe)
- Role: The graphical user interface that asks for the password.
- Mechanism: Uses Credential Providers (COM Objects/DLLs) to accept different auth types (Password, PIN, Biometrics).
LSASS (%SystemRoot%\System32\Lsass.exe)
- Role: The “Gatekeeper.” Enforces security policy, validates the password against SAM/AD, and writes to the Event Log.
- Resources: Microsoft: LSA Architecture
2. Authentication DLLs (The Packages)
These modules live inside LSASS to handle specific tasks.
| DLL Name | Function / Description |
|---|---|
| Lsasrv.dll | The Manager. Enforces policy and chooses the protocol (Negotiate: Kerberos vs NTLM). |
| Msv1_0.dll | Local / NTLM. Handles non-domain logins and legacy NTLM authentication. |
| Kerberos.dll | Domain. Handles Kerberos ticket requests and validation. |
| Samsrv.dll | SAM Interface. Talks to the local SAM database. |
| Netlogon.dll | Network. Handles the secure channel for network logons. |
| Ntdsa.dll | AD Interface. Used to create/manage records in the Registry or AD. |
3. Credential Storage Locations
Local Users (SAM)
- File Path:
%SystemRoot%\system32\config\SAM - Registry Mount:
HKLM\SAM - Protection: Partially encrypted by SYSKEY (
syskey.exe) to prevent offline extraction. - Content: Local user NTLM/LM hashes.
| Registry Hive | Description |
|---|---|
HKLM\SAM | Contains password hashes for local user accounts. These hashes can be extracted and cracked to reveal plaintext passwords. |
HKLM\SYSTEM | Stores the system boot key, which is used to encrypt the SAM database. This key is required to decrypt the hashes. |
HKLM\SECURITY | Contains sensitive information used by the Local Security Authority (LSA), including cached domain credentials (DCC2), cleartext passwords, DPAPI keys, and more. |
Domain Users (NTDS)
- File Path:
%SystemRoot%\ntds.dit - Location: Found only on Domain Controllers.
- Content: Active Directory database (Users, Groups, Computers, GPOs, Hashes).
- Sync: Replicates to all DCs (except Read-Only DCs).
Credential Manager (The Vault)
- Role: Stores saved passwords for RDP, Websites, and Network Shares.
Policy.vpolin File Path:
%UserProfile%\AppData\Local\Microsoft\Vault\%UserProfile%\AppData\Local\Microsoft\Credentials\%UserProfile%\AppData\Roaming\Microsoft\Vault\%ProgramData%\Microsoft\Vault\%SystemRoot%\System32\config\systemprofile\AppData\Roaming\Microsoft\Vault\
- Resource: Microsoft: Credential Manager

BloodHound
BloodHound
- https://github.com/SpecterOps/BloodHound
- Attack Path: https://morimori-dev.github.io/posts/tech-bloodhound-attack-paths/
NOTE: sometimes the outputed zipfile doesn’t get properly ingested… trying extracting and uploading the individual JSON files
BloodHound is THE TOOL for AD enumeration. “[L]everages graph theory to reveal hidden and often unintended relationships across identity and access management systems…” visually along with other pre-built queries to find weakness in domain structures.
Pre-Requisites
Collecting Info
- Collection Methods: https://bloodhound.specterops.io/collect-data/ce-collection/sharphound-flags
Uploading Info
- Transfer Bloodhound data to attacker
- Upload zipfile to Bloodhound: http://127.0.0.1:8080/ui/login
- Upload to Bloodhound: http://127.0.0.1:8080/ui/administration/file-ingest
Analysis and Queries
| BEST QUERIES | Why |
|---|---|
| Find Shortest Paths to Domain Admins | Primary attack path |
| Find Principals with DCSync Rights | Instant game over if found |
| Find Kerberoastable Users | Most common foothold |
| Shortest Paths to DA from Kerberoastable Users | Combined path |
| Find AS-REP Roastable Users | No creds needed |
| Find Computers where Domain Users are Local Admin | Easy lateral movement |
Domain Trusts
- Pre-built Query
- Analysis > Domain Information > Map Domain Trusts
Enumerating ACLs of User
- Select starting node user
- Select Node Info > Scroll to
Outbound Control Rights First Degree Object Control- Right-Click edge > Help for more info
Transitive Object Control- Analysis > Dangerous Rights
CanRDP
- BloodHound CanRDP:
- Search for User > Node Info > Execution Rights
- Analysis
Find Workstations where Domain Users can RDPFind Servers where Domain Users can RDP
CanPSRemote
SQLAdmin
ffuf
Fast web fuzzer ffuf is best used for Virtual Host (VHOST) Discovery, Parameter Fuzzing, and API Testing. Use feroxbuster for web file and directory brute-forcing.
When fuzzing for file extensions, try to discern (or guess by searching for index.*) to ascertain the web technologies used (i.e. PHP for Apache or ASPX for IIS, etc.)
References:
Basic usage
Wordlists
- Dir/File:
/usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-small.txt - Extensions:
/usr/share/wordlists/seclists/Discovery/Web-Content/web-extensions.txt - Subdomains:
/usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt - URL Parameters:
/usr/share/wordlists/seclists/Discovery/Web-Content/burp-parameter-names.txt - Users:
- Quick:
/usr/share/seclists/Usernames/top-usernames-shortlist.txt - Comprehensive:
/usr/share/seclists/Usernames/xato-net-10-million-usernames.txt
- Quick:
Example Commands
Find file extension (and learn web technologies)
Search for files
Search recursively for specified file extensions
Subdomain search
vHost Brute-Force
Just changes HTTP header
Parameter fuzzing
GET
POST
Value fuzzing
For HTTP GET requests, remove the -X and -d options and incorporate the PARAM=value into the -u URL.
Try other wordlists to make sure they make sense for the PARAM.
Hashcat
Hashcat is a fast password recovery tool that supports multiple attack modes and hash types. It’s the world’s fastest and most advanced password recovery utility.
References:
- Hash Type Codes: https://hashcat.net/wiki/doku.php?id=example_hashes
- Permutation Rules:
/usr/share/hashcat/rules - Cheat Sheet: https://pentesting.site/cheat-sheets/hashcat/
- Rule-Based Attack: https://hashcat.net/wiki/doku.php?id=rule_based_attack
Important Notes
- Hash Mode: Always specify the correct
-mmode for your hash type. Usehashidor check the hash format to determine the mode. - Wordlists: Common wordlists include
rockyou.txt,SecLists, and custom wordlists generated from OSINT. - Rules: Start with
best64.rulefor quick results, then move to more comprehensive rules if needed. - Performance: Use
-w 3or-w 4for faster cracking (uses more resources). Use-Ofor optimized kernels (may limit password length). - GPU Acceleration: Hashcat automatically uses GPU if available. Ensure proper drivers are installed.
- Resume Sessions: Hashcat saves progress automatically. Use
--restoreto resume interrupted sessions. - Output: Cracked passwords are saved to
~/.hashcat/hashcat.potfile~/.local/share/hashcat/hashcat.potfile
- Username: Sometimes it strips the name from hits… to show username and passwords run:
hashcat --username --show <CRACKME>
Basic Usage
Attack Modes
| Mode | Description | Example |
|---|---|---|
| 0 | Straight (Dictionary) | hashcat -a 0 -m 1000 hash.txt wordlist.txt |
| 1 | Combinator | Combines words from two wordlists |
| 3 | Brute-Force/Mask | hashcat -a 3 -m 1000 hash.txt ?a?a?a?a?a?a |
| 6 | Hybrid Wordlist + Mask | Wordlist + mask pattern |
Common Hash Types & Modes
Windows Hashes
Linux Hashes
Kerberos (Active Directory)
Other Hash Types
Rule-Based Attacks
Rule-based attacks apply transformations to words in a wordlist, creating permutations and variations.
Rule Files Location
Rule Comparison Table
| Rule File | Rule Count | Use Case |
|---|---|---|
best64.rule | 64 | First Run. Instant results for easy passwords. |
d3ad0ne.rule | ~34,000 | Deep Crack. Good for standard “complex” user passwords. |
dive.rule | ~100,000+ | Paranoid. Extremely slow; last resort for dictionary attacks. |
Using Rules
Creating Custom Rules
Common rule transformations:
| Rule | Description | Example |
|---|---|---|
c | Capitalize first character, lowercase rest | password → Password |
C | Lowercase first character, uppercase rest | password → pASSWORD |
t | Toggle case of all characters | password → PASSWORD |
$! | Append ! to end | password → password! |
$1$9$9$8 | Append 1998 to end | password → password1998 |
sa@ | Replace all a with @ | password → p@ssword |
so0 | Replace all o with 0 | password → passw0rd |
ss$ | Replace all s with $ | password → pa$$word |
Example Custom Rule File:
Mask Attacks (-a 3)
Mask attacks use placeholders to define character sets and patterns for brute-force attacks.
Charset Symbols
| Symbol | Description | Charset / Definition |
|---|---|---|
?l | Lowercase | abcdefghijklmnopqrstuvwxyz |
?u | Uppercase | ABCDEFGHIJKLMNOPQRSTUVWXYZ |
?d | Digits | 0123456789 |
?h | Hex (Lower) | 0123456789abcdef |
?H | Hex (Upper) | 0123456789ABCDEF |
?s | Special | «space»!"#$%&’()*+,-./:;<=>?@[]^_{` |
?a | All | ?l?u?d?s |
?b | Binary | 0x00 - 0xff |
Custom Charsets
Mask Examples
Hash Identification
Before cracking, identify the hash type:
Common Hash Values
| Hash Value | Type | Meaning |
|---|---|---|
d41d8cd98f00b204e9800998ecf8427e | MD5 | Empty String (0 byte input) |
da39a3ee5e6b4b0d3255bfef95601890afd80709 | SHA1 | Empty String (0 byte input) |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | SHA256 | Empty String (0 byte input) |
Workflow Examples
Linux Password Cracking
Kerberoasting
Windows NT Hashes
Hydra
Hydra is a parallelized login cracker that supports numerous protocols to attack quickly and flexibly, and new modules are easy to add.
NOTE: use netexec for Windows AD environments instead
Core Flags
Protocol-Specific Examples
SSH / FTP / RDP / SMB
Web Forms
HTTP-POST
Syntax: "/PATH:BODY:CONDITION=STRING"
- Use browser F12 > Network > DevTools, web proxy, or
-dto capture the actual POST request. Look for the form action URL and input field names. - Use
^USER^and^PASS^as placeholders inBODY - Condition String:
hydra -U http-post-form- Important: you can only define S= OR F= - not both
F=<FAILURE_STRING>(default) specifies the failure response text to detect failed logins- too many false positives means bad failure string
- `S=<SUCCESS_STRING>
S=302means a successful login due to an HTTP 302 page forward redirect
Check with -dt1 for condition strings
HTTP Basic Auth
A basic form of authentication, usually when a web resource is restricted, a pop-up window will appear asking for username and password. From a HTTP header perspective it is the base64 version of <USERNAME>:<PASSWORD> like:
WordPress Specific
Password Spraying
Password spraying uses one password against many users (alternates users), which has no risk of account lockout compared to brute-forcing. This is useful as a “hail Mary” to find any way in!
Best practice: Obtain account lockout policy beforehand (via enumeration or asking customer); if you don’t know the password policy, a good rule of thumb is to wait a few hours between attempts, which should be long enough for the account lockout threshold to reset.
Important Notes
- Account Lockout Risk: Brute-forcing (many passwords vs 1 user) has a RISK of account lockout due to account lockout policy. Use small wordlists and be cautious.
- Thread Count: Use
-t 4for SSH to avoid overwhelming the service. Web forms can handle higher thread counts like-t 16. - Wordlist Selection: For online attacks, use small wordlists (e.g., top 1000 passwords) to minimize lockout risk and reduce time.
- Output: Always use
-o <OUTPUT_FILE>to save results for later analysis.
Mimikatz
Mimikatz is a post-exploitation tool that can extract plaintext passwords, hashes, PINs, and Kerberos tickets from memory. It can also perform pass-the-hash, pass-the-ticket, and build Golden Tickets.
TL;DR Credential Dumping Checklist
Important Notes
- Debug Privilege: Most Mimikatz operations require
privilege::debugto access LSASS memory - Administrator Required: Mimikatz typically needs administrator privileges to function
- LSASS Access: Many operations read from LSASS memory, which is protected by Windows
- Detection: Mimikatz is heavily flagged by security products and EDR solutions
- Pass the Hash: When using
sekurlsa::pth, a new window will open - run commands in that new window - Golden Tickets: Golden Tickets are valid until the KRBTGT account password is changed (typically 180 days by default)
- Ticket Files: Exported Kerberos tickets use
.kirbiformat - Domain Syntax: Use “.” for domain when targeting local machine accounts
Basic Usage & Privilege Escalation
Credential Dumping
LSASS Memory (sekurlsa)
Dump All Credentials:
Dump WDigest Plaintext Credentials:
Dump Specific Hash Types:
Export Kerberos Tickets:
Extract AES Keys:
SAM Database
LSA Secrets
Dump Specific Account:
DCSync
Might require runas.
Pass the Hash (PtH)
Pass the Hash allows you to authenticate using an NTLM hash instead of a plaintext password.
Alternative Syntax:
Pass the Key (PtK) / OverPass the Hash (OtH)
Concept: Request a Kerberos Ticket (TGT) using an NTLM hash or AES Key, rather than using the NTLM protocol directly.
Extract AES Keys First:
Pass the Key with AES:
Pass the Ticket (PtT)
Pass the Ticket allows you to use stolen Kerberos tickets to authenticate as another user.
Export Tickets:
Inject Ticket:
Golden & Silver Ticket Attack
A Golden Ticket is a forged Kerberos TGT that allows you to impersonate any user in the domain, including domain administrators.
A Silver Ticket is a forged Kerberos TGS that allows you to impersonate any user on a single machine.
Step 1: Get KRBTGT Hash & SID
Method A (On DC):
Method B (Remote DCSync):
Step 2: Create & Inject Ticket
/ptt- This flag tells Mimikatz to inject the ticket directly into the session, meaning it is ready to be used./endin- The ticket lifetime. By default, Mimikatz generates a ticket that is valid for 10 years. The default Kerberos policy of AD is 10 hours (600 minutes)/renewmax- The maximum ticket lifetime with renewal. By default, Mimikatz generates a ticket that is valid for 10 years. The default Kerberos policy of AD is 7 days (10080 minutes)/user: can use any value including non-existent users
Step 3: Launch Shell
Credential Manager
Dump credentials stored in Windows Credential Manager:
DPAPI (Data Protection API)
Decrypt data protected by Windows DPAPI, such as browser credentials:
Netexec
- https://www.netexec.wiki/getting-started/selecting-and-using-a-protocol
- Logs:
~/.nxc/logs/
- Logs:
- Cheatsheet: https://gist.github.com/strikoder/99635df00444bbf5fc90ca83ec8051a0
NOTES:
- by default,
netxecattempts to authenticate with passwords or hashes at the domain level… use--local-authto force local authentication, since sometimes passwords and usually hashes are different at these levels (Pwn3d!)for valid creds means an Administrator account
Netexec (formerly CrackMapExec) is a swiss army knife for pentesting networks that helps automate assessing the security of large networks in AD environments. Netexec uses secretsdump libraries under its hood, so it is the preferred tool for network enumeration (though secretsdump is still great for offline hash extraction or targeted actions)
Protocol Selection
Netexec supports multiple protocols. Check available services with:
Common protocols include:
mssql own stuff using MSSQLwinrm own stuff using WINRMldap own stuff using LDAPsmb own stuff using SMBssh own stuff using SSHvnc own stuff using VNCwmi own stuff using WMIftp own stuff using FTPrdp own stuff using RDP- And sometimes more…
Password Policy Enumeration
Enumerate password policy information via SMB:
User Enumeration
Enumerate Users
Enumerate Groups
Share Enumeration
Password Spraying
Password spraying uses one password against many users (alternates users), which has no risk of account lockout compared to brute-forcing. This is useful as a “hail Mary” to find any way in!
Best practice: Obtain account lockout policy beforehand (via enumeration or asking customer); if you don’t know the password policy, a good rule of thumb is to wait a few hours between attempts, which should be long enough for the account lockout threshold to reset.
Pass the Hash (PtH)
Netexec supports pass-the-hash attacks for lateral movement:
Credential Dumping
LSA Secrets
Remotely dump LSA secrets from a target:
SAM Database
Remotely dump SAM database secrets:
Active Directory Operations
NTDS Extraction
- https://www.netexec.wiki/smb-protocol/obtaining-credentials/dump-ntds.dit
- NOTE: this can sometimes crash the DC:
To dump one account instead of the full database, add --ntds --user <USER>:
LDAP Operations
Admin Count Enumeration
Find high-value users with adminCount=1 (includes Domain Admins, Enterprise Admins, Backup Operators, etc.):
Command Execution
Sudo is REQUIRED because these operations act as a server/listener.
--exec-method | Protocol | How | Noise | Port |
|---|---|---|---|---|
wmiexec (default) | WMI | WMI process create | Lower | 135 |
smbexec | SMB | Creates a Windows service | Medium | 445 |
atexec | SMB | Scheduled task | Lower | 445 |
mmcexec | DCOM | MMC20 DCOM object | Lowest | 135 |
Modules
| Module | Command | Purpose |
|---|---|---|
spider_plus | nxc smb <T> -M spider_plus | Crawl shares, index all files |
ntdsutil | nxc smb <T> -M ntdsutil | Safe NTDS dump from disk |
lsassy | nxc smb <T> -M lsassy | Remote LSASS dump + parse |
laps | nxc ldap <T> -M laps | Read LAPS passwords |
gpp_password | nxc smb <T> -M gpp_password | GPP cpassword decrypt |
ntds-dump-raw | nxc smb <T> -M ntds-dump-raw | Raw disk NTDS extraction |
nanodump | nxc smb <T> -M nanodump | Stealthier LSASS dump |
gpp_autologin | nxc smb <T> -M gpp_autologin | GPP autologon creds |
webdav | nxc smb <T> -M webdav | Check if WebDAV enabled |
petitpotam | nxc smb <T> -M petitpotam | Coerce NTLM auth |
nopac | nxc smb <T> -M nopac | Check noPac/sAMAccountName vuln |
zerologon | nxc smb <T> -M zerologon | Check Zerologon vuln |
Nmap
nmapgrep: https://github.com/leonjza/awesome-nmap-grep
Scanning
Open- received TCP SYN-ACKClosed- received TCP RSTFiltered- no responseUnfiltered- (with-sATCP ACK scans) can’t determine the state, but the port is accessibleOpen/Filtered- can’t tell if the port is open or blocked by a firewallClosed/Filtered- (with-sIIP ID idle scan) can’t tell if the port is closed or blocked by a firewall
For “ghost hosts” consider: -PU137,138,161,53,67,123,500,4500 to scan UDP (though very slow)
- TCP Full-Scan (3-way handshake): https://github.com/bee-san/RustScan
- TCP Half-Scan (SYN): https://github.com/robertdavidgraham/masscan
Static nmap
A static nmap will not be able to perform -sC/--script nor -sV and there might be some issues with -O OS detection.
-sT, -sS (root), and -sV should be fine
Nmap Scripting Engine (NSE)
The Nmap Scripting Engine (NSE) extends Nmap’s functionality with custom scripts for vulnerability detection, service enumeration, and exploitation.
Reference: NSE Usage Guide
How to Use NSE
Basic Usage:
-sC- Run a set of popular, common scripts--script- Run specific scripts by name, category, or file path--script-help- Show arguments for--script-args
Advanced Usage:
- Combine scripts with wildcards:
--script "smb-*,http-*" - Use comprehensive documentation: NSE Script Database
- Search for scripts:
grep "ftp" /usr/share/nmap/scripts/script.db
Script Categories
Location: /usr/share/nmap/scripts
| Category | Description |
|---|---|
auth | Scripts related to authentication, such as bypassing credentials or checking for default ones. |
broadcast | Used to discover hosts on the local network by broadcasting requests. |
brute | Scripts that perform brute-force attacks to guess passwords or credentials. |
default | The core set of scripts that are run automatically with -sC or -A. |
discovery | Actively gathers more information about a network, often using public registries or protocols like SNMP. |
dos | Tests for vulnerabilities that could lead to a denial-of-service attack. |
exploit | Actively attempts to exploit known vulnerabilities on a target system. |
external | Interacts with external services or databases. |
fuzzer | Sends unexpected or randomized data to a service to find bugs or vulnerabilities. |
intrusive | These scripts can be noisy, resource-intensive, or potentially crash the target system. |
malware | Scans for known malware or backdoors on a target host. |
safe | Scripts that are considered safe to run as they are not designed to crash services, use excessive resources, or exploit vulnerabilities. |
version | Extends the functionality of Nmap’s version detection feature. |
vuln | Checks a target for specific, known vulnerabilities. |
Install New NSE Script
SQLmap
- https://github.com/sqlmapproject/sqlmap/wiki/Usage
- use the “Enumeration” section once finding vuln points
- Logs:
~/.local/share/sqlmap/output/<TARGET>
Core Flags
| Option | Purpose |
|---|---|
-u / --url | Target URL (GET params tested by default). |
--data | POST body (e.g. 'uid=1&name=test'). Use * at injection point: 'uid=1*&name=test'. |
-p | Test only this parameter (e.g. -p uid). |
-r | Request file — full HTTP request (from Burp / Copy to file). Put * in the request where to inject (e.g. /?id=*). |
--cookie | Session cookie (e.g. --cookie='PHPSESSID=...'). Use * in value to test cookie: --cookie="id=1*". |
-H / --header | Custom header(s). Same for --host, --referer, -A/--user-agent. |
--random-agent | Random User-Agent from built-in list (evade WAF that blocks sqlmap default). |
--mobile | Use a mobile User-Agent. |
--method | HTTP method (e.g. --method PUT). |
--batch | Non-interactive (no prompts). |
Workflow
NOTE: Don’t rely on sqlmap to crawl or guess…
Capture the exact request via:
- a web proxy, save it to a file, and feed it to sqlmap
- browser Web Developers Tools as a cURL command, then change
curltosqlmapand add any additional options like--forms
By default sqlmap prioritizes speed: level 1 only tests GET (URL) and POST (body). It does not test cookies or headers unless you raise the level.
-r(request file): Gold standard. Raw HTTP request = exact cookies, JSON, headers; no guessing.--forms: Parses the HTML response, finds<form>inputs, and builds POST requests. Without it, a URL that only shows a login form is only tested as GET.*marker: For REST (e.g./user/105) or when the injection point isn’t a normal param, put*at the value to test:sqlmap -u "http://target/item/12*"— sqlmap injects at12.
Techniques (BEUSTQ)
Try the simpler/faster techniques first to find easy wins, but
NOTE: remember this will miss techniques!
Union-based
Combine two queries to dump data directly into the response. Count the displayed columns (and maybe iteratively increase columns amount)
Error-based
Trigger DB errors that leak data inside the error message.
Blind Boolean
Infer data from whether the page content or behaviour changes (true vs false).
NOTE: careful this is a very unstable method that might require multiple runs or --no-cast
Blind Time
Infer data from response delays (e.g. SLEEP) when the condition is true.
Stacked queries
Append extra SQL statements after the vulnerable one (e.g. INSERT/UPDATE/DELETE or OS commands); requires DB support (e.g. MSSQL, PostgreSQL).
Inline queries
Query embedded inside the original query; uncommon and app-dependent.
Out-of-band
Exfiltrate via DNS or HTTP to a server you control when no output is visible.
Troubleshooting
- JSON/XML / APIs: sqlmap may not detect parameters automatically. Use
-rwith a captured request or raise--level. - Headers & cookies: Level 1 ignores them.
--level 2= cookies;--level 3= User-Agent/Referer;--level 5= Host. - CSRF tokens: If the form needs a fresh token per request, replay fails. Use
--csrf-token="csrf_token_name"or--csrf-url.
| Option | Purpose |
|---|---|
--parse-errors | Parse and display DBMS errors (syntax, access, etc.) so you can see what the database is complaining about. |
-t <FILE> | Store all traffic (requests and responses) to a file. Inspect manually to see where the failure occurs. |
-v <LEVEL> | Verbosity (e.g. -v 6). More console output; full HTTP requests/responses in real time so you can follow what sqlmap is doing. |
--proxy <URL> | Route sqlmap through a proxy (e.g. Burp: --proxy http://127.0.0.1:8080). Inspect, repeat, and use proxy features on every request. |
Attack Tuning & Escalation
“Silver Bullet” Commands
When default sqlmap fails to find an injection, match your scenario to one of these three archetypes.
Archetype A: The Logic/Bracket Failure (OR Payloads)
Use when AND logic fails, or the query uses heavily nested parentheses (((...))).
*tells SQLMap to replace the parameter entirely (creates a clean True/False baseline).--risk 3enablesORpayloads.--level 5tests maximum combinations of closing brackets/quotes.
Archetype B: The Custom Boundary (Manual Prefix)
Use when you manually found the syntax breaker in Burp (e.g., )), but SQLMap isn’t guessing it.
--prefixforces SQLMap to inject the exact closing syntax before its payload.
Archetype C: The Union Structure Failure Use when SQLMap detects a parameter but fails to extract data via UNION.
--technique=Uforces UNION-based SQLi (saves time).--union-cols=5tells SQLMap exactly how many columns exist (find this manually withORDER BY 5in Burp).
Advanced Tuning
When SQLMap is hallucinating data or failing to distinguish True/False pages, use these flags to fix its baseline.
| Flag | Purpose / Mechanic |
|---|---|
| Boundaries & Coverage | |
--level=5 | Tests more parameters (Cookies, Headers) and uses complex boundary closures ())), ""). |
--risk=3 | Enables OR logic payloads. Required for Login bypasses and UPDATE/DELETE queries. |
--prefix="..." | Manually close the developer’s SQL string (e.g., --prefix="%'))"). |
--suffix="..." | Manually comment out the rest of the developer’s SQL (e.g., --suffix="-- -"). |
| Boolean State Tuning | (Fixes “Hallucinations” and “2 Letters Off” errors) |
--string="Success" | Marks a page as TRUE only if this exact word appears. |
--text-only | Strips all HTML tags before comparing True/False. Fixes wobble from dynamic hidden fields. |
--code=200 | Uses HTTP Status Codes to define TRUE. |
--titles | Compares the <title> tags instead of the whole body. |
| Execution Control | |
--technique=BEU | Only use Boolean, Error, and Union. Skips Time-based (T) which causes timeouts. |
--union-char='a' | Replaces NULL with a string character. Fixes strict typing errors in UNION queries. |
--union-from=users | Appends a specific table to the UNION payload (Required for Oracle DBs). |
Evasion & Protections Bypass
Application Logic & Request
| Flag | Description |
|---|---|
--csrf-token="name" | Automatically parses the HTTP response to extract and update anti-CSRF tokens for subsequent requests. |
--randomize="param" | Generates a random value for a specific parameter per request, bypassing anti-automation unique-value checks. |
--eval="python_code" | Executes inline Python to calculate dynamic parameter values (e.g., import hashlib; h=hashlib.md5(id).hexdigest()). |
Network & Protocol Evasion
| Flag | Description |
|---|---|
--random-agent | Replaces the default sqlmap User-Agent with a random, legitimate browser UA to bypass basic blacklists. |
--skip-waf | Skips SQLMap’s initial, highly-noisy WAF heuristic payload check. |
--proxy="url" | Routes traffic through a single proxy (e.g., socks4://127.0.0.1:9050) or a list (--proxy-file). |
--tor | Routes traffic via the Tor network (use --check-tor to verify anonymization). |
--chunked | Uses HTTP chunked transfer encoding to split POST bodies, bypassing WAF keyword inspection at the protocol layer. |
--hpp | HTTP Parameter Pollution. Splits the payload across multiple identical parameters (e.g., ?id=1&id=UNION&id=SELECT). |
Tamper Scripts
Tamper scripts use Python to rewrite the SQL payload before it is sent to the target. They can be chained by comma-separating them (e.g., --tamper=space2comment,randomcase).
- Official Repository: github.com/sqlmapproject/sqlmap/tree/master/tamper
- List locally:
sqlmap --list-tampers
| Tamper-Script | Description |
|---|---|
0eunion | Replaces instances of UNION with e0UNION |
base64encode | Base64-encodes all characters in a given payload |
between | Replaces greater than operator (>) with NOT BETWEEN 0 AND # and equals operator (=) with BETWEEN # AND # |
commalesslimit | Replaces (MySQL) instances like LIMIT M, N with LIMIT N OFFSET M counterpart |
equaltolike | Replaces all occurrences of operator equal (=) with LIKE counterpart |
halfversionedmorekeywords | Adds (MySQL) versioned comment before each keyword |
modsecurityversioned | Embraces complete query with (MySQL) versioned comment |
modsecurityzeroversioned | Embraces complete query with (MySQL) zero-versioned comment |
percentage | Adds a percentage sign (%) in front of each character (e.g. SELECT -> %S%E%L%E%C%T) |
plus2concat | Replaces plus operator (+) with (MSSQL) function CONCAT() counterpart |
randomcase | Replaces each keyword character with random case value (e.g. SELECT -> SEleCt) |
space2comment | Replaces space character ( ) with comments /**/ |
space2dash | Replaces space character ( ) with a dash comment (--) followed by a random string and a new line (\n) |
space2hash | Replaces (MySQL) instances of space character ( ) with a pound character (#) followed by a random string and a new line (\n) |
space2mssqlblank | Replaces (MSSQL) instances of space character ( ) with a random blank character from a valid set of alternate characters |
space2plus | Replaces space character ( ) with plus (+) |
space2randomblank | Replaces space character ( ) with a random blank character from a valid set of alternate characters |
symboliclogical | Replaces AND and OR logical operators with their symbolic counterparts (&& and ') |
versionedkeywords | Encloses each non-function keyword with (MySQL) versioned comment |
versionedmorekeywords | Encloses each keyword with (MySQL) versioned comment |
Database Enumeration
| Option | Purpose |
|---|---|
--banner --current-user --current-db --is-dba | DB version, user, DB name, is DBA. |
--users --passwords | Enumerate DB users and hashes (needs high priv). |
--dbs | List all databases. |
-D <DB> --tables | List tables in database. |
-D <DB> -T <TABLE> --columns | List columns in table. |
-D <DB> -T <TABLE> --dump | Dump entire table. |
-C col1,col2 --dump | Dump only specified columns. |
--start=N --stop=M --dump | Dump rows N through M. |
--where="cond" --dump | Dump only rows matching condition. |
--dump-all --exclude-sysdbs | Dump all DBs except system (e.g. information_schema, mysql). |
--is-dba true → | Pivot to --os-shell / --file-read (RCE). |
| Dump path | ~/.local/share/sqlmap/output/; use --dump-format=sqlite for large DBs. |
| DBMS root ≠ Linux root | DB root can write anywhere only if DBMS runs as Linux root. |
OS Exploitation Options
| Option | Description |
|---|---|
--file-write="local" | Specifies the local file you want to upload to the target. |
--file-dest="remote" | Specifies the absolute path on the target server where the file should be written. |
--os-cmd="cmd" | Executes a single operating system command and retrieves the output. |
tmux
Install and Setup
Install Tmux Plugin Manager (TPM):
Tmux Core Hotkeys
Default Prefix: CTRL+B
| Action | Hotkey | Description |
|---|---|---|
| Create New Tab (Window) | Prefix + C | Creates a new tmux window (full-screen tab). |
| Next Tab | Prefix + N | Switches to the next tmux window. |
| Previous Tab | Prefix + P | Switches to the previous tmux window. |
| Switch by Number | Prefix + 0-9 | Jumps directly to a window by index. |
| Rename Current Tab | Prefix + , | Renames the current window for easier tracking. |
Tmux Logging Hotkeys
Note: Logging is enabled by default in this config via pipe-pane, with one timestamped file per pane in ~/.tmux/logs/ (format: YYYYmmdd-HHMMSS-session-window-pane.log). The plugin hotkeys below are still useful for manual/retroactive captures. See docs for changing plugin logging options.
| Action | Hotkey | Description |
|---|---|---|
| Toggle Logging | Prefix + Shift + P | Starts/stops logging the current pane to a file. |
| Retroactive Log | Prefix + Alt + Shift + P | Saves the entire pane history (up to history-limit) if you forgot to start logging initially. |
| Pane Capture | Prefix + Alt + P | Saves only the currently visible screen. Solves copy/paste formatting messes when panes are split. |
Web proxy tools (OWASP ZAP & Burp Suite)
WIP: currently this is AI slop distilled from handouts
Quick reference: hotkeys
Same action, side by side for both tools.
| Action | OWASP ZAP | Burp Suite |
|---|---|---|
| Toggle request intercept | Ctrl+B | — |
| Forward intercepted request | — | — |
| Intercept response | — | — |
| Open Replacer / Match and Replace | Ctrl+R | — |
| Send to Repeater | — | Ctrl+R (send); Ctrl+Shift+R (go to tab) |
| Send to Intruder | — | Ctrl+I (send); Ctrl+Shift+I (go to tab) |
| URL-encode selection | — (auto on send) | Ctrl+U |
| Open Decoder / Encoder | Ctrl+E | — |
Tool-agnostic overview
Setting up
Concept (tool-agnostic):
Both tools run on Windows, macOS, and Linux. They are pre-installed on common PT distros (e.g. Parrot, Kali) and on PwnBox (dock or top bar). Both require a Java Runtime Environment (JRE); installers usually bundle it. For custom VMs you can use installers or the cross-platform JAR and run with java -jar <path/to/tool.jar>. Choose a temporary project/session for short engagements; use a saved project/session when you need to persist progress (e.g. large apps or long-running scans).
Burp Suite
- Download: Burp Download Page — installers for Windows, Linux, macOS, or JAR for any OS with JRE.
- Launch: From terminal run
burpsuite, or from the application menu. JAR:java -jar </path/to/burpsuite.jar>(or double-click). - First run: Create a project → choose Temporary project (Community Edition only supports temporary; Pro/Enterprise can save to disk or open existing). Then choose Use Burp Defaults (or load a config file if you have one) → Start Burp.
- Dark theme: Burp → Settings → User interface → Display → set Theme to Dark.
OWASP ZAP
- Download: ZAP Download Page — installers per OS or cross-platform JAR.
- Launch: From terminal run
zaproxy, or from the application menu. JAR:java -jar <path/to/zap.jar>(or double-click). - First run: When asked about persisting the session, choose not to persist for a temporary session (or pick timestamp/name if you need to save). Then continue to proxy setup.
- Dark theme: Tools → Options → Display → set Look and Feel to Flat Dark.
Proxy setup
Concept (tool-agnostic):
Use the tool as a web proxy so all browser (or app) traffic goes through it. You can inspect requests/responses, intercept and modify them, and replay them with changes to see how the app behaves. Either use the tool’s pre-configured browser (proxy + CA cert already set) or configure your own browser (e.g. Firefox) to use the proxy and install the tool’s CA certificate so HTTPS works without repeated “accept” prompts.
Pre-configured browser
Fastest option: proxy and CA are already set; traffic is routed automatically.
Burp Suite
Proxy → Intercept → click Open browser. Burp’s embedded browser opens with traffic routed through Burp.
OWASP ZAP
Click the Firefox icon at the end of the top bar. Opens the browser chosen in the Quick Start tab, pre-configured to proxy through ZAP.
Manual proxy (e.g. Firefox)
Both tools listen on port 8080 by default. Use the same port in the browser. If the port is in use, the proxy will not start (you’ll see an error).
- Change listening port:
- Burp: Proxy → Proxy settings → Proxy listeners
- ZAP: Tools → Options → Network → Local Servers/Proxies
- Firefox: Set proxy in Preferences to
127.0.0.1and the chosen port, or use FoxyProxy (e.g. on PwnBox it’s pre-installed): FoxyProxy icon → Options → Add → IP127.0.0.1, port8080, name e.g. Burp or ZAP → Save. Then use the FoxyProxy icon to switch to Burp/ZAP. (FoxyProxy can be installed from the Firefox add-ons page.)
Installing the CA certificate
Required for HTTPS to work cleanly through the proxy (otherwise traffic may fail or you’ll have to accept warnings repeatedly).
Burp Suite
With Burp set as the proxy in the browser, go to http://burp and click CA Certificate to download it.
OWASP ZAP
Tools → Options → Network → Server Certificates → Save to export the CA cert (or Generate to create a new one), then use the saved file.
Firefox (install cert):
Open about:preferences#privacy → scroll down → View Certificates → Authorities tab → Import → select the downloaded CA file → check Trust this CA to identify websites and Trust this CA to identify email users → OK.
After proxy + CA are set, all Firefox traffic will go through the web proxy.
Intercepting and manipulating web requests
Concept (tool-agnostic):
With the proxy running, you can intercept HTTP requests so they pause in the tool instead of going straight to the server. You can inspect and edit the request (headers, parameters, body), then forward it. The server sees your modified request; the response helps you test for issues the UI might block (e.g. front-end validation). Use this for testing SQL injection, command injection, upload bypass, authentication bypass, XSS, XXE, error handling, deserialization, and similar web vulnerabilities.
Example: A form may only allow digits in an “IP” field via JavaScript. By intercepting the POST, you can change e.g. ip=1 to ip=;ls; and forward to test for command injection if the backend doesn’t validate.
Intercepting requests
Burp Suite
Proxy → Intercept. Intercept is on by default (button shows “Intercept is on”). Click the button to toggle on/off. With intercept on, open the pre-configured browser and load the target; the request appears in Burp. Use Forward to send it. If multiple requests are queued (e.g. other Firefox traffic), keep clicking Forward until you reach the target request.
OWASP ZAP
Intercept is off by default (toolbar button is green = traffic passes). Click the button to toggle, or use Ctrl+B. With intercept on, load the target in the pre-configured browser; the request appears in the top-right pane. Click Step (next to the red break button) to forward one request.
HUD (Heads Up Display): Click the HUD button at the end of the top menu bar to enable in-browser controls. In the HUD’s left pane, the second button from the top turns request interception on. When a request is intercepted, use Step (one request, then break again) or Continue (forward this and let the rest through). Step is for inspecting each request; Continue when you only care about one. Note: Some browser versions may not support the HUD well. First-time ZAP browser use may show a HUD tutorial (or configuration → Take the HUD tutorial).
Manipulating then forwarding
Edit the intercepted request in the request pane (method, URL, headers, body). Change parameters, add payloads, etc. Then Forward (Burp) or Step / Continue (ZAP) to send it. Check the response in the browser or in the tool to see how the app handled your input.
Intercepting responses
Concept (tool-agnostic):
You can intercept HTTP responses before they reach the browser and edit the HTML/headers. Use this to change how the page looks or behaves: enable disabled fields, show hidden fields, change type="number" to type="text", increase maxlength, etc. That can let you test from the browser without having to send every payload via an intercepted request. For simple cases (just enable disabled or unhide hidden form fields), both tools can do it automatically so you don’t have to intercept and edit by hand.
Enabling response interception
Burp Suite
Proxy → Proxy settings → under Response interception rules enable Intercept Response (and Update Content-Length if needed). With request intercept on, do a full refresh in the browser (e.g. Ctrl+Shift+R); forward the request in Burp, then the response is intercepted. Edit the response (e.g. change type="number" to type="text", maxlength="3" to maxlength="100"), then Forward. The browser receives your modified response.
Automatic unhide: Proxy → Proxy settings → Response modification rules → enable e.g. Unhide hidden form fields so hidden/disabled fields are shown without manually intercepting.
OWASP ZAP
With request intercept on, click Step to send the request; ZAP then intercepts the response. Edit the response in the pane, then Continue to send it to the browser.
HUD — enable/show without intercepting: In the HUD left pane, the third button (light bulb) is Show/Enable: it enables disabled inputs and shows hidden fields in the current page without intercepting the response or refreshing. Use it when you only need to unlock fields, not edit HTML by hand.
HUD — HTML comments: In the HUD left pane click + → Comments to add the Comments control. It shows indicators where HTML comments are; hover to see the comment content (useful for dev notes or hidden hints).
Tip: Use a full page refresh (Ctrl+Shift+R in the browser) when testing so you get a clean request/response cycle.
Automatic modification
Concept (tool-agnostic):
Define match/replace rules so the proxy automatically changes all outgoing requests or all incoming responses without intercepting each one. Use for: replacing headers (e.g. User-Agent to bypass filters), changing response HTML on every load (e.g. type="number" → type="text", maxlength="3" → maxlength="100"), or injecting payloads in request bodies. Rules can use plain text or regex; you choose request header/body or response header/body.
Automatic request modification
Example: Replace the User-Agent header with a custom value (e.g. to bypass User-Agent filters).
Burp Suite
Proxy → Proxy settings → Match and Replace (or HTTP match and replace rules) → Add.
- Type: Request header
- Match:
^User-Agent.*$(regex for the whole User-Agent line) - Replace:
User-Agent: HackTheBox Agent 1.0 - Regex match: True
Rule is applied to all requests. Verify by intercepting a request and checking the header.
OWASP ZAP
Open Replacer: Ctrl+R or Tools → Options → Replacer (or Replacer in the options menu). Add a rule:
- Description: e.g. HTB User-Agent
- Match Type: Request Header (will add if not present) — or Request Header String for regex
- Match String:
User-Agent(or pick from dropdown; use regex in the string if Match Type is Request Header String) - Replacement String:
HackTheBox Agent 1.0 - Enable: True
Initiators tab: choose where the rule applies (default: all HTTP(S) messages). Verify with Ctrl+B (intercept on), then visit a page and check the request.
Automatic response modification
Example: Always change type="number" to type="text" and maxlength="3" to maxlength="100" in responses so the change persists across refreshes without manually intercepting.
Burp Suite
Proxy → Proxy settings → Match and Replace → Add.
- Type: Response body
- Match:
type="number" - Replace:
type="text" - Regex match: False
Add a second rule: Match maxlength="3", Replace maxlength="100", Regex false. Full refresh (Ctrl+Shift+R) in the browser to see the updated page; the field now accepts any input on every load.
OWASP ZAP
Replacer (Ctrl+R) → Add two rules:
- Match Type: Response Body String. Match Regex: False. Match String:
type="number". Replacement String:type="text". Enable: True. - Match Type: Response Body String. Match Regex: False. Match String:
maxlength="3". Replacement String:maxlength="100". Enable: True.
Refresh the page to verify. You can also add request-body rules (e.g. replace a parameter value with a payload like ;ls; when submitting a specific form) by matching the request body and setting the replacement; use Initiators in ZAP to limit which messages get the rule if needed.
Repeating requests
Concept (tool-agnostic):
Request repeating lets you resend any request that has already gone through the proxy. You edit it (e.g. change a parameter or payload), send it from the tool, and see the response there—no need to intercept again. Use this for repetitive testing (e.g. trying many commands or payloads). Both tools keep a history of requests; you pick one, send it to a repeater / request editor, modify, and Send.
Proxy / HTTP history
Burp Suite
Proxy → HTTP History. Lists all requests that passed through the proxy; use filters and sorting to find the one you want. Click a request to see full request and response. If the request was edited during intercept, the pane header shows Original Request; switch to Edited Request to see what was actually sent.
Note: Proxy → WebSockets history for WebSocket traffic (advanced use).
OWASP ZAP
History tab at the bottom (main UI), or in the HUD the bottom History pane. Filters and sorting available. Click a request to view details. ZAP shows the final/modified request only (no separate original vs edited view like Burp).
Note: WebSockets history is available for async/WebSocket connections.
Repeating (Repeater / Request Editor)
Burp Suite
With the request selected in HTTP History (or elsewhere), Ctrl+R sends it to the Repeater tab. Ctrl+Shift+R switches to the Repeater tab. In Repeater: edit the request (headers, body, etc.), click Send; the response appears in the response pane. Right-click the request → Change Request Method to switch between POST/GET without rewriting the whole request.
OWASP ZAP
Right-click the request in History → Open/Resend with Request Editor. The Request Editor window opens; edit the request, then click Send to get the response in the same window. Use the Method dropdown to change HTTP method. Use the display/layout buttons to arrange request and response (tabs vs side-by-side, etc.).
HUD: In the pre-configured browser, click the request in the bottom History pane → Request Editor appears. Replay in Console shows the response in the HUD; Replay in Browser renders it in the browser. In all cases (Burp Repeater, ZAP Request Editor, ZAP HUD) you can edit then Send to resend with changes.
Tip: Request bodies are often URL-encoded; keep encoding in mind when editing (e.g. %3B for ;). The next section covers this in more detail.
Encoding / decoding
Concept (tool-agnostic):
When you modify and send custom HTTP requests, encoding and decoding matter. URL encoding ensures the server parses data correctly: characters like spaces (can end request data), & (parameter delimiter), and # (fragment) must be encoded. Applications also use other encodings (HTML, Unicode, Base64, ASCII hex); you need to decode to inspect data (e.g. cookies, tokens) and encode payloads in the format the server expects. Both tools have built-in encoders/decoders so you can work quickly without leaving the proxy.
URL encoding
Burp Suite (Repeater): Select the text → right-click → Convert Selection → URL → URL-encode key characters, or Ctrl+U. You can enable URL-encode as you type via right-click so input is encoded automatically. Other options: Full URL-encoding, Unicode URL encoding (for many special characters).
OWASP ZAP: Request data is automatically URL-encoded before send (you may not see it in the editor). For manual control or other encodings, use the Encoder/Decoder/Hash tool (see below).
Decoder / Encoder tool
Burp Suite
Decoder tab: enter text, choose Decode as or Encode as (e.g. Base64, HTML, Unicode, ASCII hex). The output pane can be passed through another encoder/decoder—select the method in the output area to chain. Burp Inspector (in Proxy, Repeater, etc.) also does encoding/decoding inline on requests and responses.
OWASP ZAP
Encoder/Decoder/Hash: Ctrl+E. Decode tab: paste input; ZAP can try multiple decoders. Encode (or same tool): choose encoding, get output. Use Add New Tab to build custom tabs with multiple encoders/decoders. To chain (e.g. decode then encode with another method), copy the output and paste into the input field.
Example: Base64 cookie eyJ1c2VybmFtZSI6Imd1ZXN0IiwgImlzX2FkbWluIjpmYWxzZX0= decodes to {"username":"guest", "is_admin":false}. Edit to admin / true, re-encode as Base64, then paste the new string into the request in Repeater or Request Editor to test privilege changes. Same idea applies to any encoding (HTML, Unicode, etc.) for inspection and payload crafting.
Proxying other tools
Concept (tool-agnostic):
You can route command-line tools and thick clients through the web proxy so their HTTP(S) traffic is visible and editable. Configure each tool to use the proxy (e.g. http://127.0.0.1:8080); methods vary by tool. Then you get full proxy features: intercept, history, repeat, modify. Use this when you need to see or change what a script or app is sending. Note: Proxying usually slows tools down—only enable it when you need to inspect or manipulate their requests.
Proxychains (Linux)
Proxychains sends traffic from any CLI tool through a proxy. Easiest way to proxy arbitrary commands.
- Edit
/etc/proxychains.conf: comment out the default proxy line (e.g.#socks4 127.0.0.1 9050) and add: - Run the command via proxychains. Use
-qfor quiet mode (less console noise):The request appears in the web proxy (Burp or ZAP) like browser traffic. Works with any HTTP(S)-using CLI tool.
Metasploit
In msfconsole, set the proxy for modules with set PROXIES:
Requests from the module go through the proxy; check Proxy → HTTP History (Burp) or History (ZAP) to inspect them. Same approach for other scanners, exploits, and modules that make HTTP requests.
Other tools and thick clients
For other tools, scripts, or GUI apps: find how to set an HTTP proxy (often an option, env var, or config file) and point it at your proxy (e.g. 127.0.0.1:8080). Then you can examine, repeat, and modify their requests from the proxy as with browser traffic.
Web fuzzers
Concept (tool-agnostic):
Built-in web fuzzers handle fuzzing, enumeration, and brute-forcing (directories, subdomains, parameters, parameter values, etc.) and can replace or complement CLI tools (e.g. ffuf, gobuster, wfuzz, dirbuster). You send a request to the fuzzer, mark one or more payload positions, choose a wordlist and options, then run the attack and inspect results (status, length, grep matches). Use for directory discovery, login brute-force, parameter fuzzing, password spraying (e.g. AD, OWA, VPN portals), and similar tasks.
Burp Intruder
Burp’s fuzzer is Intruder. Community edition is throttled (about 1 request/second); use for short wordlists. Pro has no throttle and more features. Intruder docs; payload types.
Send request to Intruder: From Proxy history (or elsewhere), right-click the request → Send to Intruder, or Ctrl+I. Switch to Intruder tab: Ctrl+Shift+I. The Target box shows host/port from the request.
Positions: Define where the wordlist is inserted. Wrap the placeholder with § (e.g. §DIRECTORY§) or select text and click Add §. Example for directory fuzzing: GET /§DIRECTORY§/ — existing paths return 200, others 404. Leave the two blank lines at the end of the request. Attack type (e.g. Sniper = one position, Cluster bomb = multiple positions) affects how many payload sets you get.
Payloads tab:
- Payload set & type: Choose which position (1, 2, …). Payload type: e.g. Simple list (wordlist, one line per payload), Runtime file (load wordlist line-by-line, better for huge lists), Character substitution, or others. For directory fuzzing, Simple list is typical.
- Payload configuration: For Simple list: Load a file (e.g.
/usr/share/seclists/Discovery/Web-Content/common.txt) or Add items. You can combine multiple lists. Pro: Add from list for built-in wordlists. Tip: Very large wordlists → use Runtime file to avoid loading everything into memory. - Payload processing: Add rules (e.g. add suffix, Skip if matches regex). Example: skip lines starting with
.using regex^\..*$. - Payload encoding: Usually leave URL-encode enabled so special characters are encoded.
Payload options (Intruder): Payload types reference.
Settings tab: Configure Grep - Match to flag responses containing a string (e.g. 200 OK). Clear existing rules, Add 200 OK, and disable Exclude HTTP headers if you want to match the status line. Grep - Extract can pull specific parts of responses. Set Number of retries / Pause before retry if needed. Resource pool (right-hand bar) controls how much network Intruder uses for large attacks.
Attack: Click Start attack. Results table: sort by the grep column (e.g. 200 OK), Status, or Length to find hits (e.g. /admin/ with 200). Use Intruder for directory fuzzing, parameter/value fuzzing, brute-force, and password spraying against AD-authenticated apps (OWA, VPN, RDS, Citrix, etc.). ZAP’s fuzzer (below) has no speed throttle.
ZAP Fuzzer
ZAP Fuzzer is ZAP’s built-in fuzzer. It has fewer features than Burp Intruder but does not throttle request speed, so it is often better than free Burp Intruder for large wordlists. Use it for directory fuzzing, parameter fuzzing, and similar attacks.
Start a fuzz: Capture a request (e.g. visit http://SERVER_IP:PORT/test/ so the path contains the placeholder). In History, right-click the request → Attack → Fuzz. The Fuzzer window opens with the request on the left and Fuzz Locations on the right.
Locations: Like Intruder payload positions. Select the word you want to replace (e.g. test in the path) and click Add. A green marker is placed and the Payloads configuration opens. You can add multiple locations.
Payloads: Click Add and choose a payload type. Examples:
- File — load a wordlist from a file.
- File Fuzzers — use built-in wordlists (e.g. dirbuster → directory-list-1.0.txt). More lists available via ZAP Marketplace.
- Numberzz — generate number sequences with custom step.
Processors: Optional processing for each payload. Add a processor; types include Base64 Decode/Encode, MD5, Prefix String, Postfix String, SHA-1/256/512, URL Decode/Encode, Script (custom). For directory fuzzing, add URL Encode so special characters don’t break the request. Use Generate Preview to see the final payload in context, then Add and Ok.
Options: Set Concurrent Scanning Threads per Scan (e.g. 20) for speed; balance with CPU and server load. Depth first — try all payloads at one position before moving to the next (e.g. all words for one user). Breadth first — try the first word on all positions, then the next word (e.g. one password for all users). Configure retries, max errors, redirects as needed.
Start: Click Start Fuzzer. In the results table, sort by Response code (e.g. 200) to find hits. Click a row to view request/response. Size Resp. Body can indicate different pages; RTT (round-trip time) matters for time-based attacks (e.g. time-based SQLi).
Web scanners
Concept (tool-agnostic):
Web proxy tools often include scanners that combine a crawler (follow links and forms to map the site), passive scanning (analyze already-seen traffic for issues without sending new requests), and active scanning (send probes to confirm and find vulnerabilities). Define scope (in/out of scope) so the scanner only targets allowed URLs. Use scan results and reports as supporting evidence; never substitute a raw tool report for a proper client deliverable.
Burp Scanner (Pro only)
Burp Scanner is a Pro-only feature (not in Community edition). It uses a Crawler to build the site structure and Scanner for passive and active vulnerability checks.
Target scope
- Start a scan: (1) From Proxy → HTTP History: right-click a request → Scan (configure) or Passive scan / Active scan (defaults). (2) Dashboard → New Scan for custom target set. (3) Use scope so only in-scope items are scanned.
- Scope: Target → Site map lists everything Burp has seen. Right-click an item → Add to scope (or Remove from scope). Target → Scope shows include/exclude rules; use Use advanced scope control for regex. You can restrict Burp to in-scope only to save resources. When you add the first scope item, Burp may ask whether to limit features to in-scope only.
Crawler
- Dashboard → New Scan. Two modes: Crawl (map only) or Crawl and Audit (crawl then scan). Crawler follows links and forms; it does not discover unreferenced paths (use Intruder or Content Discovery, then add to scope).
- Scan configuration: New for custom (speed, limits, login behaviour) or Select from library (e.g. Crawl strategy - fastest). Application login: add credentials and/or record a manual login in the built-in browser so the crawler can stay authenticated. Ok to start. Progress under Dashboard → Tasks; View details or the gear icon to adjust. When finished, Target → Site map shows the updated map.
Passive scanner
- Analyzes existing requests/responses only (no new requests). Flags possible issues (e.g. missing security headers, DOM XSS). Each finding has a confidence (e.g. Certain, Firm). Right-click target in Site map or a request in Proxy history → Do passive scan / Passively scan this target. Task appears in Dashboard. View details → Issue activity (or the Issue activity pane on Dashboard) to see findings. Prioritise High severity and Certain/Firm confidence; for sensitive apps, review all severities.
Active scanner
- Crawl and Audit in New Scan runs: (1) Crawl + discovery (like a fuzzer) for pages, (2) Passive scan on discovered content, (3) Active checks to verify passive findings, (4) JavaScript analysis, (5) Fuzzing of parameters for XSS, command injection, SQLi, etc. Frequently updated by PortSwigger.
- Start: right-click request → Do active scan, or New Scan → Crawl and Audit. Set Crawl config (as above) and Audit config: what to check, insertion points; Select from library e.g. Audit checks - critical issues only. Add login if needed. Ok to run. Progress in Dashboard → Tasks; Logger tab shows requests made by the scanner. When done, filter Issue activity by severity (e.g. High) and confidence (e.g. Certain/Firm). Click an issue for the advisory, request/response, and remediation notes.
Reporting
- Target → Site map → right-click the host → Issue → Report issues for this host. Choose export format and what to include. The report summarizes by severity/confidence and can include PoC and remediation. Use as appendix or supplementary data, not as the final client report; always produce a proper written deliverable and use tool output as support.
ZAP Scanner
ZAP includes Spider, passive scanning, and active scanning; all run in the free version. Scope defines which URLs are included in scans and can be customized for multiple sites.
Spider
- Start: In History, right-click a request → Attack → Spider. Or in the HUD (pre-configured browser): open the target page, then click the second button on the right pane (Spider Start) and confirm. If the site is not in scope, ZAP may ask to add it (choose Yes). Scope is the set of URLs ZAP will crawl/scan; you can add multiple targets. Note: Some browser versions may not support the HUD fully.
- Spider follows links and validates them (similar to Burp Crawler). Progress: HUD Spider button or main ZAP UI (often switches to the Spider tab). When finished: Sites tab in the main UI, or HUD first button on the right pane (Sites Tree) for an expandable tree of discovered URLs and directories.
- Ajax Spider: Third button on the right pane. Discovers links loaded via JavaScript/AJAX. Run after the normal Spider for better coverage; it can find more URLs but takes longer.
Passive scanner
- Runs automatically on every response (e.g. while Spider runs or as you browse). Identifies potential issues from source (e.g. missing security headers, DOM-based XSS). Alerts can appear before you run an Active Scan. In the HUD: left pane = alerts for the current page, right pane = all alerts for the application. In the main UI: Alerts tab lists all findings; click an alert for details and the URLs where it was seen.
Active scanner
- Click Active Scan on the right pane (or equivalent in main UI). Scans all URLs in the site tree. If you have not run the Spider yet, ZAP runs it first to build the tree. Progress is shown in the HUD and in the main ZAP UI; alerts increase as the scan runs. The Active Scanner sends many probes against pages and parameters (XSS, command injection, SQLi, etc.) and takes longer. When done: filter by severity (e.g. High for issues that may lead to compromise). Click an alert for description, attack example, and evidence; click the URL to see the request/response and use Replay in Console or Replay in Browser to reproduce.
Reporting
- Report → Generate HTML Report (top bar). Choose save location; reports can also be exported as XML or Markdown. Open in a browser to review. Use as a log or supplement for engagements, not as the sole client deliverable.
Extensions / add-ons
Concept (tool-agnostic):
Both tools support extensions (Burp) or add-ons (ZAP) from the community. They can act on captured requests, add features (e.g. decoding, beautifying, new scan checks), or provide extra wordlists and payloads. Install only what you need; some extensions have dependencies (e.g. Jython) that must be installed on your system first.
Burp: BApp Store
- Extender tab → BApp Store sub-tab. Browse extensions; sort by Popularity. Some are Pro-only; most are available to all users.
- Click an extension to install it. After install, a new tab or menu item may appear. Use the extension’s documentation in the BApp Store or its GitHub page for usage. Some extensions require Jython (or other runtimes) to be installed on your machine (Linux/macOS/Windows) before they can run.
- Example: Decoder Improved — adds a tab with more encoders/decoders and hashing (e.g. Hash With → MD5). Use like the built-in Decoder with extra options.
- Examples of useful extensions: .NET Beautifier, J2EEScan, Software Version Reporter, Active Scan++, AWS Security Checks, Backslash Powered Scanner, Wsdler, Java Deserialization Scanner, C02 (cloud storage tester), CMS Scanner, Error Message Checks, Detect Dynamic JS, Headers Analyzer, HTML5 Auditor, PHP Object Injection Check, JavaScript Security, Retire.JS, CSP Auditor, Random IP Address Header, Autorize, CSRF Scanner, JS Link Finder. Browse the store for more.
ZAP: Marketplace
- Click Manage Add-ons (toolbar) → Marketplace tab. Add-ons can be Release (stable) or Beta/Alpha (may be unstable).
- Install add-ons to add features or data. Example: FuzzDB Files and FuzzDB Offensive add wordlists for the ZAP Fuzzer. In the Fuzzer, choose payload type File Fuzzers → e.g. fuzzdb → attack → os-cmd-execution (e.g.
command_execution-unix.txt) for command-injection payloads. Run the fuzzer to test with many payloads (e.g.;id,/usr/bin/id); useful when testing WAF-protected or strict applications. Try other Marketplace add-ons for scanners, scripts, and extra payloads.