Memory Forensics During Incident Response. Jack Crook. Incident Handler. Works for GE. Founded RaDFIRe. Handlerdiaries.com. IR in a nutshell. Consider the following scenario. - PowerPoint PPT Presentation
Why collect memory?
Memory Forensics During Incident ResponseJack CrookIncident HandlerWorks for GEFounded RaDFIReHandlerdiaries.comIR in a nutshell
Consider the following scenarioIts been a long night and you finally get to bed only to be woken up 30 minutes later to the sound of your phone alerting you that theres an alert that fired and needs to be triaged immediately. Crawling out of bed youre thinking this has to be a false positive because youve gone through this same routine each of the past 5 nights you were on call. Not bothering to turn the lights on for something thats sure to be random noise, you peer into the ids console and see an alert that you have never seen before. You automatically think to yourself, being the tired analyst that you are, who was the a$$hole that added this new rule, and youre sure it was added intentionally just to keep you awake, but you know you cant get back to bed until the alert is validated. So you begin sifting through the data and it quickly becomes apparent that this isnt a false positive, but rather its the real deal and alerted to the fact that theres an intruder in your network attempting to move laterally. You double check your initial analysis and you come to the realization that youre not going to feel the comfort of your bed for a long long time to come. As the adrenaline begins to rush, your mind starts racing, thinking about everything that needs to happen and you know you need to act immediately.Questions that need answeredUseful Data TypesKnowing which data will give you the most information when analyzing intrusions and being able to quickly collect that data is critical. Network (PCAP / Netflow)OS logsAV, HIPS/HIDS LogsMFTMemoryPagefilePrefetchRegistry Hives
7Host based analysisQuestions that need answeredMemory is one if the richest pieces of data to collect when analyzing host dataWhy collect memory?Acquisition timesComplete system stateRecover artifacts of compromiseIdentify command executionTools for acquiring memoryThere are several tools that you can use to acquire memory during forensic investigations.DumpIt (Moonsols)Fastdump Pro (HBGary)Memoryze (Mandiant)FTK Imager (FTK)
12Analysis ToolsThere are several freely available tools that you can use to aid in your forensic investigations.VolatilityRekallRedlineResponderStringsGrepdd
13Questions we can often answer?Is the host compromised?How was the host compromised?Were malicious files dropped?Who talked to the host?Who did the host talk to?Were any user accts compromised?Was any lateral movement identified?How was lateral movement performed?Was any data taken from the host?Do additional hosts need investigation?What can we glean?
Memory TermsSome key terms that will be explained in the following slides :Virtual MemoryStack MemoryHeap MemoryPagingMemory managementVADsShared Memory
16Memory TermsVirtual Memory: A mechanism used so that each process can have its own memory space without bleeding into other process space.
Stack Memory:This is basically the runtime state of process. This area of memory includes data such as local variables and functions. All processes.
Heap Memory:This area of memory is used for the dynamic allocation. File contents and user input are some of the data types in heap memory. All processes.
17Memory TermsPaging:Also know as swapping. Used when physical memory for that process is exhausted. Pages from memory are written to disk to free physical memory space. When a swapped page is needed it is retrieved from disk and rewritten to memory.
Memory Management:The operating systems process of allocating and tracking allocated memory.
18Memory TermsVAD:Also known as Virtual Address Descriptors. Its the method used to record the usage of virtual addresses. Its possible to rebuild an entire process (minus paged data) by walking this tree like structure and extracting each page.
Shared Memory:Used for processes to share different pieces of memory. Think of dlls.
19Demo2012 GrrCON forensic challengehttps://docs.google.com/file/d/0B_xsNYzneAhEQXNZSzh6YTVZQ3M/edit