AI-powered Covert Botnet Command and Control on OSNs

Zhi Wang, Chaoge Liu, Xiang Cui, Jialong Zhang, Di Wu, Jie Yin, Jiaxi Liu, Qixu Liu, Jinli Zhang

Introduction

Command and Control (C&C) infrastructure represents the critical "nervous system" of botnet operations, enabling attackers to direct infected hosts. While Online Social Networks (OSNs) like Twitter are attractive C&C carriers due to their high availability, they face two significant challenges: reversibility and detectability. Defenders can often reverse-engineer malware to identify hard-coded account handles or Domain Generation Algorithms (DGAs), and security filters easily flag encrypted or "gibberish" command strings as bot-like behavior.

DeepC2 is a novel, stealthy C&C framework designed to overcome these hurdles. It leverages Siamese Neural Networks (SNN) for dynamic attacker identification and uses hash collisions within natural language tweets to hide command data, making the infrastructure nearly impossible to pre-emptively block.

Methodology

The DeepC2 framework operates through a multi-stage process involving both attacker preparation and automated bot execution. The system replaces traditional static identifiers with AI-driven visual recognition and semantic data embedding.

Workflow of the DeepC2 framework showing attacker preparation and bot execution.

Dynamic Addressing via Siamese Neural Networks

Instead of relying on static usernames, DeepC2 utilizes visual recognition for identity verification. The malware is distributed with a pre-trained SNN model and a set of feature vectors (mathematical representations of images). To locate the controller, the bot monitors trending topics and compares the profile pictures (avatars) of active users against its internal vectors. This approach provides a "one-way" identity; while the bot can verify an attacker's image, a defender cannot easily reconstruct the original image from the lossy, non-explainable feature vectors found in the malware code.

Covert Communication via Hash Collisions

To transmit commands (e.g., malicious IP addresses) without triggering security filters, DeepC2 employs a technique involving Easy Data Augmentation (EDA) and hash collisions. The attacker generates hundreds of thousands of variations of a benign, natural-sounding tweet using synonym replacement and word swapping. They then select the specific variation whose hash (e.g., the first 16 bits of a SHA-256 hash) matches the binary representation of the command data. This results in perfectly readable tweets that secretly carry binary instructions.

Example of a command-embedded tweet that appears as natural social media content.

Evaluation and Results

The researchers validated the system using a dataset of 115,887 real Twitter avatars and 79 global trending topics from regions including San Francisco, London, Sydney, and Johannesburg. Key performance metrics include:

  • Identification Accuracy: The SNN achieved over 99.999% accuracy in distinguishing the attacker's avatar from thousands of decoys.
  • Command Delivery: The system reached a 100% success rate for command delivery when generating approximately 330,000 candidate sentences.
  • Operational Efficiency: Generating candidate tweets takes between 3 to 10 seconds, and bots typically identify the attacker within a window of 5 seconds to 4.5 minutes, depending on network conditions.

Key Insights and Future Work

DeepC2 demonstrates that AI can create highly resilient, "block-resistant" communication channels by breaking the link between identity and hard-coded data. By tethering activity to trending topics, botnet traffic effectively blends into legitimate high-volume noise, making traffic analysis significantly harder for ISPs and security vendors.

However, certain behavioral patterns, such as the periodic checking of Twitter Trends, remain potentially detectable. Future enhancements could include randomized "heartbeat" intervals and digital signatures to prevent defenders from hijacking the channel. The authors suggest that OSNs could mitigate this threat by running malware samples in sandboxes to extract feature vectors and proactively block matching profiles across the entire platform.

Summary updated

BibTeX
@inproceedings{wang2022ai,
  author = {Zhi Wang and Chaoge Liu and Xiang Cui and Jialong Zhang and Di Wu and Jie Yin and Jiaxi Liu and Qixu Liu and Jinli Zhang},
  title = {{AI-powered Covert Botnet Command and Control on OSNs}},
  booktitle = {ICICS},
  year = {2022},
  doi = {10.1007/978-3-031-15777-6\_22},
}
Figure