38
AFAUC – anti-forensics of storage devices by alternative use of communication channels Harald Baier , Julian Knauer Hochschule Darmstadt, CASED IMF, 2014-05-12 Harald Baier AFAUC / IMF, 2014-05-12 1/38

AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

AFAUC – anti-forensics of storage devicesby alternative use of communication

channels

Harald Baier, Julian Knauer

Hochschule Darmstadt, CASED

IMF, 2014-05-12

Harald Baier AFAUC / IMF, 2014-05-12 1/38

Page 2: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Harald Baier

1. Doctoral degree from TU Darmstadt in the area of ellipticcurve cryptography.

2. Principal Investigator within Center for Advanced SecurityResearch Darmstadt (CASED)

3. Establishment of forensic courses within HochschuleDarmstadt.

4. Current working fields:I IT forensics.

I Anomaly detection in high-traffic environments.

I Security protocols for eMRTD.

Harald Baier AFAUC / IMF, 2014-05-12 2/38

Page 3: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 3/38

Page 4: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Motivation

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 4/38

Page 5: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Motivation

Use case: hide information in oppressive countries

Harald Baier AFAUC / IMF, 2014-05-12 5/38

Page 6: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Motivation

Use case: detect dark activities

Harald Baier AFAUC / IMF, 2014-05-12 6/38

Page 7: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Motivation

Key question: where to hide data?

1. Location of hidden data:I Inspire yourself by well-known anti-forensic approaches.

2. Access channel:I Usual one as expected.

I Usual one in an unexpected way.

I Alternative channel.

Harald Baier AFAUC / IMF, 2014-05-12 7/38

Page 8: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 8/38

Page 9: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

General anti forensic measures

1. Obfuscation techniques to prevent investigators to accesscontent of data, e.g.,

I Encryption.

I Packers.

2. Hide data somewhere on the disc, e.g.,I Steganography.

I Non-partioned area.

I Slack space of the file system.

I Journals.

I Inode area of an extX file system.

I ATA-standardised disc areas like HPA or DCO.

Harald Baier AFAUC / IMF, 2014-05-12 9/38

Page 10: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

HPA and DCO

I HPA = Host/Hidden Protected AreaI At the ’end’ of the disc.

I Not accessible using ordinary OS commands.

I Possible aims: installation/recovery software of manufacturersincluding boot sector.

I Detectable by boot messages, hdparm or using disk_stat

from TSK.

I DCO = Device Configuration OverlayI Located ’behind’ HPA.

I Configure parameters of the disc including its native size.

I Possible aim: the device looks smaller than it actually is (e.g.,because a distributor sells 600 GiB HDDs instead of 1 TiBHDDs).

Harald Baier AFAUC / IMF, 2014-05-12 10/38

Page 11: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

Sample disc layout

1. Three different maximum Logical Block Addresses (LBA):I lastUserLBA = 488, 000, 000 (set by SET MAX ADDRESS)

I nativeMaxLBA = 488, 245, 120 (set byDEVICE CONFIGURATION SET)

I realMaxLBA = 488, 397, 168 (invariant (?))

Harald Baier AFAUC / IMF, 2014-05-12 11/38

Page 12: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

Identifying HPA using hdparm

$ hdparm -N /dev/sda

/dev/sda:

max sectors = 488000001/488245121, HPA is enabled

$ man hdparm

[REMOVED]

-N Get/set max visible number of sectors, also known as the Host

Protected Area setting. Without a parameter, -N displays the

current setting, which is reported as two values: the first

gives the current max sectors setting, and the second shows the

native (real) hardware limit for the disk. The difference

between these two values indicates how many sectors of the disk

are currently hidden from the operating system, in the form of a

Host Protected Area (HPA).

Harald Baier AFAUC / IMF, 2014-05-12 12/38

Page 13: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

Identifying DCO using hdparm

$ hdparm --dco-identify /dev/sda

/dev/sda:

DCO Revision: 0x0002

The following features can be selectively disabled via DCO:

Transfer modes:

udma0 udma1 udma2 udma3 udma4 udma5 udma6

Real max sectors: 488397168

ATA command/feature sets:

[REMOVED]

$ man hdparm

[REMOVED]

--dco-identify

Query and dump information regarding drive configuration set-

tings which can be disabled by the vendor or OEM installer.

These settings show capabilities of the drive which might be

disabled by the vendor for "enhanced compatibility". When dis-

abled, they are otherwise hidden and will not show in the -I

identify output.

Harald Baier AFAUC / IMF, 2014-05-12 13/38

Page 14: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Foundations

Knowledge about HPA / DCO

1. Knowledge about the existence of an HPA or a DCO is notwidespread under computer scientists.

2. However, well-known in the computer forensics community.I Part of any investigation.

I IT forensic guideline from the German Federal Office forInformation Security:

Completeness of the image: Reserved areas of mass storagemedia (e.g., HPA and DCO) must be detected reliably anddeactivated during acquisition to get a complete image.

3. Many tools available to acquire the whole drive untilrealMaxLBA.

Harald Baier AFAUC / IMF, 2014-05-12 14/38

Page 15: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

General methodology

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 15/38

Page 16: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

General methodology

Basic idea: special case ATA devices

Create non-standardised data area similar to HPA / DCO.

1. We are inspired by both hidden data areas and side channelattacks from cryptography.

2. Key questions:

2.1 Is it possible to manipulate realMaxLBA?

2.2 Is there an alternative interface to the firmware than the ATAone?

2.3 If yes, how to access the maintenance area?

=⇒ AFAUC – anti-forensics of storage devices by alternative use ofcommunication channels

Harald Baier AFAUC / IMF, 2014-05-12 16/38

Page 17: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

General methodology

Key steps (1/2)

1. Identify communication channel to access storage device:I Further interfaces than bulk data interface?

I Wired or wireless?

I Paradigm: ’abuse’ it for unintended use.

I Notation side channel vs. alternative use of a communicationchannel.

2. Connect to the interface and find out basic communicationparameters:

I Role of pins, voltage.

I Data structures, baud rate.

Harald Baier AFAUC / IMF, 2014-05-12 17/38

Page 18: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

General methodology

Key steps (2/2)

3. After successful connection: reverse engineer interfacecommands to change configuration.

I Sample sources: manuals, manufacturer’s web site, Internetforums, ...

I Pitfalls: checksums, backup copies, encryption.

4. Adapt non-digital information, e.g., HDD identification plate.

5. Self-evaluate your manipulation using common IT forensictools.

Harald Baier AFAUC / IMF, 2014-05-12 18/38

Page 19: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

General methodology

AFAUC is dual use

Harald Baier AFAUC / IMF, 2014-05-12 19/38

Page 20: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 20/38

Page 21: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Our sample disc

Harald Baier AFAUC / IMF, 2014-05-12 21/38

Page 22: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Diagnostic interface

1. Manufacturers use it for maintenance:I Hardly documented.

I Provides serial interface to the Micro Controller Unit (MCU)of the HDD.

2. Sample layouts:

Harald Baier AFAUC / IMF, 2014-05-12 22/38

Page 23: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Our host environment

1. An ’old’ PC providing a serial interface :-).

2. Linux, hdparm.

3. minicom as terminal emulator.

4. RS232 transceiver

Harald Baier AFAUC / IMF, 2014-05-12 23/38

Page 24: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Favoured modified disc layout

1. Keep lastUserLBA and nativeMaxLBA unaltered.

2. realMaxLBA ← realMaxLBA −100, 000.

Harald Baier AFAUC / IMF, 2014-05-12 24/38

Page 25: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Relevant Samsung diagnostic commands

Command Parameter DescriptionRM ModuleIndex Read Module: reads the module with

ModuleIndex from the service area intothe device memory.

MW Offset DataWord[DataWord...]

Memory Write: modify the contents ofthe memory by writing one or multipleDataWord beginning at Offset.

WM ModuleIndex Write Module: writes the memorybuffer back to the service area as mod-ule ModuleIndex.

Harald Baier AFAUC / IMF, 2014-05-12 25/38

Page 26: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

CONFIG module before manipulation

ENG> RM 6

W:005B00 434F 4E46 4947 2020 0000 0000 0000 0004

W:005B08 0000 0001 0002 0003 0000 0001 0002 0003

W:005B10 3FFF 0010 003F 5970 1D1C 0000 0000 0000

W:005B18 2459 005B 65B4 01D2 7242 0349 7D93 04BE

[...]

1. 434F 4E46 4947 2020 == CONFIG__

2. We search for realMaxLBA:

488397168 = 0x1D1C5970

Harald Baier AFAUC / IMF, 2014-05-12 26/38

Page 27: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

CONFIG module before manipulation

ENG> RM 6

W:005B00 434F 4E46 4947 2020 0000 0000 0000 0004

W:005B08 0000 0001 0002 0003 0000 0001 0002 0003

W:005B10 3FFF 0010 003F 5970 1D1C 0000 0000 0000

W:005B18 2459 005B 65B4 01D2 7242 0349 7D93 04BE

[...]

1. 434F 4E46 4947 2020 == CONFIG__

2. realMaxLBA at offset W:005B13:

488397168 = 0x1D1C5970

Harald Baier AFAUC / IMF, 2014-05-12 27/38

Page 28: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Sample access and reconfiguration

Modification of the CONFIG module

1. Determine modified realMaxLBA:

488297168 = 0x1D1AD2D0

2. Translate it to little-endian words D2D0 and 1D1A.

3. Write two words at offset W:005B13:

MW 5B13 D2D01D1A

4. Make the changes permanent:

WM 6.

Harald Baier AFAUC / IMF, 2014-05-12 28/38

Page 29: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Evaluation

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 29/38

Page 30: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Evaluation

Evaluation tools and persons

1. Different tools:I dd.

I hdparm.

I ACE Laboratory PC-3000 UDMA suite.

I Tableau TD1 Forensic Duplicator.

2. Two IT forensic departments to apply their common processmodell to acquire the HDD dump:

I Law enforcement.

I IT forensic department of an audit firm.

3. Only consider digital information, e.g., do not process HDDlabel.

Harald Baier AFAUC / IMF, 2014-05-12 30/38

Page 31: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Evaluation

Basic functional tests: Preparation

I Disable HPA and DCO.

I Write a file of length 512 bytes into the final HDD block.

I File contains the ASCII control pattern

Do you detect our AFAUC anti-forensic approach?

I Modify CONFIG module of the HDD as described before.

Harald Baier AFAUC / IMF, 2014-05-12 31/38

Page 32: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Evaluation

Basic functional tests

1. HDD dump using dd:I Acquire disc data: dd if=/dev/sda of=dump.dd

I Control pattern not found in dump dump.dd.

2. Read out realMaxLBA using hdparm:

$ hdparm --dco-identify /dev/sda

/dev/sda:

[REMOVED]

Real max sectors: 488297168

[REMOVED]

Harald Baier AFAUC / IMF, 2014-05-12 32/38

Page 33: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Evaluation

Evaluation using PC-3000 UDMA

1. German law enforcement agency.

2. PC-3000 connects to S-ATA interface of the HDD.

3. Hidden data partition is not revealed.

4. However, PC-3000 can access 3 backup copies of themodules: all backup copies contain the original realMaxLBA.

Harald Baier AFAUC / IMF, 2014-05-12 33/38

Page 34: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Evaluation

Evaluation using TD1

Performed by a German IT forensic department.

Harald Baier AFAUC / IMF, 2014-05-12 34/38

Page 35: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Conclusion and future work

Motivation

Foundations

General methodology

Sample access and reconfiguration

Evaluation

Conclusion and future work

Harald Baier AFAUC / IMF, 2014-05-12 35/38

Page 36: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Conclusion and future work

Take home messages

1. Always keep anti-forensic measures in mind.

2. Be aware of alternative use of interfaces.

3. Skilled people can generate hidden HDD partitions ’for free’.

4. AFAUC is dual use.

Harald Baier AFAUC / IMF, 2014-05-12 36/38

Page 37: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Conclusion and future work

Future work

1. Terminology: side channel vs. interface for unintended use vs.interface for alternative use

2. Manipulation of backup copies of the modules.

3. Reverse engineer non-standardised ATA commands as used bymanufacturers and PC-3000.

4. Wireless interfaces (e.g., SD card).

Harald Baier AFAUC / IMF, 2014-05-12 37/38

Page 38: AFAUC anti-forensics of storage devices by alternative use ...€¦ · Identifying HPA using hdparm $ hdparm -N /dev/sda /dev/sda: max sectors = 488000001/488245121,HPA is enabled

Conclusion and future work

Questions?

Source: www.dilbert.com/strips/

Harald Baier AFAUC / IMF, 2014-05-12 38/38