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
 

Recommended Reading:

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
COVID-19: Latest Security News & Commentary
Dark Reading Staff 7/2/2020
Ripple20 Threatens Increasingly Connected Medical Devices
Kelly Sheridan, Staff Editor, Dark Reading,  6/30/2020
DDoS Attacks Jump 542% from Q4 2019 to Q1 2020
Dark Reading Staff 6/30/2020
Register for Dark Reading Newsletters
White Papers
Video
Cartoon
Current Issue
How Cybersecurity Incident Response Programs Work (and Why Some Don't)
This Tech Digest takes a look at the vital role cybersecurity incident response (IR) plays in managing cyber-risk within organizations. Download the Tech Digest today to find out how well-planned IR programs can detect intrusions, contain breaches, and help an organization restore normal operations.
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-2020-9498
PUBLISHED: 2020-07-02
Apache Guacamole 1.1.0 and older may mishandle pointers involved inprocessing data received via RDP static virtual channels. If a userconnects to a malicious or compromised RDP server, a series ofspecially-crafted PDUs could result in memory corruption, possiblyallowing arbitrary code to be executed...
CVE-2020-3282
PUBLISHED: 2020-07-02
A vulnerability in the web-based management interface of Cisco Unified Communications Manager, Cisco Unified Communications Manager Session Management Edition, Cisco Unified Communications Manager IM & Presence Service, and Cisco Unity Connection could allow an unauthenticated, remote attack...
CVE-2020-5909
PUBLISHED: 2020-07-02
In versions 3.0.0-3.5.0, 2.0.0-2.9.0, and 1.0.1, when users run the command displayed in NGINX Controller user interface (UI) to fetch the agent installer, the server TLS certificate is not verified.
CVE-2020-5910
PUBLISHED: 2020-07-02
In versions 3.0.0-3.5.0, 2.0.0-2.9.0, and 1.0.1, the Neural Autonomic Transport System (NATS) messaging services in use by the NGINX Controller do not require any form of authentication, so any successful connection would be authorized.
CVE-2020-5911
PUBLISHED: 2020-07-02
In versions 3.0.0-3.5.0, 2.0.0-2.9.0, and 1.0.1, the NGINX Controller installer starts the download of Kubernetes packages from an HTTP URL On Debian/Ubuntu system.