OffSec · Free Practice Questions · Last reviewed May 2026
66 original exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
During an authorized penetration test, you want to perform a client-side attack by delivering a malicious HTA file via a phishing email. Which technique is most effective to execute native commands silently when the user opens the file?
Embedding the HTA inside a standard PDF document using an external URI scheme pointing to a remote script
Hosting the HTA file on an Apache web server with a fake mime-type configuration forcing automatic execution
Using mshta.exe to process a VBScript payload embedded within the HTA container to spawn a reverse shell
The mshta.exe utility natively interprets HTML Applications and executes embedded scripting languages like VBScript or JScript with the full privileges of the current user. This bypasses typical browser isolation boundaries because the file runs as a trusted local Windows application.
Converting the HTA payload into a malicious shortcut (.lnk) file that calls PowerShell with hidden window arguments
You are analyzing a target web application that reflects user input directly into an HTML attribute without proper sanitization. Which vulnerability class should you primarily investigate for exploitation?
SQL Injection
Cross-Site Scripting (XSS)
Reflected XSS targets client-side execution by injecting malicious JavaScript through unvalidated parameters that get rendered immediately. This vulnerability allows attackers to steal session cookies, capture keystrokes, or perform actions on behalf of the authenticated user when they click a crafted link.
Remote Code Execution
Cross-Site Request Forgery
During a web application assessment, you discover that the application allows users to upload profile pictures. The server saves these files with their original extensions in a publicly accessible directory. What is the most effective client-side risk associated with this misconfiguration?
Direct execution of native ELF binaries on the underlying Linux web server operating system
Immediate compromise of the backend database via automated SQL injection through the filename
Execution of Stored Cross-Site Scripting when a victim user navigates directly to the uploaded SVG or HTML file
Browsers render SVG and HTML files containing embedded JavaScript within the origin context of the web application storage domain. This allows attackers to steal cookies, manipulate DOM elements, or perform unauthorized actions when other users view the uploaded file.
Bypassing network perimeter firewalls through encapsulated ICMP tunneling inside the image metadata
You are conducting a client-side attack using a weaponized Microsoft Office document containing a malicious VBA macro. Which user interaction and application setting combination is required for the macro to execute successfully by default?
The user must double-click the document while holding down the Shift key to bypass AutoOpen restrictions
The file must be saved in the local startup directory and the user must open the application normally
The user must click 'Enable Content' in the security banner after the file opens in Protected View
Modern Microsoft Office suites isolate downloaded documents in Protected View and display a yellow security banner warning about active content. Execution only occurs if the user explicitly overrides these security controls by clicking the enable button.
The target workstation must have macro auditing disabled via Group Policy Objects before execution
During an assessment, you identify a Cross-Site Scripting vulnerability that allows you to execute arbitrary JavaScript in the context of a victim user's browser session. What is the primary objective of leveraging this capability against an authenticated user?
Extracting plaintext password hashes directly from the remote web server operating system memory
Hijacking the user session by accessing session tokens or performing actions on their behalf within the application
Executing JavaScript in the victim browser permits access to session identifiers stored in cookies or local storage, facilitating session hijacking. The attacker can also forge HTTP requests using the user's active session to perform unauthorized administrative actions.
Modifying the enterprise DNS records hosted on the primary domain controller via client-side DOM manipulation
Bypassing enterprise firewall packet inspection rules by encapsulating shellcode inside HTTPS headers
When evaluating a web application for Cross-Site Scripting vulnerabilities during a penetration test, which TWO input contexts should you examine because they frequently lead to executable script injection?
Input reflected directly between opening and closing HTML tags, such as <div>USER_INPUT</div>
Reflecting user input between standard HTML tags allows an attacker to supply arbitrary HTML and script tags. When the browser parses the document, it interprets the injected <script> tags as executable code rather than plain text.
Input processed by a backend database stored procedure for primary key generation
Input placed inside HTML event handler attributes, such as <img src='x' onerror='USER_INPUT'>
Event handler attributes such as onerror execute JavaScript when the event fires, so injected input breaks out of the attribute context and runs as script. This satisfies the stem's requirement for an input context frequently yielding executable injection, distinct from plain HTML body text.
Input stored as an encrypted binary blob inside the browser local session storage
Input utilized as a parameter value inside a server-side JSON response header without content-type sniffing
Want more Client-Side Attacks practice?
Practice this domainYou are performing a network scan on a target network and notice that ICMP echo requests are blocked, but you need to determine if the target host is alive. Which technique should you utilize to identify active hosts without relying on standard ICMP ping?
Send a UDP packet to port 53 and wait for a DNS response.
Perform a TCP SYN scan on common ports such as 80, 443, and 22.
TCP SYN scanning to common ports reliably confirms host activity by triggering a response from the TCP/IP stack. Since most servers run these services, the receipt of a SYN/ACK or RST packet acts as a definitive indicator that the host is reachable, bypassing the need for ICMP connectivity.
Use ARP scanning regardless of the network topography.
Send a broadcast ping to the entire subnet range.
Refer to the exhibit. You have scanned a target and obtained these results. Which step is most logical to perform next to effectively enumerate the web service?
Immediately attempt to exploit the FTP service with anonymous login.
Perform directory busting using tools like ffuf or gobuster.
Directory busting helps discover unlinked files and directories that could contain sensitive information, backups, or administrative interfaces. This enumeration phase is vital because many web applications rely on security by obscurity, and finding these hidden paths often provides the necessary leverage for a successful penetration test and further exploitation.
Brute-force the SSH service using a list of common passwords.
Run a full vulnerability scanner against the entire target IP.
Which TWO of the following techniques are most effective for enumerating SMB shares on a Windows host during a penetration test?
Use smbclient -L //target_ip -N to list available shares.
The smbclient tool is the standard Linux utility for interacting with SMB shares. The -L flag queries the target for a list of shares, and the -N flag specifies no password, which is essential when testing for null sessions or guest access that might be improperly enabled on the target.
Run nmap with the --script smb-enum-shares scan argument.
The Nmap NSE script library includes powerful modules specifically designed for SMB enumeration. Using smb-enum-shares allows you to automate the process of discovering shares and their associated access permissions, providing a comprehensive view of the filesystem without requiring individual manual connections to each potential share folder.
Perform a brute-force attack on the C$ share.
Attempt to ping the host using ICMP to check SMB connectivity.
Use the telnet command to connect to port 445.
Which command-line tool is primarily used during the reconnaissance phase to identify open ports and service versions on a remote target?
netcat
Nmap
Nmap is the primary utility for network discovery and security auditing. It offers advanced features like service version detection, operating system fingerprinting, and scriptable automation, making it the most reliable and comprehensive tool available for identifying the services running on a target during the reconnaissance phase of testing.
Wireshark
grep
When enumerating a web application, which THREE of the following items are most important to identify to increase the likelihood of finding a vulnerability?
Hidden directories and files.
Hidden directories often contain configuration files, backup scripts, or administrative interfaces that lack proper authentication. Identifying these paths provides a significant advantage, as they may contain sensitive information or serve as entry points that bypass the main application's security controls, providing easier access for a penetration tester.
The web server software and version.
Knowing the web server's software and version is critical for identifying specific, known vulnerabilities. Many older or unpatched versions have public exploits available, allowing a tester to quickly research and apply targeted tests, which is often more efficient than attempting to find flaws in the custom application layer.
User input fields and URL parameters.
Input fields and URL parameters are the primary vectors for common web vulnerabilities like SQL injection, XSS, and command injection. Identifying where the application processes user-supplied data allows a tester to craft malicious payloads to test the application's sanitization and security logic against common attack patterns.
The color scheme of the website.
The number of images hosted on the server.
During a network assessment, you want to enumerate users on a domain controller. Which protocol and port combination is the most standard target for this type of enumeration?
HTTP on port 80
LDAP on port 389
LDAP is the primary protocol for directory services in Windows domains. Connecting to port 389 allows for queries that can return lists of users, groups, and computers. This is a standard enumeration technique used to map the domain and prepare for further attacks like password spraying or credential harvesting.
FTP on port 21
SMTP on port 25
Want more Enumeration and Reconnaissance practice?
Practice this domainYou have obtained a low-privileged domain user account and are performing internal enumeration. You identify a computer object in the domain where the 'ms-MCS-AdmPwd' attribute is readable by your user account. Which attack path does this vulnerability facilitate?
Kerberoasting the computer account password hash
Exploiting the GPO to modify the Domain Admins group
Extracting the cleartext local administrator password
The LAPS solution stores the cleartext local administrator password in the ms-MCS-AdmPwd attribute of the computer object. If a domain user has read access to this attribute, they can retrieve the password, enabling them to authenticate as the local administrator on that specific computer, facilitating unauthorized access.
Performing an AS-REP Roasting attack on the machine
Which tool is primarily used to perform BloodHound data collection to map out attack paths within an Active Directory environment?
Mimikatz
SharpHound
SharpHound is the official data collector for BloodHound. It automates the collection of Active Directory data, including group memberships, ACLs, and session information. This data is essential for building the graph database used in BloodHound to discover and analyze potential attack paths to high-value targets.
Responder
PowerSploit
Which THREE of the following are valid techniques for achieving persistence within an Active Directory environment?
Skeleton Key
Skeleton Key is an in-memory patch applied to a domain controller that allows any user to authenticate with a master password while still allowing normal password authentication. This provides stealthy, persistent access to any account in the domain without requiring knowledge of the actual user passwords.
Golden Ticket
A Golden Ticket is a forged TGT created using the KRBTGT account's NTLM hash. Because it does not rely on real account passwords, it can be configured with an extremely long expiration date, allowing an attacker to maintain persistent, high-level access to the domain as long as the KRBTGT hash remains unchanged.
Kerberoasting
AdminSDHolder modification
Modifying the ACLs on the AdminSDHolder object ensures that any changes to permissions are automatically propagated to protected groups and accounts within the domain. By adding a backdoored user or group to the ACL, an attacker ensures their access persists even after an administrator cleans up other unauthorized changes.
LLMNR Poisoning
You have captured an NTLM hash of a domain user. Why is performing a Pass-the-Hash (PtH) attack often more effective than attempting to crack the hash for the cleartext password?
It requires less network traffic than a standard login
The hash is accepted directly by the authentication service
NTLM authentication protocols authenticate using the NTLM hash directly. By providing the hash to the authentication process, the attacker can successfully impersonate the user without needing to crack the hash to reveal the cleartext password, making it an immediate and highly effective method for lateral movement.
Cracking the hash is prohibited by corporate policy
The hash provides access to all domain controllers
Which of the following describes the 'GPP Password' vulnerability?
A flaw in the Kerberos preauthentication mechanism
The storage of cleartext credentials in GPO XML files
GPP password vulnerability occurs when sensitive credentials stored in Group Policy XML files are encrypted using a publicly available static key. This allows anyone with read access to the SYSVOL share to decrypt the 'cpassword' attribute and obtain the cleartext password, facilitating unauthorized access to local administrator accounts.
The inability to enforce password complexity on GPOs
A failure in the Domain Controller's LDAP signing
What is the primary objective of an 'AS-REP Roasting' attack?
To capture the KRBTGT hash from the domain controller
To crack the password of an account without preauth
AS-REP Roasting exploits accounts with the 'Do not require Kerberos preauthentication' flag. By requesting a ticket without providing preauthentication data, the attacker receives a response encrypted with the user's hash, which can be cracked offline to reveal the cleartext password, regardless of the password's complexity or length.
To bypass the need for an NTLM hash during relay
To escalate privileges via a forged Kerberos ticket
Want more Active Directory Attacks practice?
Practice this domainYou have identified a vulnerable service using an outdated version of a CMS. You successfully locate a public exploit script on GitHub. What is the most critical first step before running this script against your target?
Immediately run the exploit script with administrative privileges.
Change the target IP address in the script's configuration.
Read the source code to understand its mechanism and potential impact.
Analyzing the source code allows you to confirm that the exploit performs exactly what you expect. It helps identify hardcoded credentials, malicious payloads, or potential stability issues that could crash the target service, which is essential for maintaining control and stability during your assessment.
Install all dependencies listed in the script's requirements file.
Which repository is generally considered the most reliable starting point for finding verified, community-contributed public exploits during an OSCP assessment?
A random forum dedicated to malware distribution.
The Exploit Database (Exploit-DB) via Searchsploit.
Searchsploit provides a comprehensive, standardized, and offline-accessible database of exploits. This tool is specifically curated for penetration testers and researchers, offering a reliable way to match service versions to known exploit code while ensuring you maintain an efficient and controlled testing methodology during your exam.
The dark web marketplace for zero-day vulnerabilities.
The latest compiled binary downloads from unknown websites.
When modifying a public exploit to fit your specific target, which TWO of the following actions are considered best practices? (Choose TWO)
Updating the hardcoded IP address and port to match your target.
Hardcoded values in public exploits are specific to the original researcher's environment. Updating these to match your current target is mandatory for the exploit to reach the intended destination. Failing to do this will result in the exploit attempting to connect to an irrelevant host.
Changing the exploit code to use a different programming language entirely.
Replacing the default payload with your own reverse shell payload.
Public exploits often include default payloads that may not suit your network configuration or listener setup. Replacing them with a verified reverse shell that matches your listener ensures you receive the callback successfully, which is a fundamental requirement for achieving a stable remote command execution.
Deleting all comments to make the exploit run faster.
Adding complex obfuscation to bypass all possible firewalls.
Refer to the exhibit. You identify an Apache 2.4.49 vulnerability and locate the exploit. After reviewing the exploit code, you realize it requires a specific input format to trigger the path traversal. What is the most effective way to verify the vulnerability without crashing the server?
Execute the exploit immediately against the root directory.
Use a simple path traversal payload to request a harmless file.
Requesting a harmless file like a public document is a safe way to confirm the path traversal vulnerability exists. If you receive the file content back successfully, you have proven the vulnerability without causing any disruption to the service or damaging the target system's stability.
Run the exploit as is and hope the server remains stable.
Modify the exploit to dump the entire password file immediately.
Why might a public exploit for a specific service fail to execute even when the service version matches the vulnerability description exactly?
The exploit code is always written in an incompatible shell format.
The target environment has different memory protections or patch levels.
Memory protections like ASLR and DEP are common on modern systems and can prevent standard exploit payloads from executing. Even with the same service version, different patch levels or underlying OS configurations significantly alter the target environment, causing the original exploit code to fail consistently on your target.
Public exploits are intentionally corrupted to prevent usage.
You forgot to increase the network timeout settings.
When using Searchsploit, what is the purpose of the '-m' flag?
To move the exploit file to the root directory.
To mirror (copy) the exploit to the current directory.
The '-m' flag is specifically designed to mirror an exploit file into your current directory, making it accessible for modification. This is an essential step for any tester who needs to customize an exploit before execution, ensuring the original database remains untouched for future use.
To mark the exploit as malicious.
To monitor the exploit for execution errors.
Want more Public Exploits practice?
Practice this domainWhich of the following describes a successful Path Traversal attack in a web application?
Injecting JavaScript into a form field to capture user session cookies.
Using dot-dot-slash sequences to read /etc/passwd on a Linux server.
This is the classic example of a Path Traversal attack. By moving up the directory tree using '..', the attacker can point the application to sensitive files like /etc/passwd that reside outside the intended document root, effectively bypassing access controls.
Submitting a crafted SQL query to retrieve data from the database.
Overloading the server with requests to exhaust system memory.
An application is vulnerable to Server-Side Request Forgery (SSRF). You want to use this to scan the internal network. Which target should you attempt to access first to verify the vulnerability?
A known external public domain like google.com.
The local loopback address (127.0.0.1) or localhost.
Accessing 127.0.0.1 confirms that the application can reach its own local services. Since the local interface is usually trusted, this is a highly reliable way to confirm the SSRF vulnerability and potentially uncover local administrative services or configuration endpoints.
The default gateway IP of the server's network.
An arbitrary private IP address like 10.0.0.1.
What is the primary security risk of an application that fails to properly validate the 'Content-Type' header during a file upload process?
It allows attackers to perform SQL Injection attacks.
It enables an attacker to bypass file type restrictions to upload executable scripts.
The Content-Type header is easily modified in an intercepting proxy. If the server trusts this header, an attacker can send a PHP script while labeling it as 'image/jpeg'. The server accepts it, potentially allowing the attacker to execute malicious code on the system.
It prevents the server from storing large files, leading to denial of service.
It exposes the server to Cross-Site Request Forgery (CSRF) attacks.
Which of the following describes the security benefit of the 'HttpOnly' flag shown in the exhibit?
It ensures the cookie is only sent over encrypted HTTPS connections.
It prevents the cookie from being accessed by JavaScript.
The 'HttpOnly' attribute is specifically designed to block access to the cookie through the document.cookie property. This protects the session from being stolen by XSS attacks, as malicious scripts are unable to read or transmit the session token to an attacker-controlled server.
It stops the browser from sending the cookie in cross-site requests.
It automatically regenerates the session ID every 30 minutes.
Which of the following is a common symptom of a Command Injection vulnerability?
The web page displays a SQL syntax error message.
The application returns the output of a command like 'whoami' or 'id'.
If an application executes OS commands based on user input, injecting common Linux commands like 'whoami' will cause the application to return the current user's identity. This direct reflection of command results is the most clear proof-of-concept for a command injection vulnerability.
The login page takes a long time to respond to requests.
Users are redirected to an external, malicious website.
During a web assessment, you find that an application uses an insecure random number generator for token creation. What is the main security implication of this flaw?
It allows attackers to perform Cross-Site Request Forgery (CSRF).
It leads to session hijacking through token prediction.
If the random number generator is predictable, an attacker can generate a sequence of valid tokens and potentially hijack active user sessions. This allows unauthorized access to user accounts without needing to know a password, representing a severe flaw in authentication and session integrity.
It triggers a stack overflow in the web server process.
It makes the application vulnerable to SQL Injection.
Want more Web Application Attacks practice?
Practice this domainYou have gained a low-privileged shell on a Linux system and discovered a binary with the SUID bit set. The binary executes a system call to 'cat' without specifying an absolute path. How can you leverage this to escalate privileges?
Overwrite the SUID binary's source code in /usr/src to include a reverse shell.
Use 'chmod' to grant everyone execute permissions on the SUID binary to trigger a buffer overflow.
Prepend a directory containing a malicious 'cat' script to the PATH variable and run the binary.
By creating a script named 'cat' in a directory like /tmp and setting the PATH variable to start with that directory, the system executes your script instead of the legitimate binary. Because the parent program is SUID root, your malicious script runs with root privileges, granting a shell.
Modify the /etc/ld.so.preload file to inject a malicious library into the SUID binary's execution flow.
Refer to the exhibit. Given the sudo privileges, which command will successfully spawn a root shell?
sudo /usr/bin/vim -c ':!/bin/sh'
The -c command flag executes a command immediately upon vim startup. By invoking :!/bin/sh, the user forces vim to spawn a system shell. Because vim is running with sudo privileges, the spawned shell inherits root permissions, effectively escalating the user's access level to the highest possible on the system.
sudo /usr/bin/vim /etc/shadow
sudo /usr/bin/vim --version
sudo /usr/bin/vim -u NONE
Which Linux kernel feature, if misconfigured or outdated, allows an unprivileged user to gain root access by exploiting a vulnerability in the handling of user namespaces?
AppArmor profile confinement
Unprivileged user namespace clone functionality
The 'unshare' or 'clone' syscalls allow creating new namespaces without root. Exploits often target how the kernel handles these namespaces to escalate privileges. Because these features are often exposed to all users, they serve as a critical vector for local privilege escalation attacks on outdated kernels.
Shared memory segment access via IPC
Extended file attributes (xattr)
Refer to the exhibit. The 'find' binary has the SUID bit set. How can you leverage this to gain a root shell?
find . -exec /bin/sh -p \;
Using the -exec flag with /bin/sh allows you to spawn a shell. The -p flag is essential for 'sh' to maintain the SUID privilege level instead of dropping it to the user's real UID. This command effectively drops you into a root shell because 'find' is executing as root.
find . -name "*" -delete
find . -exec chmod 777 /etc/shadow \;
find / -user web -exec ls -l {}
You find that a binary relies on a relative path to execute a secondary script. If you cannot modify the PATH variable, what is the best alternative to exploit this configuration?
Modify the binary's ELF header to change the search path.
Create the expected directory structure in a location you control and execute the binary from there.
If the binary expects to find a script in a relative path like './scripts/run.sh', you can create a directory named 'scripts' in your current location and place a malicious 'run.sh' inside. When the binary runs, it will find and execute your script, inheriting the binary's SUID privileges.
Use the 'ptrace' system call to attach to the binary and change its execution flow.
Inject environment variables like 'LD_LIBRARY_PATH' to overwrite the binary's functionality.
When reviewing 'sudo -l' output, what does the 'NOPASSWD' tag signify for the listed command?
The user is automatically added to the root group.
The command can be run as root without entering a password.
NOPASSWD specifically bypasses the sudo password prompt for the defined command. This allows the user to execute the command with the elevated privileges defined in the sudoers file instantly. This is a primary target during privilege escalation, as it simplifies the path to root significantly.
The command is not logged by the system administrator.
The command will run in a sandbox for security.
Want more Linux Privilege Escalation practice?
Practice this domainYou are analyzing a binary and identify a function that uses strcpy() to copy user input into a fixed-size stack buffer. Which register must be controlled to redirect the instruction pointer to your shellcode?
The ESP register
The EAX register
The saved Return Address on the stack
The saved Return Address sits just above the local variables on the stack. When the function epilogue executes, the CPU performs a RET instruction, which pops this specific stack value directly into the EIP register. Controlling this value is the direct way to hijack the program control flow.
The EBP register
Based on the exhibit, what is the primary risk if your shellcode contains the byte \x0d?
The memory address becomes non-executable
The application terminates the input string early
Many string-handling functions, like strcpy or those used in network socket communication, interpret \x0d as a carriage return, signaling the end of an input stream. If the shellcode contains this byte, the program stops copying input to the buffer, leaving the exploit payload incomplete and effectively preventing successful execution.
The JMP ESP instruction fails to trigger
The CPU enters an infinite loop state
Which TWO of the following statements correctly describe the function of a NOP sled in a buffer overflow exploit?
It provides a wider range of addresses for successful jump redirection.
By placing a large NOP sled before the shellcode, the exact memory address required for the redirect becomes less precise. As long as the instruction pointer lands anywhere within the sled, the CPU execution flow will naturally slide down until it reaches the start of the actual functional shellcode payload.
It acts as a primary payload to bypass antivirus software.
It executes complex arithmetic to prepare registers for shellcode.
It ensures the instruction pointer reaches the shellcode despite offset variances.
Memory addresses can shift due to subtle changes in system state. A NOP sled acts as a buffer zone that compensates for these minor variations. By landing in the sled, the program continues executing harmless instructions until it reaches the payload, ensuring the exploit works even if the target pointer shifts.
It is required to disable hardware-based stack protections.
When fuzzing an application to identify a buffer overflow, what is the most common symptom indicating that the application's memory boundaries have been exceeded?
The application begins to consume high CPU resources
The application returns an 'Access Violation' or 'Segmentation Fault'
When an overwrite corrupts the saved return address, the CPU eventually attempts to return to an address that is not valid or mapped, resulting in an immediate crash. This exception is the standard indicator for a successful fuzzer trigger, confirming the boundary has been exceeded and control is potentially lost.
The application prints a stack dump to the console
The application generates a new network port listener
Why must you carefully identify 'bad characters' before finalizing an exploit payload?
To prevent the shellcode from triggering an antivirus alert.
To ensure the shellcode is correctly copied into memory in its entirety.
Certain characters like null bytes or line feeds are interpreted by copy functions as termination signals. If such a character appears in the middle of your shellcode, the program stops processing the rest of the buffer, leaving the shellcode incomplete and making it impossible for the CPU to execute it.
To allow the CPU to perform faster instruction decoding.
To bypass DEP (Data Execution Prevention) controls.
Which THREE of the following are essential steps when manually exploiting a stack-based buffer overflow?
Identifying the crash offset by using a pattern generator.
Using a unique cyclic pattern allows you to precisely determine the number of bytes required to overwrite the return address. This step is critical because any error in calculating the offset will cause the exploit to crash the program at the wrong location or fail to overwrite the target.
Calculating the precise offset for the return address.
Once the crash occurs using a cyclic pattern, identifying the exact bytes at the EIP allows you to know where the return address is situated. This precision is necessary to ensure the shellcode execution begins immediately after the function epilogue triggers the jump to your injected pointer.
Disabling all firewall rules on the victim machine.
Identifying bad characters to prevent payload truncation.
Testing for bad characters is essential because certain bytes can cause the application to stop reading the buffer prematurely. Finding these early ensures that your entire shellcode is successfully stored on the stack, which is the only way to ensure the CPU executes the intended instructions upon the jump.
Upgrading the target application to the latest version.
Want more Buffer Overflow Fundamentals practice?
Practice this domainYou have compromised a Linux jump host and need to access an internal web application on 192.168.1.50:80 that is firewalled from your local machine. You have SSH access to the jump host. Which command should you execute on your local machine to securely access the application via your browser?
ssh -R 8080:192.168.1.50:80 user@jump-host
ssh -D 8080 user@jump-host
ssh -L 8080:192.168.1.50:80 user@jump-host
Local port forwarding uses the -L flag to map a local port (8080) to the destination internal IP and port (192.168.1.50:80). This connection is tunneled through the SSH session, allowing you to access the web application by pointing your local web browser to http://127.0.0.1:8080, effectively bypassing the firewall limitations.
ssh -fN -L 192.168.1.50:80:8080 user@jump-host
When performing SSH dynamic port forwarding with the -D flag, what is the primary benefit compared to local port forwarding (-L)?
It provides a faster connection speed than local forwarding.
It enables routing to multiple internal hosts dynamically.
Dynamic port forwarding acts as a SOCKS proxy, allowing client applications to route traffic through the SSH server to any destination reachable by that server. This eliminates the need to create individual -L tunnels for every specific internal IP or service, providing much greater flexibility during network enumeration.
It is more secure because it disables encryption.
It allows the user to run commands on the remote machine.
Why might a penetration tester use a 'jump host' when attempting to access an internal network segment?
To increase the bandwidth of the connection.
To hide the attacker's IP from the destination server.
Because the target segment is firewalled from the attacker.
A jump host is used when the attacker cannot directly communicate with the target network. By establishing a tunnel through the jump host, the attacker effectively extends their reach into the internal segment, circumventing the firewalls that prevent direct connections from the outside world to the target internal resources.
To provide a GUI-based interface for database management.
Refer to the exhibit. You are attempting a local port forward using PLINK, but receive a 'Connection refused' error. Which of the following is the most likely cause?
The internal target (10.0.0.5) is down.
The SSH service on the jump host is unavailable.
Connection refused implies the target IP address is reachable, but the specific port (typically 22 for SSH) is closed or not accepting connections. This is common if the SSH service is disabled, misconfigured, or if an egress firewall on your local network is blocking outbound connections to port 22.
The password provided is incorrect.
The local port 8080 is already in use.
When using SSH tunneling, what is the primary security risk of using the '-R' flag in a multi-user environment?
It exposes the tunnel to all users on the remote server.
By default, ports forwarded with -R bind to the loopback interface on the remote server. However, if the server configuration allows it or if you bind to all interfaces, any user on that server can access the forwarded port, effectively hijacking your pivot for their own network activities or malicious use.
It forces the remote server to enable password-less login.
It requires the remote server to have a GUI installed.
It automatically disables logs on the jump host.
In the context of pivoting, what is 'double pivoting'?
Running two separate SSH processes to the same host.
Using two different protocols simultaneously for redundancy.
Tunneling through one compromised host to reach another.
Double pivoting involves establishing a chain of tunnels through a sequence of compromised hosts. This allows the attacker to reach deep into an internal network where the target is separated by multiple firewalls or isolated VLANs that are only reachable by sequentially pivoting through multiple intermediate jump hosts.
Encrypting the tunnel twice for double security.
Want more Port Redirection and Tunneling practice?
Practice this domainAn analyst is attempting to execute a custom C2 stager on a Windows 10 workstation with active Windows Defender. They decide to use a PowerShell one-liner that downloads a script from a remote server and executes it directly using the Invoke-Expression (IEX) cmdlet. Why is this method generally more effective than downloading an .exe file to the Desktop?
It bypasses the Antimalware Scan Interface (AMSI) entirely by default.
Memory-only execution avoids the file-on-disk signature scanning process.
Antivirus software heavily relies on scanning new files created on the hard drive against a database of known malware signatures. By executing code directly in memory using Invoke-Expression, the payload never triggers the file system write hooks that would normally prompt an immediate scan, allowing the code to run if it can evade behavioral analysis.
PowerShell scripts are automatically trusted by the Windows integrity system.
The method uses the System.Net.WebClient class which encrypts the payload.
A penetration tester modifies a known exploit's payload by changing variable names and adding junk instructions. Despite these changes, the antivirus software still flags the file as 'Trojan.Generic' immediately upon being written to disk. What is the most likely reason for this detection?
The antivirus is using signature-based detection on the specific junk code.
Heuristic analysis identified suspicious code patterns or structures.
Heuristic engines look for characteristics and behaviors rather than exact byte sequences. By identifying that the file structure or the sequence of API calls closely resembles known malware, the antivirus can make an educated guess that the file is malicious, even if the specific strings and variables have been altered by the penetration tester.
The file's entropy was too low, triggering an automatic quarantine.
The junk instructions were identified as malicious shellcode by the CPU.
Which TWO techniques are primarily used to bypass static signature-based detection by altering the file's binary appearance without changing its underlying functionality?
Binary Packing
Packing involves using a tool to compress and wrap the original executable within a new outer layer. When the file is scanned on disk, the antivirus only sees the packer's code rather than the malicious payload. At runtime, the packer decompress the original code into memory, effectively hiding the malware from static analysis.
Process Hollowing
Payload Encryption
Encrypting the payload ensures that the actual malicious instructions are not visible to static scanners. A small stub of code is included to decrypt the payload in memory at runtime. Since the encrypted data appears as random noise to the scanner, it cannot match any known signatures, effectively bypassing most static detection mechanisms.
Direct System Calls
Token Manipulation
An attacker places a malicious 'version.dll' file into the same directory as a legitimate, signed executable that is known to load that DLL. When the legitimate program starts, it loads the malicious DLL instead of the one in the System32 folder. What evasion technique is being demonstrated?
DLL Injection
DLL Sideloading
Sideloading takes advantage of the Windows DLL search order, which prioritizes the application's directory over system directories. By naming the malicious file after a required dependency, the attacker tricks a trusted application into executing their code. This is a highly effective way to gain execution while appearing as a legitimate, signed process.
COM Hijacking
Reflective DLL Loading
Which THREE techniques are commonly implemented in malware to detect and evade dynamic analysis within an automated sandbox environment?
Checking for a low number of CPU cores or small RAM size
Automated sandboxes are often resource-constrained to save costs, frequently operating with only one or two CPU cores and minimal memory. Legitimate modern workstations typically have more resources. Malware can check these hardware specifications and terminate execution if they fall below a certain threshold, assuming the environment is a virtualized analysis lab.
Executing a large number of NOP instructions to increase file size
Monitoring for specific mouse movements or keyboard input
Sandboxes are automated and often lack human interaction. Malware can record the mouse coordinates over time or wait for a specific number of clicks before detonating. If no movement is detected, the malware assumes it is being analyzed by an automated system and remains inactive to avoid revealing its true malicious capabilities.
Implementing long 'Sleep' delays or complex timing loops
Most sandboxes only analyze a file for a few minutes before moving to the next task. By calling a sleep function for an extended period, such as ten minutes, the malware can outlast the analysis window. When the sandbox times out and reports the file as benign, the malware can then safely execute its payload.
Using direct syscalls to bypass the Windows API hooks
When evaluating an antivirus solution's effectiveness, what is the primary difference between signature-based detection and behavioral-based detection?
Signatures look for file hashes, while behavior looks for network traffic.
Signatures identify known files, while behavior identifies suspicious actions.
Signature detection compares a file's content against a list of known malware 'fingerprints.' Behavioral detection, on the other hand, monitors the actual operations a program performs while running, such as attempting to inject code into another process or modifying sensitive registry keys, allowing it to catch zero-day threats.
Signatures are only used for disk scans, while behavior is for memory scans.
Behavioral detection is always more accurate and faster than signature-based.
Want more Antivirus Evasion practice?
Practice this domainYou have successfully obtained a NTLM hash dump from a domain controller. You intend to perform a pass-the-hash attack to move laterally. What is the most critical requirement for this technique to succeed in a modern Windows environment?
The target system must have the Kerberos pre-authentication disabled for the user account.
The victim machine must have the 'Restricted Admin' mode enabled in the RDP configuration.
The authentication protocol must permit NTLM or legacy authentication methods to facilitate the hash usage.
Pass-the-hash depends on the target service or system accepting NTLM authentication. If an environment is strictly configured to use Kerberos-only authentication and NTLM is disabled via Group Policy or security settings, the hash will fail to authenticate because the system will reject the NTLM challenge-response sequence entirely.
The target machine must be running a version of Windows older than Windows Server 2012.
Refer to the exhibit. What is the primary purpose of the command provided?
Performing a brute-force attack on a SHA-256 encrypted archive.
Cracking NTLM hashes using a dictionary-based approach.
Mode 1000 identifies the hash type as NTLM, and -a 0 specifies the dictionary attack mode. This combination is the standard method for attempting to recover plaintext passwords from NTLM hashes using a predefined list of words, which is the most efficient starting point for offline password recovery in Windows environments.
Attempting a mask attack to guess passwords based on a specific pattern.
Extracting domain user hashes from a SAM database file.
You are auditing a web application and notice it uses base64 encoding to store user credentials in a cookie. What is the most accurate assessment of this security practice?
The credentials are secure because base64 is difficult to reverse without the secret key.
The credentials are protected from casual inspection but vulnerable to automated tools.
The implementation is insecure because base64 is an encoding, not a cryptographic protection.
Base64 is designed to represent binary data in an ASCII string format. It offers no confidentiality or integrity. Using it to store credentials is a critical vulnerability because it exposes plaintext passwords to anyone who can view the cookie, allowing for trivial credential theft and subsequent unauthorized account access by an attacker.
The implementation is acceptable if the connection is encrypted with TLS.
During an engagement, you capture an AS-REP response from the domain controller. What is the specific prerequisite for this account to be vulnerable to AS-REP Roasting?
The account must have a Service Principal Name (SPN) set in the domain properties.
The account must have the 'Do not require Kerberos pre-authentication' option enabled.
This setting is the primary vulnerability that makes AS-REP Roasting possible. When disabled, the domain controller sends an encrypted TGT without verifying the user's password first. This encrypted ticket can then be captured and cracked offline, making it a highly effective method for gaining access to user accounts.
The user must be a member of the Domain Admins or Enterprise Admins group.
The account must be configured with a password that has never been rotated.
Which of the following describes the risk associated with using a password manager that lacks a master password and relies solely on local file encryption?
The vault is vulnerable to dictionary attacks due to the lack of a salt in the local file.
The encryption keys are stored in a predictable location or memory, allowing for easy extraction.
When a master password is not required, the application must derive the decryption key from static sources, such as registry keys, machine GUIDs, or environment variables. An attacker with access to the system can easily locate these sources to decrypt the vault, rendering the 'encryption' effectively transparent to them.
The lack of a master password prevents the use of multi-factor authentication for the vault.
The file format will be incompatible with standard password cracking software like John the Ripper.
Refer to the exhibit. As an attacker attempting to brute-force a web login, why is receiving this specific error message beneficial to your engagement?
It indicates that the account is currently locked and will not accept further attempts.
It confirms that the application uses a weak hashing algorithm that ignores complexity.
It reveals information that allows you to prune your wordlist to only relevant password candidates.
Knowing the exact password policy allows you to filter your wordlists to exclude passwords that would be rejected by the application's validation logic. This optimization significantly speeds up the brute-forcing process by ensuring that every password tested is at least theoretically compliant with the target organization's security policy.
It implies that the application is vulnerable to SQL injection because of poor error handling.
Want more Password Attacks practice?
Practice this domainYou have gained a low-privileged shell on a Windows system and discovered a service running as 'LocalSystem' with an unquoted executable path containing spaces. Which action is the most direct way to escalate privileges?
Restart the service immediately to trigger a buffer overflow.
Overwrite the existing service executable with your payload.
Place a malicious binary at a location in the unquoted path that the user can write to.
When a path is unquoted, Windows searches for the executable by adding .exe to parts of the string. If the path is C:\Program Files\My App\service.exe, Windows checks C:\Program.exe first. If you place a malicious binary there, the system will execute it as SYSTEM when the service starts.
Modify the Windows Registry to point the service to a new location.
Refer to the exhibit. What can you conclude about the security of this service binary?
The service is vulnerable to a DLL hijacking attack.
The binary can be replaced by any local user to achieve privilege escalation.
The '(M)' permission granted to BUILTIN\Users allows any standard user to write to, modify, or delete the file. By replacing the service executable with a malicious payload, the user can ensure that the next time the service starts, the malicious code executes with SYSTEM privileges.
The service is secure because only SYSTEM and Administrators have full access.
The service cannot be stopped by a standard user.
You have identified an AlwaysOn service running with SYSTEM privileges. The service binary is read-only, but you have write access to its directory. What is the most likely escalation vector?
Exploiting the unquoted service path.
DLL Hijacking.
When an application loads a DLL, it searches the application directory first. If you have write access to that directory, you can place a malicious DLL with a matching name. The application will load it instead of the system version, executing your code under the service's context.
Modify the service binary directly.
Overwriting the service configuration file.
What is the primary purpose of using 'accesschk' during the enumeration phase of Windows privilege escalation?
To bypass Windows Firewall rules.
To identify files and services with weak permissions.
Accesschk is specifically designed to display the effective permissions for a user or group on various system objects. It is the industry-standard tool for finding files, services, or registry keys that are improperly secured, allowing for targeted privilege escalation attempts on a compromised system.
To dump the SAM database for password hashes.
To automate the deployment of kernel exploits.
Refer to the exhibit. What is the most likely goal of this command execution in a privilege escalation context?
To install a persistent backdoor on the system.
To perform automated enumeration for privilege escalation.
Scripts like PowerUp are designed to search for common misconfigurations that lead to privilege escalation. Executing such scripts from a remote server is a standard technique to quickly identify escalation paths without leaving traces on the local file system, which helps maintain operational security during an engagement.
To escalate privileges to SYSTEM directly.
To exfiltrate sensitive files from the system.
When exploiting a service via 'Modify' permissions on its binary, why is it necessary to restart the service?
To refresh the file system cache.
To trigger the execution of the new binary.
The Service Control Manager only executes the binary when the service is started. Replacing the file does not affect the currently running process. A restart is required to stop the original binary and initiate the new one, which allows the attacker's code to run as the service user.
To bypass the Windows Service integrity check.
To allow the service to read the new configuration.
Want more Windows Privilege Escalation practice?
Practice this domainThe vendor does not publish an exact question count for the PEN-200. Always confirm current details on the vendor's official exam page.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 11 domains: Client-Side Attacks, Enumeration and Reconnaissance, Active Directory Attacks, Public Exploits, Web Application Attacks, Linux Privilege Escalation, Buffer Overflow Fundamentals, Port Redirection and Tunneling, Antivirus Evasion, Password Attacks, Windows Privilege Escalation. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official OffSec PEN-200 exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.