CompTIA PenTest+ PT0-002 Dumps in PDF

Free CompTIA PT0-002 Real Questions (page: 6)

A client warns the assessment team that an ICS application is maintained by the manufacturer. Any tampering of the host could void the enterprise support terms of use.
Which of the following techniques would be most effective to validate whether the application encrypts communications in transit?

  1. Utilizing port mirroring on a firewall appliance
  2. Installing packet capture software on the server
  3. Reconfiguring the application to use a proxy
  4. Requesting that certificate pinning be disabled

Answer(s): A

Explanation:

A: Utilizing port mirroring on a firewall appliance is the most effective technique for validating whether the application encrypts communications in transit.
Port mirroring allows real-time traffic analysis without altering the application's operational integrity. By duplicating network packets traversing the network interface, one can inspect whether the data is encrypted during transmission. This technique efficiently captures both inbound and outbound traffic to ascertain encryption mechanisms without modifying the application's environment, thus preserving the terms of use and maintaining manufacturer support.
Evaluation of Other Options:
B: Installing packet capture software on the server introduces a risk of modifying the host environment, potentially violating the client’s stipulations regarding manufacturer support. This method also circumvents any potential network encryption mechanisms, as it may not capture traffic effectively when the application is not designed to route through those interfaces.
C: Reconfiguring the application to use a proxy is intrusive and may unilaterally alter the application's intended operation, thus breaching the enterprise support terms. It also poses risks of decreased performance or availability and generally does not provide a clear method to identify all potential encryption protocols being utilized in existing communications.
D: Requesting that certificate pinning be disabled fundamentally undermines the security posture of the application. It exposes the communication channels to man-in-the-middle attacks and compromises overall integrity. This method is not only less effective but also unethical, posing risks to the confidentiality and integrity of communications.
Utilizing port mirroring is therefore the optimal approach, as it provides a non-intrusive, ethical means of verifying encryption without jeopardizing client relationships or support agreements.
References:
https://www.cisco.com/c/en/us/support/docs/ip/access-lists/13775-54.html https://www.cloudflare.com/learning/how-tls-works/ https://www.sans.org/white-papers/40137/


Reference:

References:
https://www.cisco.com/c/en/us/support/docs/ip/access-lists/13775-54.html https://www.cloudflare.com/learning/how-tls-works/ https://www.sans.org/white-papers/40137/



While performing a penetration testing exercise, a tester executes the following command: PS c:\tools> c:\hacks\PsExec.exe \\server01.comptia.org -accepteula cmd.exe Which of the following best explains what the tester is trying to do?

  1. Test connectivity using PSExec on the server01 using CMD.exe.
  2. Perform a lateral movement attack using PsExec.
  3. Send the PsExec binary file to the server01 using CMD.exe.
  4. Enable CMexe on the server01 through PsExec.

Answer(s): B

Explanation:

B is correct because the command executed via PsExec enables the tester to execute commands on a remote system, thereby facilitating lateral movement within the network infrastructure.
The command invokes PsExec, a tool designed for executing processes on remote systems. The use of -
accepteula indicates that the tester has pre-approved the End User License Agreement to avoid interruptions during execution. By passing cmd.exe as the argument, the tester is essentially establishing a command prompt session on server01 , which is characteristic of lateral movement where an attacker seeks to navigate through the network after gaining initial access. This enables the tester to potentially exploit vulnerabilities or gather sensitive information on the target machine.
Evaluation of Incorrect Options:

A: Test connectivity using PSExec on the server01 using CMD.exe.
While PsExec does require connectivity, its purpose extends beyond simple connectivity testing. This option understates PsExec's capability to start processes remotely, misleadingly implying that the command's intent is solely to verify network connectivity.
C: Send the PsExec binary file to the server01 using CMD.exe. This option is incorrect because the command does not involve transferring files. PsExec is already available on the local system from where the command is executed, and it is utilized to run processes remotely, not to transfer the binary itself.
D: Enable CMD.exe on the server01 through PsExec. This option misinterprets the functionality of PsExec, suggesting that it merely activates CMD.exe. In reality, the command is executing CMD.exe remotely, not “enabling” it. The command directly spawns a command prompt, allowing the tester to operate within the server context.
References:
https://docs.microsoft.com/en-us/sysinternals/downloads/psexec https://www.sans.org/white-papers/37060/ https://www.csoonline.com/article/3231637/best-practices-for-lateral-movement-and-privilege-escalation.html


Reference:

References:
https://docs.microsoft.com/en-us/sysinternals/downloads/psexec https://www.sans.org/white-papers/37060/ https://www.csoonline.com/article/3231637/best-practices-for-lateral-movement-and-privilege-escalation.html



During an assessment, a penetration tester obtains a low-privilege shell and then runs the following command: findstr /SIM /C:"pass” *.txt *.cfg *.xml Which of the following is the penetration tester trying to enumerate?

  1. Configuration files
  2. Permissions
  3. Virtual hosts
  4. Secrets

Answer(s): D

Explanation:

D is correct because the command is designed to search for sensitive information, such as passwords, in text-based files.
The command findstr /SIM /C:"pass” .txt .cfg *.xml utilizes the findstr utility to recursively search through files with specific extensions for strings that contain "pass," likely indicating a password. The inclusion of the /S
flag allows searching in subdirectories, while the /I flag makes the search case-insensitive. This clearly reflects an effort to uncover sensitive data, such as secrets or credentials, stored in configuration files or text files.

A: Configuration files While configuration files could contain secrets, the command particularly searches for the term "pass," suggesting a focus on sensitive data rather than just the files themselves.
B: Permissions The command does not assess user privileges or permissions but is rather oriented towards finding specific keywords within files, making this option inaccurate.
C: Virtual hosts The search for a keyword does not reveal information about virtual hosts or their configurations, as this would require different commands focused on network configurations.
In conclusion, the intent behind the command strongly aligns with enumerating secrets, particularly passwords, hence validating option D as the most appropriate choice.


Reference:

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr " target="_blank"> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr https://www.cybersecurity-insiders.com/the-top-5-tools-and-techniques-for-penetration-testing/ " target="_blank"> https://www.cybersecurity-insiders.com/the-top-5-tools-and-techniques-for-penetration-testing/ https://www.comptia.org/certifications/pentest
" target="_blank"> https://www.comptia.org/certifications/pentest



A penetration tester finished a security scan and uncovered numerous vulnerabilities on several hosts. Based on the targets' EPSS and CVSS scores, which of the following targets is the most likely to get attacked?

  1. Target 1: EPSS Score = 0.6 and CVSS Score = 4
  2. Target 2: EPSS Score = 0.3 and CVSS Score = 2
  3. Target 3: EPSS Score = 0.6 and CVSS Score = 1
  4. Target 4: EPSS Score = 0.4 and CVSS Score = 4.5

Answer(s): A

Explanation:

Option A is correct because it has the highest Environmental Priority Score System (EPSS) score coupled with a relatively high Common Vulnerability Scoring System (CVSS) score, indicating it is both likely to be exploited and poses a significant risk.
The EPSS provides a predictive model forecasting the likelihood of a vulnerability being exploited in the wild. A score of 0.6 suggests a strong probability of exploitation. The CVSS score of 4 indicates a medium severity level, highlighting the vulnerability's potential impact. Together, these scores signal that Target 1 is a key candidate for attack.
Evaluation of Other Options:
Option B (EPSS = 0.3, CVSS = 2): The low EPSS score indicates a reduced likelihood of exploitation, while a CVSS score of 2 signifies a low severity. Therefore, this target is less appealing for attackers focused on impactful vulnerabilities.
Option C (EPSS = 0.6, CVSS = 1): The EPSS score is enticing, yet the CVSS score of 1 indicates minimal severity and potential damage. Attackers are less motivated to exploit vulnerabilities that offer negligible risk.
Option D (EPSS = 0.4, CVSS = 4.5): While this option has a higher CVSS score suggesting significant impact, the lower EPSS score (0.4) diminishes the likelihood of exploitation compared to Target 1, making it less likely to be targeted in practice.
In summary, Target 1's combination of a high likelihood of exploitation and a medium severity score offers attackers an optimal target.
References:
https://www.first.org/cvss/ https://www.epss.io/ https://nvd.nist.gov/vuln/


Reference:

References:
https://www.first.org/cvss/ https://www.epss.io/ https://nvd.nist.gov/vuln/



During a discussion of a penetration test final report, the consultant shows the following payload used to attack a system: ?/<sCRitP>aLeRt("pwned")</ScriPt> Based on the code, which of the following options represents the attack executed by the tester and the associated countermeasure?

  1. Arbitrary code execution; the affected computer should be placed on a perimeter network
  2. SQL injection attack; should be detected and prevented by a web application firewall
  3. Cross-site request forgery; should be detected and prevented by a firewall
  4. XSS obfuscated; should be prevented by input sanitization

Answer(s): D

Explanation:

The provided payload <sCRitP>aLeRt("pwned")</ScriPt> is a classic example of Cross-Site Scripting (XSS). The deliberate casing variation ( sCRitP , ScriPt ) is an obfuscation technique used to bypass rudimentary security filters that might only check for lowercase <script> tags. The core intent is to inject malicious JavaScript code into a website, which then executes in the user's browser when they visit the compromised page. The aLeRt("pwned") part of the payload is a simple demonstration; a real attack could inject more harmful code to steal cookies, redirect users, or deface the website.
Option D is correct because it identifies the attack as XSS and the appropriate countermeasure as input sanitization. Input sanitization involves carefully validating and cleaning user-provided input to remove or neutralize any potentially malicious characters or code. This is critical because XSS relies on injecting untrusted data into the web application's output.
Option A is incorrect.
While arbitrary code execution can be a consequence of successful XSS exploitation, the payload itself is specifically designed for client-side execution within a browser, not for arbitrary code execution on the server. Placing the computer on a perimeter network is not an appropriate mitigation for XSS.
Option B is incorrect. SQL injection targets the database layer by injecting malicious SQL code into input fields. The given payload doesn't interact with the database; it focuses on injecting JavaScript into the client-side. A Web Application Firewall (WAF) can offer some XSS protection, but input sanitization remains the primary and most robust defense.
Option C is incorrect. Cross-Site Request Forgery (CSRF) exploits the trust a website has in a user's browser to perform actions without the user's knowledge. The given payload is not a CSRF attack; it's designed to inject and execute JavaScript. Firewalls are not typically effective against CSRF, as the request originates from a legitimate user session.
In conclusion, the obfuscated <sCRitP> tag signals an XSS attack, and input sanitization is the most effective defensive measure to prevent such injections by validating user inputs.
Authoritative Links:
OWASP Cross-Site Scripting (XSS): https://owasp.org/www-community/attacks/xss/ OWASP Input Validation Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html



A penetration tester gains shell access to a Windows host. The tester needs to permanently turn off protections in order to install additional payload.
Which of the following commands is most appropriate?

  1. sc config <svc_name> start=disabled
  2. sc query state= all
  3. pskill <pid_svc_name>
  4. net config <svc_name>

Answer(s): A

Explanation:

A: sc config start=disabled is correct as it disables the specified service permanently, ensuring that any security controls do not start with the operating system.
Reasoning: The command sc config <svc_name> start=disabled modifies the startup type of a service to disabled, effectively allowing the penetration tester to circumvent any protections provided by that service. This method offers a robust approach to securing the environment for additional payload installation without the concern of the service automatically re-enabling itself upon reboot.
Evaluation of Other Options:
B: sc query state= all: This command only retrieves the status of all services but does not alter them. Its utility is limited to information gathering, which does not assist in disabling protections, rendering it ineffective for this objective.
C: pskill : While this command terminates a process by its PID, it does not prevent the service from starting again upon system reboot. This option is a temporary fix that still allows for the service's re-establishment, which contradicts the requirement for a permanent alteration.
D: net config : This command is typically associated with network-related services and configurations, but cannot disable a service’s startup configuration. It neither facilitates the disabling of protection nor offers a direct manipulation of the service state, thereby failing to address the primary objective.
For further references on Windows services and command-line management, consult the following resources:
https://docs.microsoft.com/en-us/windows/win32/services/startup-types https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-config https://docs.microsoft.com/en-us/sysinternals/downloads/pskill



A penetration tester discovers data to stage and exfiltrate. The client has authorized movement to the tester’s attacking hosts only.
Which of the following would be most appropriate to avoid alerting the SOC?

  1. Apply UTF-8 to the data and send over a tunnel to TCP port 25.
  2. Apply Base64 to the data and send over a tunnel to TCP port 80.
  3. Apply 3DES to the data and send over a tunnel UDP port 53.
  4. Apply AES-256 to the data and send over a tunnel to TCP port 443.

Answer(s): D

Explanation:

Here's a detailed justification for why option D is the most appropriate choice, along with supporting explanations and resources:
Option D, applying AES-256 to the data and sending it over a tunnel to TCP port 443, is the most suitable for avoiding detection by the SOC during data exfiltration for several reasons. First, AES-256 is a strong symmetric encryption algorithm widely considered secure and very difficult to break without the key. This encryption protects the data's confidentiality during transit. Second, using a tunnel over TCP port 443 leverages the same port used for HTTPS (SSL/TLS) traffic. This means the traffic will likely blend in with legitimate encrypted web traffic, making it significantly harder for the SOC to distinguish it from normal operations. Most organizations allow and expect encrypted traffic on port 443.
Options A, B, and C have shortcomings. Option A uses UTF-8 encoding, which is just character encoding and provides no encryption, leaving the data exposed. Port 25 is typically used for SMTP, and sending a large amount of data over it could raise suspicion. Option B, using Base64, is an encoding scheme, not encryption; it simply makes the data appear in a different format but is easily decodable. Port 80 is used for HTTP, which is unencrypted and therefore insecure for exfiltrating sensitive data. Option C, while using 3DES, is an older encryption algorithm and is less secure than AES-256. UDP port 53 is used for DNS, and while tunneling over DNS is a known technique, it is often monitored due to its potential for abuse, and large data transfers over DNS are atypical.
Therefore, the combination of strong encryption (AES-256) and mimicking standard encrypted web traffic (TCP 443) provides the best chance of bypassing SOC detection and successfully exfiltrating the data while adhering to the authorization of movement to the tester's attacking hosts.
Supporting Links:
AES-256: https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/archived-crypto-tools/aes TLS/SSL (HTTPS): https://www.cloudflare.com/learning/ssl/what-is-ssl/ Tunneling: https://owasp.org/www-community/attacks/Tunneling_or_Port_Redirection



A penetration tester performs a service enumeration process and receives the following result after scanning a server using the Nmap tool:

Based on the output, which of the following services provides the best target for launching an attack?

  1. Database
  2. Remote access
  3. Email
  4. File sharing

Answer(s): D

Explanation:

SSH is high-value if you have credentials.
NFS/NIS (port 2049) is a file sharing service, often exploitable with no credentials if misconfigured.
Therefore, from a penetration tester’s perspective.
Port 2049 (NIS) → File sharing → best target for launching an attack



Share your comments for CompTIA PT0-002 exam with other users:

S
SAJI
7/20/2023 2:51:00 AM

56 question correct answer a,b

S
Summer
10/4/2023 9:57:00 PM

looking forward to the real exam

AI Tutor 👋 I’m here to help!