Exploitation, Post-Exploitation, and Red Team Operations Questions
The hands-on offensive tradecraft of compromising, pivoting through, and persisting in systems while evading defenses. Covers exploit development, privilege escalation, Active Directory and Windows exploitation, lateral movement, persistence, command-and-control, and attack chaining, extending into adversary-emulation campaigns: red-team engagement planning and objectives, multi-stage attack planning, operational security for offensive operators, and detection and defense evasion including web application firewall detection and bypass. The advanced offensive-operations layer executed against real targets, where staying undetected is itself an objective, distinct from the methodical scoped-assessment workflow of a penetration test.
What are the common ways an attacker establishes persistence on a compromised Linux host during host triage, and what artifacts would each leave behind for a defender to find?
Sample Answer
Direct answer
On a compromised Linux host, the common persistence mechanisms are scheduled execution (cron jobs or systemd timers), a malicious systemd service, shell startup file modification, SSH key injection, legacy boot scripts, and, at the most severe end, a backdoored kernel module. Each leaves a distinguishable artifact, though the highest-severity option is specifically designed to hide its own artifacts.
Structured elaboration
- Cron jobs and systemd timers. An entry added to the system crontab, a user's crontab, or a systemd timer unit that relaunches the implant. Artifact: the crontab entry itself, or a timer/service unit file, plus execution history in system logs.
- Systemd services. A malicious unit file installed to start at boot. Artifact: the unit file on disk, and its start events in the system journal.
- Shell startup file modification (a user's shell configuration file, or a system-wide profile script). Appending a command that runs whenever a shell starts. Artifact: an unexpected addition to an otherwise-static file, often visible as an unusual modification timestamp relative to the file's normal change history.
- SSH authorized-keys injection. Adding an attacker-controlled public key to a user's list of keys allowed to log in without a password. Artifact: an unexpected key entry, identifiable by comparing its comment or fingerprint against known legitimate operator keys, plus authentication log entries showing key-based logins from unfamiliar source addresses.
- Legacy boot scripts. Older init-time script hooks that some systems still execute at startup. Artifact: modified script content and its execution timestamp.
- Backdoored kernel modules or rootkits. The most severe option, since a loaded kernel module can provide both persistence and active concealment of files, processes, or network connections from the host's own normal tools. Artifact: an unexpected entry in the list of loaded kernel modules, kernel log anomalies, or a mismatch against known-good module hashes during an integrity check. The core difficulty is that a well-built rootkit actively hides these very artifacts from the live system's own tools, which is why detecting one often depends on offline or out-of-band forensic analysis rather than trusting anything the compromised host reports about itself.
Worked example
A defender reviewing a suspected-compromised host checks the obvious places, cron and systemd services, and finds nothing unusual. A closer review of a specific administrative user's authorized-keys file turns up an extra public key with no matching comment or known owner, and the authentication log shows successful key-based logins from an unfamiliar external address on a regular, unattended schedule, exactly the pattern an SSH-key backdoor produces and one that is easy to miss if the investigation stops at the more commonly-checked locations.
Trade-offs and pitfalls
SSH key persistence is quiet, simple, and frequently under-checked, which is exactly why it's a favorite for real operators. Kernel module persistence is more powerful but riskier for the attacker too, since it introduces real stability risk and, if caught, is unambiguous, undeniable evidence of compromise, which makes it overkill for a standard assessment where the goal is to demonstrate risk, not to plant the most sophisticated possible backdoor. A common investigative mistake is checking only cron and missing systemd timers, which have largely replaced cron as the default scheduling mechanism on modern distributions.
Explain the 'pass-the-hash' technique at a conceptual level: what credential material is used, why it works on Windows authentication stacks, and list three enterprise mitigations that significantly reduce the risk of successful pass-the-hash attacks.
Sample Answer
Direct answer
Pass-the-hash abuses the fact that Windows' NTLM (NT LAN Manager) authentication protocol only requires proving knowledge of a fixed-size cryptographic hash of the password, never the plaintext password itself. An attacker who obtains just the hash, for example from a compromised machine's memory or from a stolen local credential database, can present that hash directly to authenticate to another machine, without ever cracking it back into a plaintext password.
Structured elaboration
Why it works. NTLM's challenge-response exchange is entirely a mathematical function of the hash. There is no step in the protocol that re-derives or checks the underlying plaintext, so from the protocol's own point of view, the hash IS the credential. Windows also caches these hashes in memory for convenience, so a single sign-on experience across a network is possible, which is exactly what makes them recoverable and reusable by an attacker who gets code execution on the box.
Three enterprise mitigations:
- Restrict or disable NTLM authentication in favor of Kerberos wherever the environment allows it, using domain policy to audit and eventually block NTLM on servers that don't genuinely need it.
- Deploy unique, randomized local administrator passwords per machine rather than sharing one local admin password fleet-wide, so a stolen local-admin hash on one host cannot simply be replayed against every other host.
- Enable memory-isolation protections for cached credentials (a virtualization-based security feature that keeps authentication secrets out of reach of even an administrator on the same box), and restrict high-privilege logons to a small number of hardened, dedicated administrative workstations so that a compromised low-tier machine never has a high-value credential cached on it in the first place.
Worked example
An organization sets the same local administrator password across its entire workstation fleet for ease of management. An attacker compromises a single low-value workstation, dumps its local credential store, and recovers the shared local administrator hash. Because that exact hash is valid for every other workstation in the fleet, the attacker authenticates to dozens of machines using pass-the-hash without ever needing the plaintext password or touching a domain controller.
Trade-offs and pitfalls
The single most common interview mix-up is treating pass-the-hash as a form of password cracking; it is the opposite, the whole point is that the attacker never needs to recover the plaintext at all. A second common gap is naming a mitigation like disabling NTLM without acknowledging that some legacy applications and devices still require it, meaning the real-world fix is usually a staged reduction and monitoring plan rather than an instant flip of a single setting.
Explain 'living off the land' (LOTL) techniques in post-exploitation. Provide examples of common Windows and Linux binaries abused for malicious purpose (e.g., PowerShell, certutil, bitsadmin, wmic, sc, net, curl, tar) and explain why defenders find LOTL abuse difficult to detect. Suggest practical detection strategies to reduce false positives.
Sample Answer
"Living off the land" (LOTL) means carrying out post-exploitation tasks using software already trusted and present on the target, rather than dropping custom malware. The attacker's activity then looks like ordinary administrative work instead of a new, hash-flaggable binary.
Commonly abused binaries and their legitimate purpose
| Binary | Legitimate purpose | How it gets abused |
|---|---|---|
| PowerShell | Native Windows scripting and administration | Downloads, decodes, and executes code entirely in memory, no file ever touches disk |
| certutil | Managing certificates | Its -urlcache functionality can fetch a remote file and decode it, repurposed as a file-download primitive |
| bitsadmin | Background Intelligent Transfer Service, a resilient file-transfer utility | Used the same way: reliably pulls a payload down even across a flaky connection |
| wmic | Windows Management Instrumentation command-line, used for system administration and inventory | Can launch a process on a remote host, giving an attacker remote code execution using a fully signed Microsoft tool |
| sc | Service control manager tool | Creates a new Windows service, a classic persistence mechanism, using a completely legitimate administrative command |
| net | Local/domain account and group management | Used for account and group enumeration, or to create a new account for later access |
| curl / tar | Present by default on modern Windows and Linux | Download and unpack a payload without needing any attacker-supplied download tool at all |
Why this is hard to detect
Every one of these binaries is signed by a trusted vendor and often explicitly allow-listed by application-control tools like AppLocker, precisely because they're needed for legitimate work. There is no unique file hash or custom code to flag, and the activity has to be picked out of a high volume of genuinely normal administrative noise.
Practical detection strategies that keep false positives down
Detection has to move from "is this tool present" (useless, it's always present) to "is this invocation, in this context, normal." Concretely: log full command-line arguments, not just process names, since the flag combination is often the tell (certutil -urlcache -split -f is a red flag; plain certutil certificate management is not); correlate parent-child process relationships, since certutil spawned by Microsoft Word is anomalous regardless of its arguments, while certutil spawned by a certificate-management script is expected; and baseline per-host-role usage so that a rarely-used tool suddenly appearing on a host where it has no legitimate reason to run raises the alert, rather than alerting on every occurrence system-wide.
Trade-offs and pitfalls
Blanket blocking of these binaries breaks real administrative workflows, since they're genuinely needed. Command-line logging can itself be tampered with once an attacker has sufficient privilege, so it should be paired with tamper-resistant forwarding (shipping logs off-host immediately). The common wrong turn is alerting on tool presence alone, which either floods the security team with noise or gets tuned into silence; the signal that actually holds up is the combination of tool, arguments, parent process, and host-role baseline together.
Explain what a Kerberos Golden Ticket is, the prerequisites to create one (including access to the KRBTGT account hash), how an attacker uses a Golden Ticket to gain persistent domain access, typical detection artifacts that indicate Golden Ticket use, and safe testing limitations when validating Golden Ticket techniques in a customer environment.
Sample Answer
Direct answer
A Golden Ticket is a forged Ticket Granting Ticket (TGT) built entirely offline using the domain's ticket-signing account (commonly called KRBTGT). Because that account's secret is what the Key Distribution Center (KDC) trusts to validate any TGT, an attacker who has stolen it can hand-craft a ticket for any user, including nonexistent ones, with any group memberships embedded, and the domain will treat it as legitimate.
Structured elaboration
Prerequisites. The attacker needs the KRBTGT account's password hash or key material, most commonly obtained through a directory-replication abuse that mimics a domain controller requesting a routine password-hash sync from another domain controller, or through direct compromise of a domain controller itself. They also need the domain's security identifier, which is not secret and is easy to obtain once any level of domain access exists.
How it's used. With the KRBTGT secret in hand, the attacker forges a TGT offline, embedding whatever username and group memberships they choose. Because the KDC only checks that the ticket is properly encrypted with the KRBTGT key, not that the embedded user and group data corresponds to real, current account state, this grants domain access at whatever privilege level the attacker forged into the ticket. This access is unusually persistent: an ordinary password reset on the impersonated (or fabricated) user has no effect, because the forgery never depended on that user's own password in the first place, only on the domain-wide KRBTGT secret.
Detection artifacts. Tickets with a lifetime that exceeds the domain's configured maximum ticket lifetime policy, tickets used for accounts that have no corresponding real authentication event in correlated logs (a forged ticket skips the actual logon step entirely, so there's no matching initial-authentication record), and an encryption type on the ticket that doesn't match what the domain normally issues, are all recognized indicators. Authentication event log anomalies, where a ticket is presented for a session that never had a matching prior sign-in, are a well-known detection heuristic.
Safe testing limitations. The actual remediation for a demonstrated Golden Ticket, rotating the KRBTGT secret (which Microsoft's own guidance says must be done twice, since old and new tickets both remain valid for a window otherwise), is highly disruptive to a live environment. Because of that, an assessment should typically demonstrate the technique in a scoped, pre-agreed way, for example forging a ticket only for a disposable test account created specifically for the engagement, within an agreed time window, with the client's defensive team aware it may happen. Forging tickets for real privileged production accounts, or touching production domain controllers outside the agreed window, should be explicitly excluded from scope given how disruptive the actual fix is.
Worked example
During a scoped engagement, the tester obtains domain controller replication rights through an earlier finding, uses that to extract the KRBTGT hash, and forges a ticket for a throwaway test account created specifically for this demonstration, valid for an extended lifetime. Presenting that ticket grants access consistent with a Domain Admin, without any real Domain Admin account's password ever being touched, which is exactly the point being demonstrated to the client: possession of KRBTGT alone is enough, independent of any specific user's credential hygiene.
Trade-offs and pitfalls
The most common mix-up is confusing a Golden Ticket with a Silver Ticket. A Silver Ticket is forged using a specific SERVICE account's own hash rather than KRBTGT, so it only grants access to that one service and doesn't require replication rights to the domain controller at all, a much narrower blast radius than a Golden Ticket's domain-wide reach.
What are the common ways an attacker establishes persistence on a compromised Windows host, and how does 'persistence' differ from 'lateral movement' in post-compromise operations? For each persistence mechanism you name, note how detectable it is and how a defender would remediate it.
Sample Answer
Direct answer
Persistence is the set of techniques for keeping access to a host or account you have ALREADY compromised, surviving reboots, logoffs, or credential rotation. Lateral movement is a different problem: extending access to ADDITIONAL, different hosts. The two are frequently used together (persist on one host, then move to another), but persistence answers "how do I keep what I already have," while lateral movement answers "how do I get more."
Structured elaboration
- Scheduled tasks. Creating or modifying a task that relaunches the implant on a timer or at logon. Fairly detectable, since task creation is typically logged as its own event; remediation is auditing scheduled tasks, restricting who can create them, and alerting on unusual creation activity.
- Registry Run keys or startup-folder entries. An entry that runs automatically at user logon. Highly detectable once monitored, since this is one of the oldest and most well-understood persistence locations; remediation is monitoring changes to those specific registry locations and restricting write access to them.
- New or modified Windows service. Installing a service that starts at boot, often with SYSTEM-level privileges. Medium-to-high detectability, since service creation is well logged; remediation is monitoring new service creation events and restricting who can install services.
- WMI (Windows Management Instrumentation) event subscriptions. Registering a permanent event filter and consumer pair that fires the implant when a chosen system event occurs, such as a timer or a logon. Comparatively low detectability by default, since WMI activity isn't monitored as closely as the mechanisms above unless a defender has specifically enabled it; remediation is enabling WMI activity logging and periodically reviewing registered subscriptions.
- DLL (Dynamic-Link Library) or COM (Component Object Model) hijacking used for persistence, not just escalation. Planting a file in a search-order gap, or hijacking a registered COM handler, so it loads automatically whenever a commonly-used application starts. Low-to-medium detectability, harder to spot without a known-good baseline; remediation is application allow-listing and monitoring for unexpected library load paths.
- Domain-level persistence via forged tickets (a different flavor entirely from the host-level mechanisms above). Once an attacker has compromised the domain's ticket-signing account, a forged ticket grants durable, domain-wide access that survives an individual user's password reset, which is a fundamentally different, domain-scoped kind of persistence rather than a host-scoped one.
Worked example
An attacker compromises a workstation and immediately registers a WMI event subscription tied to a routine system timer, rather than a more conventional scheduled task, specifically because the target's defensive team is known to monitor scheduled task creation closely but has not enabled the more granular WMI activity logging. The implant survives the next reboot and several subsequent logon cycles, undetected, until the defensive team happens to enable WMI auditing during an unrelated investigation.
Trade-offs and pitfalls
A common gap is listing persistence mechanisms without addressing how detectable each one is or how a defender would remove it, which is the actual substance of the question. A second common mistake is conflating persistence with how a command-and-control channel communicates: staying reachable on a host is a separate design decision from how the implant talks back to its operator once it is reachable.
Unlock Full Question Bank
Get access to all 8 Exploitation, Post-Exploitation, and Red Team Operations interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.