Malware Packers Part 2

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
or

Already have an account? Sign In »

Time
3 hours 41 minutes
Difficulty
Advanced
CEU/CPE
5
Video Transcription
00:00
in the last session, we learned about the different types of packers and how they work in this session. We're going to examine and learn different techniques to be able to identify files that have been packed.
00:11
When you're analyzing malware, there's a few techniques that you can use to identify pack samples.
00:17
First, I'm going to tell you about them here, and then we can execute them in our lab. So the first one is to run the P E file through a tool that can scan it for signatures. Every packers got a unique signature, and that can help you identify.
00:30
There's a couple of tools that can help you accomplish this. The one I'm showing you here is E x e info p e. But there's also P e I. D. Uh, this one happens to be a clone of P E I. D.
00:43
And there's P E Explorer and P E Studio and detected easy these air all other tools that will allow you to be able to scan the p e file using signatures.
00:53
The second technique you can use is to open up the file in CFF Explorer or P I. D or any one of these tools to evaluate the P E section names.
01:03
Typically, the section names reveal a lot about the compiler or the packer that was used to create the program.
01:08
The third technique that you can use is to look for the unpack er stuff so typically, when execute a bles, run the file's start the execution from the first section, which would be like text or code
01:19
packed. Files, on the other hand, are different. They start the execution from the last section, indicating that the P E is beginning to execute from the unpacking stuff.
01:30
The fourth technique that you can use is to look for a small import table,
01:34
usually the P E Files. They're gonna import a lot of different A p I is that the program is going to use during its execution.
01:42
However, in PAC files, you're only going to see a few. AP is being utilized Onley enough to unpack the file.
01:49
The fifth technique that you could use is to simply look at the properties of the excusable. Remember, packed files are typically smaller in size and their strings are typically obvious. Skated.
01:59
This technique is rather simple, right? You could perform this by simply using extremes tool during a triage or simple static analysis process.
02:07
So to show you these techniques, let's go ahead and head over to our lab.
02:13
So here in our lab, we have three files and let's start with the easiest technique to scan your file with strings
02:21
follow. I want to scan is malware dot been. But before I dio just a note here, you can see that right off the bat. Among the two files the pact one is smaller Malware Dobbin is smaller than malware dot e x c.
02:35
All right, so I want to use TheStreet is tool on malware dot Been. So I will, right click and use the strings tool and immediately you can see that instead of a typical p e header, we have some section names. We have the strings E p x 01 and two.
02:53
So this is already giving you an idea that this piece of malware it is packed
02:59
In addition to seeing our section names as we're scanning through the strings, you can see that we've got some gibberish here and that these strings look obfuscated. We do have some ones that we can view. But in general, you can see that there's some obfuscation going on with this file. Okay, so that was our easiest technique using strings.
03:17
The next technique that we can use is to scan the malware with a tool that can scan it with Packer signatures.
03:25
So if we take our malware dot been and we drag it over to detect it easy,
03:31
you can see here that the Pachter signature is being detected by detected. Easy. Here we can see the malware. It looks like it's being packed with you. PX 396 which is the one I used
03:46
next using Detective Easy. We could look at the sections, which we've seen already.
03:51
If we click the arrow for number of sections, you can see that there's only three U P x 01 and two.
03:59
Remember, though different packers are going to have different section names
04:03
to look for or inspect the packer stuff we could utilize to tools.
04:10
First we can use detected easy to look at the entry point of the program. So by clicking on the entry point button here, we can see that it's 413 a 60
04:23
so Now what we can dio is we could take this and put it into a d bugger.
04:28
So if we take it and put it into X 64 debug, we can utilize the memory mapped window.
04:35
Here you can see that the entry point falls within our 411000 and 414000 address, which is within the U P X one section.
04:49
You can also see here that the permissions on this section are execute a ble
04:55
typically a normal execute herbal when opened in and oh, bugger would be pointing to an entry point in the dot tech section which this execute herbal clearly does not
05:05
now, using those techniques. So far, we've got a pretty good idea that this piece of malware is packed.
05:12
But the last thing that you could try is looking at the import table
05:15
in detected easy. If you click on the import button here, you can see that in this particular piece of malware, there's only a few AP eyes that are being listed were unpacked. Sample would have many more.
05:32
Okay, so now that you've identified a piece of malware that's packed, what are your options for unpacking it?
05:38
Well, there are several techniques you could employ. The first is that you could execute the sample and let it unpack in a live environment.
05:46
Now, this could be sufficient for you if all you need is to observe and or collect malware artifacts. Tools such as cocoa sandbox or the pocus emulator are good for this as their automated simulated, and they can also give you finer control of the unpacking process. Also, you could try using in a packer that's known for the Packer itself.
06:04
U P Accent Tamada thes air Commercially available pieces of software. You could download a copy or ask for one and see if you could unpack the sample this way
06:15
along those same lines. You could try using a generic Um Packer.
06:19
Typically generic, um, Packers like quick unpack. The one shown here thes have scripts built inside that work with specific packers so that you can automate the manual unpacking process.
06:32
Now the nice thing about the generic um, Packers is that they work with multiple packers, so even if they aren't designed for the packer you encounter, ah, lot of the times. These tools will be able to help you unpack. Sample.
06:45
You want to be careful with these, though, because when you use them, they typically executing our on the system.
06:50
Now, if none of these tools or techniques help you, the last option is to manually impact the malware, using any combination of scripts, tools and the do bugger.
07:00
There are many ways that we can tackle the manual unpacking process.
07:04
These air, however, outside the scope of this course and will be presented in an advanced level of detail in a future. Siri's
07:12
all right. So now that we have examined packing in the next session, we're going to examine another malware challenge obfuscation.
Up Next
Advanced Malware Analysis: Redux

In this course, we introduce new techniques to help speed up analysis and transition students from malware analyst to reverse engineer. We skip the malware analysis lab set up and put participants hands on with malware analysis.

Instructed By