CompTIA SY0-701 Practice Test 9
Question 80
EDR identifies a signed database service that unexpectedly receives a cross-process memory write followed by creation of a foreign execution thread. File-signature scanning of its original executable is clean. Which detection approach addresses the attacker behavior?
- Whitelisting the original signed database executable without observing what occurs inside the running process
- Allowing any process with the same parent-user identity to open and modify the database service’s memory
- Relying only on regular file-system malware signature scans that never inspect cross-process execution behavior
- Correlating anomalous process-memory access, remote thread creation and resulting network or child-process activity
Explanation
Correct Answer
D:Behavioral EDR can correlate memory-write and remote-thread activity with related processes and communications, exposing injection that no new malware file reveals. Unexpected remote memory writes followed by creation of a thread in a signed database service form a process-injection behavior sequence. Correlating source and target processes, access rights, thread creation and subsequent network or child-process activity can expose malicious code that never changed the original executable. The defender should corroborate benign tooling before containment, but file signing alone is insufficient.
Incorrect Answers
A:An approved original executable can be abused as an injection host, so its static signature alone does not identify malicious in-memory execution. Executable signing can attest that the original database service file came from an expected signer, but it does not prove every instruction executing in that process is legitimate after runtime memory modification. Treating a trusted binary as permanently safe would miss code injected into its address space. Behavioral observation is required for the described sequence.
B:Unrestricted cross-process memory modification creates exactly the injection surface indicated by the unexpected thread and memory events. Allowing arbitrary processes that share a broad user identity to write a sensitive service's memory would expand the opportunity for code injection. Cross-process handle rights and remote thread creation should be restricted and investigated, not authorized by nominal account similarity. The attacker may exploit legitimate process identity to hide activity after injection.
C:File scans may miss malicious bytes written and executed solely in another process’s memory after the clean file was loaded. On-disk signature scanning inspects stored executable content and can miss payloads introduced only into another running process's memory. The signed original file may remain unchanged while the attacker creates a thread to execute injected instructions. Runtime process access, memory events and related connections therefore carry more relevant evidence than another unchanged file hash.
Question 81
A network daemon copies client-controlled bytes into a fixed-length stack buffer without checking length. A crafted request changes return-address metadata. What class of defect is being exploited?
- A risk register missing a business owner
- A VLAN trunk native-tag mismatch
- Buffer overflow caused by writing beyond allocated memory boundaries
- An expired HTTPS certificate causing trust validation failure
Explanation
Correct Answer
C:Writing attacker data beyond the buffer can corrupt adjacent control data and may redirect program execution. The daemon copies attacker-controlled bytes without checking whether they fit in the fixed-size stack buffer. Extra bytes extend beyond the allocated object and can corrupt neighboring stack state, including control-flow metadata such as return addresses. Bounds checks, safe interfaces and memory protections help reduce this class of exploitable implementation error.
Incorrect Answers
A:Governance ownership issues do not cause machine-code stack corruption from unbounded input. A risk register records risk owners, treatments and reviews. Its absence can weaken governance, but cannot physically overwrite a network daemon's stack memory when a crafted client request is processed. The observed change to return-address metadata results from unsafe memory handling, not an administrative recordkeeping gap.
B:VLAN tagging faults alter frame classification and do not explain changes to stack return metadata. A native VLAN mismatch affects how untagged Ethernet frames are classified across a trunk and may break connectivity or create a security problem. It does not explain a service writing past the end of a stack-allocated buffer. The packet content is being copied unsafely by software after reception.
D:Certificate validation concerns encrypted-session identity, not unmanaged memory writes within a daemon. An expired TLS certificate can cause clients to reject a service identity before establishing a trusted connection. It cannot by itself overwrite a stack return address during an oversized buffer copy. The vulnerability exists in application memory management independently of whether a certificate is valid.
Question 82
A privileged service checks permissions on a file path, then reopens the path later. An attacker can replace a symbolic link between those operations. Which engineering change most directly closes the time-of-check/time-of-use gap?
- Add a longer sleep between the access check and file open
- Open the intended object securely and validate and operate on the same file handle rather than re-resolving an attacker-controlled path
- Trust all symbolic links whenever the filename has a familiar approved extension
- Review only the operation log after the protected file has already been modified
Explanation
Correct Answer
B:Keeping the check and action bound to the same securely opened object removes the exploitable substitution between separate path lookups. Open the intended file using appropriate atomic or handle-based APIs, validate its identity and permissions, and perform the privileged operation through that same held handle. This prevents an attacker from substituting a different symlink target between a separate path check and later open. The design must also consider traversal restrictions and platform-specific secure-open semantics rather than assuming a familiar pathname stays unchanged.
Incorrect Answers
A:Increasing the time gap gives the attacker more opportunity to swap the link and does not bind the permission check to the used file object. Inserting a longer delay increases the interval in which an attacker can swap the symbolic link after the permission check. The problem is an unsafe gap between two path resolutions, not a lack of waiting time. A correct fix avoids re-resolving attacker-controlled names for the protected operation.
C:The attacker can change a link target independently of the visible filename or extension, so this does not prevent a protected-file substitution. A file extension is merely part of a name and does not authenticate where a symbolic link points. An attacker can swap a link to a sensitive protected file while retaining an ordinary-looking suffix. Trust must attach to an opened object and authorized handle, not an easily changed display name.
D:Post-event records can support detection but cannot prevent the unauthorized write caused by the path-swap race. Post-operation logs can record what happened, but cannot prevent a privileged service from writing an attacker-selected file after a race. Detective controls matter for incident response yet do not close the TOCTOU vulnerability. The access check and use must be bound to the same object during execution.
Question 83
A vendor publishes a signed maintenance package from its official portal. Forensic analysis finds an unauthorized persistence agent compiled into that package after the vendor's build service was breached. Which TWO statements are defensible? Choose TWO.
- This event must be caused by a wireless channel overlap problem
- A valid release signature is absolute proof that the package contains no malicious code
- The initial compromise may reside in the supplier's software build pipeline
- Downstream customers may be affected despite downloading from the expected update source
- The scenario is impossible because cryptographic signatures prevent any insider build compromise
Explanation
Correct Answers
C:A compromised vendor build or release pipeline can embed attacker content into artifacts trusted by customers. Because the vendor's build service was breached before compilation or packaging, the unauthorized persistence agent could have entered the product in the supplier's own pipeline. Investigators need build logs, approved source revisions, dependency metadata and signing/release records to establish the intrusion point. Downloading from an official portal is not evidence the source-to-artifact chain was secure.
D:Official distribution may propagate the compromised package broadly because buyers reasonably trust their supplier's channel. Customers that install the tainted but validly signed package may execute the malicious persistence agent even when they followed their usual trusted distribution process. The affected trust boundary is the upstream supplier release, so response may span many organizations. Customer exposure and remediation should be determined from installed versions and runtime evidence, not merely the URL used to obtain them.
Incorrect Answers
A:RF interference cannot explain an embedded persistence component present in the software artifact itself. Wireless channel overlap can degrade radio performance, but it cannot account for an unauthorized persistence agent appearing inside a vendor-signed maintenance package. The compromise occurred during software build or release operations, long before clients received the artifact. RF troubleshooting would miss the provenance and distribution risk.
B:Signing proves relationship to a signing key and byte integrity; it does not guarantee that the signer built safe software. A release signature indicates that a key associated with the vendor signed the particular artifact or manifest. It does not prove that the build environment was uncompromised or all included code was harmless. Malware inserted before signing can receive a valid signature and still execute maliciously after customer installation.
E:Attackers can sign malicious releases if they compromise the build or signing workflow or an authorized release process. Cryptographic signatures bind signed content to a signing key; they cannot stop an attacker who already controls a build step from adding malware before signature creation. The scenario is therefore entirely possible without forged signatures. Additional independent provenance, reproducible-build evidence or protected pipeline controls may reveal the earlier compromise.
Question 84
A service operating with a non-administrator account exploits a vulnerable kernel driver and gains full operating-system privileges. Which vulnerability impact is illustrated?
- A volumetric network denial-of-service attack
- Privilege escalation from limited service rights to system-level authority
- An approved certificate revocation operation
- A correctly enforced least-privilege boundary without an exploit
Explanation
Correct Answer
B:The flaw allows a principal with fewer permissions to obtain powers reserved for highly privileged kernel context. The service began as a non-administrator account but exploited a kernel driver defect to acquire system-level rights. That is privilege escalation across a security boundary, not merely normal service execution. Patch vulnerable drivers, restrict unnecessary privileged interfaces and monitor abnormal token or process integrity changes to reduce exposure.
Incorrect Answers
A:Network DoS targets capacity or availability rather than elevating a local service's permissions. A volumetric denial-of-service attack disrupts availability by exhausting network or application capacity. The described exploit instead uses a vulnerable kernel driver to change the privileges of a running service. No traffic flood or bandwidth exhaustion is needed to explain the change in operating-system authority.
C:Certificate revocation concerns trust in credentials and does not explain local kernel-authority takeover. Certificate revocation changes the validity or trust status of an issued credential. It is an administrative or cryptographic control unrelated to exploiting a kernel driver for elevated execution rights. No certificate status action explains how the service gained operating-system privileges outside its original authorization.
D:Effective privilege separation would prevent the service from acquiring unrestricted host control through the driver. Correct least-privilege enforcement would prevent an ordinary service from crossing into protected kernel or system authority without specific permission. The exploit demonstrates that a vulnerable driver undermined the intended boundary. Saying the boundary functioned correctly contradicts the stated escalation outcome.
Question 85
A developer permits users to choose a report sort column. The application concatenates the chosen column name directly into an SQL ORDER BY clause, and ordinary search values are already bound as parameters. What is the correct protection for the dynamic identifier?
- Parameterize the entire SQL table and column grammar as one ordinary text value without application-owned choices
- Escape only apostrophes in the sorting input and permit any untrusted SQL identifier or expression afterward
- Map each permitted sort choice to a fixed, approved SQL identifier in application code and reject arbitrary expressions
- Give the application database-owner privileges so an injected ORDER BY expression can be evaluated correctly
Explanation
Correct Answer
C:An allowlisted choice-to-identifier mapping prevents attacker input from becoming arbitrary SQL syntax even when query values are safely parameterized. Expose a small set of user-facing sort options and translate each to an exact approved column identifier and allowed direction in application code. Reject unknown names or expressions while keeping ordinary query data values bound as parameters. This prevents the untrusted string from controlling SQL grammar even though normal search parameters are already safe.
Incorrect Answers
A:Bound parameters generally represent data values, not unrestricted SQL grammar identifiers. Dynamic query structures must be selected from approved application-owned choices. Parameterized statements bind user-controlled DATA values but generally cannot treat table names, column identifiers or SQL keywords as ordinary placeholders. Passing the entire ORDER BY grammar as one text parameter either fails or sorts by a literal value, not an approved identifier. Structural SQL choices need an application-owned allowlist.
B:Quoting a subset of special characters cannot guarantee that arbitrary sort expressions are valid or safe inside dynamic SQL syntax. Escaping apostrophes alone does not protect SQL grammar when the attacker controls an ORDER BY identifier or expression. Database dialects have other metacharacters, functions and syntax that may remain dangerous. Allowing arbitrary user expressions also creates misuse opportunities, so a fixed mapping of authorized sort choices is preferable to ad hoc escaping.
D:Excessive database rights increase the damage possible from an injection flaw and do not protect a dynamic SQL expression. Database-owner permissions would make any successful injection more damaging by granting the application broad database authority. They do not sanitize a user-selected SQL identifier. The remediation is to limit dynamic grammar through a whitelist and reduce account privileges, rather than increasing database privileges to accommodate a dangerous query.
Question 86
A search endpoint reflects the unescaped q parameter in the returned HTML. A crafted URL causes a visiting browser to run JavaScript. Which vulnerability should developers correct?
- Reflected cross-site scripting through unsafe HTML output encoding
- DOM-based cross-site scripting caused only by a client-side URL-fragment parser
- A SQL privilege grant that allows unauthorized database modification
- Stored cross-site scripting from a persistent saved review record
Explanation
Correct Answer
A:Untrusted input becomes active script when inserted into an HTML response without proper context-specific encoding. In this case a user-supplied query-string value is copied into the immediate server response, so another visitor who follows the crafted link runs the payload. Encode for the specific output context or use safe text rendering; merely checking the input URL does not correct the dangerous HTML sink.
Incorrect Answers
B:A DOM-only variant would require the browser's own script to read and unsafely insert attacker-controlled data such as a fragment, without needing the server to reflect it as executable HTML. Here the question specifies reflection in the returned HTML response, which identifies a server-response injection path rather than a purely client-side sink.
C:The observed execution is in the visitor's browser, not evidence of a direct database privilege alteration. SQL injection would manipulate a database command sent from the application to its data store. Even if the vulnerable search route also queries SQL, the described exploit executes in the visiting browser because unsafe HTML is emitted, with no evidence that database permissions or queries were altered.
D:Stored XSS persists the malicious payload in application data so users can be affected on later page visits independently of reopening the original link. The query parameter in this scenario is reflected immediately rather than saved as a comment, message or user profile record.
Question 87
A product-review comment contains hidden JavaScript. The application stores it, and every later visitor's browser executes it when loading that review. Which THREE statements are accurate? Choose THREE.
- TLS alone guarantees that the browser will not execute script embedded in trusted HTML
- The issue exists only when a SQL UNION query modifies the comments table
- The weakness is stored or persistent cross-site scripting
- Context-appropriate output encoding and safe content sanitization can reduce the risk
- Assume authenticated commenters cannot inject scripts because their account identity is known
- The payload can affect later viewers who did not submit the original comment
Explanation
Correct Answers
C:The script remains in application data and is later served to other users, making the XSS persistent. The payload is saved into the review store and served to separate readers when they load the product page, so new victims do not need the original attacker-crafted URL. This persistent behavior distinguishes the defect from an immediate reflected parameter or a purely client-side fragment sink.
D:Treating user content as data rather than executable markup interrupts the browser code-execution path. When rich text is not needed, render the comment as escaped text so browser parsing cannot turn its characters into markup or event handlers. Where rich HTML is legitimately allowed, use maintained HTML sanitization tailored to permitted tags and attributes, rather than stripping a few suspicious words.
F:When the saved comment is rendered, each viewer's browser may execute the stored active content. Because the page serves the stored comment to every future viewer, the code may execute with each visitor's browser context and the affected site's origin privileges. Investigators should remove the malicious stored data and verify affected render paths, not merely revoke the first poster's login.
Incorrect Answers
A:TLS protects transport but faithfully delivers whatever dangerous HTML the application itself sends. A secure HTTPS connection can transport a malicious stored page without any tampering on the wire. The vulnerability lies in rendering a saved comment as executable content, so transport encryption and valid certificates must be combined with context-safe handling of the comment body.
B:Stored XSS does not require SQL injection; the application can save the comment through a legitimate feature. An application may use parameterized SQL and never permit unauthorized database queries while still saving and displaying unsafe HTML submitted through normal comment forms. The browser execution path is a display-layer injection problem, not necessarily a database-query grammar failure.
E:Authentication does not make submitted HTML or scripts safe. Untrusted comments still need context-aware encoding and validation. A valid login does not prove the sender's content is harmless: authorized accounts can be stolen, abused or simply allowed to submit HTML that has not been validated. Encode or sanitize at the output boundary and maintain authorization separately so a signed-in commenter cannot affect later readers.
Question 88
A server's operating system is fully patched, but its out-of-band management controller runs obsolete firmware and is reachable from a broad administrative subnet. What risk remains?
- Host OS patching automatically updates all embedded management firmware
- A guest-to-hypervisor virtual-machine escape from an application sandbox
- An independent low-level firmware attack surface exists outside the patched operating system
- A hypervisor CPU scheduler defect that only slows guest workloads
Explanation
Correct Answer
C:Out-of-band firmware may expose privileged control despite a fully maintained guest or host operating system. BMC firmware typically has privileged functions such as remote power cycling or remote console access below the installed operating system. Broad access to an unmaintained controller therefore creates a management-plane risk even when conventional OS vulnerability scanners show the operating system as fully patched.
Incorrect Answers
A:Operating-system patches do not necessarily remediate the BMC's independently maintained code and services. Operating-system patching does not necessarily replace the firmware running on an independent baseboard management controller. Such controllers may keep network, power and remote-console services available even when the main host operating system is halted, so firmware lifecycle and management-network isolation need separate review.
B:A hypervisor guest-isolation failure would involve a compromised virtual machine crossing into the host virtualization layer. The scenario instead exposes a distinct physical management controller with its own firmware, network endpoint and privileged hardware-control path, regardless of whether virtualization is deployed.
D:A routine hypervisor scheduling bug might cause resource contention or missed CPU allocations, but it would not explain why a physically separate BMC runs obsolete reachable firmware. The relevant vulnerability boundary here is out-of-band device management rather than guest CPU time allocation.
Question 89
A business-critical switch has reached end of support, and its secure management command set is incompatible with the supported replacement. The migration team plans to copy the old startup configuration byte-for-byte to the new switch. What should be changed in the migration plan?
- Copy every legacy authentication algorithm and default community string unchanged because the new chassis is vendor-supported
- Expose the old management services on the public Internet until the replacement receives its initial configuration
- Translate and review required network behavior under the replacement's supported security baseline, test connectivity, and plan rollback or staged cutover
- Keep the old end-of-life device as a permanent production gateway after its replacement is installed to avoid documenting changes
Explanation
Correct Answer
C:Configuration translation, removal of obsolete insecure defaults, validation and controlled rollback preserve intended traffic behavior without retaining known weaknesses. Map each required VLAN, route, ACL, management authentication and monitoring function to commands supported on the new device. Verify traffic with tests before cutover, retain a recoverable baseline and define a rollback trigger in case the replacement alters forwarding unexpectedly. That preserves intended behavior while retiring insecure or obsolete settings.
Incorrect Answers
A:Unsupported legacy settings can recreate weak authentication and unauthorized management exposure even on newly supported hardware. A replacement device may no longer implement old authentication syntax, and unsupported algorithms or default SNMP community strings are unsafe even if the old configuration parsed successfully. A migration should preserve security intent, not force every command to survive a hardware and software generation change.
B:Additional public reachability during migration increases exposure and does not help preserve secure control-plane compatibility. Placing either device's management plane on the public Internet gives untrusted remote parties additional opportunities to probe unsupported services. Migration should use limited management reachability, validated credentials and a defined maintenance window, not a temporary expansion of network exposure.
D:Keeping unsupported hardware indefinitely retains unpatched risk and defeats the documented replacement objective without a valid technical justification. Keeping an unsupported gateway inline merely increases exposure to unpatched defects and leaves two operational devices to maintain. A temporary, tightly controlled backout arrangement can be justified for cutover, but permanent dependence on end-of-support firmware is not a substitute for a tested replacement.
Question 90
A malicious program running inside a tenant virtual machine obtains execution in the underlying host hypervisor's control process. What vulnerability has been demonstrated?
- A benign live migration that preserves virtual disk state
- Lateral movement over approved virtual networks into a different guest VM
- VM escape across the guest-to-host isolation boundary
- Ordinary guest-to-guest communication on an approved VLAN
Explanation
Correct Answer
C:Execution outside the guest boundary into the host or hypervisor is characteristic of a virtual-machine escape. The decisive evidence is code execution moving from a restricted tenant guest into the privileged virtualization host, giving control beyond the VM's assigned virtual hardware. Patching the hypervisor, limiting guest interfaces and isolating administration are relevant defenses; an ordinary network policy cannot by itself restore a broken hypervisor boundary.
Incorrect Answers
A:Live migration uses hypervisor features to move authorized workloads, not unauthorized access to the host control plane. Live migration is a planned workload-management operation initiated through a hypervisor's authorized control interfaces. It does not grant a guest user execution inside privileged host processes, which is the unauthorized boundary crossing explicitly observed in the scenario.
B:East-west network pivoting can let an attacker compromise other guest systems through allowed virtual networks while staying within guest operating systems. Execution inside the underlying hypervisor control process is a different, stronger break of the guest-to-host isolation boundary.
D:Traffic between VMs through their network interfaces does not prove compromise of the virtualization host itself. Legitimate communication between VMs uses virtual switches and guest network stacks, and it does not permit one tenant's process to alter host virtualization code. Even successful network access to another guest remains categorically different from execution in a hypervisor control service.