Malware Encryption Efforts Mixed, But Getting StrongerRussian botnets mostly use crypto, Chinese attacks mostly don't, but attack analysis finds that the bad guys are increasingly using better encryption
When a new software threat is discovered, reverse engineers dig into the code to find ways to detect the attack, identify the code and its authors, and discover the purpose behind the malware.
Such investigations pit the digital detectives who reverse- engineer malicious programs against the developers who created the malware. In the cat-and-mouse game, reverse engineers can easily find copies of the software to crack open and analyze, and attackers respond by throwing up a number of hurdles to slow down analysts' efforts. Chief among the roadblocks are encryption and obfuscation.
In the not-too-distant past, encryption in malware was a sign of an ambitious effort on the part of the program's author. Today, nearly all malware uses some encryption, and perhaps two-thirds of botnets use encrypted communications to obfuscate their activities, says Jeff Edwards, a research analyst with network security firm Arbor Networks.
"There is a gradual trend toward improving their encryption," Edwards says. "It all comes down to whether the botnet operators and authors feel pressure to evolve."
With the takedown of the Rustock and Kelihos botnets, which counted tens of thousands of compromised computers among their nodes, the underground operators controlling the botnets are likely feeling pressure to hide their activities to an even greater extent. In addition, as malicious software developers grow more experienced, they frequently add more complex and better implemented encryption to their products.
[Less than one day after botnet hunters announced they had crippled the Kelihos.B/Hlux.B botnet, a new version of the tenacious botnet is now back up and running today. See It's (Already) Baaack: Kelihos Botnet Rebounds With New Variant.]
The Black Energy bot software, for example, originally used a basic encryptor to scramble its executable to avoid detection by antivirus software, and it used Base64 encoding to scramble its communications. Both were easily reverse-engineered. The latest version of Black Energy, however, uses a variant -- somewhat flawed, it turns out -- of the more robust RC4 stream cipher to encode its communications.
In a recent set of blog posts, Arbor Networks analyzed the encryption of four major bot programs used for denial-of-service. The analyses have found a wide variety of encryption methods, from custom substitution algorithms to the RC4 stream cipher, a popular encryption method used in Secure Sockets Layer, among other protocols. In one analysis, Arbor researched the Dark Comet remote access Trojan, which uses RC4 to encrypt its communications and uses other interesting techniques to obfuscate the encryption keys.
"It's all over the map -- you get everything from no encryption to really solid encryption," Edwards says. "RC4 is the most popular one right now, or some variation of RC4. It's a standard, it's well-understood, and it's reasonably secure."
Encryption in botnets has evolved slowly. Five years ago, the Sinowal, or Torpig, Trojan used a modified version of the XTEA block cipher to encrypt its configuration data, according to Kurt Baumgartner, senior security researcher with Kaspersky Lab. Since late 2008, the Waledac and Kelihos, or Hlux, botnets used custom implementations of the advanced encryption standard (AES) mixed with other encoding and compression to obfuscate their code and communications, he says.
"Over the past several years, we have seen malware applying encryption schemes rise and fall," Baumgartner says. "These guys are not giving up on it."
Oddly enough, the programs that researchers expect to use encryption sometimes use only simple obfuscation. While malware coming from Russia and Europe have gradually used better encryption methods, Chinese cybercriminals still use simpler methods and sometimes no obfuscation at all. Many attacks that are considered advanced persistent threats (APT) eschew encryption and use other types of obfuscation.
"We see odd, modified encoding schemes and compression schemes in their malware toolset, but not a lot of elegant or complex crypto," says Baumgartner. "It appears that it is all maintained to fly under the radar as best they can."
The situation underscores a trade-off in malware's use of encryption. Encrypted data is generally easy to detect, but not decrypt. Custom encryption or obfuscation can hide data less securely, but more effectively get around security tools, such as antivirus detection.
"These schemes are very sensitive to the amount of noise they may sound out to listening anti-malware technologies," Baumgartner says. "Some anti-malware [programs] are much better or much worse at listening for that noise than others."
Have a comment on this story? Please click "Add Your Comment" below. If you'd like to contact Dark Reading's editors directly, send us a message.