1
Hunting For Memory Resident Malware
Memhunter tool
Marcos Oviedo | McAfee Endpoint Software Architect
Hunting For Memory Resident Malware Memhunter tool Marcos Oviedo | - - PowerPoint PPT Presentation
Hunting For Memory Resident Malware Memhunter tool Marcos Oviedo | McAfee Endpoint Software Architect 1 Agenda Problem Description Fileless Attacks Overview Common Injection Techniques Current Challenges with memory
1
Memhunter tool
Marcos Oviedo | McAfee Endpoint Software Architect
2
3
About me
Currently working at McAfee as a Software Architect Born and raised in Cordoba. Telecommunication Engineer. I’m really passionate about Infosec. BSides Cordoba Organizer! Speaker at Blackhat Arsenal 18 (memhunter) I’m going to be speaking at both Blackhat Arsenal 19 and Defcon 27 Demo Labs this year! Marcos Oviedo @marcosd4h
4
detection techniques
executable files
5 Source: BRK3116 – Microsoft Ignite Conference
No file activity is performed
Only “indirect“ file activity involved
The threat has a fileless persistence or presence on the machine, but requires files to
HARDWARE MBR CPU PCI FILE NETWORK CODE INJECTION MACRO FILE JS VBS PS Remote Attacker Documents LNK Sch Task Exe Service Registry WMI Repo Shell Network Card Hard Disk Circuitry backdoors, IME Disk partition Java Flash Exe USB BadUSB VM Hypervisor BIOS UEFI Mobo Firmware
Multiple Techniques
6
Type I: No File Activity Memory Scanning Can catch injected modules or payloads or shell codes Behavior Monitoring Suspicious/anomalous behavior used alongside
threat activity Type II: Indirect file activity Behavior Monitoring Catches installation & persistence not relying on files (WMI, autorun keys, etc) Trust level Protection It detects trusted processes suspicious activity AMSI Catches scripting activity even when highly
Type III: Files required to Operate Memory Scanning It catches injected payloads or scripts loading .NET binary directly from memory. Behavior Monitoring Suspicious behaviors from common Macro or scripts can be caught AMSI Catches scripting activity even when highly
ML in the client and cloud to scale these protections against new and emerging threats
Source: BRK3116 – Microsoft Ignite Conference
7
memory in target
shellcode/payload into target
execute the payload Classic DLL Injection
Poison Ivy
8
design and code by Steven Fewer
a ‘dumb’ injector. Available in github
powershell empire)
imports, fixup relocations, call entry Reflective DLL Injection
Meterpreter Payload
Source: SANS_Hunting_In_Memory – Joe Desimone
9
existing code
ResumeThread()
WriteProcessMemory
SetThreadContext Process Hollowing
DarkComet Payload
Source: SANS_Hunting_In_Memory – Joe Desimone
10
Threat Hunters rely on personal knowledge and intuition to digest enterprise data and detect problems Threat Hunters expertise is critical and needs to be up- to-date to cope with latest threats On-going attacks are hard to detect on the complex and constantly changing Enterprise Memory resident malware has become increasingly sophisticated
11
Memhunter automate the hunting of memory resident malware at scale, improving the threat hunter analysis process and remediation times Memhunter in a nutshell
find footprints left by common injection techniques.
logs for forwarding
https://github.com/marcosd4h/memhunter
12
13
Deployment Start Collection Hunting orchestration
plugins
14
15
AE53722E-C863-11d2-8659-00C04FA321A1
00c04fd7ba7c)
00c04fd7ba7c)
00a0c911f518)
Intelligence
16
memory regions associated to thread base address
17
happen, it should be memory mapped always. Detects Process Hollowing
18
Execution Options), Appinit_DLL and AppCertDLLs
19
APIs with what can be obtained from the kernel (kernel call through EPROCESS)
MEM_MAPPED, RW and MZ/PE at address.
signs of cmdline spoofing
20
Authentication Package used, etc
21
22