Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Vulnerabilities / Threats //

Advanced Threats

8/29/2017
10:30 AM
Connect Directly
Twitter
LinkedIn
RSS
E-Mail vvv
100%
0%

How Hackers Hide Their Malware: The Basics

Malware depends on these four basic techniques to avoid detection.

First of a two-part series.

Antivirus (AV) and anti-malware products are among the oldest and most mature defenses against cyber attacks we have, yet new malware samples seem to make it past legacy AV solutions every day. If you monitored the top AV engines the day WannaCry surfaced, you'd have seen that most of them missed the first samples early on but slowly updated signatures over the following hours, days, and weeks. This is a perfect example of the delayed, reactive nature of signature-based detection solutions.

Signature-based AV software can also miss well-known threats. The industry sees anywhere from 300,000 to 1 million new malware variants each day. However, criminals aren't making millions of new worms, Trojans, or viruses. There are probably thousands, not hundreds of thousands, of truly unique malware families. So, where do these millions of variants come from?

The answer is malware evasion techniques. Over time, malware authors have developed hundreds of techniques to make their malware look "new again" to evade security controls. In the second of a two-part post, I'll cover seven high-level evasion techniques cybercriminals use to hide malware from you and your security software, and explain some of the ways we can still detect them. Here, in part 1, I'll outline four basic malware obfuscation methods.

1. Packers
A packer is a program that compresses an executable to make it smaller. It wraps the compressed executable in the code necessary to decompress itself at runtime. The act of compression changes the way the executable file looks. Signature-based detection relies on malware researchers or automated systems finding a pattern in a known malware file, such as a hash or the number of binary patterns, to create a unique identifier for that malware. Packing changes this identifier, so the AV may not detect the packed file.

Though there are legitimate uses for packers, including making your executables smaller or making it harder for pirates to reverse engineer your code, malware regularly uses packed executables to try to hide from your AV. AV can often detect packing, but since you can legitimately pack executables, AV products can't use this alone to decide something is malware.  

2. Crypters
A crypter is similar to a packer but adds additional obfuscation or encryption to the mix. Like a packer, its goal is to change the binary fingerprint of a file to avoid detection. In a nutshell, the crypter encrypts the original executable using an encryption algorithm — often something as simple as a XOR cipher with a unique key. The crypter then creates a stub, which is the initial program that has everything it needs to decrypt and run the real embedded payload.

By using different keys with a XOR cipher to encode the original program, you can create almost endless altered copies of the same program. Nowadays, other criminals sell many different crypters on the underground market. You can also find many free ones, like the well-known Veil-Evasion framework.

There are some issues with both packers and crypters. For instance, both techniques mostly protect malware from static analysis but not necessarily dynamic analysis. Static analysis means malware detection techniques you perform on a file that has not executed yet. Because you want to stop malware before it gets onto systems, many AV products scan files as they pass through networks or get copied onto a computer's file system. However, static analysis limits what AV can learn about the particular file since those files could be packed or crypted.

Dynamic analysis, on the other hand, means detection techniques applied when a file executes. Dynamic analysis allows you to see the malware code in memory, or pay attention to other things it does. A packed or crypted program eventually has to unpack or decrypt itself to run. Thus, products using dynamic analysis can often recognize the obfuscated malware once it does run. Furthermore, once AV companies figure out how to detect particular packers or the stubs for crypters, they can sometimes recognize those malicious files without needing to see the decoded binary.

I'm simplifying, of course. Packers and crypters continue to evolve in an arms race against AV software and now use techniques such as only decrypting small portions of the real payload in memory at a time, which can make it harder for AV products.

3. Polymorphic Malware
At the highest level, polymorphic malware is malware that repeatedly uses packing and crypting methods to change the way it looks. However, rather than using static keys as most crypters do, polymorphic malware uses more complex encrypting algorithms with random keys, variables, and decoders. The malware itself can mutate itself every time it copies itself to a new location, or criminals can set up servers that automatically morph their malware variant every time it's sent to a new victim. Server-side polymorphic malware is very popular and likely accounts for a large majority of daily malware variants.

4. Downloaders, Droppers, and Staged Loading
Many kinds of malware use staging programs called droppers or downloaders to learn about a system before installing the real malware. Some of these droppers scope out a system first to avoid triggering security alerts when they download and install the real payload. They may seek out and kill security processes or check to see if they're running on a virtual system. They may also download their secondary payloads using encrypted back channels to avoid network detection or inject malware directly into known Windows processes to avoid detection. On the downside, AV vendors can design signatures to recognize these droppers and downloaders, and modern AV programs are good at defending themselves from dropper tricks.

These four techniques hackers use to hide malware are relatively basic but quite effective. In the second part of this series, I describe several more advanced obfuscation methods, and explain ways companies can still detect malware even if it's hidden.

Related Content:

Learn from the industry’s most knowledgeable CISOs and IT security experts in a setting that is conducive to interaction and conversation. Click for more info and to register.

Corey Nachreiner regularly contributes to security publications and speaks internationally at leading industry trade shows like RSA. He has written thousands of security alerts and educational articles and is the primary contributor to the WatchGuard Security Center blog, ... View Full Bio
Comment  | 
Print  | 
More Insights
Comments
Oldest First  |  Newest First  |  Threaded View
Aviation Faces Increasing Cybersecurity Scrutiny
Kelly Jackson Higgins, Executive Editor at Dark Reading,  8/22/2019
Microsoft Tops Phishers' Favorite Brands as Facebook Spikes
Kelly Sheridan, Staff Editor, Dark Reading,  8/22/2019
MoviePass Leaves Credit Card Numbers, Personal Data Exposed Online
Kelly Sheridan, Staff Editor, Dark Reading,  8/21/2019
Register for Dark Reading Newsletters
White Papers
Video
Cartoon
Current Issue
7 Threats & Disruptive Forces Changing the Face of Cybersecurity
This Dark Reading Tech Digest gives an in-depth look at the biggest emerging threats and disruptive forces that are changing the face of cybersecurity today.
Flash Poll
The State of Ransomware
The State of Ransomware
Ransomware has become one of the most prevalent new cybersecurity threats faced by today's enterprises. This new report from Dark Reading includes feedback from IT and IT security professionals about their organization's ransomware experiences, defense plans, and malware challenges. Find out what they had to say!
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2016-6154
PUBLISHED: 2019-08-23
The authentication applet in Watchguard Fireware 11.11 Operating System has reflected XSS (this can also cause an open redirect).
CVE-2019-5594
PUBLISHED: 2019-08-23
An Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting") in Fortinet FortiNAC 8.3.0 to 8.3.6 and 8.5.0 admin webUI may allow an unauthenticated attacker to perform a reflected XSS attack via the search field in the webUI.
CVE-2019-6695
PUBLISHED: 2019-08-23
Lack of root file system integrity checking in Fortinet FortiManager VM application images of all versions below 6.2.1 may allow an attacker to implant third-party programs by recreating the image through specific methods.
CVE-2019-12400
PUBLISHED: 2019-08-23
In version 2.0.3 Apache Santuario XML Security for Java, a caching mechanism was introduced to speed up creating new XML documents using a static pool of DocumentBuilders. However, if some untrusted code can register a malicious implementation with the thread context class loader first, then this im...
CVE-2019-15092
PUBLISHED: 2019-08-23
The webtoffee "WordPress Users & WooCommerce Customers Import Export" plugin 1.3.0 for WordPress allows CSV injection in the user_url, display_name, first_name, and last_name columns in an exported CSV file created by the WF_CustomerImpExpCsv_Exporter class.