Reverse engineering hardware for software reversers: studying an encrypted external HDD



Similar documents
Analysis of an encrypted HDD

FIPS Non Proprietary Security Policy: Kingston Technology DataTraveler DT4000 Series USB Flash Drive

SecureDoc Disk Encryption Cryptographic Engine

SECURE USB FLASH DRIVE. Non-Proprietary Security Policy

Secure My-d TM and Mifare TM RFID reader system by using a security access module Erich Englbrecht (info@eonline.de) V0.1draft

Disk encryption... (not only) in Linux. Milan Brož

Reviving smart card analysis

FIPS Non Proprietary Security Policy: IBM Internet Security Systems Proventia GX Series Security

Aegis Padlock for business

USB Portable Storage Device: Security Problem Definition Summary

Side Channel Analysis and Embedded Systems Impact and Countermeasures

ADVANCED IC REVERSE ENGINEERING TECHNIQUES: IN DEPTH ANALYSIS OF A MODERN SMART CARD. Olivier THOMAS Blackhat USA 2015

FIPS Non Proprietary Security Policy: IBM Internet Security Systems Proventia GX Series Security

VASCO Data Security International, Inc. DIGIPASS GO-7. FIPS Non-Proprietary Cryptographic Module Security Policy

Presentation on Black Hat Europe 2003 Conference. Security Analysis of Microsoft Encrypting File System (EFS)

Windows Server 2008 R2 Boot Manager Security Policy For FIPS Validation

PUF Physical Unclonable Functions

USB Portable Storage Device: Security Problem Definition Summary

PL2775 JBOD / BIG / RAID0 / RAID1 Mode Application

Cautions When Using BitLocker Drive Encryption on PRIMERGY

Secure File Transfer Appliance Security Policy Document Version 1.9. Accellion, Inc.

SNAPcell Security Policy Document Version 1.7. Snapshield

PMAfob Home Automation Demo

Message Authentication Codes

Northrop Grumman M5 Network Security SCS Linux Kernel Cryptographic Services. FIPS Security Policy Version

Bootloader with AES Encryption

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

Reboot the ExtraHop System and Test Hardware with the Rescue USB Flash Drive

Secure Data Exchange Solution

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Industrial Flash Storage Trends in Software and Security

Introduction to BitLocker FVE

How To Set Up A Hard Drive With A Harddrive With A 2Gb Hard Drive (I386) And 2Gb Drive (Amd64) On A Hardrive (I219) (Iee) (Amd66) (Ai219

IronKey Data Encryption Methods

How to Encrypt your Windows 7 SDS Machine with Bitlocker

Penetration Testing Windows Vista TM BitLocker TM

i.mx USB loader A white paper by Tristan Lelong

FIPS Non-Proprietary Security Policy. IBM Internet Security Systems SiteProtector Cryptographic Module (Version 1.0)

Horst Görtz Institute for IT-Security

12/3/08. Security in Wireless LANs and Mobile Networks. Wireless Magnifies Exposure Vulnerability. Mobility Makes it Difficult to Establish Trust

Secure Network Communications FIPS Non Proprietary Security Policy

FIPS Non- Proprietary Security Policy. McAfee SIEM Cryptographic Module, Version 1.0

MARTECH SPI Tools. MARTECH SPI Tools User Manual v1.0. User Manual

SecureD Technical Overview

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Broadcasting encryption or systematic #FAIL? Phil

Today. Important From Last Time. Old Joke. Computer Security. Embedded Security. Trusted Computing Base

What users should know about Full Disk Encryption based on LUKS

Into The Droid. Gaining Access to Android User Data DEF CON 20

YubiKey Integration for Full Disk Encryption

Legal Notes. Regarding Trademarks. Models supported by the KX printer driver KYOCERA MITA Corporation

Secure USB Flash Drive. Biometric & Professional Drives

Guide to Data Field Encryption

Athena Smartcard Inc. IDProtect Key with LASER PKI FIPS Cryptographic Module Security Policy. Document Version: 1.0 Date: April 25, 2012

ios Security Decoded Dave Test Classroom and Lab Computing Penn State ITS Feedback -

Dolphin In-Circuit programming Updating Firmware in the field

Encrypting with BitLocker for disk volumes under Windows 7

Cryptographic Modules, Security Level Enhanced. Endorsed by the Bundesamt für Sicherheit in der Informationstechnik

Fondamenti su strumenti di sviluppo per microcontrollori PIC

MXMedia CipherStream. Preliminary Assessment. Copyright 2012 Farncombe 1.0. Author: T F

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Security Policy for FIPS Validation

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

Chapter 13. PIC Family Microcontroller

CCNA 2 Chapter 5. Managing Cisco IOS Software

IRT84. Irt84. Datasheet. EMV L1 compliant terminal with ISO14443A/B. 1

Pulse Secure, LLC. January 9, 2015

Bypassing Local Windows Authentication to Defeat Full Disk Encryption. Ian Haken

Bypassing Self- Encrypting Drives (SED) in Enterprise Environments. Daniel Boteanu Kevvie Fowler November 12 th, 2015

Full Drive Encryption Security Problem Definition - Encryption Engine

FLASH USB Introduction ENGLISH

Accellion Secure File Transfer Cryptographic Module Security Policy Document Version 1.0. Accellion, Inc.

WICE-SPI Hardware Operation Manual

Assessing the Security of Hardware-Based vs. Software-Based Encryption on USB Flash Drives

Computer Security. Draft Exam with Answers

SECURE IMPLEMENTATIONS OF CONTENT PROTECTION (DRM) SCHEMES ON CONSUMER ELECTRONIC DEVICES

SHE Secure Hardware Extension

Lab Experiment 1: The LPC 2148 Education Board

V16 Pro - What s New?

Opgui and OpenProg user s guide. v.1.2

ESATA PCI CARD. User s Manual

Using BitLocker As Part Of A Customer Data Protection Program: Part 1

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

Overview of the LTC2978 Configuration EEPROM (NVM) Revision 1.0

Implementation and Implications of a Stealth Hard-Drive Backdoor

Security Policy, DLP Cinema, Series 2 Enigma Link Decryptor

Security Policy: Key Management Facility Crypto Card (KMF CC)

Client Server Registration Protocol

1-10 The USB PIC K150 microcontroller programmer Hardware version V2.0 File version V2.0 Product Image

Eureka Technology. Understanding SD, SDIO and MMC Interface. by Eureka Technology Inc. May 26th, Copyright (C) All Rights Reserved

Linux. Reverse Debugging. Target Communication Framework. Nexus. Intel Trace Hub GDB. PIL Simulation CONTENTS

What is LOG Storm and what is it useful for?

Exploring the impact of a hard drive backdoor. Jonas Zaddach

SAS Data Set Encryption Options

Functional diagram: Secure encrypted data. totally encrypted. XOR encryption. RFID token. fingerprint reader. 128 bit AES in ECB mode Security HDD

Credit Card Fraud The Contactless Generation Kristin Paget

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

HP ProtectTools Windows Mobile

Kaseya US Sales, LLC Virtual System Administrator Cryptographic Module Software Version: 1.0

FANTEC MR-35DU3-6G USER MANUAL

Transcription:

Reverse engineering hardware for software reversers: studying an encrypted external HDD Joffrey Czarny & Raphaël Rigo / AGI / TX5IT 2015-10-02 / Hardwear.io

2015-10-02 / Hardwear.io 2

Introduction Why study encrypted hard drives? Initially: audit need inside Airbus Group Previous work revealed vulnerabilities Discover how to analyze hardware based on microcontrollers Previous epic fails on this type of HW Kingston/SanDisk FIPS 140-2: magic unlocking packet (2010) Corsair Padlock: data not encrypted, reachable without PIN (2008) Corsair Padlock 2: brute-forceable PIN (2010) WD Passport (yesterday s talk by Gunnar Alendal and Christian Kison) End goal Analyze the actual level of protection of user data = Validate security and cryptography implementations inside the enclosure 2015-10-02 / Hardwear.io 3

Introduction This talk s objectives: Describe the study of an external encrypted HDD: Explain the methodology in details Show our various failures Give leads to continue the analysis Case study: Zalman ZM-VE400 Enclosure: HDD is replaceable Optional AES-256 XTS encryption (physical keyboard) Can mount ISO as USB optical drive Really a rebranded iodd 2541 2015-10-02 / Hardwear.io 4

Context, first results General security checks Verify basic crypto properties: ECB mode? statistical tests OK? Fixed key? More tests, to verify the key is not derived directly from the PIN: The same PIN, on 2 different enclosures, must lead to different encryption The same PIN, on the same enclosure, must lead to different encryption Secret material (keys, hashes) should be stored in tamper resistant hardware VE400 results Basic crypto properties: OK Encryption does not depend on enclosure: an encrypted HDD put in a new Zalman enclosure can be accessed with the right PIN Activating encryption uses 10 sectors at the end of the HDD: Not usable anymore Contain a blob of 768 bytes, of high entropy, twice 2015-10-02 / Hardwear.io 5

Going forward Important result: design failure Everything needed to decrypt data is stored on the HDD itself. = Efficient attacks are possible (bruteforce, key recovery) New end goal Understand the blob stored at the end of the disk: its data and its format, to implement an offline attack How? First by trying to access the firmware and/or by analyzing communications Firmware updates are encrypted, so we need to attack the hardware 2015-10-02 / Hardwear.io 6

Hardware analysis PCB analysis Components identification Traces and vias identification = Logical view Flash memories study Identify communication buses Flash content recovery = Flash content analysis (hopefully cleartext code) 2015-10-02 / Hardwear.io 7

PCB: component identification 1/2 PCB: front side System on Chip (SoC) Fujitsu MB86C311 USB3-SATA SPI flash EN25F80 PIC32MX 150F128D microcontroller 2015-10-02 / Hardwear.io 8

PCB: component identification 2/2 PCB: back size SPI flash EN25F80 2015-10-02 / Hardwear.io 9

SoC and microcontroller Fujitsu MB86C311 USB3 SATA controller AES-256 XTS encryption ARM core Internal ROM and external SPI firmware support (encrypted?) PIC32MX 150F128D MIPS32 CPU (with MIPS16e support) 128 Ki of internal flash 32 Ki of RAM Supports ICSP and EJTAG Protection bits to disable external access 2015-10-02 / Hardwear.io 10

PCB: traces analysis (1/5): Hobo mode with GIMP 2015-10-02 / Hardwear.io 11

PCB: traces analysis (2/5): getting real with PCBRE [5] 2015-10-02 / Hardwear.io 12

PCB: traces analysis (3/5): leveling up: optical microscope 2015-10-02 / Hardwear.io 13

PCB: traces analysis (4/5): level cap: X-rays 2015-10-02 / Hardwear.io 14

PCB: traces analysis (5/5) In the end One flash dedicated to the USB-SATA controller (SoC) One flash dedicated to the PIC32 One link between the SoC and the PIC, (partially) shared with the SoC flash 2015-10-02 / Hardwear.io 15

PCB: logic view What s inside the flash chips? Maybe the code is in cleartext? = Let s get their contents! 2015-10-02 / Hardwear.io 16

Flash content recovery (1/2) Reading flash content SPI Chip desoldering needed to avoid interferences Interface using a SOIC DIP adapter to keep the board working 2015-10-02 / Hardwear.io 17

Flash content recovery (2/2) SPI tools GoodFET with goodfet.spiflash (recommended) Bus Pirate Raspberry Pi with spidev Results: flashes content USB-SATA controller: Plaintext configuration data (USB descriptors, etc.) Code, encrypted PIC32 microcontroller: A font, for the LCD screen Code, encrypted 2015-10-02 / Hardwear.io 18

Results Code access: fail All the code is encrypted, so we cannot reverse engineer the firmware What can we do now? As in network reversing, we will analyze communications (black box) How? By using a logic analyzer to capture communications 2015-10-02 / Hardwear.io 19

Hardware and probe placement Saleae Logic Pro 16 logic analyzer 2015-10-02 / Hardwear.io 20

PCB traces and components pinout 2015-10-02 / Hardwear.io 21

Probe placement 2015-10-02 / Hardwear.io 22

Screenshot 2015-10-02 / Hardwear.io 23

Analyzing flash SPI communications USB-SATA/PIC to flash Placing the 4 probes: simply on flash pins SPI decoding parameters: standard (cf. datasheet) Sampling speed: 50MS/s min, 100MS/s recommended (25MHz quartz) Post-treatment CSV export of decoded SPI data Ruby script to interpret flash commands: Text display Binary dump rebuilding Results PIC never writes to its external flash USB-SATA controller writes data when the PIN is validated 2015-10-02 / Hardwear.io 24

Analyzing SoC PIC communications USB-SATA controller PIC Probes placement: on the SOC flash pins (cf. PCB traces) Sampling speed: 50MS/s min, 100MS/s recommended Protocol: unknown Post-treatment SPI based protocol: Low level decoding with Saleae, then CSV export Application-layer data must be reversed engineered 2015-10-02 / Hardwear.io 25

Custom protocol Reverse engineering Preambles: AA AA AA AA 55 (SoC PIC) and A5 A5 A5 5A (PIC SoC) Type, Length, Value Frames are numbered and acknowledged Unknown 16bits checksum = Ruby script to decode data from the CSV produced by Saleae Decoded example: PIN request 0.00000000 SoC->PIC T: 0x33, ID: 0x14 01,01,10,01 0.00003861 PIC->SoC RESP: 0x14 06,00,01,00,09,4d,01,cb, 0e,00,00,00,89,0f,3a,7a 2015-10-02 / Hardwear.io 26

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

Summary: communication sequence 2015-10-02 / Hardwear.io 27

And now? Remaining questions Can we do a hardware bruteforcer? (PIC+Keyboard emulator) No, because the hash algorithm is unknown What is inside the block at 0x1000 in the SoC flash? Flash block at 0x1000 Properties: Written when: Enabling encryption Entering a valid PIN Erased when encryption is disabled Contains 3 different blocks of data of high entropy: 1. 512 bits, AES-256-XTS key 1, encrypted? 2. 512 bits, AES-256-XTS key 2, encrypted? 3. SHA256 of previous data (1 and 2) 2015-10-02 / Hardwear.io 28

Designing an attack Hypothesis The block at 0x1000 seems to contain AES-XTS encryption keys, in an encrypted or obfuscated form Implications? Can we use this block to mount an attack? The idea Assuming the block at 0x1000 contains decryption keys: We will try to keep the one of the target drive intact, in the flash... while validating the PIN against a chosen blob, stored on the HDD 2015-10-02 / Hardwear.io 29

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

Theoretical steps 2015-10-02 / Hardwear.io 30

In practice First fail The flash status register is reset to 0 during startup Attack, second version The flash is put in read only after startup: 1. Connect the enclosure 2. Unplug flash 3. Put it in read only using GoodFET 4. Plug it back 5. Continue the attack: enter the known PIN Final result Fail. PIN code is not valid (Not match on screen) = There s probably an unidentified check 2015-10-02 / Hardwear.io 31

Final attack: demo 2015-10-02 / Hardwear.io 32

Conclusion Encrypted data security The whole security relies on: The security of the blob at the end of the disk The security of the block at 0x1000 in the flash = Everything relies on the fact that the Fujitsu firmware is secret iodd s feedback (original board dev) Firmware evolution (version 077): PIN hash is now non-deterministic The rest is not fixable: Customer support choice: data can survive broken enclosure Opaque handling of the blob at the end of the HDD: binary code provided by Fujitsu 2015-10-02 / Hardwear.io 33

Conclusion: going further Access the code of the USB-SATA controller Find a JTAG? (unlikely) The firmware encryption is the same on all chips: Buy the SDK? (probable NDA) Find someone generous ;) Emulate the SoC SPI flash Allows subtle modifications of block 0x1000 Try blind ARM code modifications Dump PIC32 code Use semi-invasive attack to reset protection fuse = Hardware bruteforcer by emulating the whole keyboard/screen part 2015-10-02 / Hardwear.io 34

End Questions? 2015-10-02 / Hardwear.io 35

References [1] http://support.ironkey.com/article/aa-02513/ [2] http://www.h-online.com/security/features/ USB-stick-with-PIN-code-746169.html [3] https://www.exploit-db.com/papers/15424/ [4] http://hardwear.io/speakers-kison-alendal/ [5] https://github.com/davidcarne/pcbre [6] http://sigrok.org/wiki/main_page [7] http://support.saleae.com/hc/en-us/articles/200672010 2015-10-02 / Hardwear.io 36

Blob comparison 2015-10-02 / Hardwear.io 37

Firmware comparison: Zalman vs PS4 2015-10-02 / Hardwear.io 38