Curated

Attacks and Exploits 2 (4.4–4.5)

0 votes

Questions99

  1. Question 51

    Attacks and Exploits

    A tester makes a legitimate application load an attacker-controlled DLL so the code runs inside it. Which attack is this?

    Show the answer

    Correct answerB. Library injection

    AWhy not this: Credential dumping extracts stored secrets such as hashes; it does not run code in an app.

    BWhy this is right: a trusted application loads an attacker-supplied library and runs its code.

    CWhy not this: Hollowing swaps out a suspended process's memory image; it does not make an app load a DLL.

    DWhy not this: Shell escape breaks out of a restricted shell or application to reach a full shell.

    Library injection forces a trusted process to load an attacker-supplied shared library, so the code runs in that process's context. Process hollowing is different: it replaces the memory image of a suspended process rather than loading a library into it.

    Open this question
  2. Question 52

    Attacks and Exploits

    A tester with root on a Linux host truncates its local auth log, yet defenders still rebuild the tester's logins. Which control most likely made this possible?

    Show the answer

    Correct answerA. Log forwarding to a remote collector

    AWhy this is right: entries already sent off-host survive local truncation.

    BWhy not this: Encryption protects data at rest; root can still truncate the file once the system is running.

    CWhy not this: Allowlisting restricts program execution and keeps no copy of login records.

    DWhy not this: Lockout limits password guessing and records nothing about past logins.

    Events forwarded to a remote collector as they occur remain intact when the local file is truncated, so tampering on the host cannot erase them. Application allowlisting controls which programs execute and does not preserve log evidence.

    Open this question
  3. Question 53

    Attacks and Exploits

    A mobile app calls an API endpoint that returns the tester's own full user record, including password hashes and internal flags, though the app shows only the name. Which API weakness does this show?

    Show the answer

    Correct answerA. Excessive data exposure

    AWhy this is right: The response returns sensitive fields the client does not need, trusting the app to filter them.

    BWhy not this: Session hijacking steals a valid session token; no token is taken here.

    CWhy not this: IDOR requires accessing another user's object by changing an identifier; only the tester's own record is returned.

    DWhy not this: Mass assignment involves a client setting extra fields in a request; this case is about response content.

    The API sends far more data than the client needs and relies on the app to hide it, which is excessive data exposure. Mass assignment concerns writing extra fields in a request, not reading extra fields in a response.

    Open this question
  4. Question 54

    Attacks and Exploits

    A site stores uploaded files in a web-accessible folder. Which control BEST stops an uploaded web shell from running?

    Show the answer

    Correct answerD. Disable script execution in the upload directory

    AWhy not this: Output encoding mitigates XSS; it does not affect whether the server runs an uploaded file.

    BWhy not this: Lockouts slow brute-force logins; they do not control what runs from the upload folder.

    CWhy not this: CSRF tokens stop forged cross-site requests; they do not stop an uploaded script from executing.

    DWhy this is right: If scripts cannot execute in the folder, the uploaded web shell is served as plain data and never runs.

    A web shell only works if the server executes the uploaded script. Disabling script execution in the upload directory leaves the file inert. Anti-CSRF tokens protect against forged requests and do nothing about an uploaded file being executed.

    Open this question
  5. Question 55

    Attacks and Exploits

    A server issues HS256-signed JWTs and rejects any token whose edited payload is not re-signed. The tester holds one valid token. Which approach BEST forges an admin token?

    Show the answer

    Correct answerA. Recover the signing secret offline with a wordlist, then re-sign

    AWhy this is right: HS256 is symmetric, so a weak secret can be cracked offline from one token and then used to sign any claims.

    BWhy not this: Algorithm confusion relies on a server using RS256 with a public key; this token is HS256 and has none.

    CWhy not this: The server verifies the signature, so changed claims with the old signature are rejected.

    DWhy not this: Replaying the token only impersonates its owner; it cannot produce admin claims.

    HS256 uses a shared secret, so a weak secret can be guessed offline against the captured token. Once recovered, the tester can sign any claims. Algorithm confusion needs an asymmetric scheme with a public key, which this token does not use.

    Open this question
  6. Question 56

    Attacks and Exploits

    During an authorized test, a tester wants to forge JWTs carrying arbitrary claims that the API accepts. Which three server behaviors would allow this? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersB. Server fetches verification keys from a jku URL supplied in the token headerE. Server uses the kid header to select a key file without sanitizing itF. Server accepts tokens whose alg header is set to none

    AWhy not this: Header transport affects CSRF exposure and has no bearing on forging a signature.

    BWhy this is right: A token-supplied jku lets the tester host their own key set and sign with the matching private key.

    CWhy not this: Base64URL encoding makes claims readable, which is disclosure, but it does not let a tester produce a valid signature.

    DWhy not this: A short lifetime limits replay and does not help forge claims.

    EWhy this is right: An unsanitized kid can point to a file or record with known content, which the tester then uses as the signing key.

    FWhy this is right: With alg none the server skips signature verification, so any edited claims are accepted.

    Accepting alg none removes signature checking, trusting a token-supplied jku lets the tester host their own key, and an unsanitized kid lets the tester point to a key whose content they know. Readable payloads only disclose data; they do not allow forging.

    Open this question
  7. Question 57

    Attacks and Exploits

    A PHP page includes the file named in its page parameter. Including config.php returns a blank page because the server executes it. Which technique BEST reveals its source code?

    Show the answer

    Correct answerB. Include config.php through the php://filter base64 wrapper

    AWhy not this: The data wrapper executes embedded code and needs allow_url_include; it does not disclose config.php.

    BWhy this is right: The filter wrapper base64-encodes the file before inclusion, so PHP output is text and not executed.

    CWhy not this: Log poisoning aims to run injected code, not to read a file's source, and it needs a writable, readable log.

    DWhy not this: A remote URL is RFI; it fetches the tester's file and cannot expose the target's config.php source.

    The php://filter wrapper with a base64 conversion returns the file as encoded text, so the PHP is never executed and the source can be decoded. The data wrapper runs supplied code instead of reading the file, so it does not reveal the source.

    Open this question
  8. Question 58

    Attacks and Exploits

    A product search page prints the matching database rows in an HTML table, and a stray quote in the search value triggers a SQL syntax error. The tester wants usernames from a different table shown in that table. Which technique is BEST?

    Show the answer

    Correct answerA. UNION query matching the original column count

    AWhy this is right: UNION appends rows from another table to the visible results, provided the column count and types match.

    BWhy not this: Boolean-based extraction infers data from page differences, which is needless when results are displayed.

    CWhy not this: Time-based extraction is a blind technique, slow and unnecessary when query output is already displayed.

    DWhy not this: A shell separator targets OS command injection, not a SQL query.

    Because query results are printed on the page, a UNION query that matches the original column count can append rows from another table to the output. Blind techniques (time-based, boolean) extract data one bit at a time and are only needed when no output is shown.

    Open this question
  9. Question 59

    Attacks and Exploits

    A report finds an insecure direct object reference on /api/orders/{id}. Which fix BEST addresses it?

    Show the answer

    Correct answerA. Verify the requester is authorized for the requested object

    AWhy this is right: An ownership or permission check on each requested object removes the flaw.

    BWhy not this: Anti-CSRF tokens stop forged requests and do not check whether the user may access the object.

    CWhy not this: Parameterized queries block SQL injection, but the lookup can still return another user's order.

    DWhy not this: Output encoding counters cross-site scripting and does not control access to records.

    IDOR exists because the server returns an object without checking that the requester may access it, so a server-side authorization check on every request fixes it. Parameterized queries stop SQL injection but do not decide who may see a record.

    Open this question
  10. Question 60

    Attacks and Exploits

    A tester's template expression in a profile field is evaluated in the server's HTTP response, and an error page names the Jinja2 engine. Which next step BEST determines the impact?

    Show the answer

    Correct answerC. Switch to Jinja2-specific syntax and probe for code execution

    AWhy not this: The value goes to the template engine, not to a shell, so a separator has no effect on the injection point.

    BWhy not this: A script tag tests browser-side execution, but this expression was evaluated on the server.

    CWhy this is right: Template payloads are engine-specific, so Jinja2 syntax is used to test for server-side code execution.

    DWhy not this: No serialized object is involved; the evaluated expression points to the template, not deserialization.

    The input is evaluated by the server-side template engine, so the next step is engine-specific syntax that probes for access to server objects and code execution. A shell separator is tempting, but the input reaches the template engine, not an OS shell.

    Open this question
  11. Question 61

    Attacks and Exploits

    A tester reports stored cross-site scripting in the comment field of a client's web app. Which four recommendations would reduce the risk? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersA. Encode output for the HTML context where it is renderedB. Set the HttpOnly flag on session cookiesC. Deploy a restrictive Content Security PolicyF. Validate input against an allowlist of expected characters

    AWhy this is right: Context-aware output encoding makes injected markup display as text instead of executing.

    BWhy this is right: HttpOnly stops injected script from reading the session cookie, limiting the damage.

    CWhy this is right: A restrictive CSP blocks inline and untrusted scripts from executing in the browser.

    DWhy not this: Anti-CSRF tokens counter forged requests, and injected script on the same site can often read them.

    EWhy not this: Parameterized queries prevent SQL injection and do nothing about script rendered in the browser.

    FWhy this is right: Allowlist validation rejects unexpected characters before they are stored.

    Output encoding, allowlist input validation and a restrictive CSP stop or limit injected script, and HttpOnly keeps scripts from reading session cookies. Parameterized queries address SQL injection, and anti-CSRF tokens address forged requests; neither stops script from running in the browser.

    Open this question
  12. Question 62

    Attacks and Exploits

    A web form passes a host value to an OS utility. A filter rejects semicolons and ampersands in the value. Which input approach BEST still chains an extra command?

    Show the answer

    Correct answerB. Use a pipe or newline as the separator

    AWhy not this: Traversal sequences change which file is reached; they do not make the shell run another command.

    BWhy this is right: Pipe and newline are other shell metacharacters that chain commands, so a short blocklist misses them.

    CWhy not this: A template expression is evaluated by a template engine, not by the OS shell running the utility.

    DWhy not this: Quote-and-UNION syntax targets a SQL query, but this value goes to an OS utility.

    The shell accepts several metacharacters that join or separate commands, including the pipe and the newline, so a filter blocking only semicolons and ampersands leaves other separators open. Traversal sequences only change file paths and do not chain commands.

    Open this question
  13. Question 63

    Attacks and Exploits

    A host's antivirus uses signature-based detection and quarantines the tester's well-known tool on disk. Which approaches would circumvent it? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Pack and encrypt the payload with a custom packerB. Load the tool reflectively so it runs only in memoryE. Recompile the tool after changing its strings and structure

    AWhy this is right: Packing and encryption change the file's bytes so known signatures no longer match.

    BWhy this is right: Running only in memory avoids writing a file for the on-disk scanner to match.

    CWhy not this: Signatures match file content, not the file name, so a renamed copy is still detected and quarantined.

    DWhy not this: Log clearing removes records after the fact and does nothing to stop the scanner from matching and quarantining the tool.

    EWhy this is right: Changing strings and structure produces a build that no longer matches known signatures.

    Signature scanners match known file content, so packing, in-memory execution and modified builds avoid a match. Clearing the Security log removes event records but does not stop the antivirus from scanning and quarantining the tool. Renaming the file changes none of its content, so the signature still matches.

    Open this question
  14. Question 64

    Attacks and Exploits

    A tester with local administrator rights on a Windows workstation needs hashes of recently logged-on users. Which action fits?

    Show the answer

    Correct answerD. Dump the memory of lsass.exe

    AWhy not this: Clearing the log erases evidence and returns no hashes.

    BWhy not this: Hollowing is a code-hiding technique and does not collect any stored credentials.

    CWhy not this: Kiosk escape breaks out of a restricted interface; this tester already has administrator access.

    DWhy this is right: The LSASS process keeps credentials of logged-on users in memory, and an administrator can read them.

    LSASS holds credential material for logged-on users in memory, and an administrator can read it to extract hashes. Process hollowing only hides code inside another process and does not collect credentials.

    Open this question
  15. Question 65

    Attacks and Exploits

    An authorized tester has a shell as an IIS application pool identity on a Windows server, and whoami /priv shows SeImpersonatePrivilege enabled. What is the most direct route to SYSTEM?

    Show the answer

    Correct answerC. Abuse the privilege with a token-impersonation exploit

    AWhy not this: Reading LSASS memory needs administrator or debug rights, which this low-privileged service identity does not have.

    BWhy not this: Hollowing hides code in a process; creating or altering a SYSTEM process already requires rights the tester lacks.

    CWhy this is right: Service accounts holding this privilege can impersonate a SYSTEM token obtained from a coerced connection, giving direct escalation.

    DWhy not this: No vulnerable service path is described, and writing into protected folders needs rights this identity lacks.

    SeImpersonatePrivilege lets a service account impersonate tokens of clients that connect to it, so a token-impersonation exploit can trick a SYSTEM client into connecting and yield a SYSTEM token. LSASS dumping needs administrator or debug rights the app pool identity lacks.

    Open this question
  16. Question 66

    Attacks and Exploits

    A standard-user tester on a Windows workstation finds the Windows Installer policy "Always install with elevated privileges" enabled for both the machine and the user. Which action exploits this?

    Show the answer

    Correct answerA. Run an attacker-built MSI package, which installs as SYSTEM

    AWhy this is right: With the policy enabled in both locations, MSI packages run elevated, so a crafted package executes as SYSTEM.

    BWhy not this: Injecting into a SYSTEM service needs rights the standard user lacks, and the policy setting is not involved.

    CWhy not this: The tester already has a shell; the finding concerns installer privileges, not an interface restriction.

    DWhy not this: Reading LSASS memory needs administrator or debug rights, which a standard user lacks.

    With AlwaysInstallElevated set in both policy locations, any user's MSI package installs with SYSTEM privileges, so a crafted package runs attacker actions as SYSTEM. LSASS dumping needs administrator rights the standard user does not have.

    Open this question
  17. Question 67

    Attacks and Exploits

    An authorized tester's custom payload is flagged by the client's signature-based endpoint scanner when it is written to disk. Which four techniques change what the scanner sees while keeping the payload's behavior? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersA. Encoding the script content and decoding it only when it runsB. Packing the executable with a crypter that unpacks it at launchD. Encrypting the payload body and decrypting it in memory at run timeF. Renaming variables, splitting strings, and inserting junk code

    AWhy this is right: Encoded content hides recognizable strings from static scanning and is decoded at execution.

    BWhy this is right: A packer or crypter replaces the file's visible content with a wrapper that unpacks at launch.

    CWhy not this: Timestomping alters file metadata that a content signature ignores, so the payload's bytes still match.

    DWhy this is right: The stored bytes are ciphertext with no known signature, and the real code appears only in memory.

    EWhy not this: This is log tampering. It erases evidence afterward and leaves the scanned payload unchanged.

    FWhy this is right: Altered names, split strings and junk code break the static strings and patterns a signature matches.

    Encryption, packing, code-level obfuscation and encoding all change the bytes or strings a static signature matches while the payload still does the same job. Truncating the Security log is log tampering: it hides activity after the fact and does nothing to the file the scanner inspects. Timestomping changes only file metadata, so the scanned bytes still match.

    Open this question
  18. Question 68

    Attacks and Exploits

    An authorized tester has a restricted shell on a Linux host, and the account may run a text editor as root through sudo. What is the best way to gain a root shell?

    Show the answer

    Correct answerC. Spawn a shell from inside the editor, which runs as root

    AWhy not this: Restricted shells block setting variables, and sudo normally resets the environment, so preloading fails.

    BWhy not this: A low-privileged account cannot read root's hashes from memory, so this does not work.

    CWhy this is right: The editor's built-in shell feature breaks out of the restriction, and the child shell inherits root.

    DWhy not this: Hollowing a process needs code execution first, and the restricted shell does not allow it.

    Many editors can launch a shell from within themselves. Because sudo runs the editor as root, the spawned shell is a root shell and also leaves the restricted shell behind. Library injection needs environment control that a restricted shell and sudo typically deny.

    Open this question
  19. Question 69

    Attacks and Exploits

    An authorized tester faces a lobby kiosk that runs one full-screen application and blocks Task Manager and Windows-key shortcuts. The application's Print command opens the standard Windows print dialog. What is the best way to reach the operating system?

    Show the answer

    Correct answerB. Use the dialog's file browser to open a command prompt

    AWhy not this: A kiosk presents a locked GUI, not a restricted command shell, so there is no editor or shell to escape from.

    BWhy this is right: Common dialogs expose file browsing, which lets the tester launch a command prompt or Explorer outside the kiosk app.

    CWhy not this: UAC bypass elevates an existing session. The tester's problem is lack of any shell, not elevation.

    DWhy not this: Injection requires code already running on the host, which the tester does not yet have.

    A kiosk escape uses the application's own interface features, such as standard dialogs, to reach the file system and launch a shell or Explorer. A shell escape applies only when a command shell or interpreter already exists, which a GUI-only kiosk does not provide.

    Open this question
  20. Question 70

    Attacks and Exploits

    An authorized tester's shell runs as a member of the local Administrators group but in a medium-integrity process, so privileged actions fail. No credentials are available and no one is at the console to approve a prompt. Which approach best obtains an elevated token?

    Show the answer

    Correct answerC. Abusing an auto-elevating Windows binary to bypass UAC

    AWhy not this: This needs a writable path and a service restart, and it is not a way to elevate this admin session.

    BWhy not this: Reading LSASS needs elevated privileges the shell lacks, so this cannot be the way to get them.

    CWhy this is right: Auto-elevating binaries run elevated without a prompt, so abusing one yields a high-integrity token for this admin.

    DWhy not this: A hollowed process launched from this shell inherits the same medium-integrity token.

    The account is already an administrator, but UAC filters its token. A UAC bypass that abuses an auto-elevating built-in binary gets a high-integrity process without a prompt. Credential dumping from LSASS itself needs elevated rights, so it does not solve the problem.

    Open this question
  21. Question 71

    Attacks and Exploits

    A tester without administrator rights cannot run a .ps1 file on a compromised workstation because the execution policy is Restricted. What is the BEST way forward?

    Show the answer

    Correct answerD. Start a new PowerShell process with the policy bypassed for that session only

    AWhy not this: Editing the machine-wide setting in HKLM needs administrator rights, which the tester lacks.

    BWhy not this: ISE applies the same execution policy as the console, so the script is still blocked.

    CWhy not this: PsExec only starts a process; powershell.exe launched through it still enforces the policy.

    DWhy this is right: A per-process override of the policy needs no admin rights and leaves the system configuration unchanged.

    Execution policy is a safety setting, not a security boundary. A new PowerShell process can be started with the policy overridden for that process alone, and this needs no administrator rights. ISE is tempting, but it enforces the same policy.

    Open this question
  22. Question 72

    Attacks and Exploits

    During an authorized test, a client's SOC sees a service named PSEXESVC installed on a server right after a file was written to its ADMIN$ share. Which tool did the tester most likely use?

    Show the answer

    Correct answerD. PsExec

    AWhy not this: Rubeus works with Kerberos tickets and does not execute commands through a remote service.

    BWhy not this: Seatbelt only reads host configuration and does not install services or write to remote shares.

    CWhy not this: Evil-WinRM works over WinRM and does not copy a binary to ADMIN$ or create a PSEXESVC service.

    DWhy this is right: PsExec drops its service binary in ADMIN$ and creates the PSEXESVC service, which matches both artifacts.

    PsExec copies its service executable to the ADMIN$ share over SMB and installs the temporary PSEXESVC service to run commands remotely. Evil-WinRM is tempting as a remote shell, but it uses the WinRM service and leaves no PSEXESVC service.

    Open this question
  23. Question 73

    Attacks and Exploits

    Which default TCP port does Evil-WinRM connect to on a target for the HTTP-based WinRM listener?

    Show the answer

    Correct answerC. 5985

    AWhy not this: TCP 445 is SMB, the transport PsExec relies on, not WinRM.

    BWhy not this: TCP 5986 is the WinRM HTTPS listener, used only when SSL is requested.

    CWhy this is right: TCP 5985 is the default WinRM HTTP listener port that Evil-WinRM uses.

    DWhy not this: TCP 3389 is RDP, which gives a graphical session rather than a WinRM shell.

    Evil-WinRM talks to the Windows Remote Management service, whose HTTP listener uses TCP 5985 by default. Port 5986 is the HTTPS listener, which Evil-WinRM only uses when SSL is requested.

    Open this question
  24. Question 74

    Attacks and Exploits

    The EDR flags every unsigned tool a tester uploads to a Windows host. The tester switches to using only signed Microsoft binaries already installed on it. Which technique is this?

    Show the answer

    Correct answerC. Living off the land

    AWhy not this: Library injection forces a trusted application to load an attacker DLL, which still needs a payload.

    BWhy not this: Credential dumping extracts secrets from memory or files; it describes a goal, not this approach.

    CWhy this is right: Reusing signed binaries already present on the host is the definition of living off the land.

    DWhy not this: Process hollowing swaps a suspended process's memory for malicious code; it is not about native binaries.

    Living off the land means abusing legitimate, signed binaries already on the system, so no unknown tool is introduced and activity blends in with normal administration. Process hollowing is tempting, but it replaces the code inside a suspended process rather than reusing built-in binaries.

    Open this question
  25. Question 75

    Attacks and Exploits

    During an authorized test, EDR flags a svchost.exe process that the tester's loader started. Which four observations are consistent with process hollowing? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersB. The thread's entry point was changed before the process was resumedC. The original image's memory was unmapped or overwritten with the payloadD. Process listings still show the legitimate binary's name and pathF. The process was created in a suspended state before running any code

    AWhy not this: That describes library injection into a running process; hollowing replaces a new process's image instead.

    BWhy this is right: The entry point is redirected to the payload so resuming the thread runs it, not the original code.

    CWhy this is right: The legitimate image is unmapped or overwritten so the payload runs in its place.

    DWhy this is right: The process was created from the trusted file, so its name and path on disk still look legitimate.

    EWhy not this: That describes unquoted service path planting, a file-placement attack, not memory replacement.

    FWhy this is right: The process is started suspended so its image can be replaced before any legitimate code executes.

    Hollowing starts a legitimate process suspended, replaces its image in memory, redirects the entry point and resumes it, so listings still show the trusted name and path. Mapping a DLL into a running process is library injection, a different technique.

    Open this question
  26. Question 76

    Attacks and Exploits

    Service queries show four binary paths, and the tester can write only to the root of C:\. Which service is open to unquoted service path injection?

    Show the answer

    Correct answerB. C:\Program Files\Vendor App\svc.exe

    AWhy not this: The only space follows the executable and begins its arguments, so Windows runs the real binary.

    BWhy this is right: No quotes and a space in a folder name make Windows try C:\Program.exe first, which the tester can plant.

    CWhy not this: Quotation marks make Windows read the whole path as one file, so no earlier name is tried.

    DWhy not this: With no spaces in the path, Windows has only one possible file to run, so nothing can be planted.

    The unquoted path contains a space, so Windows first tries C:\Program.exe, a location the tester can write to. Quotation marks make Windows treat the whole path as one file, so the quoted version is not exploitable.

    Open this question
  27. Question 77

    Attacks and Exploits

    Which Linux environment variable makes the dynamic loader load a tester's shared library before a program's normal libraries?

    Show the answer

    Correct answerC. LD_PRELOAD

    AWhy not this: It sets the directories searched for commands, not which shared libraries a program loads.

    BWhy not this: It controls where shell history is saved, which relates to log tampering, not library loading.

    CWhy this is right: It tells the dynamic loader to load the listed libraries first, so their code runs inside the program.

    DWhy not this: It sets the shell's field separator, which some shell escapes abuse, but it loads no libraries.

    LD_PRELOAD lists shared libraries the dynamic loader maps first, so the tester's code runs inside the target program. PATH only sets where commands are searched for; it does not make a running program load a library.

    Open this question
  28. Question 78

    Attacks and Exploits

    A tester with a non-root shell on a Linux host wants this session's typed commands left out of the user's saved shell history. Which action does that?

    Show the answer

    Correct answerD. Unset the shell's history file variable before exiting

    AWhy not this: Altering timestamps hides when the file changed but leaves the recorded commands in it.

    BWhy not this: Stopping rsyslog needs root and only halts system logging; shell history is written by the shell.

    CWhy not this: The auth log is a system log needing root and holds no record of the user's typed commands.

    DWhy this is right: With the history file variable unset, the shell has no file to save the session's commands to.

    With no history file defined, the shell writes nothing to disk at exit, so the session's commands are not saved. Truncating the auth log or stopping rsyslog needs root and does not touch the per-user history file.

    Open this question
  29. Question 79

    Attacks and Exploits

    A tester has local administrator credentials for a remote server where WinRM is disabled. The tester needs a command shell running as the SYSTEM account, not as the supplied account. Which tool fits?

    Show the answer

    Correct answerC. PsExec

    AWhy not this: Evil-WinRM depends on WinRM, which is disabled, and runs as the supplied user.

    BWhy not this: Mimikatz extracts credentials; it is not a remote shell tool.

    CWhy this is right: PsExec works over SMB with admin rights and can run the shell as SYSTEM.

    DWhy not this: Seatbelt only enumerates host information and opens no remote shell.

    PsExec uses SMB and the ADMIN$ share to install a temporary service, and it can start the remote process under the SYSTEM account. Evil-WinRM needs WinRM and gives a shell as the authenticating user.

    Open this question
  30. Question 80

    Attacks and Exploits

    Application control on a host permits only Microsoft-signed software that ships with Windows. Which binary could a tester use to proxy the execution of code?

    Show the answer

    Correct answerD. regsvr32.exe

    AWhy not this: Mimikatz is a third-party tool that is not part of Windows and would be blocked.

    BWhy not this: Seatbelt is an uploaded enumeration tool, not a binary that ships with Windows.

    CWhy not this: Rubeus is an uploaded third-party tool, not a signed binary that ships with Windows.

    DWhy this is right: regsvr32.exe is signed, built in and can run code, which makes it a LOLBin.

    regsvr32.exe is a signed binary built into Windows that can load and run scriptlets or DLLs, so it is a LOLBin. Mimikatz, Rubeus and Seatbelt are third-party tools that are not installed by default and would be blocked.

    Open this question
  31. Question 81

    Attacks and Exploits

    A tester has a user's NTLM hash and WinRM is open on the target. Which tool opens a remote shell using that hash?

    Show the answer

    Correct answerA. Evil-WinRM

    AWhy this is right: Evil-WinRM accepts an NTLM hash and returns a remote PowerShell shell over WinRM.

    BWhy not this: Certify enumerates certificate templates and authorities in AD CS.

    CWhy not this: Mimikatz extracts hashes from a host; it does not provide a WinRM shell.

    DWhy not this: Rubeus handles Kerberos tickets; it is not a remote shell tool.

    Evil-WinRM can authenticate to WinRM with a password or an NTLM hash, giving a pass-the-hash shell from a Linux machine. Rubeus works with Kerberos tickets and does not open a WinRM shell.

    Open this question
  32. Question 82

    Attacks and Exploits

    On a compromised host, the EDR scans every file written to disk, but the tester has a PowerShell prompt and a script on the tester's own web server. How can the tester run the script without writing it to disk?

    Show the answer

    Correct answerA. Load the script text into memory and run it with Invoke-Expression

    AWhy this is right: Invoke-Expression runs a string held in memory, so no script file touches disk.

    BWhy not this: Copying to ADMIN$ writes a file to disk, and PsExec adds a service artifact.

    CWhy not this: Saving and opening the file writes it to disk, which is what the EDR scans.

    DWhy not this: ISE is an editor; saving a copy still creates a file on disk.

    PowerShell can fetch script text from a web server into a string and pass it to Invoke-Expression, so the code runs in memory and no script file is created. Saving a copy in ISE still writes a file that the EDR can scan.

    Open this question
  33. Question 83

    Attacks and Exploits

    Four services have unquoted paths containing spaces, and the tester can write to a folder in each path. Which service is the best target for privilege escalation?

    Show the answer

    Correct answerA. Backup Agent, running as LocalSystem

    AWhy this is right: The planted binary runs as LocalSystem, the most privileged local account, giving full control of the host.

    BWhy not this: A payload running as the tester's own account gives no privilege gain.

    CWhy not this: LocalService has minimal local rights, so a payload in this service gains little.

    DWhy not this: NetworkService has limited local privileges, so it is a weaker target than LocalSystem.

    A hijacked service binary runs in the service's account, so the LocalSystem service gives the highest privileges. The service running as the tester's own account adds nothing, and the other two accounts have limited rights.

    Open this question
  34. Question 84

    Attacks and Exploits

    A tester's loader starts a signed Windows binary suspended, replaces its mapped image with a payload, and resumes it. The file on disk is untouched. Which defender check most reliably exposes this?

    Show the answer

    Correct answerB. Comparing the process's in-memory image with its file on disk

    AWhy not this: The disk file is still the genuine signed binary, so its signature validates and hides the hollowing.

    BWhy this is right: Hollowed memory differs from its backing file, so an image-to-disk comparison reveals the swapped code.

    CWhy not this: The unmodified file hashes to the known-good value, so a hash check passes even though memory was replaced.

    DWhy not this: No DLL is loaded in hollowing, so a DLL-signing policy never comes into play.

    Hollowing swaps the code in memory while the backing file stays genuine, so only a comparison of the running image with the on-disk file shows the mismatch. Signature and hash checks inspect the unchanged file and pass.

    Open this question
  35. Question 85

    Attacks and Exploits

    A tester with local administrator rights wants a Windows host to stop recording further logon and process events, without wiping existing history. Which action fits?

    Show the answer

    Correct answerB. Disable the relevant audit policy subcategories

    AWhy not this: Encoding the payload only alters what a scanner sees; the host still logs the activity.

    BWhy this is right: Disabling auditing stops new logon and process events from being written and leaves earlier records intact.

    CWhy not this: Injection hides code inside another process but does not stop the host from auditing events.

    DWhy not this: Clearing the log deletes all existing history, which the tester wants to avoid, and it leaves a clearing event.

    Turning off the audit policy subcategories stops new events from being generated while leaving existing records in place. Clearing the log would wipe the history, which the stem rules out.

    Open this question
  36. Question 86

    Attacks and Exploits

    What is the main advantage of library injection for an authorized tester?

    Show the answer

    Correct answerB. The code runs inside a trusted process, with that process's rights

    AWhy not this: Removing log entries is log tampering; loading a library into a process does not alter any logs.

    BWhy this is right: A loaded library executes inside the host process, so it inherits that process's identity, privileges and trusted name.

    CWhy not this: Reading hashes from memory is credential dumping; library injection only gets code running inside a process.

    DWhy not this: Escaping a restricted application is a shell or kiosk escape, not a result of loading a library.

    Library injection gets a target process to load the tester's library, so the code runs in that process's context with its privileges and under its name. It does not erase logs; that is log tampering, a separate activity.

    Open this question
  37. Question 87

    Attacks and Exploits

    A tester wants every generated copy of a payload to have different bytes, so no single signature matches all copies, while the behavior stays the same. Which approach fits?

    Show the answer

    Correct answerA. Polymorphic encoding

    AWhy this is right: Each copy is re-encoded differently, so no fixed byte signature matches every copy.

    BWhy not this: It places code inside a legitimate process; the payload's bytes stay the same.

    CWhy not this: It removes or alters records after the fact; it does not change what a scanner sees.

    DWhy not this: It makes a program load the tester's library; it does not alter payload bytes.

    Polymorphic encoding rewrites the payload with a different encoding each time, so its bytes change but its function does not, defeating fixed signatures. Process hollowing hides code inside another process but does not change the payload's bytes.

    Open this question
  38. Question 88

    Attacks and Exploits

    A tester's SSH account uses a restricted bash that blocks slashes in commands and changes to PATH, but the server allows remote command execution at login. Which approach best escapes the restriction?

    Show the answer

    Correct answerA. Request an unrestricted shell as the SSH remote command so it runs instead of the login shell

    AWhy this is right: The bare shell name has no slash, so it is allowed and starts a shell without the restrictions.

    BWhy not this: This is a kiosk-style escape; an SSH text session has no graphical application or dialog.

    CWhy not this: History contents do not control the restrictions; this confuses log tampering with escaping.

    DWhy not this: The stem says PATH changes are blocked, so this is exactly what the restricted shell prevents.

    The restriction applies to the interactive restricted shell. Asking SSH to run a plain shell name as the remote command starts an unrestricted shell, which is a shell escape. Changing PATH is exactly what the restriction blocks.

    Open this question
  39. Question 89

    Attacks and Exploits

    A tester's shell runs as a standard user with no membership in the local Administrators group, and default UAC settings are on. An auto-elevating UAC bypass fails. What is the best conclusion?

    Show the answer

    Correct answerC. UAC bypass only elevates an administrator's token, so another escalation vector is needed

    AWhy not this: A bypass does not use a hash; it abuses auto-elevation for an administrator's own token.

    BWhy not this: Obfuscation changes detection by scanners, not whether the account is allowed to elevate.

    CWhy this is right: UAC bypass skips the consent prompt for administrators; it grants no rights to a standard account.

    DWhy not this: A standard user cannot normally inject into an elevated process, and that would not hand over a token.

    A UAC bypass only moves an account that is already an administrator from a medium-integrity to a high-integrity token without a prompt. A standard user needs a different privilege escalation path. Obfuscation affects detection, not whether the account may elevate.

    Open this question
  40. Question 90

    Attacks and Exploits

    An authorized tester's PowerShell payload is Base64-encoded and split into concatenated strings, and the client's signature-based scanner no longer flags the file. Which four controls could still detect it once it runs? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersA. AMSI inspection of the script content after the interpreter decodes itC. Script block logging that records the deobfuscated codeD. EDR behavioral rules on the process's API calls and child processesE. Network monitoring of the beacon's traffic pattern to the command-and-control host

    AWhy this is right: AMSI scans the script after it is decoded in memory, so the encoding does not hide it.

    BWhy not this: The obfuscated file has a different hash and different bytes, so the original's entry never matches.

    CWhy this is right: Script block logging records the code after deobfuscation, exposing the real commands.

    DWhy this is right: Behavior such as API calls and child processes stays the same however the payload is written.

    EWhy this is right: The beacon's network traffic is unchanged by how the payload file was obfuscated.

    FWhy not this: The file on disk holds only encoded, split strings, so a rule for the original plain text never matches it.

    Obfuscation changes how a payload looks on disk, not what it does. AMSI and script block logging see the decoded code, EDR sees the behavior, and network monitoring sees the beacon. A hash entry for the original file fails because the obfuscated file has different bytes. An on-disk rule for the original plain-text strings fails for the same reason.

    Open this question
  41. Question 91

    Attacks and Exploits

    A kiosk runs one full-screen application with Task Manager, the Windows key and Alt+Tab disabled. The application has no menus, and the tester has only the attached keyboard. What is the best way to reach the OS?

    Show the answer

    Correct answerB. Press Shift five times to trigger the Sticky Keys prompt and open its settings link

    AWhy not this: The stem says the application has no menus, so there is no Save As dialog to open.

    BWhy this is right: The accessibility shortcut works at the OS level and its link leads out of the kiosk application.

    CWhy not this: Dumping LSASS needs code execution and does not leave the kiosk application.

    DWhy not this: Library injection needs code already running on the host; a keyboard alone cannot do it.

    The Sticky Keys shortcut is an operating system accessibility feature that the kiosk lockdown often leaves active, and its settings link opens a system window to pivot from. With no menus, no Save As dialog is available. Injection and dumping need code execution the tester does not have yet.

    Open this question
  42. Question 92

    Attacks and Exploits

    A tester's PowerShell payload runs only in memory, yet Defender blocks it before it executes. Which Windows interface most likely passed the script content to Defender for scanning?

    Show the answer

    Correct answerD. AMSI

    AWhy not this: UAC controls elevation prompts and has no role in scanning scripts.

    BWhy not this: ETW provides event telemetry for monitoring; it does not pass content to an engine to block it.

    CWhy not this: SmartScreen checks downloaded files and URLs by reputation, not in-memory script content.

    DWhy this is right: AMSI submits script content to the antimalware engine at runtime, so fileless scripts are still scanned.

    The Antimalware Scan Interface lets the scripting engine hand script content to the installed antimalware product at runtime, so in-memory scripts are inspected and blocked. ETW only emits telemetry events for defenders and does not scan content to block it.

    Open this question
  43. Question 93

    Attacks and Exploits

    A standard user on a Linux host finds a root-owned cron job that runs /opt/backup.sh every minute. The script file is world-writable. What is the best way to gain root?

    Show the answer

    Correct answerD. Append a command to the writable script so root's next scheduled run executes it

    AWhy not this: /etc/shadow is readable only by root, so a standard user cannot get the hashes this way.

    BWhy not this: LD_PRELOAD applies only to programs launched from that shell; the running root cron daemon is unaffected.

    CWhy not this: A standard user cannot attach to or hollow a root-owned process; the operating system blocks it.

    DWhy this is right: The root job executes the writable script, so tester-added commands run as root at the next scheduled run.

    Cron runs the script as root, so any command added to a file the tester can write runs with root privileges on the next run. LD_PRELOAD only affects processes started from the tester's own environment, so it never reaches the already running cron daemon.

    Open this question
  44. Question 94

    Attacks and Exploits

    A tester has root on a Linux host. Which file holds the hashed local passwords to copy for offline cracking?

    Show the answer

    Correct answerA. /etc/shadow

    AWhy this is right: It stores local account password hashes and is readable only by root, so it is the dump target.

    BWhy not this: It lists accounts and shells, but modern systems keep only a placeholder here, not the hash.

    CWhy not this: It defines who may use sudo and with what rights; it holds no password hashes.

    DWhy not this: It maps group names to members and holds no password hashes.

    /etc/shadow stores the password hashes for local accounts and is readable only by root, so root access lets a tester copy it and crack the hashes offline. /etc/passwd lists accounts but holds only a placeholder in place of the hash on modern systems.

    Open this question
  45. Question 95

    Attacks and Exploits

    A standard user finds a SYSTEM service whose fully quoted binary path points to a file that Authenticated Users can modify. What is the best way to escalate?

    Show the answer

    Correct answerC. Replace the writable service binary with a payload and restart the service

    AWhy not this: A standard user cannot inject into a SYSTEM-owned process without extra privileges.

    BWhy not this: Clearing logs hides activity but does not change what the service runs or escalate privileges.

    CWhy this is right: Weak permissions on the service binary let the tester overwrite it, and the service runs it as SYSTEM.

    DWhy not this: That trick exploits unquoted paths with spaces; the quoted path here blocks it.

    Because users can modify the service executable, swapping in a payload makes the SYSTEM service run it on the next start. Dropping a file at an earlier path segment works only for unquoted paths, and this path is quoted.

    Open this question
  46. Question 96

    Attacks and Exploits

    A tester's compromised account holds directory replication rights in the domain. The tester wants the krbtgt account's hash without running anything on a domain controller. What should the tester use?

    Show the answer

    Correct answerC. Mimikatz, sending a DCSync replication request to a domain controller

    AWhy not this: Kerberoasting yields crackable service-account tickets; it does not return the krbtgt hash.

    BWhy not this: Certify audits AD CS templates and CAs; it does not read domain account hashes.

    CWhy this is right: DCSync uses replication rights to pull account hashes remotely, with nothing executed on the domain controller.

    DWhy not this: PsExec runs code on the domain controller, which the stem forbids, and it does not extract hashes by itself.

    Mimikatz can run DCSync, which impersonates a domain controller and asks another one to replicate account secrets, including the krbtgt hash, over the network. PsExec would put code on the domain controller, which the stem rules out. Kerberoasting does not return the krbtgt hash.

    Open this question
  47. Question 97

    Attacks and Exploits

    A tester on a Windows host wants AS-REP material for accounts that have Kerberos pre-authentication disabled. Which tool does this?

    Show the answer

    Correct answerA. Rubeus

    AWhy this is right: Rubeus has an AS-REP roasting function that requests and formats the crackable response.

    BWhy not this: PsExec runs commands remotely over SMB and has no Kerberos attack function.

    CWhy not this: Seatbelt only enumerates host configuration and does not send Kerberos requests.

    DWhy not this: Mimikatz dumps credentials and manipulates tickets in memory; it is not the usual AS-REP roasting tool.

    Rubeus is a Kerberos toolkit that can request AS-REP responses for accounts without pre-authentication, which are then cracked offline. Mimikatz handles credentials and tickets in memory but is not the usual tool for AS-REP roasting.

    Open this question
  48. Question 98

    Attacks and Exploits

    As a standard domain user, a tester runs Certify and sees a template that Domain Users can enroll in, has the Client Authentication EKU, and lets the enrollee supply the subject alternative name. What does this indicate?

    Show the answer

    Correct answerA. Any enrolling user can get a certificate that authenticates as another account, such as a domain admin

    AWhy this is right: the enrollee-supplied SAN plus Client Authentication lets the requester impersonate any account.

    BWhy not this: Template settings do not expose the CA's private key to domain users.

    CWhy not this: Kerberoasting targets accounts with service principal names, not certificate template settings.

    DWhy not this: The Client Authentication EKU makes the certificate valid for logon, so the template is exploitable.

    A template that allows low-privileged enrollment, client authentication and an enrollee-supplied subject alternative name lets the requester ask for a certificate naming a privileged account, then authenticate with it. The Client Authentication EKU is what makes the certificate usable for logon, so the template is not limited to encryption.

    Open this question
  49. Question 99

    Attacks and Exploits

    On a foothold host, a tester wants to know whether LSA protection and Credential Guard are enabled before choosing a credential-dumping approach. The check must only read configuration. Which tool fits?

    Show the answer

    Correct answerD. Seatbelt, to run its read-only host configuration checks

    AWhy not this: Rubeus works with Kerberos tickets and does not report LSA or Credential Guard settings.

    BWhy not this: Certify targets AD CS templates and CAs, not host credential protections.

    CWhy not this: Mimikatz would attempt the dump itself; that is an attack, not a read-only configuration check.

    DWhy this is right: Seatbelt reports security configuration such as LSA protection and Credential Guard without changing the host.

    Seatbelt runs read-only host survey checks, including LSA protection and Credential Guard settings, so the tester can plan around them without touching credentials. Mimikatz would be the tool to dump credentials, and trying it just to test for protections is not a read-only check.

    Open this question