Welcome!

Related Topics: Cloud Security

Cloud Security: Blog Post

Malware Analysis - A Cost Effective and Quick "How To"

Full time malware analysis is expensive, this method provides a fast and simplified approach that produces results.

Malware analysis can be a time consuming process, especially when dealing with a sample from skilled attackers with time and money on their side . There is no doubt that fully reversing malware and finding out how it works is the most effective way to learn how to defend against it, but most businesses don't have the time or the professional resources to do it.

There are ways in which you, a Computer Network Defender, can glean enough information from malware to be used in IDS and AV signature creation, DNS poisoning and blocking as well as sharing with the CND community. This can be accomplished in a cost effective manner (maybe even free) and in an efficient manner that can rival very long code based analysis.  There are even cases where in depth knowledge of how to fully reverse the sample is not needed.

It should be noted that this is a low tech, high level mechanism for capturing indicators from malware. It should not be considered a substitute for fully analyzing malicious software, as sophisticated samples can defeat a lab environment similar to this quite easily. I will not be covering anything related to debugging the malware, that is outside of the intention of this "How-to".

Requirements
Before we start, you will need to procure a few bits and pieces:

  • Host machine with enough storage and memory to run at least 2 virtual machines concurrently, 4GB of ram and at least 30GB would be the minimum requirement.
  • A virtualization platform, there are several on the market, some of them are free to use, VirtualBox and Xen to name a couple. I will be using VMWare Fusion for this demonstration.
  • A copy of "REMNUX", a reverse-engineering malware linux distribution available at http://zeltser.com/remnux/.
  • A licensed copy of MS Windows (this will be your victim host). I will be using WindowsXP for this demonstration.
  • Free and open source tools for analysis of the Windows host (Putty, RegShot, Sysinternals, etc etc)

Setting Up the Victim Host Machine
Something to consider when setting up your victim host machine is system and software patches. Depending on what you are testing on your victim host, it may only affect a certain version of Windows, or possibly only to a certain patch level. Something I like to do is to "snapshot" my "victim" host machines through various patch stages, that way if I need to roll back, it's as easy as choosing a snapshot and "rolling back". This also applies to the types of software you install on your victim, snapshot your host with different versions of java, flash and adobe reader to be able to quickly select a vulnerable configuration. Consider outfitting your malware analysis lab setup with hosts that mimic your native operating environment. If you only utilize Windows 7 and do not allow Firefox on your network, then set up your victim machines to match that configuration.

A screenshot of the VMWare Fusion "Snapshot" process

Once you have finished patching your host, downloading and installing various types of software to aid in allowing successful exploitation you are going to setup a new network adapter, and set it for "host-only". This will keep your host from accidentally reaching the Internet once infected. It will also allow you to send the traffic to another machine to analyze what your victim is trying to do once successful exploitation has taken place.

  • Set the IP on your victim host to a non-routable address, for instance 10.1.1.10.
  • Set your router or gateway to be 10.1.1.1, this will the IP address of your REMNUX virtual machine.

Setting Up the REMNUX Host Machine
One of the main purposes for the REMNUX virtual machine in this demonstration is simply to act as a catch-all for network traffic originating from your now exploited victim host. REMNUX has many uses and capabilities both for the beginner and advanced malware reverse engineer, but we want fast indicators from our malware sample so that we can start defending against it immediately.

The REMNUX virtual machine is ready to go once imported into your virtualization platform with minimal modifications.  We are simply going to add a network adapter in "host-only" mode and set the IP address to a non-routable IP. REMNUX will act as the internet "gateway" and DNS server for our victim machine. This will allow us to see all network requests and DNS requests that come from our infected victim host.

A screenshot of the "REMNUX" desktop
A screenshot of the "REMNUX" network interfaces config, modify to suite your needs.

Infecting the Host
Now that you have the infrastructure in place, test your connectivity between the victim virtual machine and the gateway virtual machine. Have Wireshark running on the gateway box to verify successful connectivity. Attempt to SSH from your victim host to the gateway using putty. You can use "pscp.exe" within the Putty suite to move the original malware, and any malicious files the malware creates or drops onto your victim. Once you have moved the file over to your REMNUX host, you can take the MD5 of the original malware, before it is run. This will help in creating virus signatures and give you the required information for sharing within the CND community.

The victim host pre-infection with Process Explorer running.

Utilizing "Regshot", take a snapshot of the "C:" drive pre infection, that way you will have something to compare after your host is infected. Regshot will record the current windows registry, all windows directories and files before infection, allow you to record again after infection, and then compare the changes made to the host.

The victim host running Regshot and Process Explorer

You can now move your malware sample to the victim host. Ensure that you are running the necessary services and tools on your REMNUX host to capture the traffic. If you are not looking to interact with the malware, Wireshark can provide a wealth of data with not much in-depth knowledge. If you are looking to interact however, please consult the REMNUX readme for more information on "honeyd", "farpd" and "fakedns".

I also recommend running some kind of process explorer on the victim host to monitor what the malware does, any new processes it may spawn or kill. Sysinternals suite has several great tools, Process Explorer and Process Monitor are my two favorites.

Capturing the Indicators
Once executed on your victim host, you can record the information being fed to ProcMon, allowing you to watch what the malware does. You may see new applications start, processes get killed and new processes start. These are all indicators of the malware, and essential data to capture.

The victim host has a new process running attached to an executable with PID 2168

Watch your REMNUX host, check to see if any callouts are being made by the malware and see if it attempts to resolve DNS addresses. Often times once the DNS has successfully resolved, you will witness the malware attempt to connect to the Command & Control domain over an HTTP/HTTPS port.

A screenshot of Wireshark capturing the first DNS resolution attempt by the malware.
A screenshot of Wireshark capturing the second DNS resolution attempt by the malware.

A Note on DNS Resolution with Malware
The malware may attempt to resolve a known good website, this can be for internet connectivity checking as well as an attempt to fool someone monitoring it. If the malware is unable to resolve lets say “google.com” it may simply die on the victim host, and never try to reach the real command and control domain (CnC). This is when you want to have “fakedns” running on your REMNUX host, it will resolve any domain asked, this will then give the malware the positive connectivity test it is looking for, at which point may try to resolve the actual CnC domain.

Once you are satisfied with the length of time you have let the malware run, 10 minutes or less usually suffices, you can take the second “Regshot’ of the system. This will capture any changes made to the system by the malware. Once it has completed the second pass, compare the two and analyze the output. “Regshot” will reveal any new files created, deleted or modified. It will show you if any new registry keys were added or changed and any services that were created. It is an essential tool in the analysis toolbox.

A screenshot of the "Regshot" compare results.

As you can see with the "dir /ah" command, the files that were hidden on the victim. These files were all dropped from the malicious word document.

A screenshot showing the hidden files added to the temp directory on the victim host.

Once you have located the dropped or newly added malware on the victim host, you should move them over to your "REMNUX" host for analysis. These files are also indicators of a positive infection and should be included in your analysis of the initial malware. The MD5 hashes of these files are just as relevant for blocking and signature development as the principle delivery of these files, e.g. malicious word document, can easily change in future attempts.

Share Your Findings - One of the Most Important Pieces to Computer Network Defense
From this quick, and high level analysis of the malicious word document you were presented with several indicators that can benefit other Computer Network Defenders. One thing that I  have learned is that not everyone catches or sees something the way I may I see it.  So when I look at a piece of malware, no matter how simple I think it may be, I share it with the hopes that the indicators could assist others.

It is essential that you share as much information as you are comfortable with, as it may help to thwart future attempts against other targets. Collaboration amongst teams can help to stop these types of infections and identify current infections if they exist within your network. If possible, share any Command & Control Domains, MD5 Hashes, IP addresses, File Names and Sizes and anything else you feel is relevant to the infection.

More Stories By Cory Marchand

Cory Marchand is a trusted subject matter expert on topics of Cyber Security Threats, Network and Host based Assessment and Computer Forensics. Mr. Marchand has supported several customers over his 10+ years within the field of Computer Security including State, Federal and Military Government as well as the Private sector. Mr. Marchand holds several industry related certificates including CISSP, EnCE, GSEC, GCIA, GCIH, GREM, GSNA and CEH.

Latest Stories
Fact: storage performance problems have only gotten more complicated, as applications not only have become largely virtualized, but also have moved to cloud-based infrastructures. Storage performance in virtualized environments isn’t just about IOPS anymore. Instead, you need to guarantee performance for individual VMs, helping applications maintain performance as the number of VMs continues to go up in real time. In his session at Cloud Expo, Dhiraj Sehgal, Product and Marketing at Tintri, wil...
Ixia (Nasdaq: XXIA) has announced that NoviFlow Inc.has deployed IxNetwork® to validate the company’s designs and accelerate the delivery of its proven, reliable products. Based in Montréal, NoviFlow Inc. supports network carriers, hyperscale data center operators, and enterprises seeking greater network control and flexibility, network scalability, and the capacity to handle extremely large numbers of flows, while maintaining maximum network performance. To meet these requirements, NoviFlow in...
StarNet Communications Corp has announced the addition of three Secure Remote Desktop modules to its flagship X-Win32 PC X server. The new modules enable X-Win32 to safely tunnel the remote desktops from Linux and Unix servers to the user’s PC over encrypted SSH. Traditionally, users of PC X servers deploy the XDMCP protocol to display remote desktop environments such as the Gnome and KDE desktops on Linux servers and the CDE environment on Solaris Unix machines. XDMCP is used primarily on comp...
SYS-CON Events announced today that StarNet Communications will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. StarNet Communications’ FastX is the industry first cloud-based remote X Windows emulator. Using standard Web browsers (FireFox, Chrome, Safari, etc.) users from around the world gain highly secure access to applications and data hosted on Linux-based servers in a central data center. ...
The 19th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportuni...
SYS-CON Events announced today that eCube Systems, a leading provider of middleware modernization, integration, and management solutions, will exhibit at @DevOpsSummit at 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. eCube Systems offers a family of middleware evolution products and services that maximize return on technology investment by leveraging existing technical equity to meet evolving business needs. ...
SYS-CON Events announced today Telecom Reseller has been named “Media Sponsor” of SYS-CON's 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
For basic one-to-one voice or video calling solutions, WebRTC has proven to be a very powerful technology. Although WebRTC’s core functionality is to provide secure, real-time p2p media streaming, leveraging native platform features and server-side components brings up new communication capabilities for web and native mobile applications, allowing for advanced multi-user use cases such as video broadcasting, conferencing, and media recording.
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at Cloud Expo, Ed Featherston, a director and senior enterprise architect at Collaborative Consulting, will discuss the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
Pulzze Systems was happy to participate in such a premier event and thankful to be receiving the winning investment and global network support from G-Startup Worldwide. It is an exciting time for Pulzze to showcase the effectiveness of innovative technologies and enable them to make the world smarter and better. The reputable contest is held to identify promising startups around the globe that are assured to change the world through their innovative products and disruptive technologies. There w...
Is the ongoing quest for agility in the data center forcing you to evaluate how to be a part of infrastructure automation efforts? As organizations evolve toward bimodal IT operations, they are embracing new service delivery models and leveraging virtualization to increase infrastructure agility. Therefore, the network must evolve in parallel to become equally agile. Read this essential piece of Gartner research for recommendations on achieving greater agility.
To leverage Continuous Delivery, enterprises must consider impacts that span functional silos, as well as applications that touch older, slower moving components. Managing the many dependencies can cause slowdowns. See how to achieve continuous delivery in the enterprise.
Enterprises have forever faced challenges surrounding the sharing of their intellectual property. Emerging cloud adoption has made it more compelling for enterprises to digitize their content, making them available over a wide variety of devices across the Internet. In his session at 19th Cloud Expo, Santosh Ahuja, Director of Architecture at Impiger Technologies, will introduce various mechanisms provided by cloud service providers today to manage and share digital content in a secure manner....
Using new techniques of information modeling, indexing, and processing, new cloud-based systems can support cloud-based workloads previously not possible for high-throughput insurance, banking, and case-based applications. In his session at 18th Cloud Expo, John Newton, CTO, Founder and Chairman of Alfresco, described how to scale cloud-based content management repositories to store, manage, and retrieve billions of documents and related information with fast and linear scalability. He addres...
Aspose.Total for .NET is the most complete package of all file format APIs for .NET as offered by Aspose. It empowers developers to create, edit, render, print and convert between a wide range of popular document formats within any .NET, C#, ASP.NET and VB.NET applications. Aspose compiles all .NET APIs on a daily basis to ensure that it contains the most up to date versions of each of Aspose .NET APIs. If a new .NET API or a new version of existing APIs is released during the subscription peri...