Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        CompTIA Security+ practice test: 60 questions

        60 questions in 1 h. Target: 45 correct, a guide since CompTIA scores are scaled.

        A server rack, a padlock and a network diagram for Security+ practice.
        Questions
        60
        Time
        1 h
        To pass
        45 (75%)
        Mode
        Timed or untimed
        Access
        Free

        The practice test needs JavaScript. These are its questions:

        Sign-in log excerpt

        A company's identity provider exported these sign-in events for review. All times are UTC on the same day. From 02:10 to 02:58, source address 198.51.100.23 (geolocated to the Netherlands) made 412 failed sign-in attempts, each against a different user name (ahmed.k at 02:10:05, b.lopez at 02:10:09, c.nguyen at 02:10:14, and so on), with one attempt per account and no account locked out. The lockout policy locks an account after 5 failed attempts in 15 minutes. At 02:58:41 the account r.osei signed in successfully from 198.51.100.23 (Netherlands). At 03:20:12 the same account signed in successfully from 203.0.113.77 (geolocated to Singapore). The previous sign-in for r.osei, at 17:45 the day before, came from the head office in Toronto.

        Perimeter firewall rule set

        A company's perimeter firewall checks inbound rules from the top down. The first rule that matches a packet decides what happens to it, and later rules are not checked. A packet that matches no rule is denied. The web server is 192.0.2.10 and the mail relay is 192.0.2.25, both in the screened subnet. The rules, in order, are: Rule 1: ALLOW TCP from any source to 192.0.2.10 port 443. Rule 2: DENY all traffic from 203.0.113.0/24 to any destination. Rule 3: ALLOW TCP from any source to 192.0.2.25 port 25. Rule 4: ALLOW TCP from 198.51.100.40 to 192.0.2.10 port 22. Rule 5: DENY all traffic from any source to any destination.

        Flood risk in a branch data room

        A risk analyst is reviewing a branch office data room that sits below street level. The equipment and the room fit-out are valued at $250,000. The facilities team estimates that a serious flood would destroy 40% of that value each time it happens, and local records suggest a serious flood about once every 5 years. A vendor offers flood barriers and raised equipment racks for an annualized cost of $12,000. With them installed, the analyst expects serious flooding of the room only once every 20 years, with the same 40% loss when it does happen.

        1. Before resetting any password, help desk staff must follow a written script that confirms the caller's identity by calling back the phone number on file. People carry out the check, not software. Which control category is this?

          1. Technical
          2. Managerial (administrative)
          3. Operational
          4. Physical
        2. A payment kiosk runs a vendor-locked operating system that cannot install the company's standard endpoint protection agent. Until the vendor adds support, the security team puts the kiosk on an isolated network segment and enables strict application allow listing to give comparable protection. What type of control are these measures?

          1. Deterrent, because they discourage attackers from trying
          2. Directive, because they tell staff what they must do
          3. Corrective, because they restore systems after an incident
          4. Compensating, as a substitute for the required control
        3. A purchasing manager approves contracts by signing them with a private key stored on her smart card. Later she claims she never approved one of them. Which security property lets the company prove the approval came from her?

          1. Availability
          2. Non-repudiation
          3. Confidentiality
          4. Authorization
        4. In the NIST SP 800-207 zero trust architecture, which component makes, and logs, the final decision to grant, deny or revoke a subject's access to a resource, using enterprise policy and inputs such as threat intelligence?

          1. Policy enforcement point
          2. Policy administrator
          3. Policy engine
          4. Implicit trust zone
        5. Before an approved firewall firmware upgrade in tonight's maintenance window, the change board asks for the documented steps to return the firewall to its previous working configuration if the upgrade fails. What is this part of the change request called?

          1. Impact analysis
          2. Backout plan
          3. Standard operating procedure
          4. Test results
        6. A developer stores passwords with PBKDF2, using a unique random salt for each user and an iteration count in the hundreds of thousands. What does the high iteration count add that the salt alone does not?

          1. It gives two users with the same password different hashes
          2. It lets the hash be decrypted later with a server key
          3. It rejects passwords that appear on a breach list
          4. It makes each guess costly, slowing attacks on stolen hashes
        7. A browser needs to learn whether one specific server certificate has been revoked, without downloading the certificate authority's whole list of revoked certificates. Which mechanism does this?

          1. Downloading the CA's certificate revocation list
          2. Submitting a certificate signing request
          3. An Online Certificate Status Protocol query
          4. Checking the key escrow records held by the CA
        8. A group defaces a chemical company's website with protest messages about the company's environmental record. Nothing is stolen and no ransom is demanded. Which threat actor type fits best?

          1. Organized crime
          2. Nation-state
          3. Shadow IT
          4. Hacktivist
        9. Investigators find that an intruder kept quiet access to a defense contractor's network for over a year, used custom malware, adapted each time defenders removed it, and slowly copied design documents. Which actor and motivation fit best?

          1. An unskilled attacker seeking bragging rights
          2. A nation-state actor pursuing espionage
          3. A hacktivist group seeking publicity
          4. An organized crime group seeking a ransom payment
        10. Several employees get a text message that claims to come from the company's payroll provider and asks them to tap a link to confirm their bank details. Which attack vector is this?

          1. Vishing
          2. Watering hole attack
          3. Smishing
          4. Business email compromise
        11. An attacker takes over the email account of a supplier's sales manager and, replying inside an existing invoice thread, asks the customer's accounts team to send this month's payment to a new bank account. What is this attack called?

          1. Brand impersonation on a social media page
          2. Watering hole attack
          3. Smishing
          4. Business email compromise
        12. A login form builds its database query by pasting the user's input straight into the SQL text. Entering the user name admin'-- logs a tester in without a password. Which fix addresses the root cause?

          1. Suppress detailed database error messages shown to users
          2. Encrypt the database files stored on disk
          3. Use parameterized queries that bind input as data
          4. Require longer and more complex passwords
        13. An attacker posts a product review that contains a script. The site saves the review in its database, and the script runs in the browser of every customer who later opens that product page. What vulnerability is this?

          1. Stored cross-site scripting
          2. Reflected cross-site scripting
          3. SQL injection
          4. Directory traversal
        14. A hospital wants its nurses' station PCs to run only the approved clinical applications, so that malware or unapproved programs cannot start even if a user downloads them. Which mitigation does this most directly?

          1. A host-based firewall
          2. Full-disk encryption
          3. An application allow list
          4. Data loss prevention on the PCs
        15. A new network camera arrives with an admin password printed in the public manual, and with Telnet and FTP turned on. Which hardening steps should be taken before it goes on the network?

          1. Keep the defaults so the vendor can support it remotely
          2. Change the default password and turn off unused services
          3. Place it in the screened subnet with all of its ports open
          4. Back up its configuration and then install it unchanged
        16. Which attack do the failed sign-ins between 02:10 and 02:58 show?

          1. A brute-force attack against one account
          2. Password spraying across many accounts
          3. Replay of a captured session token
          4. A denial-of-service attack on the identity provider
        17. What does the pair of successful r.osei sign-ins at 02:58 and 03:20 indicate?

          1. Impossible travel
          2. Out-of-cycle logging
          3. Resource consumption
          4. Blocked content
        18. The team confirms that r.osei's account is compromised. What should the incident response team do next?

          1. Reimage every workstation in the head office
          2. Write the lessons-learned report for management
          3. Disable the account and end its sessions
          4. Wait to see what data the attacker downloads
        19. A company runs its web application on virtual machines it rents from an infrastructure as a service (IaaS) provider. A critical vulnerability is announced in the guest operating system. Who is responsible for patching it?

          1. The cloud provider, because it owns the physical hosts
          2. The hypervisor vendor, under the provider's license
          3. No one, since IaaS images patch themselves
          4. The customer, because it manages the guest OS
        20. A research lab keeps the computers that control a particle accelerator on a network with no physical connection to any other network. Data moves to and from them only on media that staff carry by hand. What is this design called?

          1. An air-gapped network
          2. A screened subnet
          3. A software-defined network
          4. Logical segmentation with VLANs
        21. A firewall protecting a payment network must be set up so that, if its inspection engine crashes, the network stays protected even though traffic stops. Which failure mode is required?

          1. Fail-open
          2. Active/passive monitoring
          3. Tap/monitor mode
          4. Fail-closed (fail secure)
        22. A security team wants a network sensor that can drop malicious packets before they reach the servers, instead of only reporting them. How must the sensor be deployed?

          1. Inline, so traffic passes through it
          2. On a switch span port, receiving copies
          3. On a network tap that mirrors traffic
          4. On a log server that reads firewall logs
        23. An online store replaces each customer's card number with a random surrogate value for use in its order systems. Only a separate, tightly protected service can map a surrogate back to the real number. Which data protection method is this?

          1. Data masking
          2. Hashing
          3. Steganography
          4. Tokenization
        24. A company based in the European Union plans to move its customer database, which holds personal data, to a cloud region in a country outside the EU. Which consideration does this raise most directly?

          1. Protecting data in use while it sits in memory
          2. Key stretching for stored passwords
          3. Data sovereignty and transfer rules
          4. Steganography of the backup files
        25. A bank needs an alternate site that already has the system hardware, supporting infrastructure and staff in place, so that it can take over critical systems within hours of a disaster. Which site type fits?

          1. Cold site
          2. Warm site
          3. Hot site
          4. Offsite tape vault
        26. A data center's UPS units can carry the servers for about 15 minutes. Management wants the site to keep running through a power cut that could last two days. What should be added?

          1. A diesel or gas generator
          2. More UPS battery modules
          3. A second internet link
          4. RAID 1 mirroring on the servers
        27. The incident response team meets in a conference room. A facilitator presents a ransomware scenario, and members talk through what each of them would do, without touching any systems. What kind of test is this?

          1. A functional exercise
          2. A fail over to the backup site
          3. A penetration test of the backups
          4. A tabletop exercise
        28. A small office still uses WPA2-Personal with a shared passphrase. Which benefit does moving to WPA3-Personal give against an attacker who records the Wi-Fi handshake?

          1. It removes the need for a passphrase on the network
          2. SAE resists offline guessing of the passphrase
          3. It uses WEP keys that rotate every minute
          4. It hides the network name from all scanners
        29. A web application sets its session cookie. Testers find that a script injected into the page can read the cookie, and that the browser also sends the cookie over plain HTTP. Which cookie attributes fix both problems?

          1. HttpOnly and Secure
          2. Domain and Path
          3. Expires and Max-Age
          4. Path and Expires
        30. An analyst wants to open a suspicious email attachment in a restricted environment where it cannot reach the real file system or the corporate network, so its behavior can be watched safely. What is this technique?

          1. Code signing
          2. Data loss prevention
          3. Sandboxing
          4. Input validation
        31. Old SSDs will be sold to a recycler for reuse. Under NIST SP 800-88, the data on them must be unrecoverable even with state-of-the-art laboratory techniques, but the drives must still work afterward. Which sanitization method is required?

          1. Clear
          2. Purge
          3. Destroy
          4. Delete the files and empty the trash
        32. A vulnerability scan reports a flaw with a CVSS base score of 7.5. On FIRST's qualitative severity rating scale, how is it rated?

          1. Medium
          2. Critical
          3. Low
          4. High
        33. A scanner flags a server as vulnerable to an Apache web server flaw, but the server runs no Apache software at all. What has the scanner produced?

          1. A false negative
          2. A false positive
          3. A true positive
          4. A zero-day finding
        34. The server team reports that a critical patch has been installed on all 300 affected servers. What should the security team do to validate the remediation?

          1. Close the ticket based on the server team's report
          2. Lower the CVSS score of the finding in the scanner
          3. Rescan the servers to confirm the flaw is gone
          4. Add the servers to an exemption list
        35. An analyst needs to see which internal hosts talked to an external IP address last week, on which ports, and how many bytes moved, but the network keeps no full packet captures. Which data source fits?

          1. NetFlow or IPFIX flow records
          2. SNMP traps from the switches
          3. Antivirus scan reports
          4. Vulnerability scan results
        36. While correlating events in the SIEM, analysts see a firewall entry that appears to come after the server event it caused, because one device's clock is several minutes off. What should be fixed?

          1. Raise the SIEM's alert threshold for that firewall
          2. Shorten the log retention period on the server
          3. Convert all logs to plain text before upload
          4. Sync all device clocks to a common time source
        37. A company has published SPF and DKIM records, but spoofed messages that use its domain in the visible From address still reach customers' inboxes. Which DNS record lets the company tell receiving servers to reject messages that fail these aligned checks, and to send it reports?

          1. A second SPF record
          2. A DMARC policy record
          3. A DKIM selector record
          4. An MX record
        38. A host at 203.0.113.50 sends HTTPS (TCP 443) to the web server at 192.0.2.10. What happens to the traffic?

          1. It is allowed by rule 1
          2. It is denied by rule 2
          3. It is denied by rule 5
          4. It is denied because nothing matches
        39. The team wants to block everything from the hostile range 203.0.113.0/24, including HTTPS to the web server, without affecting anyone else. What is the simplest change?

          1. Delete rule 5
          2. Change rule 1 from ALLOW to DENY
          3. Move rule 2 above rule 1
          4. Add a new deny for the range below rule 5
        40. Which of these sign-in methods is true multifactor authentication?

          1. A password followed by a memorized PIN
          2. A password followed by answers to security questions
          3. A password plus a code from a hardware token
          4. Two different passwords entered one after the other
        41. A user wants a third-party scheduling app to read her calendar on a cloud service. The app should get limited, revocable access through a token and must never see her password. Which standard is designed for this delegated authorization?

          1. A SAML assertion
          2. An LDAP bind
          3. A shared account password
          4. OAuth 2.0
        42. A hospital lets staff open a patient record only when the user's department matches the patient's ward, the request comes from a managed device, and it falls within the user's shift. Which access control model is this?

          1. Discretionary access control
          2. Role-based access control
          3. Mandatory access control
          4. Attribute-based access control
        43. HR terminations are often processed days before IT removes the person's access. Which automation use case best closes this gap?

          1. Account de-provisioning triggered by the HR system
          2. Automatic ticket creation for every successful login
          3. Automatic scaling of the web server pool
          4. Weekly automated vulnerability scans
        44. A responder is collecting evidence from a running, compromised server. Following the order of volatility, which should be collected first?

          1. Memory and the running process table
          2. Files on the local disk
          3. Logs already sent to the remote syslog server
          4. Archived backup tapes
        45. A forensic analyst hands a seized laptop to a colleague for imaging. What should be recorded to keep the chain of custody intact?

          1. The laptop's purchase price, model number and warranty status
          2. Only the case number, since the laptop is sealed
          3. The colleague's opinion of what the laptop contains
          4. Who passed it, who took it, the date and time, and why
        46. An analyst needs to know which process launched powershell.exe on a Windows workstation at 09:14, and with which command-line arguments. Command-line auditing is enabled. Which data source should she check?

          1. Firewall logs at the perimeter
          2. Endpoint logs: Windows event 4688 (process creation)
          3. NetFlow records from the core switch
          4. The latest vulnerability scan report for that workstation
        47. Before new employees get network access, they must read and sign a document that says what they may and may not do with company computers, email and internet access. What is this document?

          1. An acceptable use policy
          2. A business continuity plan
          3. A service-level agreement
          4. An incident response playbook
        48. A retailer decides why and how its customers' personal data is used, and hires an email marketing vendor that sends newsletters using that data only on the retailer's instructions. Under the GDPR, what is the vendor?

          1. The data controller
          2. The data subject
          3. A data processor
          4. A data protection supervisory authority
        49. A company document states: 'All company laptops must use the approved full-disk encryption product configured for AES-256.' It is compulsory and names a specific technology. What type of governance document is it?

          1. A guideline
          2. A standard
          3. A procedure
          4. An incident playbook
        50. What is the single loss expectancy (SLE) for a serious flood?

          1. $20,000
          2. $100,000
          3. $50,000
          4. $250,000
        51. What is the annualized loss expectancy (ALE) before the countermeasure?

          1. $20,000
          2. $100,000
          3. $500,000
          4. $50,000
        52. What is the annual value of the flood countermeasure, and is it worth buying on cost grounds alone?

          1. $15,000 a year, so it is worth buying
          2. $8,000 a year, so it is worth buying
          3. Negative $7,000 a year, so it is not worth it
          4. $3,000 a year, so it is worth buying
        53. A bank is negotiating a contract with a cloud payment processor. It wants the contractual ability to review the processor's controls, receive its independent audit reports, and require fixes when problems are found. Which clause provides this?

          1. A non-disclosure clause
          2. A conflict-of-interest clause
          3. A right-to-audit clause
          4. A service-level clause
        54. Before an outside firm starts a penetration test, both parties sign a document that sets the scope, testing hours, allowed techniques and emergency contacts, and gives the testers authority to carry out those activities. What is this document?

          1. Rules of engagement
          2. A service-level agreement
          3. A memorandum of understanding
          4. A non-disclosure agreement
        55. A contract with a hosting provider guarantees 99.95% monthly uptime and a one-hour response to severity 1 tickets, with service credits if these targets are missed. What type of agreement sets these terms?

          1. Non-disclosure agreement (NDA)
          2. Memorandum of understanding (MOU)
          3. Service-level agreement (SLA)
          4. Memorandum of agreement (MOA)
        56. A customer in the EU closes her account and asks the company to delete all of her personal data, which it no longer needs for the purpose it was collected for. Which GDPR right is she using?

          1. The right to data portability
          2. The right to object to profiling
          3. The right of access
          4. The right to erasure
        57. A client gives penetration testers a list of its public IP ranges and one standard user account, but no network diagrams or source code. Which test environment is this?

          1. Known environment
          2. Unknown environment
          3. Integrated offensive and defensive test
          4. Partially known environment
        58. During an approved assessment, a tester connects a laptop to a span port and records which hosts talk to each other, which ports they use and which operating systems appear, without sending a single packet. What is this?

          1. Passive reconnaissance
          2. Active reconnaissance
          3. Vulnerability scanning
          4. Physical penetration testing
        59. After a simulated phishing campaign, which result best shows that the awareness training is changing behavior?

          1. Fewer staff opened any email at all that week
          2. The help desk got fewer password reset calls
          3. More staff reported the test email as phishing
          4. More employees finished the yearly policy quiz on time
        60. An employee finds a USB drive labeled 'Salary review 2027' in the office parking lot. What should security awareness training tell her to do?

          1. Plug it into a spare offline PC to find the owner
          2. Plug it in, but turn off autorun first
          3. Throw it away so no one else finds it
          4. Give it to IT or security without plugging it in

        What this set covers

        • 1.1 Security controls2 questions
        • 1.2 Security concepts2 questions
        • 1.3 Change management1 questions
        • 1.4 Cryptographic solutions2 questions
        • 2.1 Threat actors2 questions
        • 2.2 Threat vectors2 questions
        • 2.3 Vulnerabilities2 questions
        • 2.5 Mitigation techniques2 questions
        • 2.4 Indicators of malicious activity2 questions
        • 4.8 Incident response3 questions
        • 3.1 Architecture models2 questions
        • 3.2 Secure infrastructure2 questions
        • 3.3 Data protection2 questions
        • 3.4 Resilience and recovery3 questions
        • 4.1 Securing computing resources3 questions
        • 4.2 Asset management1 questions
        • 4.3 Vulnerability management3 questions
        • 4.4 Alerting and monitoring2 questions
        • 4.5 Enterprise security capabilities3 questions
        • 4.6 Identity and access management3 questions
        • 4.7 Automation and orchestration1 questions
        • 4.9 Investigation data sources1 questions
        • 5.1 Security governance3 questions
        • 5.2 Risk management3 questions
        • 5.3 Third-party risk2 questions
        • 5.4 Security compliance2 questions
        • 5.5 Audits and assessments2 questions
        • 5.6 Security awareness2 questions

        More practice for this exam

          All practice for the CompTIA Security+

          Independent practice. The Work Gym isn't affiliated with CompTIA, and these aren't official CompTIA questions. CompTIA Security+® is a registered trademark of CompTIA, Inc.

          Your Work Gym account

          Save your progress and pick up on another device. Your browser's progress comes with you.

          or

          You can keep practicing without an account.

          Change your plan

          Checking the price

          Help and feedback

          Ask a question, tell us what is not working, or share an idea. We reply by email.

          What is it about?

          We use it only to reply to you.