TL;DR
This paper introduces DeepC2, a novel AI-powered system for covert Command and Control (C2) using Online Social Networks (OSNs). It tackles the challenges of reversible attacker identification and the detection of abnormal C2 traffic by employing neural networks for addressing and data augmentation with hash collisions for command embedding.
What Problem Does This Paper Address?
Command and Control (C2) is a critical component of many cyberattacks, allowing attackers to send instructions to compromised machines. Traditionally, C2 channels have been vulnerable. Attackers often hardcode identifiers (like IP addresses or domain generation algorithms) into malware to find the C2 server. This hardcoding is reversible, meaning defenders can analyze the malware and discover these identifiers, leading to the shutdown of the C2 channel. Furthermore, C2 traffic, whether plain, encrypted, or encoded, often appears as abnormal content on OSNs, triggering alerts and restrictions. This paper addresses these two core problems: making attacker identification resistant to reverse engineering and embedding C2 commands into seemingly normal OSN content.
Methods
DeepC2 proposes an AI-driven approach to overcome these challenges:
- AI-Powered Addressing (Neural Networks): Instead of hardcoding identifiers, DeepC2 uses a Siamese Neural Network (SNN). The attacker trains an SNN to extract feature vectors from avatar images. These feature vectors, along with the trained model, are embedded into the malware. When the malware needs to find the attacker, it uses the model to extract feature vectors from potential attacker avatars on OSNs. A low distance between the malware's feature vectors and an avatar's feature vector indicates a match, effectively identifying the attacker's account without revealing explicit identifiers. This approach leverages the "poor explainability" of neural networks to make reverse engineering difficult.
- Covert Command Embedding (Hash Collision & Data Augmentation): To avoid C2 traffic being flagged as abnormal, DeepC2 embeds commands into normal-looking tweets. This is achieved through:
- Hash Collision: For commands like IP addresses, the attacker splits the IP into parts and uses hash collisions to embed each part into a tweet. The malware can then reconstruct the IP by calculating hashes of attacker tweets.
- Easy Data Augmentation (EDA): To generate a large volume of diverse tweets for hash collisions, EDA techniques (synonym replacement, random insertion, swap, deletion) are used. This process, combined with converting text to uppercase and adding punctuation, generates numerous variations of sentences, increasing the chances of successful hash collisions.
- Rendezvous Point (Twitter Trends): Twitter Trends are used as a dynamic rendezvous point. The attacker posts commands related to trending topics, and the malware, also monitoring trends, can find the attacker's account within that context.
Datasets
- Avatars for Training: The paper mentions crawling avatars from 115,887 Twitter users. For training the SNN, they used 19,137 sets of avatars. They also used avatars of different sizes (48x48, 73x73, 200x200, 400x400) from the same users to create pairs with label 0 (indicating different avatars from the same user).
- Avatars for Testing: 40 photos were prepared as avatars for the attacker's accounts.
- Tweets for EDA: 79 trending topics were selected from four regions, and 1,000 tweets were crawled for each topic. These were then augmented using EDA.
- IP Addresses for Hash Collision: 100 IP addresses were collected from a threat report.
No new benchmarks were introduced; existing datasets and publicly available information (Twitter API) were utilized.
Key Insights and Ideas
- Neural Networks as Obfuscation: The core insight is using the inherent difficulty in reverse-engineering neural network models as a security feature for C2 addressing. Instead of relying on predictable hardcoded values, the attacker leverages the model's abstract representations.
- Hash Collisions for Covert Data Transfer: The paper creatively applies hash collisions, typically used for integrity checks, as a method to embed arbitrary data (like IP addresses) into seemingly normal text content.
- EDA for Scalability: The use of EDA is crucial for generating the massive number of text variations needed for successful hash collisions, making the covert command embedding practical.
- Dynamic Rendezvous Points: Employing Twitter Trends as a rendezvous point adds a layer of dynamism, making it harder for defenders to predict where and when the C2 communication will occur.
Key Results
- Addressing Accuracy: The trained SNN achieved over 99.999% accuracy in distinguishing between avatars, with a very low rate of mislabeling. The chosen threshold of 0.02 for Euclidean distance proved effective.
- Hash Collision Success Rate: The system achieved a 90.28% hit rate for hash collisions with an average of 219,335 sentences, which is considered acceptable for practical purposes.
- Tweet Generation Efficiency: Generating 20K to 45K sentences using EDA took only 3 to 10 seconds, making it efficient for attackers.
- Malware Finding Time: The malware could find the attacker within 1K tweets after waiting 5 minutes, and within 3K tweets after waiting 1 hour in 88% of cases.
- Avatar Recognition Time: Extracting features from 1K avatars and calculating 1K distances took approximately 11.92 seconds, which is deemed acceptable.
Limitations and Future Work
- Defender Capabilities: The paper acknowledges that defenders can still attempt to analyze traffic patterns and behaviors. While DeepC2 aims to hide identifiers, periodic C2 activity and net flow can still be indicative.
- Avatar Similarity: While the SNN is robust, the paper notes that if avatars share similar styles (e.g., large solid color backgrounds), it might be easier for defenders to find collisions. Attackers are advised to use more diverse and unique avatars.
- OSN Platform Dependence: The current implementation focuses on Twitter. Extending DeepC2 to other OSNs with different features and policies would be a natural next step.
- Authentication: The paper suggests that authentication mechanisms (like digital signatures) could enhance security, especially against scenarios where defenders might post fake commands.
- Model Enhancement: The authors suggest that longer feature vectors and more complex loss functions could further improve the security of the avatar recognition.
- Collaboration: The paper highlights the importance of collaboration between OSNs and security communities to detect and mitigate such attacks.
Summary updated