A tunnel has one end inside a protected segment and the other end outside it. It joins two networks that the segment's edge was meant to keep apart.
Protocols inside protocols, and what slips through
A parcel can travel inside a courier's sack, and the driver who carries the sack never sees the parcel. Networks do the same thing: one protocol is often carried whole inside another. No background is assumed beyond the seven layers. Security staff need this because a filter that judges only the outer wrapper can let almost anything through inside it.
By the end of this unit you will be able to:
- Explain what tunnelling is and why one protocol is carried inside another
- Name the benefits of carrying protocols inside others
- Tell apart the three drawbacks: covert channels, filters bypassed and boundaries overstepped
- Explain how name lookups and encrypted web traffic are used to move data out unseen
- Explain why DNP3 inside TCP/IP needs a filter that understands DNP3
The firewall allowed name lookups and nothing else
An illustrative example
An accountancy firm's firewall lets staff computers send only two kinds of traffic to the internet: secure web pages and name lookups. Everything else is blocked.
One Monday the firm's IT contractor reviews the weekend's records. A single laptop, left switched on in a locked office, made 40,000 name lookups between midnight and five in the morning. Every one asked for a different, long, random-looking name ending in the same unfamiliar domain. Nobody was in the building.
How could a firewall that allowed only name lookups have let the laptop send data out?
Tunnelling: one protocol carried whole inside another
Encapsulation normally follows the layers in order: data inside a segment, inside a , inside a frame. Nothing stops a protocol from carrying a complete unit of another protocol as if it were ordinary data. A packet can travel inside another packet, or a whole protocol stack inside a single connection.
Carrying a complete unit of one protocol as the data of another is tunnelling. The protocol doing the carrying is the outer, or delivery, protocol. The one being carried is the inner, or payload, protocol. A device on the path reads the outer wrapper and treats everything inside as cargo.
A parcel in a sack
A courier puts a parcel addressed to Leeds inside a sack labelled for the Manchester depot. Every driver reads only the sack's label. Nobody on the way knows what the parcel is or where it is finally going until the sack is opened.
Generic Routing Encapsulation (GRE) is a plain example. It wraps any network-layer packet in a new IP packet with a small GRE header between the two. The outer IP header carries IP protocol number 47, which marks the contents as GRE. GRE adds no .
A virtual private network (VPN) is a tunnel used to join two sites, or a remote worker to an office, across a shared network such as the internet. Whether a VPN hides its contents depends on the protocol it uses, such as IPsec or TLS.
What carrying one protocol inside another makes possible
Protocols layered in this way are called multilayer protocols. The design has real advantages, which is why it is everywhere.
- Many services share one network. IP can carry web traffic, voice, storage and industrial control alike, so a new service needs no new cables.
- Protection can be added at more than one layer. IPsec can protect every packet at , TLS can protect one connection above , and a program can encrypt its own data as well.
- Traffic can cross networks that do not speak its protocol. packets can travel inside packets, and storage traffic built for its own cables can travel over IP.
- Private networks can be built over public ones. A tunnel lets two offices behave as one network across the internet.
Each benefit has the same root. The outer protocol does not need to understand what it carries, so almost anything can be carried. That same fact produces the drawbacks.
Covert channels, bypassed filters and crossed boundaries
A covert channel is a way of passing information that the security rules never meant to allow, hidden inside traffic that is allowed. Carrying one protocol inside another is the easiest way to build one.
A filter bypass happens when a control judges traffic by its outer wrapper. A rule that allows a protocol by its port number passes whatever that protocol happens to carry. The GRE standard itself says that filtering needs a firewall that looks inside the GRE packet, or filtering at the ends of the tunnel.
A boundary overstep happens when a tunnel joins two networks that a boundary was meant to keep apart. If one end of the tunnel sits inside a protected segment and the other outside it, traffic crosses the boundary without passing the checks placed on it. Wrapping a unit twice, so that the checkpoint reads only the outer wrapper, is called double encapsulation.
| Drawback | How it happens | Control |
|---|---|---|
| Covert channel | Data is hidden inside an allowed protocol, such as name lookups | Watch for unusual volume, size and timing; allow only approved destinations |
| Filter bypassed | The filter reads the outer header and never sees the inner protocol | Inspection that opens and understands the inner protocol |
| Boundary overstepped | A tunnel's two ends sit on either side of a segment boundary | Allow tunnels to end only at controlled points, and inspect there |
Tunnelling data out through name lookups and HTTPS
Removing data from an organisation without permission is exfiltration. Attackers favour protocols that every network must allow. The Domain Name System (DNS) is the clearest case: almost every network lets name lookups out, and some allow them before a device has even signed in.
- The attacker registers a domain and runs its name server.
- Malicious software on a victim's computer breaks stolen data into short pieces and writes each piece as the first part of a name in that domain.
- The organisation's own name server cannot answer, so it forwards each lookup to the attacker's name server, carrying the data with it.
- The attacker's replies can carry commands back in the same way.
Data leaves inside traffic the firewall allows
Read this figure as text
Removing data without permission is exfiltration. Attackers favour protocols every network must allow, and almost every network lets name lookups out. The Domain Name System is the clearest case.
- The attacker registers a domain and runs its name server, outside on the internet.
- Malicious software on an infected laptop inside the organisation breaks stolen data into short pieces and writes each piece as the first part of a name in that domain. Each lookup asks for a long, random-looking name.
- The laptop looks up the name through the company's own name server, which cannot answer it.
- The company name server forwards the lookup to the attacker's name server, carrying the data with it.
- The firewall's rule allows outbound name lookups, so it lets the lookup pass. It sees an allowed lookup on the DNS port and nothing of the data inside the name.
- The attacker's name server records the data and replies. The replies can carry commands back to the laptop the same way.
- The signs are many lookups to one domain, long random-looking names, lookups by programs that are not browsers, and activity at hours nobody works. The controls: send every lookup through the organisation's own name servers, block all others, and refuse lookups for unknown or known-bad domains.
Encrypted web traffic, HTTPS, hides content in a different way. A filter sees only where the connection goes, not what it carries. DNS over HTTPS puts name lookups inside encrypted web traffic, so even the lookups disappear from view.
The signs are patterns: many lookups to one domain, names that are long and random-looking, lookups made by programs that are not web browsers, and activity at hours when nobody works. The controls follow from them. Send every lookup through the organisation's own name servers and block all others. Refuse lookups for unknown or known-bad domains, and inspect encrypted traffic at a proxy where that is lawful.
DNP3: an industrial protocol stack carried inside TCP/IP
Utilities run supervisory control and data acquisition (SCADA) systems: a control room that monitors and commands equipment at distant sites, such as electricity substations and water pumping stations. These systems use protocols of their own.
Distributed Network Protocol 3 (DNP3) is one of the most common. It was developed for the electricity industry, is used by water companies as well, and is published as the standard IEEE 1815. DNP3 has its own three-layer design for messages between a control room and the devices it commands.
On modern networks the whole DNP3 stack travels as the data of TCP or , on 20000. That makes it a multilayer protocol in the full sense: a complete protocol stack inside another.
Two security problems follow. First, many industrial protocols check neither who sent a command nor whether it was changed on the way, and a DNP3 device cannot be assumed to do either. A forged or replayed command may simply be obeyed. Second, a firewall that allows port 20000 allows every DNP3 command alike, whether it reads a meter or opens a breaker.
The answers come from the layers. A filter or that understands DNP3 can read each message and allow only expected commands from the expected control station. Protection from a lower layer, such as IPsec between sites, can add the checks that the protocol lacks.
A question, worked through
A water company's control room sends DNP3 commands to its pumping stations across the company network. The firewall already allows TCP port 20000 only between the control room network and the stations. An audit finds that any computer on the control room network could send a command to stop a pump.
Which change BEST addresses the audit finding?
Decide on your answer, then open the reasoning
- The finding is about which computer may send which command. That is decided by reading the DNP3 message, which sits inside TCP.
- Rule out a: a different port hides the service from a casual scan, but anyone already on the control room network can still send commands. Obscurity is not a control.
- Rule out c: a second copy of the same port rule judges the same outer wrapper and still lets every DNP3 command through.
- Between b and d: an IPsec tunnel protects traffic between the two ends, but it carries whatever the control room network sends into it, including commands from the wrong computer.
- Only a filter that understands DNP3 can tell a permitted command from the master station apart from the same command sent by another machine. The answer is b.
Answer: B. Add a filter that reads each DNP3 message and allows only the master station's commands
Choosing between good answers
- A control allows or blocks traffic by port number alone
- it judges the wrapper. If the risk lies in what travels inside, choose inspection that understands the inner protocol.
- Records show many name lookups with long, random-looking names to one domain
- suspect data being tunnelled out through DNS, not a faulty name server.
- An answer relies on a hidden or unusual port
- rule it out. Changing the wrapper does not change what the traffic can do.
- A tunnel's end sits inside a protected segment
- treat it as a crossing of that boundary, and look for an answer that controls or inspects where the tunnel ends.
Try it
Open each wrapper of a captured web visit in turn and note which device on the path could read each one.
Loading the preview.
Check your understanding
5 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 5
What to remember
- Tunnelling carries a complete unit of one protocol as the data of another. Devices on the path read only the outer wrapper.
- Multilayer protocols let many services share one network, allow protection at several layers and let traffic cross networks that do not speak its protocol.
- The three drawbacks are covert channels, filters bypassed and boundaries overstepped.
- DNS and HTTPS are used to tunnel data out because nearly every network allows them. Force lookups through the organisation's own name servers and watch for unusual patterns.
- DNP3 is an industrial control protocol stack carried inside TCP or UDP on port 20000. A port rule cannot tell its commands apart; a DNP3-aware filter can.
Say it from memory
What are the benefits and the three drawbacks of multilayer protocols, and why does DNP3 over TCP/IP illustrate them?
Benefits: many services share one network, protection can be added at several layers, and traffic can cross networks that do not speak its protocol. Drawbacks: covert channels, filters bypassed because they read only the outer wrapper, and segment boundaries overstepped by tunnels. DNP3 is a whole industrial protocol stack inside TCP or UDP on port 20000, so a port rule passes every command; a DNP3-aware filter is needed.
What is tunnelling, and what does Generic Routing Encapsulation add to the packet it carries?
Tunnelling is carrying a complete unit of one protocol as the data of another: the outer, or delivery, protocol carries the inner, or payload, protocol. GRE wraps any network-layer packet in a new IP packet marked with IP protocol number 47. GRE adds no encryption.
Which signs point to data being tunnelled out through DNS, and which controls follow from them?
Signs are many lookups to one domain, long random-looking names, lookups by programs that are not web browsers and activity at hours when nobody works. Send every lookup through the organisation's own name servers and block all others. Refuse lookups for unknown or known-bad domains, and inspect encrypted traffic at a proxy where lawful.
What is DNP3, and what two protections answer its weaknesses?
Distributed Network Protocol 3 (DNP3) is a SCADA protocol developed for the electricity industry and published as IEEE 1815. A device cannot be assumed to check who sent a command or whether it was changed. A filter that understands DNP3 allows only expected commands from the expected control station, and IPsec between sites can add the missing integrity checks.
Sources
- RFC 2784: Generic Routing Encapsulation (GRE), IETFGRE encapsulates an arbitrary network-layer protocol over another, uses IPv4 protocol 47, and packet filtering requires a firewall to look inside the GRE packet or filtering at the tunnel endpoints.
- NIST CSRC Glossary: covert channel, NISTA covert channel is an unintended or unauthorised channel that lets information pass in a way that violates security policy.
- MITRE ATT&CK: Protocol Tunneling (T1572), The MITRE CorporationAdversaries tunnel communications inside another protocol, including DNS over HTTPS, to avoid detection and network filtering; filtering traffic and network intrusion prevention are the named mitigations.
- MITRE ATT&CK: Application Layer Protocol: DNS (T1071.004), The MITRE CorporationCommands and their results are embedded in DNS traffic, DNS is common and may be allowed before authentication, and detection looks for high query volume and long encoded subdomains; routing DNS through organisational servers disrupts it.
- NIST SP 800-82 Rev. 3: Guide to Operational Technology Security, NISTDNP3 is published as IEEE 1815; many OT protocols lack authentication and integrity checking, allowing replayed, modified or spoofed data; IPsec can add integrity; IDS products carry DNP3 signatures and parsers for deep inspection.
- Overview of DNP3 Protocol, DNP Users GroupDNP3 was developed for the electric utility industry, is also used in water and waste water, and is based on a three-layer Enhanced Performance Architecture.
- Service Name and Transport Protocol Port Number Registry, IANADNP is registered on port 20000 for TCP and UDP.