Which of the following technologies is most likely used with badge cloning? (Select two).
Show answerHide answer
Correct answer: A, BNFC
RFID
Explanation
Explanation:
Badge cloning is a physical security attack where an adversary intercepts the wireless signal of an access credential to create an unauthorized duplicate. This process predominantly targets RFID and NFC technologies, which serve as the communication backbone for most physical access control systems (PACS).
Incorrect Options Analysis
Bluetooth (C): While used for some modern mobile-entry systems, Bluetooth involves complex pairing and encrypted handshakes that are fundamentally different from the simple "read and replicate" nature of badge cloning.
Modbus (D): This is an application-layer messaging protocol used for communication between devices in industrial control systems (ICS/SCADA). It has no application in physical access badges.
Zigbee (E): A low-power, wireless mesh network protocol used primarily for IoT devices and home automation sensors, not for credential-based entry.
CAN bus (F): The Controller Area Network is a specialized bus standard used within vehicles to allow microcontrollers to communicate. It is unrelated to building access badges.
References
CompTIA PenTest+ (PT0-003) Domain 3.0: Physical Security Attacks (3.4).
NIST Special Publication 800-116: Guidelines for the Use of PIV Credentials in Facility Access.
Question 42Choose 1
A penetration tester finds that an application responds with the contents of the /etc/passwd
file when the following payload is sent:
xml
Copy code
]> &foo;
Which of the following should the tester recommend in the report to best prevent this type
of vulnerability?
Show answerHide answer
Correct answer: CDisable the use of external entities.
Explanation
Explanation:
The payload provided is a classic example of an XML External Entity (XXE) injection attack. This vulnerability occurs when an XML parser is configured to process Document Type Definitions (DTDs) and resolve external entities. In this specific scenario, the SYSTEM identifier instructs the parser to fetch the contents of a local URI (file:///etc/passwd) and assign it to the entity &foo;. When the application processes &foo;, it substitutes the entity with the sensitive system file's content, which is then returned in the application's response.
Incorrect Options Analysis
Drop all excessive file permissions (A): While following the principle of least privilege is a good security practice, it is not the "best" prevention. Restricting permissions on /etc/passwd might break system functionality, and the attacker could still use XXE for other purposes, such as Server-Side Request Forgery (SSRF) or accessing other files the application has permission to read.
Ensure logs are reviewed frequently (B): Log review is a detective control, not a preventative one. It helps identify that an attack occurred but does not stop the vulnerability from being exploited in the first place.
Implement a WAF (D): A Web Application Firewall (WAF) is a compensating control. While it can filter known XXE patterns, it can often be bypassed with encoding or alternative XML structures. It addresses the symptom rather than fixing the underlying insecure code configuration.
References
CompTIA PenTest+ (PT0-003) Objective 4.2: Given a scenario, analyze the output of application assessment tools and recommend mitigation.
OWASP Top 10: A05:2021 – Security Misconfiguration (formerly its own category, XML External Entities).
Question 43Choose 1
During a red-team exercise, a penetration tester obtains an employee's access badge. The
tester uses the badge’s information to create a duplicate for unauthorized entry.
Which of the following best describes this action?
Show answerHide answer
Correct answer: CRFID cloning
Explanation
Explanation:
The scenario describes RFID cloning, a common physical security attack where a penetration tester captures the unique data stored on a physical access badge and copies it onto a new, unauthorized card. Most modern corporate badges use Radio Frequency Identification (RFID) or Near Field Communication (NFC) to communicate with building readers.
In an RFID cloning attack, the tester uses a specialized hardware device (such as a Proxmark3 or a Flipper Zero) to read the radio frequency signal emitted by the target badge. If the badge uses low-frequency (125 kHz) technology or poorly encrypted high-frequency standards, the device can capture the card's unique identifier (UID). The tester then "writes" this captured data onto a blank, writable RFID chip. Once complete, the duplicate badge is indistinguishable from the original to the building's access control system, allowing the tester to gain entry without triggering an alarm.
Incorrect Options Analysis
Smurfing (A): This is a type of Distributed Denial of Service (DDoS) attack. It involves sending large amounts of ICMP (ping) traffic with a spoofed source IP address to a network's broadcast address, causing the network to overwhelm the victim's machine with responses. It is unrelated to physical badges.
Credential Stuffing (B): This is a digital attack where stolen username and password pairs from one data breach are "stuffed" into the login portals of other unrelated services. It relies on the common habit of users reusing passwords across multiple platforms.
Card Skimming (D): While similar, skimming typically refers to the theft of payment card information (credit or debit cards) during a legitimate transaction. A skimmer is a physical device placed over a card reader (like at a gas pump or ATM) to capture the magnetic stripe data or chip info for financial fraud, rather than facility access.
References
CompTIA PenTest+ (PT0-003) Objective 3.4: Given a scenario, perform physical security attacks.
MITRE ATT&CK Framework: Technique T1122 (Replication through Removable Media/Hardware).
Question 44Choose 1
A penetration tester gains access to the target network and observes a running SSH
server.
Which of the following techniques should the tester use to obtain the version of SSH
running on the target server?
Show answerHide answer
Correct answer: CBanner grabbing
Explanation
Explanation:
Banner grabbing involves connecting to an open port (e.g., SSH on TCP/22) and reading the service’s initial response. SSH servers typically disclose their software and version in that banner unless manually hardened. Example: SSH-2.0-OpenSSH_8.9p1. This allows the tester to identify vulnerable versions.
Why other options are incorrect
A. Network sniffing – Passive traffic capture may not see the SSH banner unless the tester initiates a connection (which then becomes banner grabbing). Encryption also hides version details.
B. IP scanning – Only discovers live hosts and open ports (e.g., “port 22 open”). It does not retrieve service version banners without additional probes (which is still banner grabbing).
D. DNS enumeration – Maps domain names, subdomains, and DNS records. It provides no information about running SSH services or their versions.
References:
CompTIA PenTest+ PT0-003 Exam Objectives – Domain 2.2 (Information Gathering): “Perform service and port scanning including banner grabbing for fingerprinting.”
Nmap documentation – Version detection (-sV) is a form of banner grabbing.
MITRE ATT&CK T1592.002 – “Gather Victim Host Information: Software” – banner grabbing is a common method.
Question 45Choose 1
During an assessment, a penetration tester sends the following request:
POST /services/v1/users/create HTTP/1.1
Host: target-application.com
Content-Type: application/json
Content-Length: [dynamic]
Authorization: Bearer (FUZZ)
Which of the following attacks is the penetration tester performing?
Show answerHide answer
Correct answer: BAPI abuse
Explanation
Explanation:
The request is a POST to /services/v1/users/create with an Authorization: Bearer (FUZZ) header. The (FUZZ) indicates the tester is using a fuzzer to test different Bearer token values. This is API abuse — specifically, testing for broken authentication or privilege escalation by attempting to use forged, stolen, or missing tokens to create user accounts without proper authorization. The tester is abusing the API endpoint's access control mechanism.
Why other options are incorrect
A. Directory traversal – Involves ../ sequences to access files outside the web root. The request shows no path traversal patterns.
C. Server-side request forgery (SSRF) – Forces the server to make requests to internal or external resources. The request is a standard API call, not an SSRF payload.
D. Privilege escalation – While the goal may be privilege escalation, the attack technique itself is API abuse (fuzzing Bearer tokens to escalate privileges). Privilege escalation is the outcome, not the method.
References
CompTIA PenTest+ PT0-003 – Domain 3.2 (Web Application Attacks): "API abuse including token fuzzing and broken access control."
OWASP API Security Top 10 – API1:2023 (Broken Object Level Authorization), API2:2023 (Broken Authentication).
Question 46Choose 1
1) #!/bin/bash
2) for i in {1..254}; do
3) ping -c1 192.168.1.$i
4) done
The tester executes the script, but it fails with the following error:
-bash: syntax error near unexpected token `ping'
Which of the following should the tester do to fix the error?
Show answerHide answer
Correct answer: AAdd do after line 2.
Explanation
Explanation
The error message -bash: syntax error near unexpected token 'ping' indicates that the Bash shell encountered the ping command where it did not expect it. This points to a problem with the loop's structure.
The provided script is:
#!/bin/bash
for i in {1..254};
ping -c1 192.168.1.$i
done
The problem is on line 2. The line ends with a semicolon (;), which tells the shell that a command is ending and another is beginning. The shell then reads line 3 and sees ping, but the for loop structure requires the do keyword to come before the command to be looped.
The fix is to add do to the end of line 2.
The corrected line 2 would be: for i in {1..254}; do
Why the Other Options Are Incorrect
B. Replace {1..254} with $(seq 1 254).
The {1..254} syntax is perfectly valid in Bash for generating a sequence of numbers. While $(seq 1 254) would also work, the error is not related to how the sequence is generated. The script would fail with the same error even after this change because the do keyword is still missing.
C. Replace bash with tsh.
There is no common shell named tsh. The script correctly uses #!/bin/bash. The error is a syntax error in the script logic, not a problem with the interpreter.
D. Replace $i with ${i}.
Using $i is standard and correct in this context. While ${i} can be used for clarity or to separate the variable from surrounding text (e.g., file_${i}.txt), it is not necessary here. The error occurs before the variable is even expanded, so this change would not fix the problem.
Reference
This is a fundamental Bash scripting syntax error. The structure of a for loop is a basic concept covered in any shell scripting guide. The error message is a classic indicator of a missing keyword, like do, then (in an if statement), or fi.
Question 47Choose 1
A penetration testing team wants to conduct DNS lookups for a set of targets provided by the client. The team crafts a Bash script for this task. However, they find a minor error in one line of the script:
1) #!/bin/bash
2) for i in $(cat example.txt); do
3) curl $i
4) done
Which of the following changes should the team make to line 3 of the script?
Show answerHide answer
Correct answer: Dhost $i
Explanation
Explanation:
The goal of the script is to perform DNS lookups (resolving domain names to IP addresses or retrieving DNS records) for a list of targets (likely domain names) stored in example.txt.
Current problematic line:
Bashcurl $i
curl is an HTTP client — it makes HTTP/HTTPS requests, not DNS lookups.
Running curl example.com would attempt to download the website content (or fail if no HTTP service exists), which is not what the team wants for DNS enumeration.
The correct tool for simple, command-line DNS lookups in Bash scripts is host, a lightweight utility specifically designed for querying DNS records.
Corrected line 3:
Bashhost $i
Example output when run:
textexample.com has address 93.184.216.34
example.com mail is handled by 0 .
This makes the script functional for its intended purpose:
Bash#!/bin/bash
for i in $(cat example.txt); do
host $i
done
Why not the other options? A. resolvconf $ iresolvconf is a tool for managing /etc/resolv.conf (updating nameserver settings dynamically). It is not used for performing DNS lookups/queries. B. rndc $ irndc (Remote Name Daemon Control) is the control utility for BIND DNS servers (e.g., rndc reload, rndc flush). It is used to administer a running DNS server, not to query DNS records from a client. C. systemd-resolve $ isystemd-resolve (or its successor resolvectl on newer systems) can perform DNS lookups, but:
The syntax is usually systemd-resolve --status or resolvectl query $i
It is less portable (only on systemd-based Linux distributions)
host is the simpler, more universal, and traditionally preferred command in pentesting Bash scripts for DNS resolution
Learning Point
CompTIA PenTest+ PT0-003 objectives (Domain 2.0 – Information Gathering and Vulnerability Scanning):
Covers passive and active reconnaissance techniques, including DNS enumeration.
Tools such as host, dig, nslookup are standard for DNS queries.
host is frequently used in scripting because of its clean, parsable output and wide availability on Linux systems used in pentesting.
Bottom line: To fix the script and make it actually perform DNS lookups on the list of targets, change line 3 to host $i.
A penetration tester observes the following output from an Nmap command while
attempting to troubleshoot connectivity to a Linux server:
Starting Nmap 7.91 ( https://nmap.org ) at 2024-01-10 12:00 UTC
Nmap scan report for example.com (192.168.1.10)
Host is up (0.001s latency).
Not shown: 9999 closed ports
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
443/tcp open https
2222/tcp open ssh
444/tcp open microsoft-ds
Nmap done: 1 IP address (1 host up) scanned in 0.23 seconds
Which of the following is the most likely reason for the connectivity issue?
Show answerHide answer
Correct answer: AThe SSH service is running on a different port.
Explanation
Explanation:
The Nmap output shows port 2222/tcp open ssh instead of the default SSH port 22. The tester is likely attempting to connect to port 22 (default SSH) and failing, assuming the service is missing or blocked. However, SSH is actively running on port 2222. The connectivity issue is simply that the tester is using the wrong port.
Why other options are incorrect
B. SSH service blocked by firewall – Nmap shows port 2222 as open, meaning no firewall is blocking it. If blocked, Nmap would show filtered or closed.
C. SSH requires certificate authentication – This affects authentication, not connectivity. The tester would still establish a TCP connection to the correct port.
D. SSH service is not active – Nmap confirms SSH is active and listening on port 2222.
References
CompTIA PenTest+ PT0-003 – Domain 2.2 (Network Scanning): "Interpret Nmap output to identify non-standard service ports."
Nmap documentation – open state means a service is actively listening on that port.
Common misconfiguration – SSH moved from port 22 to another port (e.g., 2222) for obscurity or to avoid automated scans.
Question 49Choose 1
A penetration tester runs a vulnerability scan that identifies several issues across
numerous customer hosts. The executive report outlines the following:
The client is concerned about the availability of its consumer-facing production application.
Which of the following hosts should the penetration tester select for additional manual
testing?
Show answerHide answer
Correct answer: CServer 3
Explanation
Explanation:
The client is concerned about the availability of its consumer-facing production application. The Perimeter network web server is the only host directly exposed to external consumers. A compromise or disruption of this server would directly impact customer availability. Servers 1, 2, and 4 are internal (development, back-office, QA) and do not affect consumer-facing production availability as directly as the perimeter web server.
Why other options are incorrect
A. Development sandbox server – Internal, non-production. Not consumer-facing. Exploitation here does not affect customer availability.
B. Back-office file transfer server – Internal business function. May be important for operations but not directly consumer-facing.
D. Developer QA server – Quality assurance/internal testing. No direct impact on consumer availability.
References
CompTIA PenTest+ PT0-003 – Domain 1.0 (Planning and Scoping): "Prioritize testing based on business impact and asset criticality."
Business impact analysis (BIA) – Consumer-facing production systems are critical for availability.
Question 50Choose 1
A penetration tester runs a vulnerability scan that identifies several issues across numerous customer hosts.
The executive report outlines the following information:
Server High-severity vulnerabilities
1. Development sandbox server 32
2. Back office file transfer server 51
3. Perimeter network web server 14
4. Developer QA server 92
The client is con ble monitoring mode using Aircrack-ng ch of the following hosts should the penetration
tester select for additional manual testing?
Show answerHide answer
Correct answer: CServer 3
Explanation
Explanation:
This question assesses your knowledge regarding vulnerability prioritization and risk management in penetration testing. It tests your ability to evaluate which asset poses the greatest risk and requires manual testing based on its exposure and business impact.
Option A
❌ This option is incorrect because the development sandbox server is primarily used for testing and development rather than being customer-facing, posing a lower immediate risk to production operations.
Option B
❌ This option is incorrect because the back office file transfer server is typically an internal-facing asset, which is less exposed to external threats than the perimeter network.
Option C
✔️ This option is correct because the perimeter network web server (Server 3) is an internet-facing asset, making it highly exposed to external attackers. Even with a lower number of high-severity vulnerabilities, an exploit on this system could provide direct access to the internal network and directly impact customer-facing operations or availability.
Option D
❌ This option is incorrect because the developer QA server is an internal testing environment that does not directly expose the consumer-facing production application to external threats.
Reference
CompTIA PenTest+ Certification confirms the skills related to vulnerability prioritization and risk assessment.
Full mock exam
Sit the PT0-003 exam before exam day
Full-length mocks with the same number of questions and the same time limit as the real PT0-003 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.