Modern Malware For Dummies
Modern Malware For Dummies
Modern Malware For Dummies
FOR
DUMmIES
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
For general information on our other products and services, please contact our Business Development Department in the U.S. at 317-572-3205. For details on how to create a custom For Dummies book for your business or organization, contact info@ dummies.biz. For information about licensing the For Dummies brand for products or services, contact BrandedRights&[email protected].
ISBN: 978-1-118-18254-3 (pbk); ISBN: 978-1-118-18413-4 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
About This Book ........................................................................ 1 Foolish Assumptions ................................................................. 1 How This Book Is Organized .................................................... 2 Chapter 1: Understanding the Modern Threat Landscape ........................................................ 2 Chapter 2: Defining Modern Malware ........................... 2 Chapter 3: Why Traditional Security Solutions Fail to Control Modern Malware ................................ 2 Chapter 4: What the Next-Generation Firewall Brings to the Fight against Malware .......................... 2 Chapter 5: Creating Modern Malware Protection Policies....................................................... 3 Chapter 6: Ten Best Practices for Controlling Modern Malware .......................................................... 3 Glossary ............................................................................ 3 Icons Used in This Book ............................................................ 3 Where to Go from Here ............................................................. 4
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
iv
Chapter 3: Why Traditional Security Solutions Fail to Control Modern Malware . . . . . . . . . . . . . . . . .27
The Rapidly Expanding Attack Surface ................................. 27 Unintended Consequences of Social Media.......................... 28 A Lack of Visibility ................................................................... 29 Signature Avoidance ................................................................ 31 Targeted Malware .................................................................... 32 Polymorphism .......................................................................... 33 Traditional Network Controls Are Ineffective ...................... 33 Firewalls .......................................................................... 33 Intrusion prevention ..................................................... 34 Proxies ............................................................................ 34 Crossing Legacy Security Silos............................................... 35 Network versus host-based approaches .................... 35 Integrating multi-disciplinary solutions...................... 36
Chapter 4: What the Next-Generation Firewall Brings to the Fight against Malware . . . . . . . . . . . . .37
Introducing the Next-Generation Firewall ............................ 37 Preventing Infection with Next-Generation Firewalls ................................................... 39 Reduce the attack surface ............................................ 39 Control modern malware enabling applications ....... 40 Prevent use of circumventors ...................................... 43 Protect remote users..................................................... 45 Investigate unknowns.................................................... 45 Finding Infected Hosts with Next-Generation Firewalls ...... 47 Find command-and-control traffic ............................... 47 Automate tracking and correlation ............................. 48
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Table of Contents
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Publishers Acknowledgments
Were proud of this book and of the people who worked on it. For details on how to create a custom For Dummies book for your business or organization, contact info@ dummies.biz. For details on licensing the For Dummies brand for products or services, contact BrandedRights&[email protected]. Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Vertical Websites Senior Project Editor: Zo Wykes Editorial Manager: Rev Mengle Acquisitions Editor: Amy Fandrei Business Development Representative: Karen Hattan Custom Publishing Project Specialist: Michael Sullivan Composition Services Senior Project Coordinator: Kristie Rees Layout and Graphics: Carl Byers Proofreaders: Rebecca Denoncour, Jessica Kramer Special Help from Palo Alto Networks: Wade Williamson
Publishing and Editorial for Technology Dummies Richard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher Mary Bednarek, Executive Director, Acquisitions Mary C. Corder, Editorial Director Publishing and Editorial for Consumer Dummies Kathleen Nebenhaus, Vice President and Executive Publisher Composition Services Debbie Stailey, Director of Composition Services Business Development Lisa Coleman, Director, New Market and Brand Development
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Introduction
odern malware has transformed into highly sophisticated network applications and has, in the process, changed the world of enterprise security and how networks are attacked. These threats are experts at remaining hidden from traditional security while exhibiting an intelligence, resiliency, and scale that has never before been seen in malware. Controlling these threats will require multiple security disciplines. While no single solution will solve the problem of networked malware on its own, the next-generation firewall provides the unique visibility and control of, and the true integration of, threat-prevention disciplines needed to find and stop these threats both known and unknown.
Foolish Assumptions
First and foremost, despite the title of this book, we assume that you know a little something about network security and Internet-based threats. We know, its a bit of an oxymoron, but Modern Malware For Geniuses just isnt that catchy! As such, this book is written primarily for technical readers who are evaluating potential new security solutions to address modern malware threats.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: What the NextGeneration Firewall Brings to the Fight against Malware
Here we take a deep dive into the advanced capabilities and features of the next-generation firewall and lay out a practical methodology to protect your enterprise from malware and botnets.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Introduction
Glossary
And, just in case you get stumped on a technical term or an acronym here or there, we include a glossary to help you sort through it all.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 1
or many years, the security industry was seen as Chicken Little, telling anyone who would listen that the sky was falling and that hackers were trying to steal their most precious information. For the most part, that simply wasnt the case. Hackers were largely creatures of opportunity seeking the path of least resistance if they encountered a secured network, they were likely to move on, looking for a softer target. Todays hackers are highly motivated, professional cyber criminals often well-funded by criminal organizations or rogue nation-states that are far more patient and persistent in their efforts to break through an organizations defenses. In this chapter, you find out why hackers are more dangerous than ever before and explore the modern attack lifecycle. Malware is malicious software or code that typically damages or disables, takes control of, or steals information from a computer system. Malware broadly includes botnets, viruses, worms, Trojan horses, logic bombs, rootkits, bootkits, backdoors, spyware, and adware.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
U.S. Senate (political hacktivism). In June 2011, LulzSec (a loosely organized hacker group) broke into the U.S. Senate website and posted a list of compromised but not sensitive or classified files online. Other examples of political hacktivism by various hacker groups include attacks against the U.S. Public Broadcasting Service (PBS), Fox Broadcasting Company, and MasterCard, Visa, and PayPal websites in retaliation for negative coverage or adverse actions against WikiLeaks. Spear phishing is a targeted phishing campaign that appears more credible to its victims by gathering specific information about the target, and thus has a higher probability of success. A spear phishing e-mail may spoof an organization (such as a financial institution) or individual that the recipient actually knows and does business with, and may contain very specific information (such as the recipients first name, rather than just an e-mail address). Spear phishing, and phishing attacks in general, are not always conducted via e-mail. A link is all that is required, such as a link on Facebook or on a message board or a shortened URL on Twitter. These methods are particularly effective in spear phishing because they allow the attacker to gather a great deal of information about the targets and then lure them into dangerous clicks in a place where the users feel comfortable. Many organizations and individuals have been lulled into a false sense of security by the mistaken belief that the only data an attacker wants to steal and thus the only data that needs to be protected is financial data, such as credit card
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Infection
Infection almost always has a social aspect, such as getting users to click on a bad link in a phishing e-mail, luring them to a social networking site, or sending them to a web page with an infected image, for example. Understanding how malware and exploits have become closely interrelated in the modern attack lifecycle is important. Exploits used to be directed at vulnerabilities on servers that were directly targeted. Most exploits today are used to crack a target system to infect it with malware: an exploit is run, causing a buffer overflow, which allows the attacker to gain shell access.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
10
Communication
Encryption
Common Apps
Proxies, RDP, Application Tunnels Port Evasions (tunnel over open ports) Fast Flux (Dynamic DNS)
(Drive-by-Download)
Figure 1-1: Key components and tools in the modern attack strategy.
With shell access, the attacker can deliver pretty much any payload. The first step is to exploit the target, then deliver the malware in the background through the application or connection that is already open. This is known as a driveby-download and is far and away the most common delivery mechanism for modern malware today. Infection relies heavily on hiding from and evading traditional security solutions. Targeted attacks will often develop new and unique malware that is customized specifically for the target network. This technique allows the attacker to send in malware knowing that it is unlikely to be detected by traditional antivirus tools. Another common way to avoid security is to infect the user over a connection that security cant see into, such as an encrypted channel. Attack transmissions are often obscured in SSL-encrypted (Secure Sockets Layer) traffic or other proprietary encryption used in P2P (peer-topeer) networking applications and IM (instant messaging), for example. The trend today is that threats do not necessarily come as an executable attachment in an e-mail. A link is all that is required. This is why social media, webmail, message boards,
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
11
Persistence
Once a target machine is infected, the attacker needs to ensure persistence (the resilience or survivability of the bot). Rootkits and bootkits are commonly installed on compromised machines for this purpose. A rootkit is malware that provides privileged (root-level) access to a computer. A bootkit is a kernel-mode variant of a rootkit, commonly used to attack computers that are protected by full-disk encryption. Backdoors enable an attacker to bypass normal authentication procedures to gain access to a compromised system. Backdoors are often installed as failover in case other malware is detected and removed from the system. Poison Ivy is one example of a backdoor that was used in the RSA attack (discussed earlier in this chapter). Finally, anti-AV malware may be installed to disable any legitimately installed antivirus software on the compromised machine, thereby preventing automatic detection and removal of malware that is subsequently installed by the attacker. Many anti-AV programs work by infecting the Master Boot Record (MBR) of a target machine.
Communication
Communication is fundamental to a successful attack. Malware must be able to communicate with other infected systems or controllers to enable command and control, and to extract stolen data from a target system or network. Attack communications must be stealthy and cannot raise any suspicion on the network. Such traffic is usually obfuscated or hidden through techniques that include Encryption with SSL, SSH (Secure Shell), or some other custom application. Proprietary encryption is also commonly used. For example, BitTorrent is known for its use of proprietary encryption and is a favorite hacker tool both for infection and ongoing command and control.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
12
13
Unfortunately, our traditional view of malware and old security habits make us think of malware as the pea an executable payload, perhaps attached to an e-mail. To understand, control, and successfully counter modern threats, we need to focus on not just the pea (malware), but on all the moving parts. We explore the central role of malware in the modern threat lifecycle further in Chapter 2.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
14
Applications: Can hide and enable threats. URLs and websites: Can host and enable threats. Exploits: Create shell access to the target. Malware: controls and uses the compromised target. Files: Used to update malware and steal data. Security must expand beyond the perimeter. Organizations need to focus on expanding visibility beyond the network perimeter both inward and outward. This is best accomplished with network segmentation and a next-generation firewall to enforce central controls on internal and external (such as remote and mobile access) network traffic. The sky is NOT falling! Todays threats are not so advanced that they are impossible to control. They are not completely new, just more common and better organized. Solutions do exist, and organizations can adopt best practices and adapt to changes in the threat landscape. Dont fall into the APT (Advanced Persistent Threats) ate my homework trap!
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 2
he rise of modern malware is reshaping the threat landscape and forcing enterprises to reassess how they protect themselves. Collectively, modern malware has outpaced traditional anti-malware strategies and in the process, has established a foothold within the enterprise that criminals and nation-states can use to steal information and attack sensitive assets. In this chapter, you learn about this new class of threat that has come to be known as modern malware bots, botnets, and bot-herders (but not fem-bots sorry, Austin Powers!), what makes them tick, and what makes them particularly nasty.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
16
100
This poor catch rate is due to several factors. Some malware has the ability to mutate or can be updated to avoid detection by traditional malware signatures. Additionally, modern malware is increasingly specialized to the point where the attacker will develop a customized piece of malware that is targeted against a specific individual or network. Botnets are a particularly useful example for understanding some of the unique characteristics of modern malware. Bots (individual infected machines) and botnets (the broader network of bots working together) are notoriously difficult for traditional antivirus/anti-malware solutions to detect. Bots leverage networks to gain power and resilience. A bot under the remote control of a human attacker (or bot-herder) can be updated just like any other application so that the attacker can change course and dig deeper into the network, based on what he finds or to adapt to changes and countermeasures. This is a fundamental shift compared to earlier types of malware, which were more or less a swarm of independent agents
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
17
that simply infected and replicated themselves. Botnets and a great deal of modern malware are centrally coordinated, networked applications in a very real sense. In much the same way that the Internet changed what was possible in personal computing, ubiquitous network access is changing what is possible in the world of malware. Now, all malware of the same type can work together toward a common goal, with each infected machine growing the power and value of the overall botnet. The botnet can evolve to pursue new goals or adapt to changes in security measures. Some of the most important and unique functional traits of botnets (see Figure 2-2) are discussed in the following sections.
Bots refresh to avoid signature detection Functions change based on bot-herders needs Data ex ltrated to remote server
Command-andControl Server
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
18
Multifunctional
Updates from the command-and-control servers can also completely change the bots functionality. This multifunctional capability enables a new economic approach for a bot-herder (botnet operator), who can now use portions of the botnet for a particular task such as collecting credit card numbers, while other segments of the botnet might be sending spam. The important point is that the infection is the most important step, because the functionality can always be changed later as needed.
Spamming botnets
The largest botnets are often dedicated to sending spam. The premise is fairly straightforward the bot-herder infects as many computers as possible, which can then be used without the users knowledge to send out thousands of spam messages.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
19
Microsoft is offering a $250,000 USD reward for information leading to the identification, arrest, and conviction of the individual(s) who were responsible for the Rustock botnet.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
20
Financial botnets
Financial botnets have received widespread coverage in the press, largely due to the spectacular monetary damage they have caused. These botnets are typically not as large and monolithic as spamming botnets, which grow as large as possible for a single bot-herder. Instead, financial botnets are often sold as kits that allow large numbers of attackers to license the code and set about building their own botnets and targets. Even with their smaller size, the impact of these botnets can be enormous. Financial botnets such as ZeuS and SpyEye are responsible for the direct theft of funds from all types of enterprises. ZeuS botnets have stolen millions of dollars from numerous enterprises in very short periods of time. Other financial botnets focus on the theft of credit card information or faking ACH bank transfers. The impact of a financial breach can be enormous for an enterprise. The breach of customer credit card information can lead to serious financial, legal, and brand damage, and the enterprise could lose money that potentially may never be recovered.
Targeted intrusions
Botnets are also a key component of targeted, sophisticated, and ongoing attacks. These types of botnets are very different than their larger brothers. Instead of attempting to infect large numbers of machines to launch malicious large-scale attacks, these smaller botnets aim to compromise specific high-value systems that can be used to further penetrate and intrude into the target network. In these cases, an infected machine can be used to gain access to protected systems and to establish a backdoor into the network in case any part of the intrusion is discovered. These types of threats are almost always undetectable by antivirus software. They represent one of the most dangerous threats to the enterprise because they specifically target the organizations most valuable information, such as research and development, intellectual property, strategic planning, financial data, and customer information.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
21
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
22
Infected Users
Finally, successfully decapitating or taking down a botnet can take several years. Enterprise security needs are far more immediate ensuring that an intrusion or exploit does not succeed in the first place (see Figure 2-4). In a very real sense, relying on the security industry to disable a botnet is like waiting for the government to enact a law against an act that someone is committing against you right now.
How the Industry Targets Botnets Focus on the largest botnets Focus on spammers Years required for remediation How Botnets Target the Enterprise Small, targeted, customized Data theft and espionage Requires immediate remediation
Figure 2-4: Why the top-down model doesnt protect the enterprise.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
23
So while progress has been made attacking botnets at a global level, the simple truth is that the wins provide little solace to an enterprise that is under attack today. This puts the responsibility for protecting the enterprise from botnets squarely on the shoulders of the enterprise itself. In Chapter 3 we discuss what doesnt work, then in Chapter 4 you find out what does work in the fight against modern malware! Enterprise security teams rarely need to take down an entire botnet at the source. Instead, your security team needs to be more narrowly focused on such things as preventing infections, finding machines that are infected, and limiting the scope of any damage. In short, your goal is not to be Eliot Ness aiming to take down Al Capone, but to be the local beat cop keeping your community safe from Al Capones criminal activities.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
24
Persistence
Infects MBR 32/64 bit rootkits
Communication
Proprietary encryption Tunneled within SSL Sells proxy as a service
Persistence is achieved through installation of a bootkit that infects the Master Boot Record (MBR) of the victim machine, and more than 20 additional malware programs, including fake antivirus programs, adware, and a spamming bot. Very cleverly, TDL-4 actually removes approximately 20 common malware programs such as Gbot and ZeuS to avoid drawing unwanted attention to a victim computer when legitimately installed antivirus software detects these common malware programs on the computer! Communications are concealed using proprietary encryption that is tunneled within SSL. TDL-4 can also install a proxy server on an infected machine, which can then be rented out as an anonymous browsing service that proxies traffic through numerous infected machines. Thats right! Youre familiar with Software as a Service (SaaS), Infrastructure as a Service (IaaS), and Platform as a Service (PaaS) get ready for Malware as a Service (MaaS)! For command and control, TDL-4 uses the Kad P2P network, a publicly accessible P2P file exchange network. TDL-4 updates and distributes information about infected machines over the Kad network, so that even if a command-and-control server is taken down, other infected bots can be found to maintain the botnet without command-and-control servers.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
25
While all that certainly sounds ominous, there is an important distinction between the way that the security industry goes about completely dismantling a botnet and the steps that an enterprise should undertake to protect itself from that same botnet. A whole host of challenges make botnet takedowns very challenging, not the least of which is the need to take down the entire command-and-control infrastructure in a relatively short window of time. We cover this and other botnet security challenges in the next section. Modern malware depends on the enterprise network in order to survive. In the truest sense, modern malware consists of networked applications that are uniquely designed to evade traditional security solutions. To detect and stop these threats, security teams need to regain full visibility into network traffic, reduce the exposure of the network and user, and establish new techniques to detect and prevent modern malware. These techniques exist today and are discussed in Chapter 4.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
26
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 3
odays application and threat landscape renders traditional port-based firewalls and other security solutions largely ineffective at protecting corporate networks. In this chapter, you learn how modern malware has challenged these legacy security devices, particularly firewalls, beyond their capability to effectively protect todays networks.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
28
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
29
The explosive growth of social media in the corporate network is accompanied by explosive growth in the business and security risks associated with these applications. The business risks include what employees can and should post or say about themselves, the projects they work on, and the company. The security risks in social media applications include social engineering and malware delivery.
A Lack of Visibility
In order to maximize their accessibility and use, many applications are designed from the outset to circumvent traditional port-based firewalls by dynamically adjusting how they communicate and malware threats are coming along for the ride. Simply stated, you cant control threats that you cant see. Modern malware uses various techniques to hide its true nature or existence on the network, including Nonstandard ports and port hopping. Evasive applications are one of the key factors leading to the demise of traditional port-based firewalls. These applications merely bypass the simplistic controls defined by ports: If a default port is blocked, they find another port that is open. Most applications do this simply for convenience and ease of use. However, this same tactic is ideal for an attacker wanting to sneak malware or command and control traffic across the network perimeter in this case, for expressly criminal purposes. SSL encryption. Malware creators rely heavily on various forms of encryption to hide infecting traffic, as well as the ongoing command-and-control traffic associated with botnets. SSL is a favorite, simply because it has become a default protocol for so many social media sites, such as Gmail and Facebook. These sites are coincidentally very fertile ground for social engineering and malware delivery. As a result of SSL encryption, many IT security teams lack the ability to see malware traffic on their network. Other types of encryption have also become popular for hiding malware traffic. Peer-to-peer applications provide both infection and command-and-control capabilities, and often use proprietary encryption, again allowing malicious content to pass through the traditional network perimeter undetected.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
30
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
31
Fighting blind: The convergence of social media, SSL, and advanced threats
Social media is a well-established hub for social engineering, malware infection, and command and control. This broad category of applications includes social networking, webbased e-mail, instant messaging, web-based file transfer, and a variety of blogs, message boards, and microblogging platforms such as Twitter. As a group, these applications have become favorite targets for hackers because they provide easy, largely uncontrolled access to the weakest link in enterprise security the end user. In particular, these applications provide many opportunities to gain the trust of a target user and offer a wealth of links, scripts, ads, and images, all of which can be used to exploit an unsuspecting user. Additionally, the very popularity of these applications makes it easy for an attackers traffic to blend in with normal user traffic and traverse the network without suspicion. This characteristic is true for outbound as well as inbound traffic, with a variety of bots and malware being known to use social networking, microblogging, and message boards as command-and-control channels for the management of a botnet or an ongoing intrusion. In an effort to improve privacy for their users, many of these applications have begun to use SSL as a default protection for all traffic. This move to SSL has ironically taken a bad security situation and made it worse by encrypting the very channels that hackers are using to attack the network. Now, instead of trying to hide in plain sight or being forced to use a circumventor application that may draw unwanted attention, the attackers can simply ride within the SSL connection between the application and the target user. This provides a near-perfect platform for an attacker with a wealth of targets, a full complement of attack vectors, and built-in cloaking from security solutions.
Signature Avoidance
The traditional approach to detecting and blocking malware is based on the simple notion of collecting samples of malware and then writing a signature for that sample. Even at its best, this approach has several drawbacks simply due to the reactive nature of the strategy.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
32
Targeted Malware
Before malware became a networked threat, the main goal was often to replicate and spread the malware as widely as possible. In fact, this is how the security industry ranked malware for many years how many machines could the malware infect in a certain period of time. This widespread replication made new malware samples readily available and relatively easy to collect. Modern malware has changed that model, however. Modern malware is more intelligent and highly networked, which enables an attacker to remotely control the target user or users. For savvy attackers, this means that they no longer need millions of infected users. Depending on the goal of the attack, even a single infected host may be enough for a skilled attacker to perform a very sophisticated attack. In such cases, attackers have increasingly turned to highly targeted malware. These types of malware are often specifically designed for a particular user or network. Stuxnet is an example of targeted malware. It is designed to run only in a specific network with specific assets on the network. This approach accomplishes two very important things. First, it makes it
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
33
extremely unlikely that a sample of the malware will be captured in the wild, since there are only a few samples instead of millions to be caught. Second, it is designed to avoid infecting networks that are not the intended target, and thereby avoids drawing unwanted attention to itself. This targeted approach is rapidly becoming a hallmark of some of the worlds most sophisticated network attacks targeting intellectual property.
Polymorphism
Polymorphism has been used by malware for some time, but continues to be popular today. This approach aims to avoid signatures by regularly mutating to avoid simple signature matches. Some malware applications have entire sections of code that serve no purpose other than to change the signature of the malware.
Firewalls
Port-based firewalls are often used as a first line of defense, providing coarse filtering of traffic and segmenting the network into different password-protected zones. One drawback to port-based firewalls is that they use protocol and port to identify and control what gets in and out of the network. This port-centric design is ineffective when faced with malware and evasive applications that hop from port to port until they find an open connection to the network. Additionally, firewalls themselves have little ability to identify and control malware.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
34
Intrusion prevention
Intrusion prevention systems (IPS) provide a step in the right direction, in that they look much deeper into the traffic than a firewall does. However, IPS solutions typically dont run a complete set of IPS signatures against all traffic. Rather, the IPS attempts to apply the appropriate signatures to specific types of traffic, based on port. This limitation means that malware or exploits on unexpected or nonstandard ports are likely to be missed. Additionally, IPS solutions lack the depth of malware detection needed to protect networks most IPS solutions only look for a few hundred types of common malware well short of the tens of thousands that exist.
Proxies
Proxy solutions are another means of network traffic control, but here too they look at a limited set of applications or protocols and, as such, only see a partial set of the network traffic that needs to be monitored. By design, proxies need to mimic the applications they are trying to control, so they struggle with updates to existing applications and new applications. As a result, although proxies understand a few protocols in depth, they typically lack the breadth of protocol support needed to control the tunnels and protocols within protocols that hackers use to hide their true traffic. A final issue that plagues proxy solutions is throughput performance caused by the manner in which a proxy terminates an application on the proxy then forwards it on to its destination. The challenge with any of these network controls is that they do not have the ability to accurately identify applications and malware; they look at only a portion of the traffic and suffer from performance issues. Security policies must be based on the identity of users and the applications in use not just on IP addresses, ports, and protocols. Without knowing and controlling exactly who (users) and what (applications and content) have access to
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
35
36
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4
he next-generation firewall provides arguably the most important weapon in the fight against modern malware the reliable visibility and control of all traffic on the network, irrespective of port or evasive tactics that may be employed. In this chapter, we propose a methodology to limit exposure to malware as well as to detect and remediate network devices that may already be infected using the visibility and control capabilities of the next-generation firewall.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
38
Additionally, the next-generation firewall provides a fully integrated approach to threat prevention in a unified context: true coordination of multiple security disciplines (for example, application identity, malware detection, intrusion prevention, URL filtering, file type controls, and content inspection), as opposed to simply co-locating them on the same box. This integration provides a far more intelligent and definitive understanding of malware than any individual technology can provide by itself and is needed in order to see and understand the telltale signs of unknown threats.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
39
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
40
What applications and protocols are in use on the network? What applications are required for the business and who needs to use them? What dual-use or personal applications does the enterprise want to allow?
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
41
the presence of a botnet. Social networking and personal use applications meet both of these criteria, and are among the most common sources for malware infection and subsequent command and control of botnets (see Figure 4-2). These applications include social networking, web-based e-mail, instant message (IM), peer-to-peer (P2), and file transfer.
SSL
Encrypted P2P
Tunneling Apps
Figure 4-2: Preferred social networking/personal use applications and techniques for modern malware.
These applications are designed to easily share information in a variety of ways, and people often use them with an implied trust and a more cavalier attitude because they may be accustomed to using them outside of the office. This provides an attacker with a multitude of infection opportunities. Social applications also present an ideal environment for social engineering, enabling an attacker to impersonate a friend or colleague, for example, to lure an unsuspecting victim into clicking a dangerous web link. For all their sophistication, malware infections continue to rely on enticing an unsuspecting user into performing an ill-advised action, such as clicking a malicious link. Instead of opening an e-mail attachment, the click may be a link in a tweet or on a Facebook page that appears to be from a friend. Cross-site scripting can populate dangerous links among friends, and packet sniffing technologies such as FireSheep allow attackers to take over social networking accounts.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
42
In their 2010 joint report, Shadows in the Cloud, the Information Warfare Monitor (www.infowar-monitor.net) and the Shadowserver Foundation (www.shadowserver.org) provide compelling evidence of the role of social networking applications in the botnet lifecycle. They found that botinfected machines rarely, if ever, communicate directly with the command-and-control servers. Instead, the initial malware traffic from the infected host would go to popular blogs, Google Groups, Twitter accounts, and Yahoo! Mail accounts, which allowed the malware communications to blend in with normal traffic. This illustrates the key lesson that botnets often attempt to blend in with what is considered normal but low-value traffic in the network. How often would you investigate what appears to be an innocuous blog posting? Control enabling applications by:
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
43
Limiting application usage to users and groups that have a legitimate and approved business need Disabling specific features in risky applications, such as file transfers, desktop sharing, and tunneling Preventing drive-by-downloads from compromised web pages that automatically download malicious files without the users knowledge Decrypting SSL traffic selectively, based on application and URL categories (for example, decrypt social networking and webmail, but not financial traffic) Inspecting and enforcing any risky application traffic that is permitted using a next-generation firewall that provides truly integrated intrusion and threat prevention, malware protection, and URL filtering
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
44
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
45
Limiting remote desktop use, for example, to IT support personnel only Securely enabling SSH but preventing SSH tunneling Blocking unapproved proxies and encrypted tunnels, such as UltraSurf and Hamachi
Investigate unknowns
Once an enterprise has regained positive control and has the ability to inspect and accurately classify approved traffic on its network, it can examine any remaining unknown traffic on
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
46
47
Investigate unknown traffic for potential unauthorized user behavior or botnet activity: Track source, destination, and volumes of unknown traffic Correlate against URL, IPS, malware, and file-transfer records Define custom application IDs for any internal or custom applications, as needed Deliver packet captures (PCAPs) to your security vendor for further analysis and identification
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
48
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 5
ar too often, technical solutions are implemented without considering the implications for an organizations overall security strategy. To avoid this mistake, it is important to ensure that your policies are up to date and the technology solutions you are considering support a comprehensive security strategy. This chapter describes the different types of controls that must be considered in an organizations security policies.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
50
Application controls
Enablement is about knowing and understanding users and their behaviors, and applications and their associated risks. In the case of popular applications (such as social media), the users have long since decided on the benefits and are, far too often, oblivious to the threats and risks. As a result, its vital to match users needs with the most appropriate applications and features, while also educating users about the implicit risks of those applications and features.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
51
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
52
users tend to place too much trust in their network of friends, potentially introducing malware while placing personal and corporate data at risk. 3. Use technology to monitor and enforce policy. The outcome of each of these policy discussions should be documented with an explanation of how IT will apply security policies to safely and securely enable use of Facebook within enterprise environments.
As Facebook moves to SSL encryption, enterprises should strongly consider decrypting traffic to and from Facebook. Documenting and enforcing a social networking usage policy can help organizations improve their bottom line while boosting employee morale. An added benefit is that it can help bridge the chasm that commonly exists between the IT department and business groups.
Application enablement typically includes restricting the use of unneeded high-risk applications while managing allowed applications to reduce the inherent risks they may bring with them. Establishing effective policies requires open dialogue among users, IT, and management to truly understand which applications have legitimate business uses and value. Certain applications are known to be conduits for malware, both in terms of infection and ongoing command and control. Peer-topeer applications, such as BitTorrent, are iconic examples. On the other hand, many applications are not definitively good or bad (black or white), and will instead land in a gray area of enterprise security policy. These applications may have business value but can also carry considerable risk. Safe enablement should be the goal for these applications. In this case, applications can be allowed but constrained to only allow needed features while blocking higher risk features. For example, an enterprise may enable a web meeting application, but not allow the remote desktop capability that could allow a remote attacker to take control of a machine. Enabling policies could also limit certain applications or features to specific approved users, or could scan the application to ensure that no unapproved files or content is being transferred. The ultimate goal is to attack the risk in the application, not the application itself.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
53
Application controls should be part of the overarching corporate security policy. As part of the process of implementing an application control policy, IT should make a concerted effort to learn about new and evolving Web 2.0 applications. This includes embracing them for all their intended purposes and, if needed, proactively installing them or enabling them in a lab environment to see how they act. Peer discussions, message boards, blogs, and developer communities are also valuable sources of information.
User controls
Most companies have some type of application usage policy, outlining which applications are allowed and which are prohibited. Every employee is expected to understand the contents of this application usage policy and the ramifications of not complying with it, but there are a number of unanswered questions, including Given the ever-growing numbers and types of applications, how will an employee know which applications are allowed and which are prohibited? How is the list of unapproved applications updated, and who ensures employees know the list has changed? What constitutes a policy violation? What are the ramifications of policy violations a reprimand or termination of employment? The development of policy guidelines is often a challenging and polarizing process. Determining what should be allowed and what should be prohibited while balancing risk and reward elicits strong opinions from all the major stakeholders. Further complicating the process is the fact that new applications and technologies are often adopted within an organization long before appropriate policies governing their safe and appropriate use are ever considered or developed. Documented employee policies need to be a key piece of the application control puzzle, but employee controls as a stand-alone mechanism will remain largely ineffective for safe enablement of new and evolving applications.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
54
Network controls
Given that modern malware most often uses the network for infection and ongoing command and control, the network is an obvious and critical policy-enforcement point. With application-enablement policies in place, IT can shift its attention to inspecting the content of allowed traffic. This inspection often includes looking at traffic for known malware, command-and-control patterns, exploits, dangerous URLs, and dangerous or risky file types. When possible, policies that focus on the content of traffic should be coordinated as part of a single unified policy, where the rules (and the results of those rules) can all be seen in context. If content policies are spread across multiple solutions, modules, or monitors, piecing together a coordinated logical enforcement policy becomes increasingly difficult for IT security staff. Understanding whether these policies are working once they are implemented will likewise be difficult. The goal should be to create written policies that reflect the policies intentions just like someone might describe them orally. For example, only allow designated employees to use SharePoint, inspect all SharePoint traffic for exploits and malware, disallow the transfer of files types X, Y, and Z, and look for the word confidential in traffic going to untrusted zones. Another key component of network policies is the absolute need to retain visibility into the traffic content. SSL is increasingly used to secure traffic destined for the Internet. Although this may provide privacy for that particular session, if IT lacks the ability to look inside the SSL tunnel, SSL can also provide an opaque tunnel within which malware can be introduced into the network environment. IT must balance the need to look within SSL against both privacy requirements for end-users and the overall performance requirements of the network. For this reason, it is important to establish SSL decryption policies that can be enforced selectively by application and URL category. For example, social media traffic could be decrypted and inspected for malware, while traffic to financial or healthcare sites is left encrypted.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
55
Endpoint controls
The end-users machine is the most common target for modern malware and is a critical point for policy enforcement. Endpoint policies must incorporate ways of ensuring that antivirus and various host-based security solutions are properly installed and up to date. Although targeted attacks are becoming more common, the majority of threats today continue to be known threats with known signatures. Gartner, Inc. predicts that known threats will comprise 95 percent of all threats through 2015. As such, these endpoint solutions must be kept up to date and must be audited regularly. Similarly, you need to have a method for validating that host operating systems are patched and up to date. Many malware infections begin with a remote exploit that targets a known vulnerability in the operating system or application. Thus, keeping these components up to date is a critical aspect of reducing the attack surface of the enterprise. As with employee policies, desktop controls are a key piece to the safe enablement of applications in the enterprise. Desktop controls present IT departments with significant challenges. Careful consideration should be applied to the granularity of the desktop controls and the impact on employee productivity. The drastic step of desktop lockdown to keep users from installing their own applications is a task that is easier said than done and, if used alone, will be ineffective. Heres why: Remotely connected laptops, Internet downloads, USB drives, and e-mail are all means of installing applications that may or may not be allowed on the network. Completely removing administrative rights is difficult to implement and, in some cases, severely limits end-user capabilities to an unacceptable level. USB drives are now capable of running applications, so a Web 2.0 application, for example, can be accessed after network admission is granted. Desktop controls can complement documented employee policies as a means to safely enable Web 2.0 applications.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
56
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 6
n this chapter, we recommend ten best practices to control modern malware and botnets. These recommendations are not intended to replace, but rather to supplement, the existing security strategies of your organization, as part of a modern coordinated approach to defense in depth.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
58
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
59
Limit use of remote desktop protocols and applications to authorized users with a legitimate business need (such as IT support personnel)
SSL: 443 Only, 14% All Other Applications, 77% SSL: 443 or other port, 8% SSL: Any Port but 443, 1%
Source: Palo Alto Networks, Application Usage and Risk Report, May 2011
While SSL certainly provides security for the individual session, it can also create a problem for enterprise security by obscuring the traffic from network security solutions such as intrusion prevention systems (IPS), anti-malware, and data loss prevention (DLP) solutions. To make matters worse, the very sites and applications that are adopting SSL are the same ones that hackers favor for launching and maintaining their ongoing attacks.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
60
Social networking Web-based e-mail Instant messaging Message boards Microblogging Gaming sites Do-not-decrypt policies that protect the confidentiality and integrity of the following SSL traffic:
Health care applications, information, and sites Financial applications, data, and sites Secure channels
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
61
virtual environment to observe how it would behave in a vulnerable environment. This approach can expose some of the tell-tale signs of malware such as altering operating system files, making changes to registry settings, or injecting themselves into other running processes and provides IT security teams with a method for definitively identifying malware even when it is not recognized by signature-based antimalware solutions. IT security teams should have the ability to create signatures on demand when new malware is identified, and distribute these custom signatures to all of the organizations network gateways in order to protect against new malware threats. Its not enough to simply put a sandbox into your lab. You must build in the ability to quickly and centrally determine whether a given file has already been analyzed, and then quickly deliver protections to all ingress/egress points when a malicious file is detected.
62
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
63
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
64
Known malware Known exploits Phone-home detection Download history URL categories
Investigate Unknowns
A true next-generation firewall accurately classifies all known traffic and allows you to create customized classifications for any remaining unknowns, such as internal or customdeveloped applications. Unknown traffic should be tracked and investigated to find potential malware or other unidentified threats on the enterprise network. In addition to unknown traffic, you should investigate Unknown or unclassified URLs. Unknown or recently registered URLs are significant because malware and bot-herders regularly rotate between URLs that are used for command and control to impede discovery and takedown efforts. Unknown traffic going to unknown URL categories should be treated as highly suspicious. Unknown encryption. Customized encryption is often used by malware to hide their communications. Use the capabilities of a true next-generation firewall to inspect encrypted traffic and to ensure that all traffic on the network has a known, legitimate purpose.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
Glossary
adware: Pop-up advertising programs that are commonly installed with freeware or shareware. APT: Advanced Persistent Threat. An Internet-borne attack usually perpetrated by a group of individuals with significant resources, such as organized crime or a rogue nation-state. backdoor: Malware that enables an attacker to bypass normal authentication to gain access to a compromised system. BitTorrent: A P2P file-sharing communications protocol that distributes large amounts of data widely without the original distributor incurring the costs of hardware, hosting, and bandwidth resources. bootkit: A kernel-mode variant of a rootkit, commonly used to attack computers that are protected by full-disk encryption. bot: A target machine that is infected by malware and is part of a botnet (also known as a zombie). bot-herder: The owner or individual that controls a botnet. botnet: A broad network of bots working together. DDNS: Dynamic DNS is a technique used to update domain name system (DNS) records for networked devices in real time. DDoS: Distributed denial-of-service is a large-scale attack that typically uses bots in a botnet to crash a targeted network or server. drive-by-download: Software, often malware, downloaded onto a computer from the Internet without the users knowledge or permission. IPsec: An open-standard protocol used for secure VPN communications over public IP-based networks.
These materials are the copyright of John Wiley & Sons, Inc. and any dissemination, distribution, or unauthorized use is strictly prohibited.
66