Memory Forensics in Incident Response Flashcards
When did the change from rudimentary string searching to recovering process information in memory forensics?
The DFRWS 2005 challenge.
At what event did many professionals agree that “pulling the plug” is no longer acceptable?
The SANS Forensics Summit in 2008. (p8)
Why do some guides still recommend pulling the plug instead of performing memory forensics?
A lot of the guides are distributed to people with absolutely no computer training (law enforcement).
Why are memory forensics important?
Nearly everything of interest traverses RAM.
Why is memory becoming less volatile and more like a secondary file system?
It’s becoming larger.
What are volatile registry keys?
Registry keys that can be updated and only survive in memory.
p12 needed?
?
What is \Device\PhysicalMemory?
A handle in the Windows filesystem that, prior to Windows 2003 SP1, could be used to address and copy physical memory.
When did \Device\PhysicalMemory go away?
Windows 2003 SP1
What is HIPS?
Host Intrusion Protection Software
When do Windows drivers have to be signed?
64 bit systems
How do you access physical memory on Windows systems?
Pre 2003 SP1, \Devices\PhysicalMemory. Post 2003 SP1 requires a driver.
What is WinPMEM?
A memory dumping tool for Windows. It allows read only or read write access.
What is Redline?
A tool that is used for Windows memory analysis. Can also perform live memory analysis.
How can you perform memory analysis on a system that’s already been shut down?
Copies of ram that are automatically created, like hibernation files in Windows. Crash dump files as well.
What is the filename that Windows uses to create a copy of memory when the system goes into hibernation?
hiberfil.sys
What portions of memory are included in hiberfil.sys?
Everything. It’s a complete copy.
What is a Windows crash dump file named?
memory.dmp in %WINDIR%. If it’s a full crash dump, it’ll be a complete copy of memory. (See footnotes on p14)
Why is analysis of chat applications difficult?
Many don’t log communications to disk, so the only place to find the information may be in memory.
What is DumpIt?
A simple memory dumping tool from MoonSols that dumps memory from 32 or 64 bit Windows systems to the curent working directory.
Where’s the best place to run DumpIt.exe?
A large capacity thumb drive, because it dumpts to CWD.
What does DumpIt cost?
It’s free.
How is memory usually stored on disk with virtualization products?
It’s often a raw copy of memory, so can be analyzed with standard memory analysis tools.
In which virtualization products is the on-disk memory image a copy of raw memory?
VMWare, Microsoft Server 2008 Hyper-V, and Parallels.
How is the on-disk memory image for VirtualBox different from most other virtualization products?
It only holds memory in use, not a complete image of memory. (16)
What is the fallback plan to analyze memory on a virtual machine if the on-disk image analysis won’t work?
Run a memory acquisition tool within the virtual guest.
What product can be used to analyze virtualization product memory?
Volatility
What are the common file suffixed for virtual memory files?
.vmem - VMware raw memory .vmss - VMware contains memory image .vmsn - VMware contains memory image .bin - Microsoft Hyper-v memory image .vsv - Microsoft Hyper-v save state .mem - Parallels raw memory image .sav - VirtualBox partial memory image (16)
Where are memory images found?
p16.
Rajid Mitra case
p18
What is hiberfil.sys?
A Windows hibernation file a compressed copy of RAM at the time of hibernation.
How can you decompress hiberfil.sys?
Volatility’s imagecopy or MoonSols hibr2bin.exe
What files can analyze Windows hibernation files natively?
BulkExtractor
Magnet Forensics Internet Evidence Finder
Volatility
Belkasoft Evidence Center
What windows command line tool manages hibernation files?
powercfg.exe (review the options p 20)
What is memory forensics?
Study of data captured from memory of a target system, including RAM and virtual memory.
How is memory analysis different from traditional media forensics?
- Data is a snapshot in time, with dramatic changes possible moment to moment
- Complicated to establish context because there’s more information than just files and directories
- Data is formatted for execution, not to be extracted and understood, so analysis is more complicated.
How is memory analysis similar to media forensics?
- Still requires forensically clean procedure
- Still requires putting memory in context, but memory has a more complicated architecture than disk filesystems.
- Still requires analyzing the raw results to understand what the data means
Why is forensic capture of memory more complicated than of media?
Executing a program to capture memory modifies memory.
What is the KDBG?
Kernel Debugger Datablock (lots more on p.24)
What are the three traditional malware detection methods?
Signature, contradiction, heuristic/behavioral (26)
What are the processes to find the first hit in memory analysis?
- Identify rogue processes
- Analyze process DLLs and handles
- Review network artifacts
- Look for evidence of code injection
- Check for rootkit signature
- Dump suspicious processes and drivers
Redline
p. 27-
EPROCESS blocks
p. 35-
Analyzing processes
p. 37
How does Redline identify rogue processes?
p. 40-
What is MRI?
Malware Risk Index. (42)
What are the two components in MRI?
- Behavior rule set
2. Verification of digital signatures
What are the three types of rules in the behavior rule set?
- Process path verification
- Process user verification
- Process Handle Inspection (does a process like svchost have a handle to cmd.exe?)
- DLL load order issues (evidence of DLL hijacking)
What is required for Redline digital signature checking?
It can only be done in live memory analysis.
What other things does Redline check for?
1) Unmapped processes
2) Processes started by command shell
3) DLL load order/hijacking
4) Expected command line arguments
Redline heirarchical process view?
p48
HBGary Responder product?
p48
What things should you check all processes for?
1) Correct image/executable names
2) Correct file location (path)
3) Correct parent process
4) Correct command line and parameters
5) Start time information
6) Security identifies (SID)
What is the Windows per-process limit on kernel handles?
2^24 (52)
What is a handle in windows?
A pointer to a resource such a file directory registry key, mutex or semaphore, or event.
What are the components of a process in Windows?
DLLs, handles, threads, memory sections sockets.
What is a VAD?
In Windows, it’s a Virtual Address Descriptor tree and maintains a list of assigned memory sections.
What is a socket?
A network connection endpoint.
What process does Conflicker/Kido inject itself into?
svchost.exe
How can you detect Conflicker/Kido?
Only by looking at process objects. Because it uses injection into svchost.exe, SID, launch time, path, and parent process are normal.
What is Least Frequency of Occurrence?
The principle that anything related to malware should be uncommon on a system or enterprise. Sorting a list based on occurrences and looking at the least frequently occuring items can be useful. (56)
If an object appears in one process, what does that mean?
It might be a sign of malice, but not always. There are legitimate objects that only appear in one windows process.
How many signatures does Redline ship with?
Less than 50, but you can create your own.
Poison Ivy Remote Access tool?
(62)
Creating redline signatures?
(62)
List network artifacts
- suspicious ports
- suspicious connections
- suspicious processes (should it be communicating over the network at all?)
What are some examples of unusual network behavior?
A non-browser communicating over port 80/443/8080
A browser communicating over a port other than 80/443/8080.
Connections to unexplained IP addresses
Web requests directly to an IP
RDP connections (3389) particularly from odd IPs.
DNS requests for unusual names
How are RDP connections usually managed?
They’re usually routed through a VPN concentrator.
What is TDL3/TDSS?
(69)
Redline memory string analysis
(71)
What things should you search for in memory?
Known bad IPs, domains, or filenames. http://, https://, ftp:/.
Zeus
(71)
How common is DLL injection in modern malware?
Very common.
How does DLL injection work?
Allocate space in a running process, shove the DLL into it, create a new thread to load the DLL into the process.
or
Hook a process’s filter functions using SetWindowsHookEx().
How do you load a DLL into a running process?
VirtualAllocEx()
CreateRemoteThread()
What is the symptom of DLL injection?
An unnamed memory section containing executable code attached to a victim process.
What is process hollowing?
Start a copy of a legitimate system process, pause the process, de-allocate some of the original code and replace it with malicious code.
What is the advantage of process hollowing?
It retains the original executable’s process image name, path, and command line. Camouflage.
How is a memory page marked executable?
Page_Execute_ReadWrite (72)
What does it mean for a memory page to be unmapped?
It’s not backed by a file on disk.
How do you identify process hollowing?
If the image binary is not backed by a file on disk (unmapped), it’s a strong indicator of process hollowing. (77)
Zeus
(78-9)
Stuxnet
(83-5)
Process hollowing example
(83-5)
Why have malware authors resorted to techniques like hiding in plain sight?
More advanced techniques like code injection are easy to find with memory analysis, and tools like Redline makes it easy.
How do most rootkits work?
By hooking legitimate system functions and redirecting output.
What is SSDT?
The System Service Descriptor Table (89)
What is IDT?
(89)
What is IAT?
(90)
What is IRP?
(90)
Storm/SSDT hooking
(91)
Commonly hooked functions?
NtEnumerateKey
NtEnumerateValueKey
NtQueryDirectoryFile
(91(
Why is it hard to identify malicious I/O Request Packet hooks?
There are so many legitimate hooks that have to be eliminated first. Lots of 3rd party drivers.
What is a good method to identify malicious I/O Request Packet hooks?
Least Frequency of Occurrence. Most malware hooks sparingly and may hook functions that no or few other applications do.
What is the Storm Worm?
A spam bot.
How does Storm hide network activity?
It hooks IRP_MJ_DEVICE_CONTROL function within tcpip.sys.
openports?
93
What does a rootkit do?
It hides the existence of system object like processes, files, registry keys, and network artifacts.
How do you dump a process in Redline?
Processes tab in Analysis Data Pane, double click the process of interest within the Table View pane and select MRI Report from the Full Detailed Information tabs at the bottom fo the window. That contains “Acquire Process Address Space”
Where does Redline dump a process memory image?
By default %user profile%\AppData\Local\Temp\AgentAcquisition in a password protected zip archive (prevents AV quarantining)