CompTIA Security+ · Domain 2 of 5 · 22% of the exam

CompTIA Security+ Domain 2: Threats, Vulnerabilities, and Mitigations

44 free practice questions for Threats, Vulnerabilities, and Mitigations in the CompTIA Security+ (SY0-701) exam. Try each question first, then open "Show answer" for the correct option and explanation.

Threats, Vulnerabilities, and Mitigations practice questions

  1. Question 1. Which threat actor is MOST likely to have large budgets, advanced tools, and long-term espionage goals?

    1. An unskilled attacker
    2. A hacktivist collective
    3. A disgruntled contractor
    4. A nation-state group
    Show answer

    Answer: D. A nation-state group

    Nation-state actors are well funded and pursue strategic, persistent campaigns, often called advanced persistent threats.

  2. Question 2. A group defaces a company's website to protest its environmental record. Which threat actor type is this?

    1. Hacktivist
    2. Organized crime
    3. Nation-state
    4. Shadow IT
    Show answer

    Answer: A. Hacktivist

    Hacktivists are driven by ideology or political causes, and defacement is a common tactic.

  3. Question 3. An employee installs an unapproved cloud file-sharing app to work faster. What is this an example of?

    1. An insider espionage campaign
    2. A supply chain compromise
    3. A watering hole attack
    4. Shadow IT
    Show answer

    Answer: D. Shadow IT

    Shadow IT is technology used without IT approval. It's usually well meant but creates unmanaged risk.

  4. Question 4. Which motivation BEST describes a ransomware gang run like a business?

    1. Political beliefs
    2. Financial gain
    3. Revenge against an employer
    4. Intellectual curiosity
    Show answer

    Answer: B. Financial gain

    Organized crime groups are mainly financially motivated, and ransomware is a direct way to monetize attacks.

  5. Question 5. A user receives a text message claiming a parcel is held and asking them to pay a small fee through a link. What attack is this?

    1. Vishing
    2. Whaling
    3. Pharming
    4. Smishing
    Show answer

    Answer: D. Smishing

    Smishing is phishing over SMS. Vishing uses voice calls, and whaling targets senior executives.

  6. Question 6. An attacker calls the help desk pretending to be a traveling executive who urgently needs a password reset. Which technique is being used?

    1. Typosquatting combined with pharming
    2. A watering hole combined with malvertising
    3. Shoulder surfing combined with tailgating
    4. Pretexting combined with impersonation
    Show answer

    Answer: D. Pretexting combined with impersonation

    Pretexting creates a believable story to get help. Here the attacker also impersonates an authority figure to add urgency.

  7. Question 7. Attackers compromise a trade association website that a target company's engineers visit often. What is this attack called?

    1. Watering hole attack
    2. Spear phishing attack
    3. Business email compromise
    4. Credential stuffing attack
    Show answer

    Answer: A. Watering hole attack

    A watering hole attack infects a site the targets are known to visit, rather than contacting them directly.

  8. Question 8. An attacker registers the domain examp1e.com to catch users who mistype example.com. What is this called?

    1. Domain hijacking
    2. Typosquatting
    3. DNS poisoning
    4. Session hijacking
    Show answer

    Answer: B. Typosquatting

    Typosquatting relies on common typing mistakes or look-alike characters to lure users to a malicious site.

  9. Question 9. Finance receives an email from a real supplier's compromised mailbox asking to change bank details for future invoices. What attack is this?

    1. Brand impersonation
    2. A watering hole attack
    3. Business email compromise
    4. A smishing campaign
    Show answer

    Answer: C. Business email compromise

    BEC abuses a trusted or compromised business email account to redirect payments. Verifying changes out of band is the key control.

  10. Question 10. Which vulnerability occurs when a program writes more data to a memory buffer than it can hold?

    1. Race condition
    2. Memory leak
    3. Integer rounding
    4. Buffer overflow
    Show answer

    Answer: D. Buffer overflow

    A buffer overflow overwrites adjacent memory and can let an attacker change program flow or run code.

  11. Question 11. A program checks that a file is safe and then opens it, but an attacker swaps the file between the check and the use. What is this vulnerability?

    1. Time-of-check to time-of-use (TOCTOU) race condition
    2. Directory traversal through a crafted path
    3. Integer overflow in the file size field
    4. Cross-site request forgery on the upload form
    Show answer

    Answer: A. Time-of-check to time-of-use (TOCTOU) race condition

    TOCTOU is a race condition where the state changes between checking a resource and using it.

  12. Question 12. A web form passes user input directly into a database query, and entering ' OR 1=1 -- returns every record. Which vulnerability is this?

    1. SQL injection
    2. Cross-site scripting
    3. Directory traversal
    4. Server-side request forgery
    Show answer

    Answer: A. SQL injection

    SQL injection lets input change the structure of a query. Parameterized queries are the main fix.

  13. Question 13. A comment field stores a script that runs in every visitor's browser when they view the page. What is this?

    1. Reflected cross-site scripting
    2. Stored (persistent) cross-site scripting
    3. SQL injection
    4. Cross-site request forgery
    Show answer

    Answer: B. Stored (persistent) cross-site scripting

    Stored XSS saves the malicious script on the server, so it runs for everyone who loads the page. Output encoding and input validation mitigate it.

  14. Question 14. A request containing ../../../../etc/passwd returns a system file. Which attack succeeded?

    1. Command injection
    2. Buffer overflow
    3. LDAP injection
    4. Directory traversal
    Show answer

    Answer: D. Directory traversal

    Directory (path) traversal uses ../ sequences to escape the intended folder and read other files.

  15. Question 15. A logged-in banking user visits a malicious site that silently submits a funds transfer to the bank using the user's session. What attack is this?

    1. Stored cross-site scripting
    2. Session fixation
    3. Clickjacking
    4. Cross-site request forgery (CSRF)
    Show answer

    Answer: D. Cross-site request forgery (CSRF)

    CSRF tricks the browser into sending an authenticated request the user didn't intend. Anti-CSRF tokens and SameSite cookies help prevent it.

  16. Question 16. An attacker in a virtual machine exploits the hypervisor to access other VMs on the same host. What is this called?

    1. Resource reuse
    2. Sideloading
    3. VM escape
    4. Jailbreaking
    Show answer

    Answer: C. VM escape

    VM escape breaks out of a guest's isolation to reach the hypervisor or other guests. Patching hypervisors is the main defense.

  17. Question 17. A vendor's software update server is compromised and pushes a signed update containing a backdoor. Which vulnerability category does this represent?

    1. Misconfiguration of the customer's firewall
    2. Supply chain compromise through a malicious update
    3. Zero-day flaw in the customer's browser
    4. Weak encryption on the customer's backups
    Show answer

    Answer: B. Supply chain compromise through a malicious update

    Attacks on a trusted supplier reach every customer who installs its updates. Vendor risk management and update verification help.

  18. Question 18. Which term describes a vulnerability that is exploited before the vendor has released a patch?

    1. End-of-life
    2. False positive
    3. Legacy
    4. Zero-day
    Show answer

    Answer: D. Zero-day

    A zero-day has no available fix at the time of exploitation, so defenders rely on compensating controls and detection.

  19. Question 19. A company keeps running a server OS whose vendor no longer releases security updates. What is the MAIN risk?

    1. The OS will stop booting after a set date
    2. Encryption on the server will be disabled automatically
    3. New vulnerabilities will never be patched
    4. Users will be unable to log in remotely
    Show answer

    Answer: C. New vulnerabilities will never be patched

    End-of-life systems stop receiving security fixes, so any new vulnerability stays open. Isolation or replacement is needed.

  20. Question 20. Which mobile device risk involves installing apps from outside the official app store?

    1. Tethering
    2. Sideloading
    3. Geofencing
    4. Screen pinning
    Show answer

    Answer: B. Sideloading

    Sideloading bypasses app store review and can introduce malware. Jailbreaking or rooting often goes with it.

  21. Question 21. A new network printer is still using the manufacturer's admin password. What type of vulnerability is this?

    1. Default credentials, a misconfiguration
    2. A zero-day vulnerability in firmware
    3. A race condition in the print driver
    4. A cryptographic downgrade weakness
    Show answer

    Answer: A. Default credentials, a misconfiguration

    Default credentials are widely published and easy to exploit. Changing them is a basic hardening step.

  22. Question 22. Malware encrypts user files and displays a demand for cryptocurrency payment. What type of malware is this?

    1. Ransomware
    2. Spyware
    3. Adware
    4. A rootkit
    Show answer

    Answer: A. Ransomware

    Ransomware denies access to data, typically through encryption, until a ransom is paid. Offline backups are a key defense.

  23. Question 23. Which malware spreads across a network by itself without needing a user to run a file?

    1. A worm
    2. A trojan
    3. A logic bomb
    4. A keylogger
    Show answer

    Answer: A. A worm

    Worms self-replicate by exploiting network vulnerabilities. Viruses and trojans usually need user action.

  24. Question 24. A free game secretly installs a remote access tool when a user runs it. What type of malware is this?

    1. A worm
    2. A trojan
    3. A logic bomb
    4. Bloatware
    Show answer

    Answer: B. A trojan

    A trojan looks like legitimate software but hides a malicious payload.

  25. Question 25. A disgruntled administrator plants code that deletes the payroll database if their account is disabled. What is this?

    1. A rootkit
    2. A logic bomb
    3. A worm
    4. Spyware
    Show answer

    Answer: B. A logic bomb

    A logic bomb runs when a specific condition is met, such as a date or an account change.

  26. Question 26. Which malware hides its presence by modifying the operating system kernel, making it hard to detect?

    1. Adware
    2. A keylogger
    3. A rootkit
    4. Bloatware
    Show answer

    Answer: C. A rootkit

    Rootkits operate at a deep level, often the kernel or firmware, to conceal themselves and other malware.

  27. Question 27. Several user accounts show one or two failed logins each, all with the same common password, from one IP address. What attack is this?

    1. Brute force against one account
    2. Credential replay
    3. Password spraying
    4. A birthday attack
    Show answer

    Answer: C. Password spraying

    Password spraying tries a few common passwords across many accounts to avoid lockout thresholds.

  28. Question 28. A user logs in from London and, ten minutes later, from Sydney. What indicator of compromise is this?

    1. Resource exhaustion
    2. Impossible travel
    3. Missing logs
    4. Blocked content
    Show answer

    Answer: B. Impossible travel

    Logins from distant locations within an impossible time frame suggest stolen credentials being used elsewhere.

  29. Question 29. Attackers send small DNS queries with a spoofed source IP so large responses flood the victim. What attack is this?

    1. A DNS cache poisoning attack
    2. A domain hijacking attack
    3. A credential replay attack
    4. A reflected, amplified DDoS attack
    Show answer

    Answer: D. A reflected, amplified DDoS attack

    Amplification uses services that send much larger responses than requests, and reflection directs those responses at the spoofed victim.

  30. Question 30. An attacker corrupts a DNS resolver's cache so users of that resolver are sent to a malicious IP for a banking site. What attack is this?

    1. Typosquatting
    2. ARP flooding
    3. Bluesnarfing
    4. DNS cache poisoning
    Show answer

    Answer: D. DNS cache poisoning

    DNS poisoning inserts false records into a resolver's cache. DNSSEC helps validate responses.

  31. Question 31. An attacker sets up an access point with the same SSID as the corporate Wi-Fi to capture user traffic. What is this?

    1. A jamming attack
    2. Bluejacking
    3. An evil twin
    4. War driving
    Show answer

    Answer: C. An evil twin

    An evil twin impersonates a legitimate access point so clients connect to the attacker instead.

  32. Question 32. An attacker positions themselves between a client and server, relaying and possibly altering traffic without either side knowing. What attack is this?

    1. An on-path (man-in-the-middle) attack
    2. A replay-only attack
    3. A denial-of-service attack
    4. A privilege escalation attack
    Show answer

    Answer: A. An on-path (man-in-the-middle) attack

    On-path attackers intercept communication between two parties. Strong encryption and certificate validation defend against it.

  33. Question 33. An attacker captures a valid authentication token and resends it later to gain access. What attack is this?

    1. A replay attack
    2. A downgrade attack
    3. A collision attack
    4. A spraying attack
    Show answer

    Answer: A. A replay attack

    Replay attacks reuse captured valid data. Timestamps, nonces, and short-lived tokens prevent it.

  34. Question 34. An attacker forces a client and server to negotiate an older, weaker TLS version. What attack is this?

    1. A birthday attack
    2. A replay attack
    3. A downgrade attack
    4. A pass-the-hash attack
    Show answer

    Answer: C. A downgrade attack

    Downgrade attacks exploit backward compatibility. Disabling old protocol versions prevents them.

  35. Question 35. Two different inputs produce the same hash value in a weak algorithm. What is this called?

    1. A collision
    2. A salt
    3. A nonce
    4. An initialization vector
    Show answer

    Answer: A. A collision

    Collisions undermine integrity checks and signatures, which is why MD5 and SHA-1 are deprecated for those uses.

  36. Question 36. A standard user exploits a flaw in a service running as SYSTEM to gain administrative rights. What is this?

    1. Lateral movement
    2. Privilege escalation
    3. Pivoting
    4. Persistence
    Show answer

    Answer: B. Privilege escalation

    Vertical privilege escalation gains higher permissions than the account was granted.

  37. Question 37. An attacker clones an employee's proximity badge by reading it from a short distance. What attack is this?

    1. Tailgating
    2. RFID cloning
    3. Shoulder surfing
    4. Dumpster diving
    Show answer

    Answer: B. RFID cloning

    Many older proximity cards can be read and copied. Encrypted smart cards and multifactor entry help.

  38. Question 38. Which mitigation MOST directly limits an attacker's ability to move from a compromised workstation to database servers?

    1. Full-disk encryption on the workstation
    2. Network segmentation with restrictive rules between zones
    3. Longer password expiry periods for users
    4. Removing the workstation's screen lock timeout
    Show answer

    Answer: B. Network segmentation with restrictive rules between zones

    Segmentation restricts which systems can talk to each other, containing lateral movement.

  39. Question 39. An organization allows only approved executables to run on its point-of-sale terminals. Which mitigation is this?

    1. Application deny listing
    2. Sandboxing
    3. Code signing
    4. Application allow listing
    Show answer

    Answer: D. Application allow listing

    Allow listing blocks anything not explicitly approved, which is highly effective on fixed-function systems.

  40. Question 40. Which hardening step reduces a server's attack surface the MOST?

    1. Disabling unneeded services and closing unused ports
    2. Enabling verbose debug logging on every service
    3. Adding more administrator accounts for redundancy
    4. Allowing remote login with shared passwords
    Show answer

    Answer: A. Disabling unneeded services and closing unused ports

    Removing unnecessary services and ports eliminates potential entry points.

  41. Question 41. Why is decommissioning an important mitigation for old systems?

    1. Decommissioning increases the performance of remaining systems
    2. Unused but connected systems become unmonitored, unpatched targets
    3. It removes the need to back up any other data
    4. It automatically updates the asset inventory's licenses
    Show answer

    Answer: B. Unused but connected systems become unmonitored, unpatched targets

    Retiring systems properly, including wiping data, removes forgotten assets that attackers could exploit.

  42. Question 42. A developer uses a function that copies strings without checking length. Which secure coding fix BEST addresses this?

    1. Encrypt the strings before copying them
    2. Log every string copy operation
    3. Use bounds-checked functions and validate input length
    4. Run the application with a higher priority
    Show answer

    Answer: C. Use bounds-checked functions and validate input length

    Bounds checking and input validation prevent buffer overflows at the source.

  43. Question 43. Which statement about misconfigured cloud storage is MOST accurate?

    1. Cloud providers are responsible for all bucket permissions
    2. Cloud storage cannot be made publicly accessible by mistake
    3. Encryption at rest prevents access through a public bucket
    4. Publicly accessible buckets are a leading cause of cloud data exposure
    Show answer

    Answer: D. Publicly accessible buckets are a leading cause of cloud data exposure

    Under the shared responsibility model, customers configure access. Public buckets expose data even if it's encrypted at rest by the provider.

  44. Question 44. A laptop is found with an unexpected process consuming 100% CPU and connecting to a mining pool. What is the MOST likely cause?

    1. A failing hard drive
    2. A misconfigured screen saver
    3. A DNS cache poisoning attack
    4. Cryptojacking malware
    Show answer

    Answer: D. Cryptojacking malware

    Cryptojacking uses the victim's resources to mine cryptocurrency, showing up as high resource use and unusual outbound connections.

CompTIA and Security+ are trademarks or registered trademarks of CompTIA, Inc. These questions are original study material, not questions from the real exam.