CompTIA PenTest+ Practice Test Chapter 7 Practice Exam 2 (Sybex: Panek, Crystal, Tracy) Flashcards
You are a penetration tester, and you are conducting a test for a new client. The client wants you to review a new web application for availability. Which type of attack should the tester utilize?
A.TCP SYN flood
B.SQL injection
C.Cross-site scripting (XSS)
D.XMAS scan
A.TCP SYN flood
Explanation:
A TCP SYN flood (also known as a SYN flood) is a form of denial of service (DoS) attack in which a tester sends a succession of SYN requests to the target’s system in an attempt to consume enough server resources to make the system unresponsive to genuine traffic. This exploits part of the normal TCP three-way handshake and consumes resources on the targeted server and renders it unresponsive.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 348). Wiley. Kindle Edition.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 348). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. You are conducting a scan of your client’s web application. During the review of the scan results, which of the following vulnerabilities would be the most critical and should be prioritized for exploitation?
A.Clickjacking
B.Expired certificate
C.Fill path disclosure
D.Stored cross-site scripting (XSS)
D.Stored cross-site scripting (XSS)
Explanation:
Stored cross-site scripting (XSS) is the most dangerous type of cross-site scripting. Web applications that allow users to store data are potentially exposed to this type of attack. Stored XSS occurs when a web application gathers input from a user that might be malicious and then stores that input in a data store for later use.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 348). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. The client has asked you to conduct a test on a web application. You discover that the user login process sends form field data by using the HTTP GET method. To reduce the risk of exposing sensitive data, the HTML form should be sent using which method?
A.The HTTP OPTIONS method
B.The HTTP POST method
C.The HTTP PUT method
D.The HTTP TRACE method
B.The HTTP POST method
Explanation:
Forms in HTML can use either method=”POST” or method=”GET” (default) in the element. The method specified determines how form data is submitted to the server. With GET, the parameters remain in the browser history because they become part of the URL. With POST, the parameters are not saved in browser history. GET is less secure compared to POST.
You are a penetration tester, and you are conducting a test for a new client. You and the client are having a discussion regarding race condition exploitation. Which of the following is an example of race condition?
A.Cross-site request forgery (XSRF)
B.Hard-coded credentials
C.SQL injection (SQLi)
D.Time of check to time of use (TOCTTOU)
D.Time of check to time of use (TOCTTOU)
Explanation:
Race conditions occur when the security of a code segment depends upon the sequence of events occurring within the system. The time-of-check-to-time-of-use (TOCTTOU) issue is a race condition that occurs when a program checks access permissions too far in advance of a resource request.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 348). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. You are looking to start a session hijacking attack against your client’s web application. What information is important to obtain to ensure that your attack will be a success?
A.A session cookie
B.A session ticket
C.A username
D.A user password
A.A session cookie
Explanation:
Websites use HTTP cookies to keep sessions over time. If a tester is able to get a copy of the user’s session cookie, then they can use that cookie to impersonate the user’s browser and hijack the authenticated session. Attackers who are able to acquire the session cookie used to authenticate a user’s web session can hijack that session and take charge of the user’s account. Cookies used for authentication should always be securely created and transmitted only over secure, encrypted communications channels.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 348). Wiley. Kindle Edition.
A number of employees have recently become the victims of a phishing attack. They received an email that looked like it came from the president of the company. The email stated that the employees would receive disciplinary action if they did not do as the email indicated and click a link in the message. What principle of social engineering did the attacker use?
A.Authority
B.Fear
C.Scarcity
D.Social proof
A.Authority
Explanation:
Social engineering targets people instead of computers and relies on individuals or groups breaking security procedures, policies, and rules. Social engineering can be done in person, over the phone, by text messages, or by email. In this scenario, the attacker used the social engineering principle of authority. Authority follows the belief that people will tend to obey authority figures, even if they are asked to perform objectionable acts.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 348). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. You run the following from an exploited machine:
python -c ‘import pty; pty.spawn(“/bin/bash”)’
What action are you performing?
A.You are creating a sandbox.
B.You are capturing the credentials.
C.You are removing the Bash history.
D.You are upgrading the shell.
D.You are upgrading the shell.
Explanation: The pty module lets a penetration tester spawn a pseudoterminal that can fool commands like su into thinking they are being executed in a proper terminal. To upgrade the shell, just run the command shown. su is a Unix command that stands for substitute user. It is used by a computer user to execute commands with the privileges of another user account. When executed, it invokes a shell without changing the current working directory or the user environment.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (pp. 348-349). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. You have found a few unquoted service paths during your testing of the client’s network. How can you use these vulnerabilities to your advantage?
A.By attempting to crack the service account passwords
B.By attempting DLL hijacking attacks
C.By attempting to locate weak file and folder permissions
D.By attempting privilege escalation attacks
D.By attempting privilege escalation attacks
Explanation:
Privilege escalation attacks are frequently categorized into two major types: vertical and horizontal. Vertical escalation attacks focus on testers gaining higher privileges. Horizontal escalation attacks move sideways to other accounts or services that have the same level of privileges. An unquoted service path is a vulnerability in Windows. When a service is started, Windows tries to locate it. Usually, services are well-defined with quotation marks. But, there are times when a service path might contain spaces or are not surrounded by quotation marks. Testers can use the unquoted service paths to escalate privileges.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 349). Wiley. Kindle Edition.
Recently, a user has noticed that their machine has been acting irregular over the past week. They have been experiencing input lag, and the system is acting sluggish. The user has found a few text files that appear to contain bits of their emails and some instant messenger conversations. The user runs a virus scan, but nothing was detected. What type of malware may be affecting this machine?
A.Backdoor
B.Keylogger
C.Ransomware
D.Rootkit
B.Keylogger
Explanation:
A keylogger is software and hardware that can be useful as part of an ongoing exploitation process. Capturing keystrokes provides insight into the actions taken by users, and it can be a valuable source of credentials and other confidential information. A keylogger is software that tracks or logs the keys struck on a keyboard. This is usually done with malicious intent to collect account information, credit card numbers, usernames, passwords, and other private data.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 349). Wiley. Kindle Edition.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 349). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. You have been asked to assess your client’s physical security by gaining access into the corporate office. You are looking for a method that will allow you to enter the building during both business hours and after hours. What would be the most effective method for you to attempt?
A.Attempt badge cloning.
B.Attempt lock picking.
C.Attempt a lock bypass.
D.Attempt piggybacking.
A.Attempt badge cloning.
Explanation:
With badge cloning, the tester can clone the badge of a staff member to gain entry into the facility. One of the most common techniques is to clone radio-frequency identification (RFID) tags. Given this scenario of trying to obtain access both during business hours and after hours, badge cloning is the best option.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 349). Wiley. Kindle Edition.
You are a penetration tester, and you are conducting a test for a new client. You are attempting a physical security assessment, and you want to use an “under-the-door-tool” during the test. Which of the following intrusion techniques should you use?
A.Egress sensor triggering
B.Lock bumping
C.Lock bypass
D.Lock picking
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 234). Wiley. Kindle Edition.
C.Lock bypass
Explanation:
Lock bypass is simply that: bypassing locks without picking them. In this scenario, the tester is attempting a physical security assessment with the use of an under-the-door tool, which goes underneath a door and pulls open a door handle from the inside.
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 349). Wiley. Kindle Edition.
You and a colleague are discussing an upcoming physical security assessment. The discussion turns to mantraps. Which of the following types of physical security attacks does a mantrap utilize?
A.Impersonation
B.Lock picking
C.Piggybacking
D.Shoulder surfing
Panek, Crystal; Tracy, Robb. CompTIA PenTest+ Practice Tests (p. 234). Wiley. Kindle Edition.
C.Piggybacking
Explanation:
Piggybacking attacks rely on following employees in through secured doors or other entrances. A high-security organization may use mantraps to prevent piggybacking and tailgating. A properly implemented mantrap will allow only one person through at a time, and that person will have to unlock two doors, only one of which can be unlocked and opened at a time.
You are a penetration tester, and you are completing a test for a new client. You run the chkconfig –del command at the end of an engagement. Why did you run this command?
A.To check for persistence
B.To enable persistence
C.To remove the persistence
D.To report persistence
C.To remove the persistence
Explanation:
Chkconfig is a tool for managing which run levels a service will run at. Chkconfig can be used to view or change the run level of a service. Using chkconfig –del will set the named service to not run at the current run level and will remove the persistence.
You are a penetration tester, and you are completing a test for a new client. You have successfully exploited an application vulnerability and now need to remove the command history from the Linux session. What command will remove the command history?
A>$ cat history /clear
B.$ history -c
C.$ history –remove
D.$ rm -f ./history
B.$ history -c
Explanation:
The bash history keeps a record of all commands executed by a tester on the Linux command line. This allows the tester to easily run previously executed commands by using the up and down arrow keys to scroll through the command history file. The main reason for removing command-line history from the Linux terminal is to prevent another user from using the tester’s previous commands. To delete or clear all the entries from bash history, use the history command with the -c option: $ history -c.
You and a colleague are discussing different utilities that can be used when performing a penetration test. Which of the following is a utility that can be used on Windows systems to establish command-line access to the console of a remote Windows system, similar to the older Telnet client?
A.PsExec
B.Remote Login (Rlogin)
C.Remote Shell (RSH)
D.Virtual Network Computing (VNC)
A.PsExec
Explanation:
PsExec is a command-line tool that lets you execute processes on remote systems and redirect console applications’ output to the local system so that the applications appear to be running locally. It is a lightweight Telnet replacement that allows you to execute processes on other systems.
You and a colleague are discussing different utilities that can be used when performing a penetration test. Which of the following will allow for remote management and data gathering and is installed on all Windows systems?
A.Samba (SMB)
B.Virtual Network Computing (VNC)
C.Windows Management Instrumentation (WMI) D.Windows Remote Desktop (RDP)
C.Windows Management Instrumentation (WMI)
Explanation:
Windows Management Instrumentation (WMI) allows for remote management and data gathering and is installed on all Windows systems, making it an attractive target for attackers and penetration testers. WMI provides users with information about the status of local or remote computer systems. It also supports actions such as the following:
The configuration of the security settings
The system properties
The permissions for authorized users and user groups The drive labels
The scheduling of processes to run at specific times
Backing up the object repository
Enabling or disabling error logging WMI can also allow the remote execution of commands, file transfers, and data gathering from files and the Registry.
You are a penetration tester, and you are conducting a test for a new client. You want to use nmap to scan a remote system. You use the following command: nmap 142.78.32.0/24 How many TCP ports will you be scanning?
A.256
B.1,000
C.1,024
D.65,535
B.1,000
Explanation:
Using nmap’s basic functionality is quite simple. Port scanning a system just requires that nmap be installed and that you provide the target system’s hostname or IP address. By default, nmap scans the 1,000 most common ports for both TCP and UDP. However, the full range of ports available to both TCP and UDP services is from 1–65,535. In this scenario, since you did not specify exactly how many ports to scan, it will scan the default of 1,000.
You are a penetration tester, and you are conducting a test for a new client. You run the following nmap scan on a computer: nmap -sV 192.168.10.5. The client has indicated that they have disabled Telnet from their environment. However, the nmap scan results show that port 22 is closed and that port 23 as open to SSH. What might this have happened to cause this?
A.The organization did not disable Telnet.
B.The nmap results contain a false positive for port 23.
C,The service is running on a nonstandard port.
D.Port 22 is filtered.
A.The organization did not disable Telnet.
Explanation: Network Mapper (nmap) is used to discover hosts and services on a computer network by sending packets and analyzing the responses. Nmap will identify what devices are running on a client’s systems, discover hosts and services that are available, find open ports, and detect security risks. In this scenario, the client did not disable Telnet because port 23 is still open. Telnet is a client-server protocol, based on a reliable connection-oriented transport. Typically, this protocol is used to establish a connection to Transmission Control Protocol (TCP) by using port 23, where a Telnet server application (telnetd) is listening.
You are a penetration tester, and you are conducting a test for a new client. You plan on using an hping command to send traffic to a remote system. What type of traffic will the remote system see if you use the script
hping remoteclient.com -S -V -p 80?
A.HTTP traffic to TCP port 80
B.HTTPS traffic to TCP port 80
C.TCP SYNs to TCP port 80
D.TCP three-way handshake to TCP port 80
C.TCP SYNs to TCP port 80
Explanation:
Hping is a command-line tool that allows testers to generate network traffic. Hping is popular because it allows you to create custom packets. In this scenario, you will be sending TCP SYNs to TCP port 80. The -S switch asks hping to send SYN traffic, the -V switch is verbose mode, and the -p switch indicates the port.
You are a penetration tester, and you are conducting a test for a new client. You plan on using nmap. Which nmap switch must you use if you want to scan all the TCP ports on an identified device?
A.-p- 1-65535
B.-p ALX,
C.-p 1-65544
D.-port 1-65534
A.-p- 1-65535
Explanation:
Nmap is the most commonly used command-line vulnerability scanner and is a free, open source tool. It provides a broad range of capabilities, including multiple scan modes intended to bypass firewalls and other network protection devices. Nmap is a port scanner. To scan for ports, you will want to use the -p (only scan specified ports). This option specifies which ports you want to scan and overrides the default scan. Individual port numbers or ranges are acceptable. Ranges are separated by a hyphen (for example 1–1023). The beginning and/or end values of a range may be omitted, causing nmap to use 1 and 65535, respectively. So, you can specify -p- to scan ports from 1 through 65535. Port scanning a system simply requires that nmap be installed and that you provide the target system’s hostname or IP address.
You are a penetration tester, and you are conducting a test for a new client. You plan on using nmap to conduct OS fingerprinting using a company provided text file that contains a list of all the IP addresses. What switches would you need to include in your code to conduct OS fingerprinting using the text file? (Choose two.)
A.-iL B.-O C.-oN D.-oX E.-sS F.-sV
A.-iL
F.-sV
Explanation:
One of nmap’s best-known features is remote OS detection using TCP/IP stack fingerprinting. Nmap sends a series of TCP and UDP packets to the remote host and examines the responses. -iL : This is the input from list of hosts/networks. -sV: This probes open ports to determine service/version information.
You are a penetration tester, and you are conducting a test for a new client. You want to perform passive reconnaissance on the client’s external domain. What would be the best choice for you to use?
A.CeWL
B.OpenVAS
C.Peach
D.Shodan
D.Shodan
Explanation:
Passive reconnaissance is also known as open-source intelligence (OSINT). The idea behind passive reconnaissance is to gather information about a target using only publicly available resources. Shodan is a specialized search engine that provides discovery of specific types of computers and devices that are connected to the Internet by using a variety of filters. Peach is a fuzzing tool, OpenVAS performs network vulnerability scans, and CeWL is a custom wordlist generator that searches websites for keywords that may be used in password-guessing attacks.
You are a penetration tester, and you are conducting a test for a new client. You have successfully exploited a DM2 server that seems to be listening to an outbound port. You want to forward that traffic back to a device. What are the best tools to do this? (Choose two.)
A.Cain and Abel B.Netcat C.Nmap D.Secure Shell (SSH) E.Tcpdump F.Wireshark
D.Secure Shell (SSH)
F.Wireshark
Explanation:
In this scenario, the best options are SSH and Wireshark. Secure Shell (SSH) provides secure encrypted connections
between systems. SSH provides remote shell access via an encrypted connection. SSH is used for secure command-line access to systems, typically via TCP port 22, and is found on devices and systems of all types. Because SSH is so common, testing systems that provide an SSH service is a very attractive option for a penetration tester. Wireshark is a protocol analyzer that allows penetration testers to eavesdrop on and dissect network traffic. Wireshark also allows for capturing network traffic from wireless networks.
You are a penetration tester, and you are conducting a test for a new client. You are conducting a test and have compromised the client’s host. What is the correct syntax to create a Netcat listener on this device?
A.nc -lp 4444 -e /bin/bash
B.nc -lvp 4444 /bin/bash
C.nc -p 4444 /bin/bash
D.nc -vp 4444 /bin/bash
A.nc -lp 4444 -e /bin/bash
Explanation:
Netcat can be used to set up a Telnet server in a matter of seconds. You can specify the shell you want Netcat to run at a successful connection with the -e parameter. In this scenario, the proper syntax would be nc -lp 444 -e /bin/bash. The nc tells Windows to run the nc.exe file with the following arguments:
- l: Specifies listen mode, for inbound connections
- p: Specifies a port to listen for a connection on
- e: Tells what program to run once the port is connected to (cmd.exe)
- v: Be verbose, printing out messages on standard error, such as when a connection occurs
You are a penetration tester, and you are conducting a test for a new client. You want to target the NetBIOS name service. Which of the following commands is the most likely to be used to exploit the NetBIOS name service?
A.arpspoof
B.burpsuite
C.nmap
D.responder
D.responder
Explanation:
Responder is a toolkit that is used to answer NetBIOS queries from Windows systems on a network. Responder is a powerful tool when exploiting NetBIOS responses. It can target individual systems or entire local networks, allowing you to analyze or respond to NetBIOS name services, pretending to be the system that the query is intended for.
You are a penetration tester, and you are conducting a test for a new client. You want to conduct open-source intelligence (OSINT) data collection from publicly available sources. Which of the following tools can you use? (Choose two.)
A.BeEF B.Dynamo C.Maltego D.SET E.Shodan F.Wireshark
C.Maltego
E.Shodan
Explanation:
There are a variety of tools that assist with this OSINT collection:
Censys is a web-based tool that probes IP addresses across the Internet and then provides penetration testers with access to that information through a search engine.
Fingerprinting Organizations with Collected Archives (FOCA) is an open source tool used to find metadata within Office documents, PDFs, and other common file formats.
Maltego is a commercial product that assists with the visualization of data gathered from OSINT efforts.
Nslookup tools help identify the IP addresses associated with an organization
Recon-ng is a modular web reconnaissance framework that organizes and manages OSINT work.
Shodan is a specialized search engine to provide discovery of vulnerable Internet of Things (IoT) devices from public sources.
theHarvester scours search engines and other resources to find email addresses, employee names, and infrastructure details about an organization.
Whois tools gather information from public records about domain ownership.
You are a penetration tester, and you are conducting a test for a new client. You want to capture user hashes on a Windows network. You want to gather broadcast messages and have the ability to authenticate with hashes once you have captured them. What tool should you use?
A.impacket
B.Metasploit
C.Responder
D.Wireshark
A.impacket
Explanation:
Impacket is a collection of Python classes for working with network protocols. Impacket provides a wide range of tools, including the ability to authenticate with hashes once you have captured them. Metasploit’s SMB capture mode, Responder, and Wireshark can all capture SMB hashes from broadcasts, but in this scenario, you also want the ability to authenticate with hashes once you’ve captured the messages.
You are a penetration tester, and you are conducting a test for a new client. You want to perform a credential brute-force attack on a client’s application. Which tool should you use?
A.Hashcat
B.Hydra
C.John the Ripper
D.Peach
B.Hydra
Explanation:
In a credentials brute-force attack, the tester will try to log in to the application using every username and password. Hydra is a brute-forcing tool that can crack systems using password guessing.
You are a penetration tester, and you are conducting a test for a new client. As a part of your penetration test, you need to establish an active connection to the computer systems and devices at your client’s location to enumerate and fingerprint them. Which of the following tools could you use to do this? (Choose two.)
A.Aircrack-ng
B.hping
C.nmap
D.whois
B.hping
C.nmap
Explanation:
The nmap and hping utilities can be used to actively enumerate and fingerprint target systems. Hping is a command-line tool that allows testers to artificially generate network traffic. Hping is popular because it allows you to create custom packets. Nmap is the most commonly used command-line vulnerability scanner and is a free, open-source tool. It provides a broad range of capabilities, including multiple scan modes intended to bypass firewalls and other network protection devices. Whois is a tool that gathers information from public records about domain ownership. Aircrack-ng provides the ability to conduct replay and deauthentication attacks and to act as a fake access point.
You are a penetration tester, and you are conducting a test for a new client. You want to use Metasploit. Which command will start the Metasploit database?
A.db_connect
B.db_init
C.msfconsole
D.msfvenom
C.msfconsole
Explanation:
Metasploit is launched by running msfconsole from the command line. MSFconsole is located in the /usr/share/metasploit framework/msfconsole directory.
You are a penetration tester, and you are conducting a test for a new client. You want to capture NTLM v2 hashes over the wire for use in a pass-the-hash attack. Which tool does not allow you to capture NTLM v2 hashes over the wire?
A.Ettercap
B.Mimikatz
C.Metasploit
D.Responder
B.Mimikatz
Explanation:
Mimikatz is an open source utility that enables the viewing of credential information from the Windows Local Security Authority Subsystem Service (LSASS) using its sekurlsa module, which includes plaintext passwords, and Kerberos tickets, which can then be used for attacks such as pass-the-hash and pass-the-ticket. In this scenario, however, the question states “over the wire.” Mimikatz is the only tool that cannot be used that way.
You are a penetration tester, and you are conducting a test for a new client. You have captured NTLM hashes and want to conduct a pass-the-hash attack. Unfortunately, you don’t know which systems on the network might accept the hash. What tool should you use to conduct the test?
A.Drozer
B.Hashcat
C.Hydra
D.Kismet
C.Hydra
Explanation:
Hydra is designed to include support for NTLM hashes as a password. Hashcat is a password cracking and recovery tool. Drozer is a framework for Android security assessments. Kismet is an 802.11 layer 2 wireless network detector, sniffer, and intrusion detection system. Hydra, often known as thc-hydra, is a brute-force dictionary attack tool that is designed to work against a variety of protocols and services.