Courseiva
Command and Control →mediumMultiple Choice

GPEN Command and Control Practice Question

During an authorized penetration test, you compromise a Windows host in a restricted network segment that only permits outbound DNS (UDP 53) to an internal resolver. You need to establish a command-and-control channel that can survive reboots and provide interactive shell access while blending with normal DNS traffic. Which of the following is the MOST appropriate technique to achieve this?

⚠ Common exam trap

The trap here is assuming that any outbound connection can be tunneled over DNS, but the key constraint is that only DNS to an internal resolver is allowed, so direct public DNS or other protocols are blocked.

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 DNS tunneling tool such as dnscat2, configure it with a domain you control, and set up a scheduled task to restart the client on boot.

The scenario requires a C2 channel that works over DNS only, supports interactive shell, and survives reboots. DNS tunneling via dnscat2 meets these requirements because it encapsulates data in DNS queries and responses, which are allowed. Persistence via scheduled task ensures the client restarts after a reboot. The other options either violate the allowed protocol (TCP/443, ICMP) or attempt to bypass the internal resolver, which is not permitted.

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 DNS TXT record to store commands, and have the compromised host poll a public DNS server directly on UDP 53, bypassing the internal resolver.

    Why it's wrong here

    The network only permits outbound DNS to an internal resolver, not directly to public DNS servers. Attempting to bypass the internal resolver would likely be blocked by egress firewall rules. Additionally, using TXT records for command polling does not provide interactive shell access and lacks the robustness of a full tunneling protocol. This approach would fail due to network restrictions.

  • ✗

    Use a reverse TCP Meterpreter payload over port 443 with TLS, and rely on the firewall's deep packet inspection to allow it as HTTPS.

    Why it's wrong here

    The scenario states that only outbound DNS (UDP 53) to an internal resolver is permitted. A reverse TCP connection on port 443 would be blocked by the firewall because it is not DNS traffic. Even if TLS is used, the firewall rules explicitly restrict outbound traffic to DNS only. This option violates the network constraint and would fail to establish a channel.

  • ✗

    Use an ICMP tunnel such as ptunnel to encapsulate shell traffic in echo requests, and configure a registry run key for persistence.

    Why it's wrong here

    While ICMP tunneling can bypass some filters, the scenario explicitly states that only outbound DNS (UDP 53) is allowed. ICMP is a different protocol and would be blocked by the firewall. Therefore, an ICMP tunnel would not work in this environment. The registry run key for persistence is plausible, but the primary channel is invalid.

  • ✓

    Use a DNS tunneling tool such as dnscat2, configure it with a domain you control, and set up a scheduled task to restart the client on boot.

    Why this is correct

    DNS tunneling encapsulates arbitrary data within DNS queries and responses, allowing interactive shell access over UDP 53. Since the network only allows DNS to an internal resolver, dnscat2 can still reach its external server if the resolver performs recursive lookups. Persistence via scheduled task ensures the channel re-establishes after reboot. This combination directly addresses the constraints.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This GPEN question is part of Courseiva's 298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official GIAC exam blueprint

This GPEN practice question is part of Courseiva's free GIAC 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 GPEN exam.