A penetration tester needs to confirm the version number of a client's web application server. Which of the following techniques should the penetration tester use?
A. SSL certificate inspection
B. URL spidering
C. Banner grabbing
D. Directory brute forcing
Explanation:
Banner grabbing is a technique used to gather information about a service running on an open port, which often includes the version number of the application or server.
Here’s why banner grabbing is the correct answer:
Banner Grabbing: It involves connecting to a service and reading the welcome banner or response, which typically includes version information. This is a direct method to identify the version number of a web application server.
SSL Certificate Inspection: While it can provide information about the server, it is not reliable for identifying specific application versions.
URL Spidering: This is used for discovering URLs and resources within a web application, not for version identification.
Directory Brute Forcing: This is used to discover hidden directories and files, not for identifying version information.
References from Pentest:
Luke HTB: Shows how banner grabbing can be used to identify the versions of services running on a server.
Writeup HTB: Demonstrates the importance of gathering version information through techniques like banner grabbing during enumeration phases.
Conclusion: Option C, banner grabbing, is the most appropriate technique for confirming the version number of a web application server.
During a security assessment, a penetration tester gains access to an internal server and manipulates some data to hide its presence. Which of the following is the best way for the penetration tester to hide the activities performed?
A. Clear the Windows event logs.
B. Modify the system time.
C. Alter the log permissions.
D. Reduce the log retention settings.
Explanation:
The scenario describes a tester who has:
Gained access to an internal server
Manipulated data
Wants to hide evidence of activity
✅ A. Clear the Windows event logs — Correct
Windows Event Logs record:
Logins and authentication events
Privilege escalation
Process execution
Service creation
System changes
By clearing logs, the tester removes:
Evidence of access
Command execution traces
Security alerts
Timeline indicators
Common commands:
wevtutil cl Security
wevtutil cl System
wevtutil cl Application
MITRE ATT&CK:
Indicator Removal on Host (T1070)
This is the most direct method to hide activities already performed.
❌ Why the Other Options Are Wrong
B. Modify the system time
Can disrupt timelines but does not remove logged events.
Often creates suspicious inconsistencies.
C. Alter the log permissions
May prevent future logging access.
Does not remove existing evidence.
D. Reduce the log retention settings
Affects future log storage.
Does not immediately hide past activity.
🎯 PenTest+ Exam Tip
When CompTIA asks about covering tracks, think:
Clear logs ✅
Delete artifacts
Remove tools
Disable auditing
If the question focuses on immediate concealment, clearing logs is usually the best answer.
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?
A. ntlmrelayx.py -t 192.168.1.0/24 -1 1234
B. nc -tulpn 1234 192.168.1.2
C. responder.py -I eth0 -wP
D. crackmapexec smb 192.168.1.0/24
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.
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?
A. Enable monitoring mode using Aircrack-ng.
B. Use Kismet to automatically place the wireless dongle in monitor mode and collect handshakes.
C. Run KARMA to break the password.
D. Research WiGLE.net for potential nearby client access points.
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.
During a security audit, a penetration tester wants to run a process to gather information about a target network's domain structure and associated IP addresses. Which of the following tools should the tester use?
A. Dnsenum
B. Nmap
C. Netcat
D. Wireshark
Explanation:
Dnsenum is a tool specifically designed to gather information about DNS, including domain structure and associated IP addresses.
Here’s why option A is correct:
Dnsenum: This tool is used for DNS enumeration and can gather information about a domain’s DNS records, subdomains, IP addresses, and other related information. It is highly effective for mapping out a target network’s domain structure.
Nmap: While a versatile network scanning tool, Nmap is more focused on port scanning and service detection rather than detailed DNS enumeration.
Netcat: This is a network utility for reading and writing data across network connections, not for DNS enumeration.
Wireshark: This is a network protocol analyzer used for capturing and analyzing network traffic but not specifically for gathering DNS information.
References from Pentest:
Anubis HTB: Shows the importance of using DNS enumeration tools like Dnsenum to gather detailed information about the target’s domain structure.
Forge HTB: Demonstrates the process of using specialized tools to collect DNS and IP information efficiently.
A penetration tester needs to test a very large number of URLs for public access. Given the following code snippet:1) import request 2) import pathlib 3 4) for url in pathlib.Path("urls.txt").read_text().split("\n"): 5 response = requests.get(url) 6 if response.status == 401: 7 print("URL accessible") Which of the following changes is required?
A. The condition on line 6
B. The method on line 5
C. The import on line 1
D. The delimiter in line 3
Explanation:
Script Analysis:
Line 1: import requests - Imports the requests library to handle HTTP requests.
Line 2: import pathlib - Imports the pathlib library to handle file paths.
Line 4: for url in pathlib.Path("urls.txt").read_text().split("\n"): - Reads the urls.txt file, splits its contents by newline, and iterates over each URL.
Line 5: response = requests.get(url) - Sends a GET request to the URL and stores the response.
Line 6: if response.status == 401: - Checks if the response status code is 401 (Unauthorized).
Line 7: print("URL accessible") - Prints a message indicating the URL is accessible.
Error Identification:
The condition if response.status == 401: is incorrect for determining if a URL is publicly accessible. A 401 status code indicates that the resource requires authentication.
Correct Condition:
The correct condition should check for a 200 status code, which indicates that the request was successful and the resource is accessible.
Corrected Script:
Replace if response.status == 401: with if response.status_code == 200: to correctly identify publicly accessible URLs.
Pentest References:
In penetration testing, checking the accessibility of multiple URLs is a common task, often part of reconnaissance. Identifying publicly accessible resources can reveal potential entry points for further testing.
The requests library in Python is widely used for making HTTP requests and handling responses. Understanding HTTP status codes is crucial for correctly interpreting the results of these requests.
By changing the condition to check for a 200 status code, the script will correctly identify and print URLs that are publicly accessible.
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?
A. resolvconf $i
B. rndc $i
C. systemd-resolve $i
D. host $i
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 is conducting a vulnerability scan. The tester wants to see any vulnerabilities that may be visible from outside of the organization. Which of the following scans should the penetration tester perform?
A. SAST
B. Sidecar
C. Unauthenticated
D. Host-based
Explanation:
To see any vulnerabilities that may be visible from outside of the organization, the penetration tester should perform an unauthenticated scan.
Unauthenticated Scan:
Definition: An unauthenticated scan is conducted without providing any credentials to the scanning tool. It simulates the perspective of an external attacker who does not have any prior access to the system.
Purpose: Identifies vulnerabilities that are exposed to the public and can be exploited without authentication. This includes open ports, outdated software, and misconfigurations visible to the outside world.
Comparison with Other Scans:
SAST (Static Application Security Testing): Analyzes source code for vulnerabilities, typically used during the development phase and not suitable for external vulnerability scanning.
Sidecar: This term is generally associated with microservices architecture and is not relevant to the context of vulnerability scanning.
Host-based: Involves scanning from within the network and often requires authenticated access to the host to identify vulnerabilities. It is not suitable for determining external vulnerabilities.
Pentest References:
External Vulnerability Assessment: Conducting unauthenticated scans helps identify the attack surface exposed to external threats and prioritizes vulnerabilities that are accessible from the internet.
Tools: Common tools for unauthenticated scanning include Nessus, OpenVAS, and Nmap.
By performing an unauthenticated scan, the penetration tester can identify vulnerabilities that an external attacker could exploit without needing any credentials or internal access.
A penetration tester presents the following findings to stakeholders:
Control | Number of findings | Risk | Notes
Encryption | 1 | Low | Weak algorithm noted
Patching | 8 | Medium | Unsupported systems
System hardening | 2 | Low | Baseline drift observed
Secure SDLC | 10 | High | Libraries have vulnerabilities
Password policy | 0 | Low | No exceptions noted
Based on the findings, which of the following recommendations should the tester make? (Select two).
A. Develop a secure encryption algorithm.
B. Deploy an asset management system.
C. Write an SDLC policy.
D. Implement an SCA tool.
E. Obtain the latest library version.
F. Patch the libraries.
E. Obtain the latest library version.
Explanation:
Looking at the findings table, the highest risk area is Secure SDLC with 10 findings marked High, specifically noting libraries with vulnerabilities. This is where the tester should focus recommendations:
D. Implement an SCA (Software Composition Analysis) tool → This automates the detection of vulnerable libraries and dependencies during development, ensuring issues are caught early in the SDLC.
E. Obtain the latest library version → Updating to patched versions of libraries directly mitigates the vulnerabilities identified.
Other options explained:
A. Develop a secure encryption algorithm → Not practical; encryption should rely on proven algorithms, not custom ones.
B. Deploy an asset management system → Useful for patching and unsupported systems, but does not directly address the highest risk findings.
C. Write an SDLC policy → Helpful, but less impactful than implementing tools and updating libraries to immediately reduce risk.
F. Patch the libraries → This overlaps with E (Obtain the latest library version), but the more precise recommendation is to update libraries to supported, secure versions.
Why D and E?
Because the Secure SDLC findings are high risk and numerous, the most effective recommendations are:
Implement SCA tooling to continuously detect vulnerable dependencies.
Update libraries to the latest versions to remediate current vulnerabilities.
Reference
CompTIA PenTest+ PT0-003 Exam Objectives: Domain 5.0 – Reporting and Communication (focus on prioritizing high-risk findings).
OWASP Dependency-Check / SCA tools: highlight the importance of automated library vulnerability detection.
A penetration tester is evaluating a SCADA system. The tester receives local access to a workstation that is running a single application. While navigating through the application, the tester opens a terminal window and gains access to the underlying operating system. Which of the following attacks is the tester performing?
A. Kiosk escape
B. Arbitrary code execution
C. Process hollowing
D. Library injection
Explanation:
A kiosk escape involves breaking out of a restricted environment, such as a kiosk or a single application interface, to access the underlying operating system.
Here’s why option A is correct:
Kiosk Escape: This attack targets environments where user access is intentionally limited, such as a kiosk or a dedicated application. The goal is to break out of these restrictions and gain access to the full operating system.
Arbitrary Code Execution: This involves running unauthorized code on the system, but the scenario described is more about escaping a restricted environment.
Process Hollowing: This technique involves injecting code into a legitimate process, making it appear benign while executing malicious activities.Library Injection: This involves injecting malicious code into a running process by loading a malicious library, which is not the focus in this scenario.
References from Pentest:
Forge HTB: Demonstrates techniques to escape restricted environments and gain broader access to the system.
Horizontall HTB: Shows methods to break out of limited access environments, aligning with the concept of kiosk escape.
Conclusion:
Option A, Kiosk escape, accurately describes the type of attack where a tester breaks out of a restricted environment to access the underlying operating system.
| Page 5 out of 28 Pages |