Data Encoding

Adversaries may encode data to make the content of command and control traffic more difficult to detect. Command and control (C2) information can be encoded using a standard data encoding system. Use of data encoding may adhere to existing protocol specifications and includes use of ASCII, Unicode, Base64, MIME, or other binary-to-text and character encoding systems.[1] [2] Some data encoding systems may also result in data compression, such as gzip.

ID: T1132
Sub-techniques:  T1132.001, T1132.002
Tactic: Command And Control
Platforms: Linux, Windows, macOS
Permissions Required: User
Data Sources: Network protocol analysis, Packet capture, Process monitoring, Process use of network
Requires Network:  Yes
Contributors: Itzik Kotler, SafeBreach
Version: 1.1
Created: 31 May 2017
Last Modified: 14 March 2020

Procedure Examples

Name Description
BADNEWS

After encrypting C2 data, BADNEWS converts it into a hexadecimal representation and then encodes it into base64.[3]

H1N1

H1N1 obfuscates C2 traffic with an altered version of base64.[4]

Linux Rabbit

Linux Rabbit sends the payload from the C2 server as an encoded URL parameter. [5]

Ursnif

Ursnif has used encoded data in HTTP URLs for C2.[6]

Mitigations

Mitigation Description
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 obfuscation technique 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. [7]

Detection

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. [7]

References