ExamGecko
Home Home / CompTIA / PT0-003

CompTIA PT0-003 Practice Test - Questions Answers, Page 6

Question list
Search
Search

List of questions

Search

Related questions











A penetration tester has found a web application that is running on a cloud virtual machine instance. Vulnerability scans show a potential SSRF for the same application URL path with an injectable parameter. Which of the following commands should the tester run to successfully test for secrets exposure exploitability?

<a target='_blank' href='http://169.254.169.254/latest/meta-data/'>A. curl <url>?param=http://169.254.169.254/latest/meta-data/ B. curl '<url>?param=http://127.0.0.1/etc/passwd' C. curl '<url>?param=<script>alert(1)<script>/' D. curl <url>?param=http://127.0.0.1/</a>

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:

In a cloud environment, testing for Server-Side Request Forgery (SSRF) vulnerabilities involves attempting to access metadata services. Here's why the specified command is appropriate:

Accessing Cloud Metadata Service:

URL: http://169.254.169.254/latest/meta-data/ is a well-known endpoint in cloud environments (e.g., AWS) to access instance metadata.

Purpose: By exploiting SSRF to access this URL, an attacker can retrieve sensitive information such as instance credentials and other metadata.

Comparison with Other Commands:

127.0.0.1/etc/passwd: This is more about local file inclusion, not specific to cloud metadata.

<script>alert(1)</script>: This tests for XSS, not SSRF.

127.0.0.1: This is a generic loopback address and does not specifically test for metadata access in a cloud environment.

Using curl <url>?param=http://169.254.169.254/latest/meta-data/ is the correct approach to test for SSRF vulnerabilities in cloud environments to potentially expose secrets.

A penetration tester cannot find information on the target company's systems using common OSINT methods. The tester's attempts to do reconnaissance against internet-facing resources have been blocked by the company's WAF. Which of the following is the best way to avoid the WAF and gather information about the target company's systems?

A.
HTML scraping
A.
HTML scraping
Answers
B.
Code repository scanning
B.
Code repository scanning
Answers
C.
Directory enumeration
C.
Directory enumeration
Answers
D.
Port scanning
D.
Port scanning
Answers
Suggested answer: B

Explanation:

When traditional reconnaissance methods are blocked, scanning code repositories is an effective method to gather information. Here's why:

Code Repository Scanning:

Leaked Information: Code repositories (e.g., GitHub, GitLab) often contain sensitive information, including API keys, configuration files, and even credentials that developers might inadvertently commit.

Accessible: These repositories can often be accessed publicly, bypassing traditional defenses like WAFs.

Comparison with Other Methods:

HTML Scraping: Limited to the data present on web pages and can still be blocked by WAF.

Directory Enumeration: Likely to be blocked by WAF as well and might not yield significant internal information.

Port Scanning: Also likely to be blocked or trigger alerts on WAF or IDS/IPS systems.

Scanning code repositories allows gathering a wide range of information that can be critical for further penetration testing effort

During a penetration test, the tester uses a vulnerability scanner to collect information about any possible vulnerabilities that could be used to compromise the network. The tester receives the results and then executes the following command:

snmpwalk -v 2c -c public 192.168.1.23

Which of the following is the tester trying to do based on the command they used?

A.
Bypass defensive systems to collect more information.
A.
Bypass defensive systems to collect more information.
Answers
B.
Use an automation tool to perform the attacks.
B.
Use an automation tool to perform the attacks.
Answers
C.
Script exploits to gain access to the systems and host.
C.
Script exploits to gain access to the systems and host.
Answers
D.
Validate the results and remove false positives.
D.
Validate the results and remove false positives.
Answers
Suggested answer: D

Explanation:

The command snmpwalk -v 2c -c public 192.168.1.23 is used to query SNMP (Simple Network Management Protocol) data from a device. Here's the purpose in the context provided:

SNMP Enumeration:

Function: snmpwalk is used to retrieve a large amount of information from the target device using SNMP.

Community String: -c public specifies the community string, which is essentially a password for SNMP queries.

Purpose of the Command:

Validate Results: The tester uses SNMP to gather detailed information about the network devices to confirm the findings of the vulnerability scanner and remove any false positives.

Detailed Information: SNMP can provide detailed information about device configurations, network interfaces, and other settings that can validate the scanner's results.

Comparison with Other Options:

Bypassing Defensive Systems (A): Not directly related to SNMP enumeration.

Using Automation Tools (B): While SNMPwalk is automated, the primary purpose here is validation.

Script Exploits (C): SNMPwalk is not used for scripting exploits but for information gathering.

By using snmpwalk, the tester is validating the results from the vulnerability scanner and removing any false positives, ensuring accurate reporting.

A penetration tester is working on a security assessment of a mobile application that was developed in-house for local use by a hospital. The hospital and its customers are very concerned about disclosure of information. Which of the following tasks should the penetration tester do first?

A.
Set up Drozer in order to manipulate and scan the application.
A.
Set up Drozer in order to manipulate and scan the application.
Answers
B.
Run the application through the mobile application security framework.
B.
Run the application through the mobile application security framework.
Answers
C.
Connect Frida to analyze the application at runtime to look for data leaks.
C.
Connect Frida to analyze the application at runtime to look for data leaks.
Answers
D.
Load the application on client-owned devices for testing.
D.
Load the application on client-owned devices for testing.
Answers
Suggested answer: B

Explanation:

When performing a security assessment on a mobile application, especially one concerned with information disclosure, it is crucial to follow a structured approach to identify vulnerabilities comprehensively. Here's why option B is correct:

Mobile Application Security Framework: This framework provides a structured methodology for assessing the security of mobile applications. It includes various tests such as static analysis, dynamic analysis, and reverse engineering, which are essential for identifying vulnerabilities related to information disclosure.

Initial Steps: Running the application through a security framework allows the tester to identify a broad range of potential issues systematically. This initial step ensures that all aspects of the application's security are covered before delving into more specific tools like Drozer or Frida.

Reference from Pentest:

Writeup HTB: Demonstrates the use of structured methodologies to ensure comprehensive coverage of security assessments.

Horizontall HTB: Emphasizes the importance of following a structured approach to identify and address security issues.

Before starting an assessment, a penetration tester needs to scan a Class B IPv4 network for open ports in a short amount of time. Which of the following is the best tool for this task?

A.
Burp Suite
A.
Burp Suite
Answers
B.
masscan
B.
masscan
Answers
C.
Nmap
C.
Nmap
Answers
D.
hping
D.
hping
Answers
Suggested answer: B

Explanation:

When needing to scan a large network for open ports quickly, the choice of tool is critical. Here's why option B is correct:

masscan: This tool is designed for high-speed port scanning and can scan entire networks much faster than traditional tools like Nmap. It can handle large ranges of IP addresses and ports with high efficiency.

Nmap: While powerful and versatile, Nmap is generally slower than masscan for scanning very large networks, especially when speed is crucial.

Burp Suite: This tool is primarily for web application security testing and not optimized for network-wide port scanning.

hping: This is a network tool used for packet crafting and network testing, but it is not designed for high-speed network port scanning.

Reference from Pentest:

Luke HTB: Highlights the use of efficient tools for large-scale network scanning to identify open ports quickly.

Anubis HTB: Demonstrates scenarios where high-speed scanning tools like masscan are essential for large network assessments.

A penetration tester is performing an authorized physical assessment. During the test, the tester observes an access control vestibule and on-site security guards near the entry door in the lobby. Which of the following is the best attack plan for the tester to use in order to gain access to the facility?

A.
Clone badge information in public areas of the facility to gain access to restricted areas.
A.
Clone badge information in public areas of the facility to gain access to restricted areas.
Answers
B.
Tailgate into the facility during a very busy time to gain initial access.
B.
Tailgate into the facility during a very busy time to gain initial access.
Answers
C.
Pick the lock on the rear entrance to gain access to the facility and try to gain access.
C.
Pick the lock on the rear entrance to gain access to the facility and try to gain access.
Answers
D.
Drop USB devices with malware outside of the facility in order to gain access to internal machines.
D.
Drop USB devices with malware outside of the facility in order to gain access to internal machines.
Answers
Suggested answer: B

Explanation:

In an authorized physical assessment, the goal is to test physical security controls. Tailgating is a common and effective technique in such scenarios. Here's why option B is correct:

Tailgating: This involves following an authorized person into a secure area without proper credentials. During busy times, it's easier to blend in and gain access without being noticed. It tests the effectiveness of physical access controls and security personnel.

Cloning Badge Information: This can be effective but requires proximity to employees and specialized equipment, making it more complex and time-consuming.

Picking Locks: This is a more invasive technique that carries higher risk and is less stealthy compared to tailgating.

Dropping USB Devices: This tests employee awareness and response to malicious devices but does not directly test physical access controls.

Reference from Pentest:

Writeup HTB: Demonstrates the effectiveness of social engineering and tailgating techniques in bypassing physical security measures.

Forge HTB: Highlights the use of non-invasive methods like tailgating to test physical security without causing damage or raising alarms.

Conclusion:

Option B, tailgating into the facility during a busy time, is the best attack plan to gain access to the facility in an authorized physical assessment.

During a web application assessment, a penetration tester identifies an input field that allows JavaScript injection. The tester inserts a line of JavaScript that results in a prompt, presenting a text box when browsing to the page going forward. Which of the following types of attacks is this an example of?

A.
SQL injection
A.
SQL injection
Answers
B.
SSRF
B.
SSRF
Answers
C.
XSS
C.
XSS
Answers
D.
Server-side template injection
D.
Server-side template injection
Answers
Suggested answer: C

Explanation:

Cross-Site Scripting (XSS) is an attack that involves injecting malicious scripts into web pages viewed by other users. Here's why option C is correct:

XSS (Cross-Site Scripting): This attack involves injecting JavaScript into a web application, which is then executed by the user's browser. The scenario describes injecting a JavaScript prompt, which is a typical XSS payload.

SQL Injection: This involves injecting SQL commands to manipulate the database and does not relate to JavaScript injection.

SSRF (Server-Side Request Forgery): This attack tricks the server into making requests to unintended locations, which is not related to client-side JavaScript execution.

Server-Side Template Injection: This involves injecting code into server-side templates, not JavaScript that executes in the user's browser.

Reference from Pentest:

Horizontall HTB: Demonstrates identifying and exploiting XSS vulnerabilities in web applications.

Luke HTB: Highlights the process of testing for XSS by injecting scripts and observing their execution in the browser.

A penetration tester is working on an engagement in which a main objective is to collect confidential information that could be used to exfiltrate data and perform a ransomware attack. During the engagement, the tester is able to obtain an internal foothold on the target network. Which of the following is the next task the tester should complete to accomplish the objective?

A.
Initiate a social engineering campaign.
A.
Initiate a social engineering campaign.
Answers
B.
Perform credential dumping.
B.
Perform credential dumping.
Answers
C.
Compromise an endpoint.
C.
Compromise an endpoint.
Answers
D.
Share enumeration.
D.
Share enumeration.
Answers
Suggested answer: B

Explanation:

Given that the penetration tester has already obtained an internal foothold on the target network, the next logical step to achieve the objective of collecting confidential information and potentially exfiltrating data or performing a ransomware attack is to perform credential dumping. Here's why:

Credential Dumping:

Purpose: Credential dumping involves extracting password hashes and plaintext passwords from compromised systems. These credentials can be used to gain further access to sensitive data and critical systems within the network.

Tools: Common tools used for credential dumping include Mimikatz, Windows Credential Editor, and ProcDump.

Impact: With these credentials, the tester can move laterally across the network, escalate privileges, and access confidential information.

Comparison with Other Options:

Initiate a Social Engineering Campaign (A): Social engineering is typically an initial access technique rather than a follow-up action after gaining internal access.

Compromise an Endpoint (C): The tester already has a foothold, so compromising another endpoint is less direct than credential dumping for accessing sensitive information.

Share Enumeration (D): While share enumeration can provide useful information, it is less impactful than credential dumping in terms of gaining further access and achieving the main objective.

Performing credential dumping is the most effective next step to escalate privileges and access sensitive data, making it the best choice.

During a penetration test, the tester identifies several unused services that are listening on all targeted internal laptops. Which of the following technical controls should the tester recommend to reduce the risk of compromise?

A.
Multifactor authentication
A.
Multifactor authentication
Answers
B.
Patch management
B.
Patch management
Answers
C.
System hardening
C.
System hardening
Answers
D.
Network segmentation
D.
Network segmentation
Answers
Suggested answer: C

Explanation:

When a penetration tester identifies several unused services listening on targeted internal laptops, the most appropriate recommendation to reduce the risk of compromise is system hardening. Here's why:

System Hardening:

Purpose: System hardening involves securing systems by reducing their surface of vulnerability. This includes disabling unnecessary services, applying security patches, and configuring systems securely.

Impact: By disabling unused services, the attack surface is minimized, reducing the risk of these services being exploited by attackers.

Comparison with Other Controls:

Multifactor Authentication (A): While useful for securing authentication, it does not address the issue of unused services running on the system.

Patch Management (B): Important for addressing known vulnerabilities but not specifically related to disabling unused services.

Network Segmentation (D): Helps in containing breaches but does not directly address the issue of unnecessary services.

System hardening is the most direct control for reducing the risk posed by unused services, making it the best recommendation.

A penetration tester writes the following script to enumerate a 1724 network:

1 #!/bin/bash

2 for i in {1..254}; do

3 ping -c1 192.168.1.$i

4 done

The tester executes the script, but it fails with the following error:

-bash: syntax error near unexpected token `ping'

Which of the following should the tester do to fix the error?

A.
Add do after line 2.
A.
Add do after line 2.
Answers
B.
Replace {1..254} with $(seq 1 254).
B.
Replace {1..254} with $(seq 1 254).
Answers
C.
Replace bash with tsh.
C.
Replace bash with tsh.
Answers
D.
Replace $i with ${i}.
D.
Replace $i with ${i}.
Answers
Suggested answer: A

Explanation:

The error in the script is due to a missing do keyword in the for loop. Here's the corrected script and explanation:

Original Script:

1 #!/bin/bash

2 for i in {1..254}; do

3 ping -c1 192.168.1.$i

4 done

Error Explanation:

The for loop syntax in Bash requires the do keyword to indicate the start of the loop's body.

Corrected Script:

1 #!/bin/bash

2 for i in {1..254}; do

3 ping -c1 192.168.1.$i

4 done

Adding do after line 2 corrects the syntax error and allows the script to execute properly.

Total 120 questions
Go to page: of 12