The sub-techniques beta is now live! Read the release blog post for more info.

Custom Command and Control Protocol

Adversaries may communicate using a custom command and control protocol instead of encapsulating commands/data in an existing Standard Application Layer Protocol. Implementations include mimicking well-known protocols or developing custom protocols (including raw sockets) on top of fundamental protocols provided by TCP/IP/another standard network stack.

ID: T1094
Tactic: Command And Control
Platform: Linux, macOS, Windows
Data Sources: Packet capture, Netflow/Enclave netflow, Process use of network, Process monitoring, Host network interface, Network intrusion detection system, Network protocol analysis
Requires Network:  Yes
Contributors: Ryan Becwar
Version: 1.0
Created: 31 May 2017
Last Modified: 17 July 2019

Procedure Examples

Name Description

APT32 uses Cobalt Strike's malleable C2 functionality to blend in with network traffic. The group's backdoor can also exfiltrate data by encoding it in the subdomain field of DNS packets. Additionally, one of the group's macOS backdoors implements a specific format for the C2 packet involving random values.[24][3][41][42][43]


APT37 credential stealer ZUMKONG emails credentials from the victim using HTTP POST requests.[40]


BISCUIT communicates to the C2 server using a custom protocol.[32]


Carbanak uses a custom binary protocol for C2 communications.[31]


Chaos provides a reverse shell connection on 8338/TCP, encrypted via AES.[16]

Cobalt Strike

Cobalt Strike allows adversaries to modify the way the "beacon" payload communicates. This is called "Malleable C2" in the Cobalt Strike manual and is intended to allow a penetration test team to mimic known APT C2 methods.[2][3]


Crimson uses a custom TCP protocol for C2.[26]


DDKONG communicates over raw TCP.[6]


Derusbi binds to a raw socket on a random source port between 31800 and 31900 for C2.[22]


A Dipsind variant uses a C2 mechanism similar to port knocking that allows attackers to connect to a victim without leaving the connection open for more than a few sectonds.[4]


Duqu is capable of using its command and control protocol over port 443. However, Duqu is also capable of encapsulating its command protocol over standard application layer protocols. The Duqu command and control protocol implements many of the same features as TCP and is a reliable transport protocol.[5]


Emotet has been observed using an encrypted, modified protobuf-based protocol for command and control messaging.[33][34]


FlawedGrace uses a custom binary protocol for its C2 communications.[35]


InvisiMole communicates with its C2 servers through a TCP socket.[17]


Mis-Type network traffic can communicate over a raw socket.[20]


Misdat network traffic communicates over a raw socket.[20]


MoonWind completes network communication via raw sockets.[12]


Naid connects to C2 infrastructure and establishes backdoors over a custom communications protocol.[8][9]


If NETEAGLE does not detect a proxy configured on the infected machine, it will send beacons via UDP/6000. Also, after retrieving a C2 IP address and Port Number, NETEAGLE will initiate a TCP connection to this socket. The ensuing connection is a plaintext C2 channel in which commands are specified by DWORDs.[25]


njRAT communicates to the C2 server using a custom protocol over TCP.[36]


OilRig has used custom DNS Tunneling protocols for C2.[38]


PHOREAL communicates via ICMP for C2.[24]


PLAINTEE uses a custom UDP protocol to communicate.[6]


PLATINUM has used the Intel® Active Management Technology (AMT) Serial-over-LAN (SOL) channel for command and control.[39]


PlugX can be configured to use raw TCP or UDP for command and control.[28]


Some Reaver variants use raw TCP for C2.[18]


RedLeaves can communicate to its C2 over TCP using a custom binary protocol.[7]


The Regin malware platform can use ICMP to communicate between infected computers.[23]


Remsec is capable of using ICMP, TCP, and UDP for C2.[13][14]


RogueRobin uses a custom DNS tunneling protocol for C2.[29][30]


RTM uses HTTP POST requests with data formatted using a custom protocol.[27]


Seasalt uses a custom binary protocol for C2.[32]


A TYPEFRAME variant uses fake TLS to communicate with the C2 server.[21]


UBoatRAT has used a custom command and control protocol to communicate with C2. The string ‘488’ is placed at the top of the payload and encrypts the entre buffer with a static key using a simple XOR cipher.[15]


Ursnif has used a custom packet format over TCP and UDP for a peer-to-peer (P2P) network for C2.[37]


Volgmer uses a custom binary protocol to beacon back to its C2 server. It has also used XOR for encrypting communications.[10][11]


WINDSHIELD C2 traffic can communicate via TCP raw sockets.[24]


Zebrocy uses raw sockets to communicate with its C2 server.[19]


Mitigation Description
Filter Network Traffic

Filter network traffic to look for unusual or non-standard protocols.

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. Signatures are often for unique indicators within protocols and may be based on the specific protocol used by a particular adversary or tool, and will likely be different across various malware families and versions. Adversaries will likely change tool C2 signatures over time or construct protocols in such a way as to avoid detection by common defensive tools.[1]

Network Segmentation

Properly configure firewalls and proxies to limit outgoing traffic to only necessary ports and through proper network gateway systems. Also ensure hosts are only provisioned to communicate over authorized interfaces.


Analyze network traffic for ICMP messages or other protocols that contain abnormal data or are not normally seen within or exiting the network.

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 communications that do not follow the expected protocol behavior for the port that is being used. [1]

Monitor and investigate API calls to functions associated with enabling and/or utilizing alternative communication channels.


  1. Gardiner, J., Cova, M., Nagaraja, S. (2014, February). Command & Control Understanding, Denying and Detecting. Retrieved April 20, 2016.
  2. Strategic Cyber LLC. (2017, March 14). Cobalt Strike Manual. Retrieved May 24, 2017.
  3. Mudge, R. (2014, July 14). Github Malleable-C2-Profiles safebrowsing.profile. Retrieved June 18, 2017.
  4. Windows Defender Advanced Threat Hunting Team. (2016, April 29). PLATINUM: Targeted attacks in South and Southeast Asia. Retrieved February 15, 2018.
  5. Symantec Security Response. (2011, November). W32.Duqu: The precursor to the next Stuxnet. Retrieved September 17, 2015.
  6. Ash, B., et al. (2018, June 26). RANCOR: Targeted Attacks in South East Asia Using PLAINTEE and DDKONG Malware Families. Retrieved July 2, 2018.
  7. FireEye iSIGHT Intelligence. (2017, April 6). APT10 (MenuPass Group): New Tools, Global Campaign Latest Manifestation of Longstanding Threat. Retrieved June 29, 2017.
  8. Neville, A. (2012, June 15). Trojan.Naid. Retrieved February 22, 2018.
  9. Symantec Security Response. (2012, June 18). CVE-2012-1875 Exploited in the Wild - Part 1 (Trojan.Naid). Retrieved February 22, 2018.
  10. US-CERT. (2017, November 22). Alert (TA17-318B): HIDDEN COBRA – North Korean Trojan: Volgmer. Retrieved December 7, 2017.
  11. US-CERT. (2017, November 01). Malware Analysis Report (MAR) - 10135536-D. Retrieved July 16, 2018.
  12. Miller-Osborn, J. and Grunzweig, J.. (2017, March 30). Trochilus and New MoonWind RATs Used In Attack Against Thai Organizations. Retrieved March 30, 2017.
  13. Symantec Security Response. (2016, August 8). Backdoor.Remsec indicators of compromise. Retrieved August 17, 2016.
  14. Kaspersky Lab's Global Research & Analysis Team. (2016, August 9). The ProjectSauron APT. Retrieved August 17, 2016.
  15. Hayashi, K. (2017, November 28). UBoatRAT Navigates East Asia. Retrieved January 12, 2018.
  16. Sebastian Feldmann. (2018, February 14). Chaos: a Stolen Backdoor Rising Again. Retrieved March 5, 2018.
  17. Hromcová, Z. (2018, June 07). InvisiMole: Surprisingly equipped spyware, undercover since 2013. Retrieved July 10, 2018.
  18. Grunzweig, J. and Miller-Osborn, J. (2017, November 10). New Malware with Ties to SunOrcal Discovered. Retrieved November 16, 2017.
  19. Lee, B., Falcone, R. (2018, June 06). Sofacy Group’s Parallel Attacks. Retrieved June 18, 2018.
  20. Gross, J. (2016, February 23). Operation Dust Storm. Retrieved September 19, 2017.
  21. US-CERT. (2018, June 14). MAR-10135536-12 – North Korean Trojan: TYPEFRAME. Retrieved July 13, 2018.
  22. Fidelis Cybersecurity. (2016, February 29). The Turbo Campaign, Featuring Derusbi for 64-bit Linux. Retrieved March 2, 2016.
  1. Kaspersky Lab's Global Research and Analysis Team. (2014, November 24). THE REGIN PLATFORM NATION-STATE OWNAGE OF GSM NETWORKS. Retrieved December 1, 2014.
  2. Carr, N.. (2017, May 14). Cyber Espionage is Alive and Well: APT32 and the Threat to Global Corporations. Retrieved June 18, 2017.
  3. FireEye Labs. (2015, April). APT30 AND THE MECHANICS OF A LONG-RUNNING CYBER ESPIONAGE OPERATION. Retrieved May 1, 2015.
  4. Huss, D.. (2016, March 1). Operation Transparent Tribe. Retrieved June 8, 2016.
  5. Faou, M. and Boutin, J.. (2017, February). Read The Manual: A Guide to the RTM Banking Trojan. Retrieved March 9, 2017.
  6. Dell SecureWorks Counter Threat Unit Threat Intelligence. (2015, August 5). Threat Group-3390 Targets Organizations for Cyberespionage. Retrieved August 18, 2018.
  7. Falcone, R., et al. (2018, July 27). New Threat Actor Group DarkHydrus Targets Middle East Government. Retrieved August 2, 2018.
  8. Lee, B., Falcone, R. (2019, January 18). DarkHydrus delivers new Trojan that can use Google Drive for C2 communications. Retrieved April 17, 2019.
  9. Bennett, J., Vengerik, B. (2017, June 12). Behind the CARBANAK Backdoor. Retrieved June 11, 2018.
  10. Mandiant. (n.d.). Appendix C (Digital) - The Malware Arsenal. Retrieved July 18, 2016.
  11. Brandt, A.. (2019, May 5). Emotet 101, stage 4: command and control. Retrieved April 16, 2019.
  12. Manea, D.. (2019, May 25). Emotet v4 Analysis. Retrieved April 16, 2019.
  13. Schwarz, D. and Proofpoint Staff. (2019, January 9). ServHelper and FlawedGrace - New malware introduced by TA505. Retrieved May 28, 2019.
  14. Fidelis Cybersecurity. (2013, June 28). Fidelis Threat Advisory #1009: "njRAT" Uncovered. Retrieved June 4, 2019.
  15. Proofpoint Staff. (2016, August 25). Nightmare on Tor Street: Ursnif variant Dreambot adds Tor functionality. Retrieved June 5, 2019.
  16. Unit 42. (2017, December 15). Unit 42 Playbook Viewer. Retrieved December 20, 2017.
  17. Kaplan, D, et al. (2017, June 7). PLATINUM continues to evolve, find ways to maintain invisibility. Retrieved February 19, 2018.
  18. FireEye. (2018, February 20). APT37 (Reaper): The Overlooked North Korean Actor. Retrieved March 1, 2018.
  19. Dahan, A. (2017). Operation Cobalt Kitty. Retrieved December 27, 2018.
  20. Dumont, R. (2019, March 20). Fake or Fake: Keeping up with OceanLotus decoys. Retrieved April 1, 2019.
  21. Dumont, R.. (2019, April 9). OceanLotus: macOS malware update. Retrieved April 15, 2019.