Protocol Tunneling

Adversaries may tunnel network communications to and from a victim system within a separate protocol to avoid detection/network filtering and/or enable access to otherwise unreachable systems. Tunneling involves explicitly encapsulating a protocol within another. This behavior may conceal malicious traffic by blending in with existing traffic and/or provide an outer layer of encryption (similar to a VPN). Tunneling could also enable routing of network packets that would otherwise not reach their intended destination, such as SMB, RDP, or other traffic that would be filtered by network appliances or not routed over the Internet.

There are various means to encapsulate a protocol within another protocol. For example, adversaries may perform SSH tunneling (also known as SSH port forwarding), which involves forwarding arbitrary data over an encrypted SSH tunnel.[1]

Protocol Tunneling may also be abused by adversaries during Dynamic Resolution. Known as DNS over HTTPS (DoH), queries to resolve C2 infrastructure may be encapsulated within encrypted HTTPS packets.[2]

Adversaries may also leverage Protocol Tunneling in conjunction with Proxy and/or Protocol Impersonation to further conceal C2 communications and infrastructure.

Angreifer können die Netzwerkkommunikation zu und von einem Opfersystem innerhalb eines separaten Protokolls tunneln, um eine Erkennung/Netzwerkfilterung zu vermeiden und/oder den Zugriff auf ansonsten unerreichbare Systeme zu ermöglichen. Beim Tunneln wird ein Protokoll explizit in ein anderes gekapselt. Dieses Verhalten kann den bösartigen Datenverkehr verbergen, indem es sich in den bestehenden Datenverkehr einfügt und/oder eine äussere Verschlüsselungsschicht bietet (ähnlich wie ein VPN). Tunneling kann auch die Weiterleitung von Netzwerkpaketen ermöglichen, die andernfalls ihr Ziel nicht erreichen würden, wie z.B. SMB, RDP oder anderer Datenverkehr, der von Netzwerkgeräten gefiltert oder nicht über das Internet weitergeleitet würde.

Es gibt verschiedene Möglichkeiten, ein Protokoll innerhalb eines anderen Protokolls zu kapseln. So können Angreifer beispielsweise SSH-Tunneling (auch als SSH-Portweiterleitung bekannt) durchführen, bei dem beliebige Daten über einen verschlüsselten SSH-Tunnel weitergeleitet werden.(Zitat: SSH-Tunneling)

Protocol Tunneling kann von Angreifern auch während Dynamic Resolution missbraucht werden. Unter dem Namen DNS over HTTPS (DoH) können Anfragen zur Auflösung von C2-Infrastrukturen in verschlüsselten HTTPS-Paketen gekapselt werden.(Zitat: BleepingComp Godlua JUL19)

Angreifer können auch Protocol Tunneling in Verbindung mit Proxy und/oder Protocol Impersonation nutzen, um C2-Kommunikation und -Infrastruktur weiter zu verschleiern.

Les adversaires peuvent tunneliser les communications réseau à destination et en provenance d'un système victime dans un protocole distinct pour éviter la détection/le filtrage du réseau et/ou permettre l'accès à des systèmes autrement inaccessibles. La tunnellisation implique l'encapsulation explicite d'un protocole dans un autre. Ce comportement peut dissimuler le trafic malveillant en se fondant dans le trafic existant et/ou fournir une couche extérieure de cryptage (similaire à un VPN). La tunnellisation peut également permettre l'acheminement de paquets réseau qui, autrement, n'atteindraient pas leur destination prévue, tels que SMB, RDP ou d'autres trafics qui seraient filtrés par les appareils réseau ou ne seraient pas acheminés sur Internet.

Il existe divers moyens d'encapsuler un protocole dans un autre protocole. Par exemple, les adversaires peuvent effectuer un tunnelage SSH (également connu sous le nom de transfert de port SSH), qui consiste à transférer des données arbitraires sur un tunnel SSH crypté.(Citation : Tunnelage SSH)

Les adversaires peuvent également abuser du Protocol Tunneling pendant la Résolution dynamique. Connu sous le nom de DNS over HTTPS (DoH), les requêtes visant à résoudre l'infrastructure C2 peuvent être encapsulées dans des paquets HTTPS chiffrés.(Citation : BleepingComp Godlua JUL19)

Les adversaires peuvent également exploiter Protocol Tunneling en conjonction avec Proxy et/ou Protocol Impersonation pour dissimuler davantage les communications et l'infrastructure C2.

Gli avversari possono creare un tunnel per le comunicazioni di rete da e verso un sistema vittima all'interno di un protocollo separato per evitare il rilevamento/filtraggio di rete e/o permettere l'accesso a sistemi altrimenti irraggiungibili. Il tunneling implica l'incapsulamento esplicito di un protocollo all'interno di un altro. Questo comportamento può nascondere il traffico malevolo confondendosi con il traffico esistente e/o fornire uno strato esterno di crittografia (simile a una VPN). Il tunneling potrebbe anche permettere l'instradamento di pacchetti di rete che altrimenti non raggiungerebbero la destinazione prevista, come SMB, RDP o altro traffico che verrebbe filtrato da apparecchi di rete o non instradato su Internet.

Ci sono vari mezzi per incapsulare un protocollo all'interno di un altro protocollo. Per esempio, gli avversari possono eseguire il tunneling SSH (noto anche come SSH port forwarding), che comporta l'inoltro di dati arbitrari su un tunnel SSH criptato.(Citazione: SSH Tunneling)

Il Protocol Tunneling può anche essere abusato da avversari durante la Risoluzione dinamica. Conosciuto come DNS su HTTPS (DoH), le query per risolvere infrastrutture C2 possono essere incapsulate all'interno di pacchetti HTTPS criptati.(Citazione: BleepingComp Godlua JUL19)

Gli avversari possono anche sfruttare Protocol Tunneling insieme a Proxy e/o Protocol Impersonation per nascondere ulteriormente comunicazioni e infrastrutture C2.

Login
ID: T1572
Sub-techniques:  No sub-techniques
Platforms: Linux, Windows, macOS
Version: 1.0
Created: 15 March 2020
Last Modified: 27 March 2020
Translations:  DE FR IT EN
Provided by LAYER 8

Procedure Examples

ID Name Description
G0114 Chimera

Chimera has encapsulated Cobalt Strike's C2 protocol in DNS and HTTPS.[3]

G0080 Cobalt Group

Cobalt Group has used the Plink utility to create SSH tunnels.[4][5][6]

S0154 Cobalt Strike

Cobalt Strike uses a custom command and control protocol that is encapsulated in HTTP, HTTPS, or DNS. In addition, it conducts peer-to-peer communication over Windows named pipes encapsulated in the SMB protocol. All protocols use their standard assigned ports.[7][8]

G0132 CostaRicto

CostaRicto has set up remote SSH tunneling into the victim's environment from a malicious domain.[9]

S0038 Duqu

Duqu uses a custom command and control protocol that communicates over commonly used ports, and is frequently encapsulated by application layer protocols.[10]

G0037 FIN6

FIN6 used the Plink command-line utility to create SSH tunnels to C2 servers.[11]

S0173 FLIPSIDE

FLIPSIDE uses RDP to tunnel traffic from a victim environment.[12]

G0117 Fox Kitten

Fox Kitten has used protocol tunneling for communication and RDP activity on compromised hosts through the use of open source tools such as Ngrok and custom tool SSHMinion.[13][14][15]

S0604 Industroyer

Industroyer attempts to perform an HTTP CONNECT via an internal proxy to establish a tunnel.[16]

G0065 Leviathan

Leviathan has used protocol tunneling to further conceal C2 communications and infrastructure.[17]

S0508 Ngrok

Ngrok can tunnel RDP and other services securely over internet connections.[18][19][20][21]

G0049 OilRig

OilRig has used the Plink utility and other tools to create tunnels to C2 servers.[22][23][24]

S0650 QakBot

The QakBot proxy module can encapsulate SOCKS5 protocol within its own proxy protocol.[25]

Mitigations

ID Mitigation Description
M1037 Filter Network Traffic

Consider filtering network traffic to untrusted or known bad domains and resources.

M1031 Network Intrusion Prevention

Network intrusion detection and prevention systems that use network signatures to identify traffic for specific adversary malware can be used to mitigate activity at the network level.

Detection

ID Data Source Data Component
DS0029 Network Traffic Network Connection Creation
Network Traffic Content
Network Traffic Flow

Monitoring for systems listening and/or establishing external connections using ports/protocols commonly associated with tunneling, such as SSH (port 22). Also monitor for processes commonly associated with tunneling, such as Plink and the OpenSSH client.

Analyze network data for uncommon data flows (e.g., a client sending significantly more data than it receives from a server). Processes utilizing the network that do not normally have network communication or have never been seen before are suspicious. Analyze packet contents to detect application layer protocols that do not follow the expected protocol standards regarding syntax, structure, or any other variable adversaries could leverage to conceal data.[26]

Überwachung auf Systeme, die externe Verbindungen über Ports/Protokolle abhören und/oder aufbauen, die üblicherweise mit dem Tunneln verbunden sind, wie z.B. SSH (Port 22). Überwachen Sie auch Prozesse, die üblicherweise mit dem Tunneln verbunden sind, z.B. Plink und den OpenSSH-Client.

Analysieren Sie die Netzwerkdaten auf ungewöhnliche Datenströme (z.B. ein Client, der deutlich mehr Daten sendet als er von einem Server empfängt). Prozesse, die das Netzwerk nutzen und normalerweise keine Netzwerkkommunikation haben oder noch nie gesehen wurden, sind verdächtig. Analysieren Sie Paketinhalte, um Protokolle der Anwendungsschicht zu erkennen, die nicht den erwarteten Protokollstandards in Bezug auf Syntax, Struktur oder andere Variablen entsprechen, die von Angreifern zur Verschleierung von Daten genutzt werden könnten.(Zitat: University of Birmingham C2)

Surveillance des systèmes qui écoutent et/ou établissent des connexions externes à l'aide de ports/protocoles communément associés au tunneling, tels que SSH (port 22). Surveillez également les processus communément associés à la création de tunnels, tels que Plink et le client OpenSSH.

Analysez les données du réseau pour détecter les flux de données inhabituels (par exemple, un client qui envoie beaucoup plus de données qu'il n'en reçoit d'un serveur). Les processus utilisant le réseau qui n'ont pas de communication réseau normale ou qui n'ont jamais été vus auparavant sont suspects. Analysez le contenu des paquets pour détecter les protocoles de la couche application qui ne suivent pas les normes de protocole attendues en matière de syntaxe, de structure ou de toute autre variable que les adversaires pourraient exploiter pour dissimuler des données.(Citation : Université de Birmingham C2)

Monitoraggio dei sistemi che ascoltano e/o stabiliscono connessioni esterne usando porte/protocolli comunemente associati al tunneling, come SSH (porta 22). Monitoraggio anche dei processi comunemente associati al tunneling, come Plink e il client OpenSSH.

Analizzare i dati di rete alla ricerca di flussi di dati insoliti (ad esempio, un client che invia molti più dati di quelli che riceve da un server). I processi che utilizzano la rete che normalmente non hanno comunicazioni in rete o che non sono mai stati visti prima sono sospetti. Analizzare il contenuto dei pacchetti per individuare protocolli di livello applicativo che non seguono gli standard di protocollo previsti per quanto riguarda la sintassi, la struttura o qualsiasi altra variabile che gli avversari potrebbero sfruttare per nascondere i dati.(Citazione: Università di Birmingham C2)

References

  1. CISA. (2020, September 15). Iran-Based Threat Actor Exploits VPN Vulnerabilities. Retrieved December 21, 2020.
  2. ClearSky. (2020, December 17). Pay2Key Ransomware – A New Campaign by Fox Kitten. Retrieved December 21, 2020.
  3. Dragos Inc.. (2017, June 13). CRASHOVERRIDE Analysis of the Threat to Electric Grid Operations. Retrieved December 18, 2020.
  4. CISA. (2021, July 19). (AA21-200A) Joint Cybersecurity Advisory – Tactics, Techniques, and Procedures of Indicted APT40 Actors Associated with China’s MSS Hainan State Security Department.. Retrieved August 12, 2021.
  5. Kennelly, J., Goody, K., Shilko, J. (2020, May 7). Navigating the MAZE: Tactics, Techniques and Procedures Associated With MAZE Ransomware Incidents. Retrieved May 18, 2020.
  6. Cyware. (2019, May 29). Cyber attackers leverage tunneling service to drop Lokibot onto victims’ systems. Retrieved September 15, 2020.
  7. Segura, J. (2020, February 26). Fraudsters cloak credit card skimmer with fake content delivery network, ngrok server. Retrieved September 15, 2020.
  8. Borja, A. Camba, A. et al (2020, September 14). Analysis of a Convoluted Attack Chain Involving Ngrok. Retrieved September 15, 2020.
  9. Unit 42. (2017, December 15). Unit 42 Playbook Viewer. Retrieved December 20, 2017.
  10. Davis, S. and Caban, D. (2017, December 19). APT34 - New Targeted Attack in the Middle East. Retrieved December 20, 2017.
  11. Bromiley, M., et al.. (2019, July 18). Hard Pass: Declining APT34’s Invite to Join Their Professional Network. Retrieved August 26, 2019.
  12. Kuzmenko, A. et al. (2021, September 2). QakBot technical analysis. Retrieved September 27, 2021.
  13. Gardiner, J., Cova, M., Nagaraja, S. (2014, February). Command & Control Understanding, Denying and Detecting. Retrieved April 20, 2016.