Digital Investigation Full System Memory Dump Acquisition of - - PowerPoint PPT Presentation

digital investigation
SMART_READER_LITE
LIVE PREVIEW

Digital Investigation Full System Memory Dump Acquisition of - - PowerPoint PPT Presentation

When Hardware Meets Software: A Bulletproof Solution to Forensic Memory Acquisition 1 Universit` 2 Royal Holloway, a degli Studi di Milano University of London Alessandro Reina 1 Aristide Fattori 1 Fabio Pagani 1 Lorenzo Cavallaro 2 Danilo Mauro


slide-1
SLIDE 1

When Hardware Meets Software: A Bulletproof Solution to Forensic Memory Acquisition

1Universit`

a degli Studi di Milano

2Royal Holloway,

University of London

Alessandro Reina1 Aristide Fattori1 Fabio Pagani1 Lorenzo Cavallaro2 Danilo Mauro Bruschi1

28th Annual Computer Security Applications Conference

Alessandro Reina ACSAC 2012 1 / 20

slide-2
SLIDE 2

Digital Investigation

Full System Memory Dump

Acquisition of volatile memory is an essential procedure in digital forensic analysis and incident response.

Run-Time Information

processes; network connections;

  • pen files;

unencrypted data; passwords; malware; . . .

Alessandro Reina ACSAC 2012 2 / 20

slide-3
SLIDE 3

Full System Memory Dump

Challenge

Tampering of the volatile memory during a dump invalidates the collected evidence.

Alessandro Reina ACSAC 2012 3 / 20

slide-4
SLIDE 4

Full System Memory Dump

Challenge

Tampering of the volatile memory during a dump invalidates the collected evidence.

Requirements

atomicity: dump must represent the content of the memory at a single instant in time reliability: must be able to detect tampering or corruption

  • f the dump

availability: solutions must be OS and device independent

Alessandro Reina ACSAC 2012 3 / 20

slide-5
SLIDE 5

Limitations of Current Solutions: Hardware

PCI: prior-installation requirement implies reduced usability FireWire: resolves the usability problem Neither approach satisfies: ✗atomicity the CPU is not frozen ✗reliability bus scanning; subjects to DMA attack ✗availability driver required

Alessandro Reina ACSAC 2012 4 / 20

slide-6
SLIDE 6

Limitations of Current Solutions: Software

virtual device (e.g., /dev/mem): ✗atomicity the CPU is not frozen ✗reliability tool loaded in memory to be run ✗availability OS dependent hypervisor: ✓atomicity can freeze the guest and perform the dump ✗reliability changes in memory due to hypervisor loading ✗availability SW/HW support required

Alessandro Reina ACSAC 2012 5 / 20

slide-7
SLIDE 7

State-of-Art Solutions

SoA techniques leverage System Management Mode to address forensic requirements.

Alessandro Reina ACSAC 2012 6 / 20

slide-8
SLIDE 8

State-of-Art Solutions

SoA techniques leverage System Management Mode to address forensic requirements.

Issues

✓atomicity CPU is frozen ✗reliability integrity guarantee not provided ✗availability prior-installation hardware required (i.e., PCI) no attempt to read more than 4GB

Alessandro Reina ACSAC 2012 6 / 20

slide-9
SLIDE 9

State-of-Art Solutions

SoA techniques leverage System Management Mode to address forensic requirements.

Issues

✓atomicity CPU is frozen ✗reliability integrity guarantee not provided ✗availability prior-installation hardware required (i.e., PCI) no attempt to read more than 4GB We can do better!

Alessandro Reina ACSAC 2012 6 / 20

slide-10
SLIDE 10

A step back

What’s SMM?

System Management Mode is a mode of operation (similar to real mode) of Intel CPUs designed to handle system-wide functionality (e.g., power management and hardware control). code executed in an isolated processor environment transparent to the OS mode of operation with the greatest level of privilege (ring -2) address and operand size override prefixes allow 32bit data access

Alessandro Reina ACSAC 2012 7 / 20

slide-11
SLIDE 11

A step back

What’s SMM?

System Management Mode is a mode of operation (similar to real mode) of Intel CPUs designed to handle system-wide functionality (e.g., power management and hardware control). code executed in an isolated processor environment transparent to the OS mode of operation with the greatest level of privilege (ring -2) address and operand size override prefixes allow 32bit data access

Critical Issue

SMM can access at most 4GB of physical memory!

Alessandro Reina ACSAC 2012 7 / 20

slide-12
SLIDE 12

SMMDumper

Contributions

1 firmware-based technique to atomically perform a reliable

memory dump (IA32)

2 dump physical memory exceeding 4GB (PAE) 3 integrity guarantee provided by signing the whole memory

dump

4 QEMU-based prototype implemented Alessandro Reina ACSAC 2012 8 / 20

slide-13
SLIDE 13

SMMDumper

Contributions

1 firmware-based technique to atomically perform a reliable

memory dump (IA32)

2 dump physical memory exceeding 4GB (PAE) 3 integrity guarantee provided by signing the whole memory

dump

4 QEMU-based prototype implemented

Threat Model

the attacker has root access to the compromised system the attacker has compromised other machines in the same LAN the attacker can perform network attacks the attacker can NOT install an HW hypervisor

Alessandro Reina ACSAC 2012 8 / 20

slide-14
SLIDE 14

Overview of SMMDumper

SMM

[0x00...

  • - 0xff...]

C = md5(mem) sign(C)

[md5(pkt) | pkt]

(1) (2) (3) (4)

Alessandro Reina ACSAC 2012 9 / 20

slide-15
SLIDE 15

Overview of SMMDumper

SMM

[0x00...

  • - 0xff...]

C = md5(mem) sign(C)

[md5(pkt) | pkt]

(1) (2) (3) (4) (1) (2) (3) (4)

Alessandro Reina ACSAC 2012 9 / 20

slide-16
SLIDE 16

Overview of SMMDumper

SMM

[0x00...

  • - 0xff...]

C = md5(mem) sign(C)

[md5(pkt) | pkt]

(1) (2) (3) (4) (1) (2) (3) (4)

Alessandro Reina ACSAC 2012 9 / 20

slide-17
SLIDE 17

Overview of SMMDumper

SMM

[0x00...

  • - 0xff...]

C = md5(mem) sign(C)

[md5(pkt) | pkt]

(1) (2) (3) (4) (1) (2) (3) (4)

Alessandro Reina ACSAC 2012 9 / 20

slide-18
SLIDE 18

Overview of SMMDumper

SMM

[0x00...

  • - 0xff...]

C = md5(mem) sign(C)

[md5(pkt) | pkt]

(1) (2) (3) (4) (1) (2) (3) (4)

Alessandro Reina ACSAC 2012 9 / 20

slide-19
SLIDE 19

SMMDumper

Challenges

1 trigger SMI to switch to SMM 2 guarantee the integrity of the collected data on the host as

well as while in transit to a generic device

3 access all physical memory (even if it is greater than 4GB in

size)

Alessandro Reina ACSAC 2012 10 / 20

slide-20
SLIDE 20

SMMDumper: Triggering System Management Interrupt

System Management Interrupt

external SMM interrupt pin (SMI#) Advanced Programmable Interrupt Controller (APIC)

Bulletproof Triggering Implementation

hardware-based activation mechanisms: i.e., specific keystroke connected to the SMI pin (i.e. events specified by the I/O Controller Hub) isolate the SW component from user- and kernel-space

Alessandro Reina ACSAC 2012 11 / 20

slide-21
SLIDE 21

SMMDumper: Triggering System Management Interrupt

Software Triggering Implementation

SMM keylogger: I/O APIC contains a Redirection Table which routes EXTINTs to the CPUs Redirection Table is set to deliver SMI when IRQ1 is asserted the keyboard scancode is read from the keyboard controller buffer an IPI message is sent to delivery the IRQ1 to the CPU as soon as rsm is executed

Alessandro Reina ACSAC 2012 12 / 20

slide-22
SLIDE 22

SMMDumper: Data Integrity and Transmission

Network Transmission/Retransmission

simple network SMM driver (polling mode) UDP protocol retransmission of lost or corrupted data supported

Alessandro Reina ACSAC 2012 13 / 20

slide-23
SLIDE 23

SMMDumper: Data Integrity and Transmission

Network Transmission/Retransmission

simple network SMM driver (polling mode) UDP protocol retransmission of lost or corrupted data supported checksum(pkt[x:n]) phy addr chunk

x n

Communication Protocol data divided in chunks of fixed size phy addr used by the receiver to handle out-of-order or missing chunks checksum over the packet payload

Alessandro Reina ACSAC 2012 13 / 20

slide-24
SLIDE 24

SMMDumper: Data Integrity and Transmission

Signing the Whole Memory Dump

1 as soon as SMMDumper starts, a smart card device D is

plugged in

2 an incremental checksum C (MD5) of the whole memory is

computed

3 once the memory dump is completed, C is sent to a smart

card device D

4 D signs C with the private key stored inside the smart card 5 the receiver verifies the signature and compares C against the

gathered memory dump

Alessandro Reina ACSAC 2012 14 / 20

slide-25
SLIDE 25

SMMDumper: Accessing Physical Memory

SMM limitations

SMM similar to real mode

  • verride prefixes used to access up to 4GB

paging disabled physical direct memory access

Alessandro Reina ACSAC 2012 15 / 20

slide-26
SLIDE 26

SMMDumper: Accessing Physical Memory

SMM limitations

SMM similar to real mode

  • verride prefixes used to access up to 4GB

paging disabled physical direct memory access . . . but, still, how can we read more than 4GB?

Alessandro Reina ACSAC 2012 15 / 20

slide-27
SLIDE 27

SMMDumper: Accessing more than 4GB (IA32 - PAE)

PDE ⇒ 0x00000000 PDE ⇒ 0x???????? Available Injected Code Available 0x0 0x08 0x10 0x200000

1

va = 0x00200000

2

p_pde = 0x00000008

3

phy_addr = 0x100000000 /* 36-bit */

4

while phy_addr < MAX_MEMORY

5

/* Setup PDE */

6

p_pde->page_base_addr = phy_addr

7

p_pde->p = 1 /* Present */

8

p_pre->us = 1 /* User/Super */

9

/* Now 0x00200000 points to phy_addr */

10

  • ffset = 0

11

while offset < PAGE_SIZE:

12

packet = str(phy_addr+offset)

13

packet += va[offset:offset+CHUNK_SIZE]

14

packet += MD5(packet[0:len(packet)])

15

/* Send pkt */

16

/* Update overall checksum */

17

  • ffset += CHUNK_SIZE

18

phy_addr += PAGE_SIZE

Alessandro Reina ACSAC 2012 16 / 20

slide-28
SLIDE 28

SMMDumper: Experimental Evaluation

Setup

prototype based on coreboot (opensource BIOS) entirely coded in assembly (∼500LoC, 47% MD5 implementation) run on QEMU 1.0.1 (Intel 3GHz, 6GB RAM, 100Mbit)

Alessandro Reina ACSAC 2012 17 / 20

slide-29
SLIDE 29

SMMDumper: Experimental Evaluation

Setup

prototype based on coreboot (opensource BIOS) entirely coded in assembly (∼500LoC, 47% MD5 implementation) run on QEMU 1.0.1 (Intel 3GHz, 6GB RAM, 100Mbit)

Data Transmission

UDP packet = 1024(chunk) + 16(MD5) + 8(phy addr) transfer time for 6GB ≈ 13.5min ≈ 10% time overhead due to MD5 calculation 144MB of metadata

Alessandro Reina ACSAC 2012 17 / 20

slide-30
SLIDE 30

SMMDumper: Experimental Evaluation

Atomicity

QEMU instrumented to take a snapshot of the whole physical memory before starting to execute SMMDumper comparison of such a dump with the one of SMMDumper demonstrates accuracy and consistency some changes may occur when reading I/O memory mapped regions

these changes do not violate atomicity as not relevant for the analysis

Reliability

simulation of man-in-the-middle attack payload modified and checksum updated result: receiver detected that the signature was invalid

Alessandro Reina ACSAC 2012 18 / 20

slide-31
SLIDE 31

SMMDumper: Conclusion

When Hardware Meets Software: A Bulletproof Solution to Forensic Memory Acquisition

SMMDumper

SMMDumper is able to dump more than 4GB of memory SMMDumper satisfies the forensic requirements: ✓atomicity no changes occurred to memory content ✓reliability integrity is guaranteed ✓availability completely OS and device independent

Alessandro Reina ACSAC 2012 19 / 20

slide-32
SLIDE 32

SMMDumper: Conclusion

When Hardware Meets Software: A Bulletproof Solution to Forensic Memory Acquisition

SMMDumper

SMMDumper is able to dump more than 4GB of memory SMMDumper satisfies the forensic requirements: ✓atomicity no changes occurred to memory content ✓reliability integrity is guaranteed ✓availability completely OS and device independent

Future Work

extension to Intel 64bit CPU (under submission) support for multiprocessor system

Alessandro Reina ACSAC 2012 19 / 20

slide-33
SLIDE 33

Thanks for your attention!

Questions?

Alessandro Reina alessandro.reina@unimi.it

Alessandro Reina ACSAC 2012 20 / 20