ExamGecko
Home Home / CompTIA / PT0-002

CompTIA PT0-002 Practice Test - Questions Answers, Page 26

Question list
Search
Search

List of questions

Search

Related questions











During an assessment, a penetration tester manages to exploit an LFI vulnerability and browse the web log for a target Apache server. Which of the following steps would the penetration tester most likely try NEXT to further exploit the web server? (Choose two.)

A.
Cross-site scripting
A.
Cross-site scripting
Answers
B.
Server-side request forgery
B.
Server-side request forgery
Answers
C.
SQL injection
C.
SQL injection
Answers
D.
Log poisoning
D.
Log poisoning
Answers
E.
Cross-site request forgery
E.
Cross-site request forgery
Answers
F.
Command injection
F.
Command injection
Answers
Suggested answer: D, F

Explanation:

Local File Inclusion (LFI) is a web vulnerability that allows an attacker to include files on a server through the web browser. This can expose sensitive information or lead to remote code execution.

Some possible next steps that a penetration tester can try after exploiting an LFI vulnerability are:

Log poisoning: This involves injecting malicious code into the web server's log files and then including them via LFI to execute the code34.

PHP wrappers: These are special streams that can be used to manipulate files or data via LFI. For example, php://input can be used to pass arbitrary data to an LFI script, or php://filter can be used to encode or decode files5.

A penetration tester opened a reverse shell on a Linux web server and successfully escalated privileges to root. During the engagement, the tester noticed that another user logged in frequently as root to perform work tasks. To avoid disrupting this user's work, which of the following is the BEST option for the penetration tester to maintain root-level persistence on this server during the test?

A.
Add a web shell to the root of the website.
A.
Add a web shell to the root of the website.
Answers
B.
Upgrade the reverse shell to a true TTY terminal.
B.
Upgrade the reverse shell to a true TTY terminal.
Answers
C.
Add a new user with ID 0 to the /etc/passwd file.
C.
Add a new user with ID 0 to the /etc/passwd file.
Answers
D.
Change the password of the root user and revert after the test.
D.
Change the password of the root user and revert after the test.
Answers
Suggested answer: C

Explanation:

The best option for the penetration tester to maintain root-level persistence on this server during the test is to add a new user with ID 0 to the /etc/passwd file. This will allow the penetration tester to use the same user account as the other user, but with root privileges, meaning that it won't disrupt the other user's work. This can be done by adding a new line with the username and the numerical user ID 0 to the /etc/passwd file. For example, if the username for the other user is "johndoe", the line to add would be "johndoe:x:0:0:John Doe:/root:/bin/bash". After the user is added, the penetration tester can use the "su" command to switch to the new user and gain root privileges.

A company requires that all hypervisors have the latest available patches installed. Which of the following would BEST explain the reason why this policy is in place?

A.
To provide protection against host OS vulnerabilities
A.
To provide protection against host OS vulnerabilities
Answers
B.
To reduce the probability of a VM escape attack
B.
To reduce the probability of a VM escape attack
Answers
C.
To fix any misconfigurations of the hypervisor
C.
To fix any misconfigurations of the hypervisor
Answers
D.
To enable all features of the hypervisor
D.
To enable all features of the hypervisor
Answers
Suggested answer: B

Explanation:

A hypervisor is a type of virtualization software that allows multiple virtual machines (VMs) to run on a single physical host machine. If the hypervisor is compromised, an attacker could potentially gain access to all of the VMs running on that host, which could lead to a significant data breach or other security issues.

One common type of attack against hypervisors is known as a VM escape attack. In this type of attack, an attacker exploits a vulnerability in the hypervisor to break out of the VM and gain access to the host machine. From there, the attacker can potentially gain access to other VMs running on the same host.

By ensuring that all hypervisors have the latest available patches installed, the company can reduce the likelihood that a VM escape attack will be successful. Patches often include security updates and vulnerability fixes that address known issues and can help prevent attacks.

A penetration tester uncovers access keys within an organization's source code management solution. Which of the following would BEST address the issue? (Choose two.)

A.
Setting up a secret management solution for all items in the source code management system
A.
Setting up a secret management solution for all items in the source code management system
Answers
B.
Implementing role-based access control on the source code management system
B.
Implementing role-based access control on the source code management system
Answers
C.
Configuring multifactor authentication on the source code management system
C.
Configuring multifactor authentication on the source code management system
Answers
D.
Leveraging a solution to scan for other similar instances in the source code management system
D.
Leveraging a solution to scan for other similar instances in the source code management system
Answers
E.
Developing a secure software development life cycle process for committing code to the source code management system
E.
Developing a secure software development life cycle process for committing code to the source code management system
Answers
F.
Creating a trigger that will prevent developers from including passwords in the source code management system
F.
Creating a trigger that will prevent developers from including passwords in the source code management system
Answers
Suggested answer: A, E

Explanation:

Access keys are credentials that allow users to authenticate and authorize requests to a source code management (SCM) system, such as GitLab or AWS. Access keys should be kept secret and not exposed in plain text within the source code, as this can compromise the security and integrity of the SCM system and its data.

Some possible options for addressing the issue of access keys within an organization's SCM solution are:

Setting up a secret management solution for all items in the SCM system: This is a tool or service that securely stores, manages, and distributes secrets such as access keys, passwords, tokens, certificates, etc. A secret management solution can help prevent secrets from being exposed in plain text within the source code or configuration files3456.

Developing a secure software development life cycle (SDLC) process for committing code to the SCM system: This is a framework or methodology that defines how software is developed, tested, deployed, and maintained. A secure SDLC process can help ensure that best practices for security are followed throughout the software development process, such as code reviews, static analysis tools, vulnerability scanning tools, etc. A secure SDLC process can help detect and prevent access keys from being included in the source code before they are committed to the SCM system1.

The provision that defines the level of responsibility between the penetration tester and the client for preventing unauthorized disclosure is found in the:

A.
NDA
A.
NDA
Answers
B.
SLA
B.
SLA
Answers
C.
MSA
C.
MSA
Answers
D.
SOW
D.
SOW
Answers
Suggested answer: A

Explanation:

The provision that defines the level of responsibility between the penetration tester and the client for preventing unauthorized disclosure is found in the NDA, which stands for Non-Disclosure Agreement. The NDA is a legal agreement between two or more parties that outlines confidential material or knowledge that the parties wish to share with one another, but with restrictions on access, use or disclosure of that information. The NDA is commonly used in the context of penetration testing to protect the client's sensitive information that the tester may have access to during the engagement.

The NDA defines the terms of confidentiality and non-disclosure of information related to the engagement, including the responsibilities and obligations of both the tester and the client to ensure that any information exchanged or obtained during the engagement is kept confidential and not disclosed to unauthorized parties. This is particularly important in penetration testing, as the tester is granted access to the client's network and systems, and may uncover vulnerabilities or sensitive information that should not be disclosed to unauthorized parties.

In summary, the NDA plays a crucial role in defining the level of responsibility between the penetration tester and the client for preventing unauthorized disclosure of confidential information, and is an important legal instrument for protecting the client's sensitive information during a penetration testing engagement.

A penetration tester created the following script to use in an engagement:

However, the tester is receiving the following error when trying to run the script:

Which of the following is the reason for the error?

A.
The sys variable was not defined.
A.
The sys variable was not defined.
Answers
B.
The argv variable was not defined.
B.
The argv variable was not defined.
Answers
C.
The sys module was not imported.
C.
The sys module was not imported.
Answers
D.
The argv module was not imported.
D.
The argv module was not imported.
Answers
Suggested answer: C

Explanation:

The sys module is a built-in module in Python that provides access to system-specific parameters and functions, such as command-line arguments, standard input/output, and exit status. The sys module must be imported before it can be used in a script, otherwise an error will occur. The script uses the sys.argv variable, which is a list that contains the command-line arguments passed to the script.

However, the script does not import the sys module at the beginning, which causes the error "NameError: name 'sys' is not defined". To fix this error, the script should include the statement "import sys" at the top. The other options are not valid reasons for the error.

A penetration tester was able to compromise a web server and move laterally into a Linux web server. The tester now wants to determine the identity of the last user who signed in to the web server. Which of the following log files will show this activity?

A.
/var/log/messages
A.
/var/log/messages
Answers
B.
/var/log/last_user
B.
/var/log/last_user
Answers
C.
/var/log/user_log
C.
/var/log/user_log
Answers
D.
/var/log/lastlog
D.
/var/log/lastlog
Answers
Suggested answer: D

Explanation:

The /var/log/lastlog file is a log file that stores information about the last user to sign in to the server.

This file stores information such as the username, IP address, and timestamp of the last user to sign in to the server. It can be used by a penetration tester to determine the identity of the last user who signed in to the web server, which can be helpful in identifying the user who may have set up the backdoors and other malicious activities.

A penetration tester is conducting an engagement against an internet-facing web application and planning a phishing campaign. Which of the following is the BEST passive method of obtaining the technical contacts for the website?

A.
WHOIS domain lookup
A.
WHOIS domain lookup
Answers
B.
Job listing and recruitment ads
B.
Job listing and recruitment ads
Answers
C.
SSL certificate information
C.
SSL certificate information
Answers
D.
Public data breach dumps
D.
Public data breach dumps
Answers
Suggested answer: A

Explanation:

The BEST passive method of obtaining the technical contacts for the website would be a WHOIS domain lookup. WHOIS is a protocol that provides information about registered domain names, such as the registration date, registrant's name and contact information, and the name servers assigned to the domain. By performing a WHOIS lookup, the penetration tester can obtain the contact information of the website's technical staff, which can be used to craft a convincing phishing email.

Which of the following tools would BEST allow a penetration tester to capture wireless handshakes to reveal a Wi-Fi password from a Windows machine?

A.
Wireshark
A.
Wireshark
Answers
B.
EAPHammer
B.
EAPHammer
Answers
C.
Kismet
C.
Kismet
Answers
D.
Aircrack-ng
D.
Aircrack-ng
Answers
Suggested answer: D

Explanation:

The BEST tool to capture wireless handshakes to reveal a Wi-Fi password from a Windows machine is Aircrack-ng. Aircrack-ng is a suite of tools used to assess the security of wireless networks. It starts by capturing wireless network packets [1], then attempts to crack the network password by analyzing them [1]. Aircrack-ng supports FMS, PTW, and other attack types, and can also be used to generate keystreams for WEP and WPA-PSK encryption. It is capable of running on Windows, Linux, and Mac OS X.

The BEST tool to capture wireless handshakes to reveal a Wi-Fi password from a Windows machine is

Aircrack-ng. Aircrack-ng is a suite of tools used to assess the security of wireless networks. It starts by capturing wireless network packets [1], then attempts to crack the network password by analyzing them [1]. Aircrack-ng supports FMS, PTW, and other attack types, and can also be used to generate keystreams for WEP and WPA-PSK encryption. It is capable of running on Windows, Linux, and Mac OS X.

A penetration tester analyzed a web-application log file and discovered an input that was sent to the company's web application. The input contains a string that says "WAITFOR." Which of the following attacks is being attempted?

A.
SQL injection
A.
SQL injection
Answers
B.
HTML injection
B.
HTML injection
Answers
C.
Remote command injection
C.
Remote command injection
Answers
D.
DLL injection
D.
DLL injection
Answers
Suggested answer: A

Explanation:

WAITFOR can be used in a type of SQL injection attack known as time delay SQL injection or blind SQL injection34. This attack works on the basis that true or false queries can be answered by the amount of time a request takes to complete. For example, an attacker can inject a WAITFOR command with a delay argument into an input field of a web application that uses SQL Server as its database. If the query returns true, then the web application will pause for the specified period of time before responding; if the query returns false, then the web application will respond immediately. By observing the response time, the attacker can infer information about the database structure and data1.

Based on this information, one possible answer to your question is A. SQL injection, because it is an attack that exploits a vulnerability in a web application that allows an attacker to execute arbitrary SQL commands on the database server.

Total 422 questions
Go to page: of 43