CompTIA PenTest+ Practice Questions: Attacks and Exploits

52 free, exam-style CompTIA PenTest+ (PT0-003) practice questions covering Attacks and Exploits, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock PenTest+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

Attacks and Exploits practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. What is the main purpose of directory brute forcing against a web server?

  • A.Tune Wi-Fi channels
  • B.Encrypt database fields
  • C.Assign DHCP leases
  • D.Discover hidden paths and files✓ Correct
Explanation: Directory brute forcing checks common or generated paths to discover content not linked from the site. Learn more.

Q2. Which vulnerability allows an attacker to make a database run unintended queries?

  • A.Port security
  • B.Open relay only
  • C.SQL injection✓ Correct
  • D.DNS round robin
Explanation: SQL injection occurs when untrusted input is included in database queries without proper parameterization or validation. Learn more.

Q3. Which attack captures and relays authentication attempts without knowing the password?

  • A.ARP cache timeout
  • B.DHCP reservation
  • C.NTLM relay✓ Correct
  • D.DNS zone transfer
Explanation: Relay attacks forward authentication messages to another service to gain access without cracking the credential. Learn more.

Q4. What is the purpose of a reverse shell?

  • A.Create a DNS MX record
  • B.Patch a kernel
  • C.Encrypt backup tapes
  • D.Make a compromised host initiate a connection back to the tester✓ Correct
Explanation: A reverse shell causes the target to connect outward to the listener, which can bypass some inbound filtering. Learn more.

Q5. Which wireless attack attempts to capture a WPA handshake for offline cracking?

  • A.Deauthentication followed by handshake capture✓ Correct
  • B.DNS poisoning only
  • C.VLAN hopping only
  • D.ICMP redirect only
Explanation: Deauthentication can force clients to reconnect, allowing capture of the WPA handshake for offline password testing. Learn more.

Q6. Which password attack uses known breached username and password pairs against another service?

  • A.Credential stuffing✓ Correct
  • B.ARP spoofing
  • C.Kerberoasting only
  • D.Rainbow table creation only
Explanation: Credential stuffing tests reused credentials from breaches against other services. Learn more.

Q7. Which Kerberos attack targets service tickets for offline password cracking?

  • A.Bluejacking
  • B.DNS tunneling
  • C.Smurf attack
  • D.Kerberoasting✓ Correct
Explanation: Kerberoasting requests service tickets and attempts to crack the service account password offline. Learn more.

Q8. Which web vulnerability allows attacker-controlled JavaScript to run in another user browser?

  • A.Directory traversal only
  • B.Kerberoasting
  • C.Cross-site scripting✓ Correct
  • D.ARP spoofing
Explanation: Cross-site scripting occurs when untrusted script content is executed in users browsers. Learn more.

Q9. Which payload type attempts to access files outside the intended web directory using ../ sequences?

  • A.DNS amplification
  • B.Directory traversal✓ Correct
  • C.SQL injection
  • D.LDAP bind
Explanation: Directory traversal abuses path handling to reach files outside the web root or intended directory. Learn more.

Q10. Which test checks whether an application enforces authorization on object IDs a user can modify?

  • A.IDOR testing✓ Correct
  • B.VLAN trunk testing
  • C.PoE budget testing
  • D.DNS recursion testing
Explanation: Insecure direct object reference testing checks whether users can access or change objects they do not own. Learn more.

Q11. Which social engineering pretext risk is reduced by requiring callback verification through known numbers?

  • A.Packet fragmentation
  • B.SQL injection
  • C.VLAN hopping
  • D.Impersonation by phone✓ Correct
Explanation: Callback verification using trusted contact information helps prevent phone-based impersonation. Learn more.

Q12. Which attack takes advantage of weak cloud storage permissions?

  • A.Public bucket enumeration✓ Correct
  • B.Printer firmware downgrade
  • C.DHCP lease renewal
  • D.VGA spoofing
Explanation: Public cloud storage enumeration checks for exposed buckets or objects caused by weak permissions. Learn more.

Q13. Which exploit development protection makes memory addresses harder to predict?

  • A.SMTP
  • B.ASLR✓ Correct
  • C.NTP
  • D.SNMP
Explanation: Address Space Layout Randomization randomizes memory locations to make exploitation harder. Learn more.

Q14. Which mobile test issue allows a rooted device to read sensitive app tokens from local storage?

  • A.Least privilege permissions
  • B.Insecure local storage✓ Correct
  • C.Strong certificate pinning
  • D.Encrypted keychain use
Explanation: Sensitive tokens stored insecurely on a mobile device can be recovered from local files or databases. Learn more.

Q15. Which attack abuses excessive permissions granted to a cloud instance role?

  • A.DHCP starvation only
  • B.RF jamming
  • C.Cloud privilege escalation✓ Correct
  • D.Cable crosstalk
Explanation: Overprivileged cloud roles can let a compromised workload access or modify additional cloud resources. Learn more.

Q16. Which attack tries one common password against many accounts to avoid lockouts?

  • A.Dictionary attack
  • B.Credential stuffing
  • C.Rainbow table attack
  • D.Password spraying✓ Correct
Explanation: Spraying stays under per-account lockout thresholds by rotating accounts rather than passwords, which is why it evades naive lockout policies. Learn more.

Q17. Which attack reuses username and password pairs stolen from an unrelated breach?

  • A.Brute force
  • B.Kerberoasting
  • C.Credential stuffing✓ Correct
  • D.Password spraying
Explanation: Credential stuffing exploits password reuse across services and succeeds without any flaw in the target application itself. Learn more.

Q18. What does a cross-site request forgery attack cause a victim to do?

  • A.Download a malicious binary
  • B.Submit an unintended authenticated request to a site they are logged into✓ Correct
  • C.Run attacker JavaScript in their browser
  • D.Disclose their password hash
Explanation: CSRF abuses the browser automatically attaching session cookies. Anti-CSRF tokens and SameSite cookies are the standard defences. Learn more.

Q19. Which cross-site scripting variant is stored on the server and served to other users?

  • A.Persistent (stored) XSS✓ Correct
  • B.DOM-based XSS
  • C.Reflected XSS
  • D.Blind SQL injection
Explanation: Stored XSS is generally the most severe variant because the payload runs for every user who views the affected content. Learn more.

Q20. Which injection flaw allows an attacker to run operating system commands through an application?

  • A.Insecure deserialization
  • B.Cross-site scripting
  • C.Command injection✓ Correct
  • D.Clickjacking
Explanation: Command injection occurs when user input reaches a shell call unsanitised, giving execution in the application's security context. Learn more.

Q21. What makes blind SQL injection harder to exploit than standard SQL injection?

  • A.The database is hosted in the cloud
  • B.The application uses HTTPS
  • C.The application returns no direct query output to the attacker✓ Correct
  • D.The database is encrypted
Explanation: Without visible output the tester must infer results from boolean responses or time delays, which is slower but still fully exploitable. Learn more.

Q22. Which technique confirms SQL injection when the application shows no error or data?

  • A.Sending a malformed TLS handshake
  • B.Running an ARP scan
  • C.Reading the server's private key
  • D.Time-based inference using a deliberate delay function✓ Correct
Explanation: If a payload causing a conditional sleep changes the response time, the injected SQL is executing even though nothing is displayed. Learn more.

Q23. What is the goal of a server-side request forgery attack?

  • A.Crack password hashes offline
  • B.Make the server issue requests to internal systems the attacker cannot reach✓ Correct
  • C.Intercept wireless traffic
  • D.Run JavaScript in another user's browser
Explanation: SSRF turns the vulnerable server into a proxy into the internal network, and is a common route to cloud instance metadata services. Learn more.

Q24. Which cloud attack does SSRF frequently enable?

  • A.Disabling the cloud provider's billing
  • B.Physically accessing the data centre
  • C.Rewriting the provider's DNS
  • D.Reading instance metadata to steal temporary credentials✓ Correct
Explanation: Metadata endpoints are reachable only from the instance itself, so SSRF is the classic path to harvesting attached role credentials. Learn more.

Q25. Which attack intercepts and potentially alters traffic between two parties?

  • A.Privilege escalation
  • B.On-path (man-in-the-middle) attack✓ Correct
  • C.Denial of service
  • D.Buffer overflow
Explanation: An on-path position permits reading and modifying traffic; strong mutual TLS and certificate validation are the primary defences. Learn more.

Q26. What does ARP spoofing achieve on a local network?

  • A.Redirects traffic for a target IP to the attacker's MAC address✓ Correct
  • B.Assigns new IP addresses to hosts
  • C.Encrypts traffic between switches
  • D.Disables the switch's power
Explanation: ARP has no authentication, so forged replies poison neighbour caches and place the attacker on-path within the broadcast domain. Learn more.

Q27. Which attack captures a WPA2 four-way handshake for offline password cracking?

  • A.Deauthentication followed by handshake capture✓ Correct
  • B.Bluetooth pairing attack
  • C.Evil twin portal only
  • D.WPS PIN brute force
Explanation: Forcing a client to reconnect lets the tester capture the handshake, which can then be attacked offline without further wireless traffic. Learn more.

Q28. What is an evil twin attack?

  • A.A rogue access point impersonating a legitimate SSID✓ Correct
  • B.Two identical malware samples
  • C.A cloned MAC address on a switch
  • D.A duplicate DNS record
Explanation: Clients that trust an SSID by name may associate to the attacker's access point, giving an on-path position for credential capture. Learn more.

Q29. Which social engineering technique uses a phone call to manipulate a target?

  • A.Vishing✓ Correct
  • B.Pharming
  • C.Smishing
  • D.Phishing
Explanation: Vishing is voice-based. Smishing uses SMS, phishing uses email, and pharming redirects traffic through DNS or hosts file manipulation. Learn more.

Q30. What is pretexting in a social engineering engagement?

  • A.Following an employee through a secure door
  • B.Inventing a believable scenario and identity to gain trust✓ Correct
  • C.Leaving infected USB drives in a car park
  • D.Sending mass phishing emails
Explanation: Pretexting builds a plausible reason for the request, such as posing as IT support, so the target's compliance feels routine. Learn more.

Q31. Which physical attack involves following an authorised person through a controlled door?

  • A.Tailgating✓ Correct
  • B.Shoulder surfing
  • C.Dumpster diving
  • D.Badge cloning
Explanation: Tailgating exploits social reluctance to challenge someone, and defeats badge controls without any technical attack. Learn more.

Q32. What is the purpose of a reverse shell rather than a bind shell?

  • A.It requires no exploit
  • B.The target connects outward to the tester, bypassing inbound filtering✓ Correct
  • C.It encrypts all traffic automatically
  • D.It escalates privileges automatically
Explanation: Perimeter firewalls usually block inbound connections but allow outbound, so an outbound callback is far more likely to succeed. Learn more.

Q33. Which attack exploits a program writing more data than a buffer can hold?

  • A.Integer underflow only
  • B.Race condition
  • C.Format string only
  • D.Buffer overflow✓ Correct
Explanation: Overflowing a buffer can overwrite adjacent memory including control data, which may allow redirection of execution flow. Learn more.

Q34. What does insecure deserialization allow in a vulnerable application?

  • A.Attacker-controlled objects that can lead to code execution✓ Correct
  • B.Reading the server's TLS certificate
  • C.Enumerating open UDP ports
  • D.Capturing wireless handshakes
Explanation: Deserializing untrusted data can instantiate attacker-chosen types and trigger gadget chains ending in remote code execution. Learn more.

Q35. Which attack against Kerberos requests service tickets to crack offline?

  • A.Pass-the-hash
  • B.DCSync
  • C.Kerberoasting✓ Correct
  • D.Golden ticket creation
Explanation: Service tickets are encrypted with the service account's password hash, so any domain user can request them and attack them offline. Learn more.

Q36. Which weakness makes Kerberoasting particularly effective?

  • A.Multi-factor authentication on workstations
  • B.Short ticket lifetimes
  • C.Use of AES encryption
  • D.Service accounts with weak passwords and no rotation✓ Correct
Explanation: Because cracking happens offline, only password strength limits success, and service account passwords are often old and weak. Learn more.

Q37. What is the purpose of a payload in an exploitation framework?

  • A.The report template
  • B.The code that runs on the target after the exploit succeeds✓ Correct
  • C.The network scan configuration
  • D.The vulnerability scanner signature
Explanation: The exploit achieves execution; the payload determines what then happens, such as opening a shell or adding a user. Learn more.

Q38. Which factor should most influence whether a tester runs a known-unstable exploit?

  • A.The programming language used
  • B.The exploit's popularity
  • C.The size of the exploit code
  • D.The rules of engagement and the risk of disrupting the service✓ Correct
Explanation: Exploits that may crash the target are used only where the engagement explicitly permits that risk, and usually outside business hours. Learn more.

Q39. Which attack manipulates a web application's logic to change an order's price?

  • A.Cross-site scripting
  • B.Deauthentication
  • C.Business logic abuse via parameter tampering✓ Correct
  • D.ARP spoofing
Explanation: Where price is trusted from the client request rather than recalculated server-side, tampering changes the outcome without any injection flaw. Learn more.

Q40. Which vulnerability lets an attacker access another user's record by changing an ID value?

  • A.Command injection
  • B.Clickjacking
  • C.Cross-site scripting
  • D.Insecure direct object reference✓ Correct
Explanation: IDOR occurs when the application retrieves an object by identifier without confirming the requester is authorised to view it. Learn more.

Q41. What does clickjacking rely on?

  • A.Overlaying invisible framed content over what the user thinks they are clicking✓ Correct
  • B.Capturing a wireless handshake
  • C.Injecting SQL into a query
  • D.Cracking a password hash
Explanation: A transparent frame causes clicks intended for visible content to reach the framed application. X-Frame-Options and CSP frame-ancestors prevent it. Learn more.

Q42. Which attack targets a specific high-value individual with a tailored message?

  • A.Spear phishing✓ Correct
  • B.Smurf attack
  • C.Password spraying
  • D.Rainbow table
Explanation: Spear phishing uses researched, personalised content, which makes it far more convincing than a generic bulk campaign. Learn more.

Q43. Which weakness allows an attacker to upload and execute a web shell?

  • A.Verbose error messages
  • B.TLS 1.2 support
  • C.Missing HSTS header
  • D.Unrestricted file upload that permits executable file types✓ Correct
Explanation: If uploads are stored in a web-accessible path and the server will execute them, an uploaded script grants command execution. Learn more.

Q44. Which mobile testing finding most directly exposes session tokens?

  • A.Sensitive tokens written to unprotected local storage✓ Correct
  • B.The app supporting dark mode
  • C.The app requesting camera permission
  • D.The app using a custom font
Explanation: Tokens stored without platform keystore protection can be read on a rooted or jailbroken device, or extracted from a backup. Learn more.

Q45. What does a padding oracle attack exploit?

  • A.Unrestricted file upload
  • B.Weak wireless encryption only
  • C.Differences in error responses that reveal information about decryption✓ Correct
  • D.Missing input length checks
Explanation: Distinguishable padding errors let an attacker decrypt ciphertext incrementally without ever recovering the key. Learn more.

Q46. Which is the most appropriate first step after gaining a low-privilege shell?

  • A.Disable the antivirus service
  • B.Install persistent malware
  • C.Immediately delete system logs
  • D.Enumerate the host for privilege escalation paths✓ Correct
Explanation: Local enumeration establishes what escalation is possible. Destructive or persistence actions require explicit authorisation. Learn more.

Q47. Which type of denial of service amplifies traffic using third-party servers?

  • A.SYN flood from a single host
  • B.Ping of death
  • C.Slowloris
  • D.Reflection and amplification attack✓ Correct
Explanation: Protocols such as DNS and NTP return responses far larger than the request, so spoofed source addresses direct amplified traffic at a victim. Learn more.

Q48. Why is denial of service usually excluded from penetration test scope?

  • A.It is technically impossible to perform
  • B.Scanners cannot detect it
  • C.It is always illegal in every jurisdiction
  • D.It risks business disruption without demonstrating access✓ Correct
Explanation: DoS proves availability impact at the cost of real outage, and rarely tells the client anything they cannot infer from architecture review. Learn more.

Q49. Which attack forges a request to a cloud metadata endpoint to obtain credentials?

  • A.DNS zone transfer
  • B.Wireless deauthentication
  • C.SSRF against the instance metadata service✓ Correct
  • D.ARP cache poisoning
Explanation: The metadata service is only reachable from the instance, so a server-side request forgery is the standard route to attached role credentials. Learn more.

Q50. What is the main risk of an overly permissive cloud storage bucket policy?

  • A.Anonymous users can list and read stored objects✓ Correct
  • B.The region cannot be changed
  • C.Costs will always increase
  • D.The bucket will be deleted automatically
Explanation: Public read access on buckets holding backups, logs, or customer data is a frequent and high-impact real-world exposure. Learn more.

Q51. Which attack technique bypasses a web application firewall by altering payload representation?

  • A.Increasing the request size only
  • B.Using a different browser
  • C.Encoding and obfuscation of the payload✓ Correct
  • D.Sending the payload over UDP
Explanation: URL, Unicode, and case encoding variations can evade signature matching while the application still interprets the payload as intended. Learn more.

Q52. Which finding indicates a successful session fixation vulnerability?

  • A.The session identifier does not change after authentication✓ Correct
  • B.The session identifier is 128 bits
  • C.The session cookie has the Secure flag
  • D.The session expires after 15 minutes
Explanation: If the identifier survives the privilege change at login, an attacker who planted it beforehand inherits the authenticated session. Learn more.

More CompTIA PenTest+ practice topics

Keep studying CompTIA PenTest+

Full CompTIA PenTest+ practice exam · CompTIA PenTest+ study guide · All CompTIA practice questions

Last updated