In our previous
post, we detailed how Zeus bots locate, download and decode their configuration data upon installation.The second step in the early communication protocol consists of bots reporting various info to the C&C server.As a third step, the latter sends back commands to the bot.
We will address both the second and the third step in this post.
POST data encryption routine
After the configuration has been fully deciphered, the Zeus bot feeds the C&C server with data about the infected computer via HTTP POST. This data is encrypted with the RC4 Table mentioned in our previous post. The clear text version looks like the following:
Again, rather than plain text, it is a binary data structure, which could be defined as follows:
struct {
BYTE RandomBytes[20];
DWORD DataLength;
DWORD Unknown;
DWORD DataBlockCount;
BYTE HASH[16];
struct{
DWORD BlockTag;
DWORD CompressTag;
DWORD CompressedDataLength;
DWORD OriginalDataLength;
BYTE Data[DataLength];
}DataBlock[DataBlockCount];
} POST_DATA;
The ‘BlockTag’ can be any of the followings (note: list not exhaustive, and varies with bot versions):
0×2711 – Computer Name
0×2712 – Hard-coded string from “Data Block A”
0×2713 – Builder Version
0×2719 – System Time
0x271a – Result of calling GetTickCount(4 Random bytes)
0x271b – Time Zone
0x271c – Windows Version
0x271d – Default Language
The server sends commands back to the bot.
Unsurprisingly, the encryption algorithm and the data structure are identical to the above:
There is one data block per command, and the BlockTags are just incremental here (in other words, they don’t have a semantic function as before).
Inside a data block, the format is:
command_name parameters
Both the command name and the parameters are given in ASCII format. Some possible commands are listed below (list non exhaustive):
user_url_block – Block the specific web injection target
user_url_unblock – Remove the “block” on specific web injection target
user_ftpclients_get – get common FTP(FlashFXP,TotalCommander, IPSwitch,FileZilla, Far, WinSCP, FTPCommander, FTPCore, SmartFTP) credentials from compromised computer
user_flashplayer_get – get flash player data from compromised computer
user_cookies_get – get cookies from compromised computer
…
Guillaume Lovet contributed to this post.