ExamGecko
Home Home / CompTIA / PT0-002

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

Question list
Search
Search

List of questions

Search

Related questions











A security analyst is conducting an unknown environment test from 192.168.3.3. The analyst wants to limit observation of the penetration tester's activities and lower the probability of detection by intrusion protection and detection systems. Which of the following Nmap commands should the analyst use to achieve this objective?

A.
nmap -F 192.168.5.5
A.
nmap -F 192.168.5.5
Answers
B.
nmap -datalength 2 192.168.5.5
B.
nmap -datalength 2 192.168.5.5
Answers
C.
nmap -D 10.5.2.2 192.168.5.5
C.
nmap -D 10.5.2.2 192.168.5.5
Answers
D.
nmap -scanflags SYNFIN 192.168.5.5
D.
nmap -scanflags SYNFIN 192.168.5.5
Answers
Suggested answer: C

A penetration tester is enumerating shares and receives the following output:

Which of the following should the penetration tester enumerate next?

A.
dev
A.
dev
Answers
B.
print$
B.
print$
Answers
C.
home
C.
home
Answers
D.
notes
D.
notes
Answers
Suggested answer: A

Explanation:

The output displayed is typical of what one might see when using a tool like smbclient or enum4linux to list shared directories on a system that uses the SMB (Server Message Block) protocol. Here's a brief overview of the shared resources that have been found:

1. print$ - This share is generally used for printer drivers.

2. home - Could be a user's home directory, usually requires authentication.

3. dev - Suggests a development environment, possibly containing code, scripts, or tools that could be useful for further penetration.

4. notes - This has read and write permissions and could contain information such as user notes or documentation.

While all these shares could potentially provide valuable information, the dev share stands out for several reasons:

* Development Environment: As it seems to be a development share, it may contain scripts, tools, or code repositories which could be less secure than production environments and possibly contain sensitive information such as hardcoded credentials, configuration files, or backup files.

* Standard Names: Shares like print$ and home are common and are likely to be properly secured or to contain less sensitive information.

* Writable Share: The notes share is also interesting because it has read and write permissions, which could be exploited to upload malicious files or modify existing ones. However, the potential for finding exploitable material or sensitive information might be higher with the dev share.

In penetration testing, the goal is to find the path of least resistance that provides the highest potential for deeper access or sensitive information discovery. The dev share represents a target that could yield such information or further avenues for exploitation, making it the next logical step for enumeration.

In Java and C/C++, variable initialization is critical because:

A.
the unknown value, when used later, will cause unexpected behavior.
A.
the unknown value, when used later, will cause unexpected behavior.
Answers
B.
the compiler will assign null to the variable, which will cause warnings and errors.
B.
the compiler will assign null to the variable, which will cause warnings and errors.
Answers
C.
the initial state of the variable creates a race condition.
C.
the initial state of the variable creates a race condition.
Answers
D.
the variable will not have an object type assigned to it.
D.
the variable will not have an object type assigned to it.
Answers
Suggested answer: A

Explanation:

Variable initialization is the process of assigning a value to a variable at the time of declaration. In Java and C/C++, variable initialization is critical because if a variable is not initialized, it may contain a garbage value that is unpredictable and may lead to erroneous results or runtime errors when the variable is used later in the program. For example, if a variable is used in a mathematical expression or a conditional statement, the outcome may depend on the value of the variable. If the variable is not initialized, the outcome may be different each time the program is run, or the program may crash due to an invalid operation. Therefore, it is a good practice to always initialize variables before using them, or to check if they have been initialized before using them123.

Reference:

* Different Ways to Initialize a Variable in C++, GeeksforGeeks article by Anshul Aggarwal

* Static variable initialization?, Stack Overflow answer by Pawe Hajdan

* A Guide to Java Initialization, Baeldung article by Eugen Paraschiv

A penetration tester fuzzes an internal server looking for hidden services and applications and obtains the following output:

Which of the following is the most likely explanation for the output?

A.
The tester does not have credentials to access the server-status page.
A.
The tester does not have credentials to access the server-status page.
Answers
B.
The admin directory cannot be fuzzed because it is forbidden.
B.
The admin directory cannot be fuzzed because it is forbidden.
Answers
C.
The admin, test, and db directories redirect to the log-in page.
C.
The admin, test, and db directories redirect to the log-in page.
Answers
D.
The robots.txt file has six entries in it.
D.
The robots.txt file has six entries in it.
Answers
Suggested answer: C

Explanation:

The output of the fuzzing tool shows that the admin, test, and db directories have the same size, words, and lines as the login page, which indicates that they are redirecting to the login page. This means that the tester cannot access these directories without valid credentials. The server-status page returns a 403 Forbidden status code, which means that the tester does not have permission to access it. The robots.txt file returns a 404 Not Found status code, which means that the file does not exist on the server.

Reference:

* The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 2: Conducting Passive Reconnaissance, page 77-78.

* 101 Labs --- CompTIA PenTest+: Hands-on Labs for the PT0-002 Exam, Lab 2.3: Fuzzing Web Applications, page 69-70.

A penetration tester wants to find the password for any account in the domain without locking any of the accounts. Which of the following commands should the tester use?

A.
enum4linux -u userl -p /passwordList.txt 192.168.0.1
A.
enum4linux -u userl -p /passwordList.txt 192.168.0.1
Answers
B.
enum4linux -u userl -p Passwordl 192.168.0.1
B.
enum4linux -u userl -p Passwordl 192.168.0.1
Answers
C.
cme smb 192.168.0.0/24 -u /userList.txt -p /passwordList.txt
C.
cme smb 192.168.0.0/24 -u /userList.txt -p /passwordList.txt
Answers
D.
cme smb 192.168.0.0/24 -u /userList.txt -p Summer123
D.
cme smb 192.168.0.0/24 -u /userList.txt -p Summer123
Answers
Suggested answer: C

Explanation:

The cme smb 192.168.0.0/24 -u /userList.txt -p /passwordList.txt command is used to perform SMB enumeration on the 192.168.0.0/24 subnet using a list of usernames and passwords. The -u option specifies the file containing the usernames, and the -p option specifies the file containing the passwords1. This command allows the tester to attempt to authenticate with multiple accounts without locking any of them out.

Reference: SMB Command

Which of the following tools would be the best to use to intercept an HTTP response of an API, change its content, and forward it back to the origin mobile device?

A.
Drozer
A.
Drozer
Answers
B.
Burp Suite
B.
Burp Suite
Answers
C.
Android SDK Tools
C.
Android SDK Tools
Answers
D.
MobSF
D.
MobSF
Answers
Suggested answer: B

Explanation:

Burp Suite is a tool that allows intercepting and modifying HTTP requests and responses of an API, as well as performing other web application security testing tasks. Burp Suite can act as a proxy between the mobile device and the API server, and enable the tester to view, edit, and replay the HTTP traffic. Burp Suite can also modify the content of the HTTP response, such as changing the status code, headers, or body, and forward it back to the mobile device12. The other tools are not suitable for this purpose, as they either focus on Android application analysis and exploitation (Drozer and MobSF) or development and debugging (Android SDK Tools).

Reference:

* Intercepting Mobile Application Traffic Using Burp Suite, Infosec Resources article by Srinivas

* How to Intercept and Modify HTTP Requests and Responses with Burp Suite, MDN Web Docs article by Mozilla

During a client engagement, a penetration tester runs the following Nmap command and obtains the following output:

nmap -sV -- script ssl-enum-ciphers -p 443 remotehost

| TLS_ECDHE_ECDSA_WITH_RC4_128_SHA

| TLS_ECDHE_RSA_WITH_RC4_128_SHA

| TLS_RSA_WITH_RC4_128_SHA (rsa 2048)

TLS_RSA_WITH_RC4_128_MD5 (rsa 2048)

Which of the following should the penetration tester include in the report?

A.
Old, insecure ciphers are in use.
A.
Old, insecure ciphers are in use.
Answers
B.
The 3DES algorithm should be deprecated.
B.
The 3DES algorithm should be deprecated.
Answers
C.
2,048-bit symmetric keys are incompatible with MD5.
C.
2,048-bit symmetric keys are incompatible with MD5.
Answers
D.
This server should be upgraded to TLS 1.2.
D.
This server should be upgraded to TLS 1.2.
Answers
Suggested answer: A

A penetration tester is preparing a credential stuffing attack against a company's website. Which of the following can be used to passively get the most relevant information?

A.
Shodan
A.
Shodan
Answers
B.
BeEF
B.
BeEF
Answers
C.
HavelBeenPwned
C.
HavelBeenPwned
Answers
D.
Maltego
D.
Maltego
Answers
Suggested answer: C

Explanation:

HaveIBeenPwned is a website that allows users to check if their personal data has been compromised by data breaches. For a penetration tester preparing a credential stuffing attack, HaveIBeenPwned can provide valuable information about which accounts and passwords have been exposed, making them more likely targets for successful credential stuffing. This passive information gathering tool can help in identifying the most relevant credentials without actively probing the target's systems. The other tools listed (Shodan, BeEF, Maltego) serve different purposes, such as device and service enumeration, client-side exploitation, and information gathering through different means, respectively.

During an engagement, a penetration tester was able to upload to a server a PHP file with the following content:

<? php system ($_POST['cmd']) ?>

Which of the following commands should the penetration tester run to successfully achieve RCE?

A.
Option A
A.
Option A
Answers
B.
Option B
B.
Option B
Answers
C.
Option C
C.
Option C
Answers
D.
Option D
D.
Option D
Answers
Suggested answer: A

Explanation:

The PHP file uploaded by the penetration tester allows for Remote Code Execution (RCE) by executing the command supplied through the cmd POST parameter. To exploit this, the penetration tester needs to send a POST request to the PHP file with the command they want to execute.

Among the given options, Option A is the most suitable for achieving RCE:

It uses Python's requests library to send a POST request, which is appropriate because the PHP script expects data through the POST method.

The data parameter in the requests.post function is correctly formatted as a dictionary, which is the expected format for sending form data in POST requests. It includes the key cmd with the value id, which is a common command used to display the current user ID and group ID.

The only minor issue with Option A is that it prints the entire response object, which includes not just the response content but also metadata like status code and headers. To print just the response content (which would include the output of the id command), appending .text to the requests.post call would be more precise, but this is a small detail and does not affect the execution of the command.

The other options have various issues:

Option B is close but has a syntax error in the data argument. It uses parentheses () instead of curly braces {} for the dictionary, and also lacks the .text at the end to print the response content.

Options C and D use the requests.get method, which is not suitable in this scenario because the PHP script is expecting data through the POST method, not the GET method. Additionally, Option D has a syntax error similar to Option B.


Which of the following is the most common vulnerability associated with loT devices that are directly connected to the internet?

A.
Unsupported operating systems
A.
Unsupported operating systems
Answers
B.
Susceptibility to DDoS attacks
B.
Susceptibility to DDoS attacks
Answers
C.
Inability to network
C.
Inability to network
Answers
D.
The existence of default passwords
D.
The existence of default passwords
Answers
Suggested answer: D

Explanation:

IoT devices are often shipped with default passwords, which are easily discoverable and widely known. Many users fail to change these default credentials, leaving the devices vulnerable to unauthorized access. This issue is one of the most common vulnerabilities associated with IoT devices connected directly to the internet. Attackers can exploit these default passwords to gain control over the devices, potentially leading to a range of malicious activities, including the recruitment of the devices into botnets for Distributed Denial of Service (DDoS) attacks, data breaches, or other cybercriminal activities.

Total 422 questions
Go to page: of 43