A Christmas tree scan sends TCP packets with the URG, FIN, and PSH flags set to probe ports. Closed ports often reply with a reset, while open ports may stay silent. Learn how this distinctive flag pattern works—and why firewall rules and operating system behavior can affect what a scan reveals.

Multiple Choice

During a penetration test, what type of scan is indicated by flags URG, FIN, and PSH being set?

The presence of the URG, FIN, and PSH flags set in a TCP packet indicates a Christmas tree scan, a technique utilized primarily during penetration testing to identify open ports on a target system. This type of scan works by sending TCP packets with a combination of various flags set to probe the target. When the packet is sent, if a port is closed, the target will respond with a RST (reset) packet. However, if the port is open, it typically does not respond — or it may respond with a TCP segment that has a flag other than the one set, indicating that the port is indeed open. Essentially, the Christmas tree scan seeks to illuminate the "tree" of the target system by lighting up various flags, hence the name. It can bypass some firewall rules and is often less detectable than other scanning methods. This method can be particularly effective against systems that do not adhere strictly to the TCP specifications or possess certain peculiarities in how they handle TCP flags. The combined use of the URG, FIN, and PSH flags creates a unique packet signature that can be used to assess the security posture of the target system without alerting it as much as a standard scan might.

A TCP packet with the FIN, PSH, and URG flags set has a distinctive name: a Christmas tree scan, often shortened to an X-mas scan. The flags make the packet look as though several lights are switched on at once, which inspired the name. For security teams, the scan is more than a quirky bit of networking lore. It can help reveal how a target responds to unusual traffic and whether its ports appear open or closed.

To understand what the scan can show, it helps to look at how TCP connections normally work—and what happens when a packet arrives out of sequence.

A quick look at TCP flags

TCP, or Transmission Control Protocol, carries data between systems and helps ensure that it arrives in order. Each TCP packet includes a set of control flags. These flags tell the receiving system what the sender is trying to do.

For example, SYN is used to start a connection. ACK confirms receipt of data or a connection request. FIN signals that a sender has finished sending data, while RST can abruptly reset a connection. The PSH flag asks the receiving system to pass data to the application promptly. URG marks data as urgent, although modern systems rarely rely on it in ordinary network traffic.

A Christmas tree scan sends a TCP packet with FIN, PSH, and URG set together. It does not begin with the usual SYN handshake. Instead, it sends this unusual combination and observes the response—or the lack of one.

How the scan reads a response

Under classic TCP behavior, a closed port should respond to an unsolicited packet with a RST packet. A port that is open may ignore the packet and send no response. That difference can give an assessor a clue about the port’s state.

The basic interpretation looks like this:

  • RST received: the port is likely closed.

  • No response: the port may be open, or a firewall may have dropped the packet.

  • An unexpected response: the host, network device, or operating system may be handling the packet in a distinctive way.

That last point matters. Silence does not prove that a port is open. A firewall may silently discard traffic, a packet may be lost, or an intrusion prevention system may interfere. Network scanning is a process of interpreting evidence, not reading a perfect label from a machine.

The scan’s behavior is also not universal. Many Unix-like systems follow the classic response pattern, while some operating systems, including Windows, may send RST responses for both open and closed ports. In those cases, the scan may not distinguish port states reliably. The result depends on the target’s TCP stack, filtering devices, and network path.

Why send such an odd packet?

A standard SYN scan sends a SYN packet, much like the start of a normal TCP connection, then examines the reply. A Christmas tree scan takes a different route: it uses a packet that does not fit the usual connection-opening sequence. That can help an assessor study how a host or network filters unusual traffic.

It may also pass through some older or poorly configured filters that look only for familiar traffic patterns. But “stealthy” is a relative term, not a guarantee. Modern firewalls and monitoring platforms can detect scans by watching for repeated probes, odd flag combinations, or traffic aimed at many ports in a short period. The unusual packet signature that once seemed subtle can be a clear warning sign to a well-tuned security team.

In other words, an X-mas scan is not a cloak of invisibility. It is one technique among many, and its value lies in the information it can reveal about a system’s behavior.

What security teams learn from it

A scan can help an authorized assessor map a system’s exposed services and examine how network controls respond. If a port appears open, the next step is not to assume a vulnerability exists. Rather, the finding points to a service that may deserve closer review. Is the service expected? Is it restricted to the right networks? Does it need to be reachable from the internet at all?

The scan can also reveal differences between systems. Imagine two servers behind the same firewall: one sends RST responses, while the other remains silent. That contrast may reflect different operating systems, filtering rules, or TCP settings. Such details help defenders build a more accurate picture of their environment.

Still, scan results need context. A packet capture, firewall log, and asset inventory may explain why a port appears a certain way. A single probe is a small clue; combined with other evidence, it becomes more useful. That is a familiar idea in security assessment: no one signal tells the whole story.

Detection and defensive response

For defenders, unusual TCP flag combinations can be useful detection signals. Security monitoring tools may flag packets with FIN, PSH, and URG set together, especially when a source sends similar packets across a range of ports. The pattern can suggest reconnaissance, though it should not be treated as proof of malicious intent. Authorized assessments and some troubleshooting tools may produce unusual traffic too.

A sound response begins with context. Check the source address, destination systems, timing, and volume. Compare the traffic with approved assessment windows and known network activity. If the source is unfamiliar and the probes span many hosts or ports, investigate further and follow the organization’s incident response process.

Network controls can also limit unnecessary exposure. Close unused ports, restrict administrative services to trusted networks, and review firewall rules regularly. Monitoring helps, but reducing the number of reachable services gives an attacker fewer places to knock.

Keep authorization in view

Port scanning can affect network devices and services, even when a scan only sends a small number of packets. Before using any scanning method, get clear written authorization and agree on the targets, timing, and scope. That keeps a security assessment from disrupting systems or crossing into networks that were never meant to be included.

The Christmas tree scan is named for a packet lit up with three flags: FIN, PSH, and URG. Its responses can offer clues about port states and filtering, but those clues depend on the target and the network between the sender and receiver. Used with care, the scan is a useful way to study TCP behavior. Used without context, it can just as easily produce a misleading picture.