6-Hunting Malware Part 1
6-Hunting Malware Part 1
Lab 6
LAB OBJECTIVES
Use Redline to conduct memory analysis of a Mandiant Analysis (MANS) Files.
LEARNING OBJECTIVES
The objective of this lab is conduct memory analysis to detect DLL Injection and/or Rootkits.
RECOMMENDED TOOLS
• Mandiant Redline
• Hunting Workstation:
o IP: 172.16.151.50
o RDP Credentials: elshunter:ahuntingweg0!
• Administrative Assistant Workstation:
o IP: 172.16.151.75
o RDP Credentials: elshunter:ahuntingweg0!
TASKS
TASK 1. LOAD SAVED MANS FILE INTO REDLINE FOR
ANALYSIS.
1. Run Redline and load the Mandiant Analysis File called AnalysisSession1.
Note: Make sure you check the box Acquire Memory Image.
At this point we can answer the first question: “How many processes are Redlined?
• The answer is 4.
To answer the 2nd part of the question we must look at each Redlined process individually
to get more specific information about the process.
To answer the question, “why are they Redlined?”, we must look at the MRI Report.
6. Click on Sections, next to MRI Report, to see if there are any indicators of injected
code.
7. Apply filter for Injected only and hit Filter.
9. We must do the same for the other 3 processes. To do so we can either click on
Processes at the far left, in Analysis Data, or in the top navigational bread crumb,
Home > Host > Processes > Full Detailed Information.
Even though these 4 processes were Redlined, nothing immediately seems malicious to us.
Now we must see if any processes, which weren’t Redlined, are malicious. Let’s look at the
Hierarchical Processes view.
Any other suspicious processes? If so, what are the indicators that the process is
suspicious?
• Yes. There are 2 lsass processes running: 1 is the actual process (PID 492) and
1 is masquerading (PID 2816).
In the Sections tab, towards the bottom you might already see some indicators of Injected
and Untrusted. Let’s filter for those only.
Now we can look at the Timeline to attempt to answer the last question, “What file most
likely kicked off this suspicious binary?”.
4 entries found. We can see the binary of interest, 1sass, is 2 of the 4 entries.
• We can see a file was run on the desktop called 1sass.chm executed by hh.exe.
CHM are Windows Help Files. Afterwards 1sass.exe was executed.
Note: The information we were seeking for could have been quickly obtained by looking at
Memory Sections at the far left, in Analysis Data under Processes. In Memory Sections,
select Injected Memory Sections under Review Memory Sections / DLLs. The output
would be 4 entries showing as Injected and 1sass.exe being the process.
Summary:
2. In the next screen titled Start Your Analysis Session, under Review Script
Configuration check the box under Acquire Memory Image.
Optional: You can edit your script if you wish but for this exercise it’s not necessary.
3. Choose a folder where you wish to save your Collector to and click OK.
After a few seconds or minutes, depending on your setup and script, a box will be
displayed to you.
Note: This process will take a while, especially if you added more to the Collector script.
7. Once the audit has completed. Close the CMD and log off the machine.
8. Log back into your machine (if you logged out the RDP session) to begin analysis.
9. Open AnalysisSession2 in Redline and click on I am Reviewing a Full Live
Response or Memory Image or Processes from the far left, in Analysis Data.
After careful inspection we see a process, rundll32.exe, listening on port 443. Which is
odd for this workstation. Let’s go to Hierarchical Processes view and look at
runndll32.exe.
Ok, so let’s look at the Timeline to attempt to determine what could have potentially
executed this rundll32.exe.
2 results are returned. We can see a few entries right above it that tasking.exe,
powershell.exe, and conhost.exe was executed.