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
Newest First  |  Oldest First  |  Threaded View
7 Tips for Infosec Pros Considering A Lateral Career Move
Kelly Sheridan, Staff Editor, Dark Reading,  1/21/2020
For Mismanaged SOCs, The Price Is Not Right
Kelly Sheridan, Staff Editor, Dark Reading,  1/22/2020
Register for Dark Reading Newsletters
White Papers
Video
Cartoon Contest
Write a Caption, Win a Starbucks Card! Click Here
Latest Comment: This comment is waiting for review by our moderators.
Current Issue
IT 2020: A Look Ahead
Are you ready for the critical changes that will occur in 2020? We've compiled editor insights from the best of our network (Dark Reading, Data Center Knowledge, InformationWeek, ITPro Today and Network Computing) to deliver to you a look at the trends, technologies, and threats that are emerging in the coming year. Download it 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-2019-16029
PUBLISHED: 2020-01-26
A vulnerability in the application programming interface (API) of Cisco Smart Software Manager On-Prem could allow an unauthenticated, remote attacker to change user account information which can prevent users from logging in, resulting in a denial of service (DoS) condition of the web interface. Th...
CVE-2020-3115
PUBLISHED: 2020-01-26
A vulnerability in the CLI of the Cisco SD-WAN Solution vManage software could allow an authenticated, local attacker to elevate privileges to root-level privileges on the underlying operating system. The vulnerability is due to insufficient input validation. An attacker could exploit this vulnerabi...
CVE-2020-3121
PUBLISHED: 2020-01-26
A vulnerability in the web-based management interface of Cisco Small Business Smart and Managed Switches could allow an unauthenticated, remote attacker to conduct a cross-site scripting (XSS) attack against a user of the interface. The vulnerability is due to insufficient validation of user-supplie...
CVE-2020-3129
PUBLISHED: 2020-01-26
A vulnerability in the web-based management interface of Cisco Unity Connection Software could allow an authenticated, remote attacker to perform a stored cross-site scripting (XSS) attack. The vulnerability is due to insufficient input validation by the web-based management interface. An attacker c...
CVE-2020-3131
PUBLISHED: 2020-01-26
[CVE-2020-3131_su] A vulnerability in the Cisco Webex Teams client for Windows could allow an authenticated, remote attacker to cause the client to crash, resulting in a denial of service (DoS) condition. The attacker needs a valid developer account to exploit this vulnerability. The vulnerability i...