Blog Feed Post

YARA: Incident Response Host Prioritization

Your Intrusion Detection System (IDS) fires off an alert implying that your Domain Controller may have been compromised by malware XYZ and your network logs show connections with fifteen other hosts on your network. Where do you turn for help? How do you prioritize which boxes to analyze? Fortunately, there’s an awesome tool available that will be there to have your back and help you sort things out.

Why YARA is the bizness

YARA is a tool used by malware researchers to quickly identify key textual and binary patterns of interest. This tool is useful for aiding in the decision about which potentially compromised hosts should be investigated first, and thus can help prioritization, discovery, and ultimately quicker remediation.

During the initial part of the Incident Response (IR), all hosts flagged by the IDS are usually quarantined and have their memory dumped. This occurs to preserve the forensic information of what was stored in memory.

As the IR team continues their investigation, from current or previous attacks, they will discover IOCs (indicators of compromise). YARA rules can be written from IOCs to scan memory dumps and can be run against all suspected hosts to see if they contain artifacts present in memory to imply compromise.

It’s important to note that a host could still be compromised even if YARA does not find a match. The specific rule may not contain a pattern that can be matched by what was running in memory during the memory dump.

Let’s look at an example

In this compromise scenario, we’re going to use an old favorite and pretend that the IDS alerted to a Poison Ivy (PIVY) Remote Administration Trojan (RAT) activity on the network. As this RAT has been heavily researched by malware researchers in the past, we have access to a variety of IOC’s we can use to write our YARA rules with.

In this example, for our first YARA rule we are going to create it using the most well known PIVY mutex as our IOC. Shown below:


To start the YARA rule, we begin by setting the rule name:

        description = "Possibly PIVY Infection"
        intel = "http://myintel.com"

This is now where we can define our pattern. In this instance it’s just a string, but YARA provides us with the capability to use regular expressions to match complex patterns.

        $m1 = ")!VoqA.I4"

Lastly, we define what strings need to match for the rule to find. YARA has a very extensive capability list in this department, which enables the rule creator to have the rule only fire, for example, when all or three out of a group of seven strings match. In our case, we only have one string for this basic rule so far, so we will go with that.

        all of them

Now, we combine them together in a text file that we will call “pivy.yar”:

rule poison_ivy : pivy
        description = "Possibly PIVY Infection"
        intel = "http://myintel.com"

        $mutex1 = ")!VoqA.I4"

        all of them

With our “pivy.yar” rule created, we can now run this against our memory dump.

yara -gms pivy.yar pivy_infected_host_mem.dump

If the mutex is detected, this command should output something similar to the following:

poison_ivy [pivy] [description="Possibly PIVY Infection",intel="http://myintel.com"] memdump.img
0x80f23fb:$m1: )!VoqA.I4
0x90336f3:$m1: )!VoqA.I4
0xa5273fb:$m1: )!VoqA.I4
0x1118a6f3:$m1: )!VoqA.I4
0x138f76f3:$m1: )!VoqA.I4
0x1738d3fb:$m1: )!VoqA.I4

Congrats, we now have a working YARA rule.

Now, using this rule we can scan all the boxes using it to see which ones we know to contain this suspect PIVY mutex string (assuming hostname_mem.dump.str):

$yara -gms pivy.yar suspect_hosts/

This information can help you prioritize your investigation around the hosts you know to contain strings associated with suspect or malicious activity.

If you’re interested in learning more about the capabilities of YARA, you can head over to their documentation site. If you would like to acquire additional rules or contribute your own work to the YARA community YARA rules github is a good place to do that. The primary download link for YARA can be found here.

Happy Hunting!

Read the original blog entry...

More Stories By Hurricane Labs

Christina O’Neill has been working in the information security field for 3 years. She is a board member for the Northern Ohio InfraGard Members Alliance and a committee member for the Information Security Summit, a conference held once a year for information security and physical security professionals.

Latest Stories
ChatOps is an emerging topic that has led to the wide availability of integrations between group chat and various other tools/platforms. Currently, HipChat is an extremely powerful collaboration platform due to the various ChatOps integrations that are available. However, DevOps automation can involve orchestration and complex workflows. In his session at @DevOpsSummit at 20th Cloud Expo, Himanshu Chhetri, CTO at Addteq, will cover practical examples and use cases such as self-provisioning infra...
As DevOps methodologies expand their reach across the enterprise, organizations face the daunting challenge of adapting related cloud strategies to ensure optimal alignment, from managing complexity to ensuring proper governance. How can culture, automation, legacy apps and even budget be reexamined to enable this ongoing shift within the modern software factory? In her Day 2 Keynote at @DevOpsSummit at 21st Cloud Expo, Aruna Ravichandran, VP, DevOps Solutions Marketing, CA Technologies, was jo...
"Storpool does only block-level storage so we do one thing extremely well. The growth in data is what drives the move to software-defined technologies in general and software-defined storage," explained Boyan Ivanov, CEO and co-founder at StorPool, in this SYS-CON.tv interview at 16th Cloud Expo, held June 9-11, 2015, at the Javits Center in New York City.
As Marc Andreessen says software is eating the world. Everything is rapidly moving toward being software-defined – from our phones and cars through our washing machines to the datacenter. However, there are larger challenges when implementing software defined on a larger scale - when building software defined infrastructure. In his session at 16th Cloud Expo, Boyan Ivanov, CEO of StorPool, provided some practical insights on what, how and why when implementing "software-defined" in the datacent...
Blockchain. A day doesn’t seem to go by without seeing articles and discussions about the technology. According to PwC executive Seamus Cushley, approximately $1.4B has been invested in blockchain just last year. In Gartner’s recent hype cycle for emerging technologies, blockchain is approaching the peak. It is considered by Gartner as one of the ‘Key platform-enabling technologies to track.’ While there is a lot of ‘hype vs reality’ discussions going on, there is no arguing that blockchain is b...
Blockchain is a shared, secure record of exchange that establishes trust, accountability and transparency across business networks. Supported by the Linux Foundation's open source, open-standards based Hyperledger Project, Blockchain has the potential to improve regulatory compliance, reduce cost as well as advance trade. Are you curious about how Blockchain is built for business? In her session at 21st Cloud Expo, René Bostic, Technical VP of the IBM Cloud Unit in North America, discussed the b...
You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
Is advanced scheduling in Kubernetes achievable?Yes, however, how do you properly accommodate every real-life scenario that a Kubernetes user might encounter? How do you leverage advanced scheduling techniques to shape and describe each scenario in easy-to-use rules and configurations? In his session at @DevOpsSummit at 21st Cloud Expo, Oleg Chunikhin, CTO at Kublr, answered these questions and demonstrated techniques for implementing advanced scheduling. For example, using spot instances and co...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
The cloud era has reached the stage where it is no longer a question of whether a company should migrate, but when. Enterprises have embraced the outsourcing of where their various applications are stored and who manages them, saving significant investment along the way. Plus, the cloud has become a defining competitive edge. Companies that fail to successfully adapt risk failure. The media, of course, continues to extol the virtues of the cloud, including how easy it is to get there. Migrating...
The use of containers by developers -- and now increasingly IT operators -- has grown from infatuation to deep and abiding love. But as with any long-term affair, the honeymoon soon leads to needing to live well together ... and maybe even getting some relationship help along the way. And so it goes with container orchestration and automation solutions, which are rapidly emerging as the means to maintain the bliss between rapid container adoption and broad container use among multiple cloud host...
Imagine if you will, a retail floor so densely packed with sensors that they can pick up the movements of insects scurrying across a store aisle. Or a component of a piece of factory equipment so well-instrumented that its digital twin provides resolution down to the micrometer.
The need for greater agility and scalability necessitated the digital transformation in the form of following equation: monolithic to microservices to serverless architecture (FaaS). To keep up with the cut-throat competition, the organisations need to update their technology stack to make software development their differentiating factor. Thus microservices architecture emerged as a potential method to provide development teams with greater flexibility and other advantages, such as the abili...
In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, provided an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settle...
Product connectivity goes hand and hand these days with increased use of personal data. New IoT devices are becoming more personalized than ever before. In his session at 22nd Cloud Expo | DXWorld Expo, Nicolas Fierro, CEO of MIMIR Blockchain Solutions, will discuss how in order to protect your data and privacy, IoT applications need to embrace Blockchain technology for a new level of product security never before seen - or needed.