ExamGecko
Home Home / CompTIA / PT0-002

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

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.
Map --datalength 2.192.168.5.5
B.
Map --datalength 2.192.168.5.5
Answers
C.
Nmap --D 10.5.2.2.168.5.5
C.
Nmap --D 10.5.2.2.168.5.5
Answers
D.
Map --scanflags SYNFIN 192.168.5.5
D.
Map --scanflags SYNFIN 192.168.5.5
Answers
Suggested answer: D

Explanation:

To limit observation of the penetration tester's activities and lower the probability of detection by intrusion protection and detection systems, the security analyst should use theNmap -D 10.5.2.2 192.168.3.3command1. The -D option is used to conceal the identity of the attacker by using decoy IP addresses.This option can be used to confuse the IDS/IPS and lower the probability of detection1.

Which of the following tools would be the best to use to intercept an HTTP response at 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 web application security testing tool that can intercept, modify, and forward HTTP requests and responses. It can be used to manipulate the data sent between an API and a mobile device, such as changing the content of the response before it reaches the device. Drozer is a framework for Android security assessment, but it does not intercept HTTP traffic. Android SDK Tools are a set of tools for developing Android applications, but they do not have the functionality to intercept and modify HTTP responses.MobSF is a mobile security framework that can perform static and dynamic analysis of Android and iOS applications, but it does not have the capability to intercept and change HTTP responses at an API level.Reference:The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 8: Application Testing1; The Official CompTIA PenTest+ Student Guide (Exam PT0-002), Lesson 8: Application Testing2; Burp Suite Documentation3

A penetration tester executes the following Nmap command and obtains the following output:

Which of the following commands would best help the penetration tester discover an exploitable service?

A.
nmap -v -p 25 -- soript smtp-enum-users remotehost
A.
nmap -v -p 25 -- soript smtp-enum-users remotehost
Answers
B.
nmap -v -- script=mysql-info.nse remotehost
B.
nmap -v -- script=mysql-info.nse remotehost
Answers
C.
nmap --ocript=omb-brute.noe remotehoat
C.
nmap --ocript=omb-brute.noe remotehoat
Answers
D.
nmap -p 3306 -- script 'http*vuln*' remotehost
D.
nmap -p 3306 -- script 'http*vuln*' remotehost
Answers
Suggested answer: B

Explanation:

The Nmap command in the question scans all ports on the remote host and identifies the services and versions running on them. The output shows that port 3306 is open and running MariaDB, which is a fork of MySQL. Therefore, the best command to discover an exploitable service would be to use the mysql-info.nse script, which gathers information about the MySQL server, such as the version, user accounts, databases, and configuration variables. The other commands are either misspelled, irrelevant, or too broad for the task.Reference:Best PenTest+ certification study resources and training materials,CompTIA PenTest+ PT0-002 Cert Guide,101 Labs --- CompTIA PenTest+: Hands-on Labs for the PT0-002 Exam

During a vulnerability scanning phase, a penetration tester wants to execute an Nmap scan using custom NSE scripts stored in the following folder:

/home/user/scripts

Which of the following commands should the penetration tester use to perform this scan?

A.
nmap resume 'not intrusive'
A.
nmap resume 'not intrusive'
Answers
B.
nmap script default safe
B.
nmap script default safe
Answers
C.
nmap script /home/user/scripts
C.
nmap script /home/user/scripts
Answers
D.
nmap -load /home/user/scripts
D.
nmap -load /home/user/scripts
Answers
Suggested answer: C

Explanation:

The Nmap command in the question aims to use custom NSE scripts stored in a specific folder. The correct syntax for this option is to use the script argument followed by the path to the folder. The other commands are either invalid, use the wrong argument, or do not specify the folder path.Reference:Best PenTest+ certification study resources and training materials,CompTIA PenTest+ PT0-002 Cert Guide,101 Labs --- CompTIA PenTest+: Hands-on Labs for the PT0-002 Exam

A penetration tester managed to exploit a vulnerability using the following payload:

IF (1=1) WAIT FOR DELAY '0:0:15'

Which of the following actions would best mitigate this type ol attack?

A.
Encrypting passwords
A.
Encrypting passwords
Answers
B.
Parameterizing queries
B.
Parameterizing queries
Answers
C.
Encoding output
C.
Encoding output
Answers
D.
Sanitizing HTML
D.
Sanitizing HTML
Answers
Suggested answer: B

Explanation:

The payload used by the penetration tester is a type of blind SQL injection attack that delays the response of the database by 15 seconds if the condition is true. This can be used to extract information from the database by asking a series of true or false questions. To prevent this type of attack, the best practice is to use parameterized queries, which separate the user input from the SQL statement and prevent the injection of malicious code. Encrypting passwords, encoding output, and sanitizing HTML are also good security measures, but they do not directly address the SQL injection vulnerability.Reference:

The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 5: Attacks and Exploits, Section 5.2: Perform Network Attacks, Subsection: SQL Injection, p. 235-237

Blind SQL Injection | OWASP Foundation, Description and Examples sections

Time-Based Blind SQL Injection Attacks, Introduction and Microsoft SQL Server sections

Which of the following is the most important aspect to consider when calculating the price of a penetration test service for a client?

A.
Operating cost
A.
Operating cost
Answers
B.
Required scope of work
B.
Required scope of work
Answers
C.
Non-disclosure agreement
C.
Non-disclosure agreement
Answers
D.
Client's budget
D.
Client's budget
Answers
Suggested answer: B

Explanation:

When calculating the price of a penetration test service for a client, the most important aspect to consider is therequired scope of work1. The scope of work defines the objectives of the penetration test and the systems that will be tested.It is important to understand the scope of work to determine the resources required to complete the test and the time it will take to complete the test2.

Which of the following should be included in scope documentation?

A.
Service accounts
A.
Service accounts
Answers
B.
Tester experience
B.
Tester experience
Answers
C.
Disclaimer
C.
Disclaimer
Answers
D.
Number of tests
D.
Number of tests
Answers
Suggested answer: C

Explanation:

A disclaimer is a statement that limits the liability of the penetration tester and the client in case of any unintended consequences or damages caused by the testing activities. It should be included in the scope documentation to clarify the roles and responsibilities of both parties and to avoid any legal disputes or misunderstandings.Service accounts, tester experience, and number of tests are not essential elements of the scope documentation, although they may be relevant for other aspects of the penetration testing process.Reference:The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 1: Planning and Scoping Penetration Tests1; The Official CompTIA PenTest+ Student Guide (Exam PT0-002), Lesson 1: Planning and Scoping Penetration Tests2; What is the Scope of a Penetration Test?3

Which of the following assessment methods is the most likely to cause harm to an ICS environment?

A.
Active scanning
A.
Active scanning
Answers
B.
Ping sweep
B.
Ping sweep
Answers
C.
Protocol reversing
C.
Protocol reversing
Answers
D.
Packet analysis
D.
Packet analysis
Answers
Suggested answer: A

Explanation:

Active scanning is the process of sending probes or packets to a target system or network and analyzing the responses to gather information or identify vulnerabilities. Active scanning can be intrusive and disruptive, especially in an ICS environment, where availability and reliability are critical. Active scanning can cause unintended consequences, such as triggering alarms, shutting down devices, or affecting physical processes. Therefore, active scanning is the most likely to cause harm to an ICS environment among the given options.

Reference:

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

* The Official CompTIA PenTest+ Student Guide (Exam PT0-002) eBook1, Chapter 2: Conducting Passive Reconnaissance, page 2-20.

* Risk Assessment Standards for ICS Environments2, page 8.

Which of the following is most important to include in the final report of a static application-security test that was written with a team of application developers as the intended audience?

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

Explanation:

A static application-security test (SAST) is a type of software testing that analyzes the source code, bytecode or binary code of an application for potential vulnerabilities, such as injection flaws, cross-site scripting, buffer overflows and insecure data handling. A SAST report should provide the application developers with detailed information about the location, severity and impact of the identified vulnerabilities, as well as recommendations for remediation. One of the most important elements to include in a SAST report is the code context for each vulnerability, which shows the relevant code snippets where the issue occurs, as well as the data flow and control flow paths that lead to the vulnerability. This helps the developers understand the root cause of the problem and how to fix it. Code context is especially important for instances of unsafe typecasting operations, which are a common source of security weaknesses in applications. Typecasting is the process of converting one data type to another, such as from an integer to a string. Unsafe typecasting occurs when the conversion is done without proper validation or sanitization, which can lead to unexpected behavior, memory corruption, data loss or code execution. For example, in C/C++, casting a pointer to an incompatible type can result in undefined behavior or buffer overflows. Therefore, a SAST report should include the code context for instances of unsafe typecasting operations, so that the developers can review and correct them.

Reference:

* The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 6: Analyzing and Reporting Pen Test Results, page 329-330.

* Static Application Security Testing (SAST) | GitLab1

* What Is Static Application Security Testing (SAST)?2

* APPLICATION SECURITY TESTING REPORT 2020 - Code Intelligence3

* On the combination of static analysis for software security assessment ...4

A penetration tester developed the following script to be used during an engagement:

#!/usr/bin/python

import socket, sys

ports = [21, 22, 23, 25, 80, 139, 443, 445, 3306, 3389]

if len(sys.argv) > 1:

target = socket.gethostbyname (sys. argv [0])

else:

print ('Few arguments.')

print ('Syntax: python {} <target ip>'. format (sys. argv [0]))

sys.exit ()

try:

for port in ports:

s = socket. socket (socket. AF_INET, socket. SOCK_STREAM)

s.settimeout (2)

result = s.connect_ex ((target, port) )

if result == 0:

print ('Port {} is opened'. format (port) )

except KeyboardInterrupt:

print ('\nExiting ... ')

sys.exit ()

However, when the penetration tester ran the script, the tester received the following message:

socket.gaierror: [Errno -2] Name or service not known

Which of the following changes should the penetration tester implement to fix the script?

A.
From: target = socket.gethostbyname (sys. argv [0]) To: target = socket.gethostbyname (sys.argv[1])
A.
From: target = socket.gethostbyname (sys. argv [0]) To: target = socket.gethostbyname (sys.argv[1])
Answers
B.
From: s = socket. socket (socket. AF_INET, socket. SOCK_STREAM) To: s = socket.socket (socket.AF_INET, socket. SOCK_DGRAM)
B.
From: s = socket. socket (socket. AF_INET, socket. SOCK_STREAM) To: s = socket.socket (socket.AF_INET, socket. SOCK_DGRAM)
Answers
C.
From: import socket, sys To: import socket import sys
C.
From: import socket, sys To: import socket import sys
Answers
D.
From: result = s.connect_ex ((target, port) ) To: result = s.connect ( (target, port) )
D.
From: result = s.connect_ex ((target, port) ) To: result = s.connect ( (target, port) )
Answers
Suggested answer: A

Explanation:

The socket.gaierror: [Errno -2] Name or service not known is an error that occurs when the socket module cannot resolve the hostname or IP address given as an argument. In this case, the script is using sys.argv[0] as the argument for socket.gethostbyname, which is the name of the script itself, not the target IP address. The target IP address should be the first command-line argument after the script name, which is sys.argv1. Therefore, changing the script to use sys.argv1 as the argument for socket.gethostbyname will fix the error and allow the script to scan the ports of the target IP address.

Reference:

* The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 5: Attacks and Exploits, page 262-263.

* socket.gaierror: [Errno -2] Name or service not known | Python1

* How do I fix the error socket.gaierror: [Errno -2] Name or service not known on debian/testing?2

Total 422 questions
Go to page: of 43