- A
Use a reverse shell listener on TCP port 3389 and connect from the target
Why wrong: Port 3389 is Remote Desktop Protocol, which is likely not allowed outbound unless explicitly permitted. The firewall only allows ports 80, 443, and 53.
- B
Use a bind shell on the target's port 4444 and connect directly
Why wrong: A bind shell opens a listening port on the target, but outbound connectivity from the tester to that port may be blocked by firewalls on the tester's side, and inbound connections to the target are likely also restricted.
- C
Use a reverse shell over DNS by encoding commands in DNS queries
DNS traffic (UDP 53) is often allowed outbound for name resolution. Tools like dnscat2 can encapsulate data in DNS packets, enabling a reverse shell that can bypass the firewall.
- D
Use a reverse shell on TCP port 8080 and hope it is not blocked
Why wrong: Port 8080 is not in the allowed list (80, 443, 53). The firewall would likely block this outbound connection.
Quick Answer
The correct answer is to use a reverse shell over DNS by encoding commands in DNS queries. This technique is most effective because DNS traffic on port 53 is almost always permitted through restrictive outbound firewalls, as it is essential for name resolution. By tunneling the reverse shell’s TCP data inside DNS queries and responses, tools like dnscat2 or iodine make the malicious traffic appear as legitimate DNS lookups, effectively bypassing firewall rules that block other ports. On the CompTIA PenTest+ PT0-002 exam, this question tests your understanding of protocol tunneling and firewall evasion—a common trap is choosing an HTTP or HTTPS reverse shell, which may still be inspected by a proxy or deep packet inspection. Remember the memory tip: “DNS is the firewall’s blind spot—if it resolves, it evolves into a shell.”
PT0-002 Attacks and Exploits Practice Question
This PT0-002 practice question tests your understanding of attacks and exploits. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A penetration tester has gained initial access to a Linux server through a vulnerable web application. The server has a restrictive outbound firewall that only allows traffic on ports 80, 443, and 53. The tester wants to establish a reverse shell that is likely to bypass the firewall. Which of the following techniques would be most effective?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Use a reverse shell over DNS by encoding commands in DNS queries
Option C is correct because DNS traffic on port 53 is typically allowed through restrictive outbound firewalls, and encoding reverse shell commands within DNS queries allows the tester to tunnel traffic over DNS, bypassing the firewall's port restrictions. Tools like dnscat2 or iodine can encapsulate TCP data in DNS requests, making the reverse shell appear as legitimate DNS traffic.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a reverse shell listener on TCP port 3389 and connect from the target
Why it's wrong here
Port 3389 is Remote Desktop Protocol, which is likely not allowed outbound unless explicitly permitted. The firewall only allows ports 80, 443, and 53.
- ✗
Use a bind shell on the target's port 4444 and connect directly
Why it's wrong here
A bind shell opens a listening port on the target, but outbound connectivity from the tester to that port may be blocked by firewalls on the tester's side, and inbound connections to the target are likely also restricted.
- ✓
Use a reverse shell over DNS by encoding commands in DNS queries
- ✗
Use a reverse shell on TCP port 8080 and hope it is not blocked
Why it's wrong here
Port 8080 is not in the allowed list (80, 443, 53). The firewall would likely block this outbound connection.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may assume a reverse shell on a non-standard port (like 3389) will work because it's a common service port, but the firewall's explicit allow list (80, 443, 53) makes any other port blocked, and DNS tunneling is the only technique that leverages an allowed protocol for covert communication.
Detailed technical explanation
How to think about this question
DNS tunneling works by encoding data within DNS query and response packets, often using TXT or A record queries to carry payloads, and requires a controlled DNS server to decode the traffic. Tools like dnscat2 use a client-server model where the target sends DNS queries to a malicious DNS server, which responds with encoded commands, allowing bidirectional communication over UDP port 53. In real-world engagements, this technique is effective even when HTTPS traffic is inspected, as DNS is often not deeply analyzed by firewalls.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A security analyst at a medium-sized enterprise encounters this scenario during an investigation or architecture review. The correct answer reflects best practice for the specific threat or control described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Security exam questions test whether you can match controls to threats in context — not just recall definitions.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Attacks and Exploits — study guide chapter
Learn the concepts, then practise the questions
- →
Attacks and Exploits practice questions
Targeted practice on this topic area only
- →
All PT0-002 questions
509 questions across all exam domains
- →
CompTIA PenTest+ PT0-002 study guide
Full concept coverage aligned to exam objectives
- →
PT0-002 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related PT0-002 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Planning and Scoping practice questions
Practise PT0-002 questions linked to Planning and Scoping.
Information Gathering and Vulnerability Scanning practice questions
Practise PT0-002 questions linked to Information Gathering and Vulnerability Scanning.
Attacks and Exploits practice questions
Practise PT0-002 questions linked to Attacks and Exploits.
Reporting and Communication practice questions
Practise PT0-002 questions linked to Reporting and Communication.
Tools and Code Analysis practice questions
Practise PT0-002 questions linked to Tools and Code Analysis.
PT0-002 fundamentals practice questions
Practise PT0-002 questions linked to PT0-002 fundamentals.
PT0-002 scenario practice questions
Practise PT0-002 questions linked to PT0-002 scenario.
PT0-002 troubleshooting practice questions
Practise PT0-002 questions linked to PT0-002 troubleshooting.
Practice this exam
Start a free PT0-002 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this PT0-002 question test?
Attacks and Exploits — This question tests Attacks and Exploits — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Use a reverse shell over DNS by encoding commands in DNS queries — Option C is correct because DNS traffic on port 53 is typically allowed through restrictive outbound firewalls, and encoding reverse shell commands within DNS queries allows the tester to tunnel traffic over DNS, bypassing the firewall's port restrictions. Tools like dnscat2 or iodine can encapsulate TCP data in DNS requests, making the reverse shell appear as legitimate DNS traffic.
What should I do if I get this PT0-002 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
This PT0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PT0-002 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.