SlideShare a Scribd company logo
Controlling USB Flash Drive
Controllers:
Exposé of hidden features
Richard Harman
Shmoocon 2014
Richard Harman
●

InfoSec Analyst for ~10 years

●

Lead Intrusion Analyst at SRA SOC
–

Malware analysis

–

Perl scripting

–

Incident Response & all around SysAdmin-fu

@xabean

warewolf

Richard@RichardHarman.com
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Hacking USB thumb drives
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
#B
ad
BI
OS
#BadBIOS ... features ?
1) Spread via USB flash drives
2) Infect USB flash drive firmware
3) Infect host firmware
4) Cross-platform
5) Cross-operating system
6) IPv6 networking
7) Audio-based communication for bridging air-gaps
What?
Overview
●

USB mass storage hardware

●

Hardware Disassembly

●

Block-level Components

●

●

Flash Controller Identification & Their
Features
Reprogramming Flash Controllers
USB Mass Storage
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Data, Power, controller board,
IDE HDD
2.5”, SATA, controller board
USB3 flash drive
USB HDD
basic components
USB SATA HDD
Controller/Power board
●

Host Interface

●

Power
USB SATA HDD
Controller/Power board
●

Host Interface

●

Power
USB SATA HDD
Controller/Power board
●

USB differential signaling pins
USB SATA HDD
Controller/Power board
●

Device Interface

●

Bridge/Controller
USB SATA HDD
Controller/Power board
●

SATA differential signaling pins (2 pair)
USB SATA HDD
Controller/Power board
●

Device Interface

●

Bridge/Controller
Controller/Bridge
HDD v.s. Flash
●

HDD (Bridge)
–
–

●

USB → HDD protocol translation
Generic firmware - host sees what is connected

Flash (Controller)
–

Logical mapping LBAs to Flash Memory

–

Controller can be reprogrammed!

–

Host sees what the controller wants!!
Controlling USB Flash Drive Controllers: Expose of Hidden Features
USB Flash Drive
PCB
Basic Components of Flash drives
●

Controller ASIC

●

Flash Memory
Basic Components of Flash drives
●

Controller ASIC

●

Flash Memory
USB Mass Storage
●

Signaling: Differential Voltage

●

Speed: 6MHz, 12MHz, 24MHz, 2.5GHz (SS)

●

●

Bridge/Controller chip translates USB to
storage device
No direct translation from USB-MS
protocol to SATA/IDE protocol or Flash
Chips
USB Mass Storage == SCSI
●

●

●

●

USB-MS is encapsulated SCSI
Subset of SCSI commands, based on
peripheral type
Encapsulation can cause trouble (smartmon,
smartctl, etc)
Generally one SCSI target, one or more
Logical Units (LUNs)
USB signaling
Differential Signaling
Phison Security Tool
Low-Level Sniffing USB
●

Logic Analyzer
–
–

Too much detail

–
●

Low level
No protocol-in-protocol decoding

Hardware MITM device
–

Low level

–

See Dominic's talk tomorrow
Saleae Logic8
●

USB2 based logic analyzer

●

v1.1.18 beta software supports USB

●

USB2 sniffing a USB2 device? Inconceivable!
–

Use a USB1 hub to slow down target.

–

Vampire tap lines
Sniffing rig
(USB extension cable)
Sniffing rig
Results! … no context though
High-Level Sniffing USB
●

USBPcap (self-snoop) + Wireshark
–

●

Virtualization dumping USB
–

●

Windows, High level, can/will miss data
Full & complete dump

Linux usbmon → tcpdump -i usbmon2
–

Lots of tools to inspect

–

Wireshark!
●

USB decoding, USB-MS decoding
Sniffing USB
Virtualization + usbmon dumping USB
Re-implementing USB Flash
Drive Security Features Under Linux
●

Disable LUN Protection:
# echo -n password | sg_raw -s 8 /dev/sg3 
0E 00 01 55 AA 00

●

Unlock LUN:
# echo -n password | sg_raw -s 8 /dev/sg3 
0E 00 00 00 00 00
Re-implementing USB Flash
Drive Security Features Under Linux
●

Change Password / Lock LUN:
# perl -e 'print pack("a16 a16 a32",
"old pass", "new pass", "pw hint")' | 
sg_raw -v -s 64 /dev/sg3 0E 06 01 00 00 00
UP21 Flash Controller
UP21 Flash Controller
Consumer Flash
Drive Vendors
●

SanDisk

●

Patriot

●

Kingston Digital

●

ADATA

●

Lexar

●

Silicon Power

●

PNY

●

Transcend

●

HP

●

Verbatim

●

Sony

●

Toshiba

●

TDK

●

Lenovo
OEM Flash
Controller Vendors
●

Phison

●

Ameco

●

ALCOR

●

ChipsBank

●

Innostor

●

Efortune

●

Skymedi

●

Icreate

●

Silicon Micro

●

Netac

●

Solid State System

●

OTI

●

USBest

●

Prolific
Who uses what?

?
Silicon Motion (SMI)

x1
Alcor

Phison

x1

x1

Consumer
Vendor
Innostor

x1

Skymedi

x1
x1
Solid State System (SSS)
Silicon Motion (SMI)
Alcor

Phison

x1

Verbatim
Skymedi

Innostor

Solid State System (SSS)
Silicon Motion (SMI)
Alcor

Phison

x2

Intel
Skymedi

Innostor

Solid State System (SSS)
Silicon Motion (SMI)
Alcor

Phison

x3

TDK
Skymedi

Innostor

Solid State System (SSS)
Silicon Motion (SMI)
Alcor

Phison

x1

x3

Lenovo
Skymedi

Innostor

Solid State System (SSS)
Silicon Motion (SMI)

x1
Alcor

Phison

x1

x3

Sony
Skymedi

Innostor

Solid State System (SSS)
Silicon Motion (SMI)

x2
Alcor

Phison

x1

x3

Corsair
Skymedi

Innostor

Solid State System (SSS)
Silicon Motion (SMI)

x2
Alcor

Phison

x1

x3

Toshiba
Skymedi

Innostor

x1
Solid State System (SSS)
Silicon Motion (SMI)

x3
Alcor

Phison

x2

x3

Trend Micro
Skymedi

Innostor

x1

x1
Solid State System (SSS)
Silicon Motion (SMI)

x4
Phison

Alcor

x2

x3

ADATA
Skymedi

Innostor

x2

x1
Solid State System (SSS)
Silicon Motion (SMI)
Phison

x5

Alcor

x3

x4

Silicon Power
Skymedi

Innostor

x3

x1
Solid State System (SSS)
Silicon Motion (SMI)
Phison

x6

Alcor

x4

x5

Kingston
Skymedi

Innostor

x4

x1
x2
Solid State System (SSS)
Flash drive lineup
●

All purchased at Micro Center

●

Tried to get as different as possible ........
Which controller?

?
Which controller brand?

?
Phison

Phison

SMI

USBest

Phison

Phison

Phison

SMI

Innostor

Which controller brand?
Flash Lineup: Controller Chips
Count

Brand

Chip

1

Innostor

IS916E

2

Phison

PS2251-61

1

Phison

PS2261-68

1

Phison

PS2251-03

1

Phison

PS2251-67

2

Silicon Motion SM3257ENLT
Microcenter 4G USB2
●

4G @ $5

●

Phison PS2251-61
–

Supports multiple LUNs

–

Supports hidden LUNs

–

Supports PW protected LUNs
Centeon
Jezebel Licorice
●

8GB @ $8

●

SMI SM3257ENLT
–

Supports multiple LUNs

–

Supports hidden LUNs

–

Supports PW protected LUNs
Centeon
Secure
●

8GB @ $17

●

Phison 2251-61
–

Supports multiple LUNs

–

Supports hidden LUNs

–

Supports PW protected LUNs

●

No HW Crypto support

●

Contains LUN w/ crypto SW
Which would you buy?
●

8GB @ $8 Centeon Jezebel Licorice
–

All the Flash controller features

–

Use FREE PGP or Truecrypt

OR
●

8GB @ $17 Centeon Secure
–

2x as expensive

–

No additional benefits
Monolithic USB Close-Ups
Controlling USB Flash Drive Controllers: Expose of Hidden Features
http://www.bunniestudios.com

@BunnieStudios
http://www.bunniestudios.com

@BunnieStudios
http://www.bunniestudios.com

@BunnieStudios

Monolithic v.s. PCB
http://www.bunniestudios.com

@BunnieStudios

Monolithic v.s. PCB
Monolithic v.s. PCB
(to scale)
Visual Flash Controller
ASIC Identification
●

●

Destroys/mangles device housing
Consumer packaging never mentions
controllers

●

OEMS use anything (Kingston)

●

Monolithic drives are epoxied

●

I don't have nitric acid + fume hood.
Software Flash Controller
ASIC Identification
●

OS sees what the ASIC wants it to

●

USB PID:VID is supposed to be useful

●

lsusb & friends are useless

●

Need to talk to the ASIC directly

●

No OS tools to talk to ASIC

●

What software?
ChipEasy
ChipEasy
Picking on Phison
●

●

Taiwan based Flash controller ASIC
manufacturer
Controller interfaces: USB 1/2/3, SATA, IDE,
eMMC, SD & more

●

Core CPU: Intel 8051 (on-die)

●

Hardware AES-256 (in some controllers)

●

Multiple device “modes”
Flash ASIC-based Crypto...
1) Flash controllers do wear-leveling
2) Encryption key may be held in the ASIC,
initially set during ASIC programming
3) LUNs (drives) can be hidden, locked w/
password AND encrypted
4) Flash drives have more space than you know

This is a forensics NIGHTMARE
PS2251 Series Flash Modes
(Logical Units)
Mode #

LUN0

(common) 3

HDD

7

HDD

HDD*

8

HDD*‡

HDD‡

HDD

HDD

(common) 21

CD

HDD

30

CD

31

CD

HDD*

32

CD

CD

14

LUN1

* LUN invisible until unlocked w/ app
‡ Only one LUN visible at a time

LUN2

CDROM

HDD
No more U3 drives!
●

●

Mode 21 is “U3” like
U3 drives are dead as of 2009 thanks to
Microsoft & SanDisk
–
–

●

Superseded by “StartKey”
Appears to be related to “Windows 2 Go”

Flash drives you already have most likely
support mode 21.
PS2251 Block Diagram
Hello, Intel 8051
Bunnie & xobs @ 30C3
“SD Card Hacking”
●

●

●

Re-purposing 8051 MCU inside SD cards
Arbitrary code execution on controller in SD
Cards
Most likely will work with these flash drives
too, similar controllers

●

RE'd a controller, wrote a debugger!

●

8051 is an “IP” core – it's EVERYWHERE
MOOSEDRIVES
(NOT FOR SALE, SORRY)

4GB Flash
$5 Microcenter Brand
Phison 2251-61
SECRETMOOSE
Features:
●

USB PID:VID 1337:1337

●

4GB Public partition
–

●

Containing windows unlock app

1-3G Secure (hidden) partition (recovered space)
–

Password protected, unlock w/ Windows app

–

5 guesses, 6th failed attempt erases device .. or not.
●

Windows app appears to do wiping
PORTABLEMOOSE
Features:
●

Fedora 19 LiveCD image
–
–

Reset Persistent storage

–
●

Bootloader Modified for persistent overlay
Non-persistent boot

3G overlay storage
Not just portable apps, an entire portable OS.
REDMOOSE
Features:
●

32bit Kali Linux CDROM image

●

1.5G storage
Which is for you?
●

ISOSTICK
–

●

CDEMU
–

●

$99, uSD (up to 64g), “isosel” boot loader
Open source project, still in development

Regular thumb drives
–

$0 - $??

–

A little of your time + varying levels of “fun”
(Re)programming Phison Controllers
●

Foolproof/Easy Mode:
–
–

●

Mode Converter
Switch between different modes easy

Dangerous/Advanced:
–

MPAll

–

GetInfo utility bundled (more info than ChipEasy)

–

Change firmware, partitioning, USB identification,
password lock, enable crypto (if supported)
Phison ModeConverter
Phison MPAll
MPAll Partitioning (LUNs)
Controlling USB Flash Drive Controllers: Expose of Hidden Features
Configurable Settings
●

Drive Size

●

Set LUNs R/O

●

Multi-LUN

●

LUN PW Protect

●

Device IDs & Strings

●

Turn LED on/off

●

Emulate CDROMs

●

Memory voltages

●

Serial Number

●

Reformat (recover)

●

# of ECC bits

●

Memory Timing
Phison MPAll Troubleshooting
●

Use ChipEasy Flash ID to help

●

Try the latest version of MPAll

●

Be prepared to brick drives! (until you learn)

●

Find Controller Firmware updates

●

●

IDBLK_TIMING.dll updates – Updated Flash ID
& Timing params
Tripple check Flash ID & Timings are correct
Controlling USB Flash Drive Controllers: Expose of Hidden Features
UnRAID, by Lime Technology
●

Slackware based commercial NAS solution

●

Different Tiers for supported # of HDD:
–

●

Cost per Server:
–

●

Free: <= 3, Plus: <= 7, Pro: <= 24
Free: $0, Plus: $69, Pro: $119

Licensing Method:
–

27 character USB Flash drive GUID
Not so globally unique
lime-technology.com/registration-keys/
●

Example GUID:
–
–

●

058F-6387-0000-0000B65F1E82
This was an Alcor Flash Drive s/n: B65F1E82

www.linux-usb.org/usb.ids
–

VID 058F: Alcor Micro Corp

–

PID 6387: Flash Drive
Cloning an unRAID
Registration Key
1) Set USB VID and PID to match
2) Set Serial number to match
3) Win!

Please use a real hardware security
token like the Aladdin HASP.
Looking for a HW USB Sniffer?
●

See Dominic's Talk tomorrow:
–

●

An Open and Affordable USB Man in the Middle
device

No public documentation on programming flash
controllers

●

Windows + USBpcap + Wireshark insufficient :(

●

No Linux support
–

usb_modeswitch has no idea about these controllers
Similar Work / Research
●

2013: Bunnie & xobs
–

30C3 – SD Card Hacking
http://www.bunniestudios.com/blog/?p=3554

●

2013: Bunnie
–

Where USB memory sticks are born
http://www.bunniestudios.com/blog/?p=2946

●

2011: Wesley McGrew @McGRewSecurity
–

Hacking U3 drives
http://mcgrewsecurity.com/pub/hackingu3
Similar Work / Research
●

2010: Digital Forensics Research Center – Korea
–

●

Secure USB Bypassing Tool
http://www.dfrws.org/2010/proceedings/bang.pdf

2010: SySS
–
–

●

PW protected flash drives unlocked w/ single command
http://www.darkreading.com/security/news/222200174

2008: Russel Butturini / TCSTool
–

Incident Response U3 Switchblade
Links & Contact
ChipEasy: Google “Chipeasy English”

flashboot.ru
usbdev.ru
usb-fix.blogspot.com
upan.cc

xabean

warewolf

richard@richardharman.com

More Related Content

PPTX
Flash Memory
PDF
Creating Your Own PCI Express System Using FPGAs: Embedded World 2010
PDF
Introduction to 8085 Microprocessors
PPT
8085 microprocessor Embedded system
PPT
Linux memory
PPTX
80386 Architecture
PDF
Brief Introduction to Boltzmann Machine
PPTX
Introduction to AVR Microcontroller
Flash Memory
Creating Your Own PCI Express System Using FPGAs: Embedded World 2010
Introduction to 8085 Microprocessors
8085 microprocessor Embedded system
Linux memory
80386 Architecture
Brief Introduction to Boltzmann Machine
Introduction to AVR Microcontroller

What's hot (20)

PDF
Introduction to Linux Drivers
PDF
Chapter 6 - Introduction to 8085 Instructions
PPTX
Arithmetic Logic Unit .
PPTX
PPT
Semiconductor memory
PDF
Programed I/O Modul..
DOCX
Flag register 8086 assignment
PPT
8051 MICROCONTROLLER
PPT
Pipeline hazards in computer Architecture ppt
PPTX
Spiking neural network: an introduction I
PPTX
Microcontroller
PDF
The ideal and reality of NVDIMM RAS
PPTX
Intel 8051 Programming in C
PDF
BeagleBone Black Booting Process
PPTX
UART Communication
PPTX
MicroProcessors
PPTX
Chipset PowerPointPresentation
PPTX
PCI BUS
PPT
Fpga 11-sequence-detector-fir-iir-filter
PDF
Mini Project on 4 BIT SERIAL MULTIPLIER
Introduction to Linux Drivers
Chapter 6 - Introduction to 8085 Instructions
Arithmetic Logic Unit .
Semiconductor memory
Programed I/O Modul..
Flag register 8086 assignment
8051 MICROCONTROLLER
Pipeline hazards in computer Architecture ppt
Spiking neural network: an introduction I
Microcontroller
The ideal and reality of NVDIMM RAS
Intel 8051 Programming in C
BeagleBone Black Booting Process
UART Communication
MicroProcessors
Chipset PowerPointPresentation
PCI BUS
Fpga 11-sequence-detector-fir-iir-filter
Mini Project on 4 BIT SERIAL MULTIPLIER
Ad

Viewers also liked (20)

PPTX
SanDisk SecureAccess Encryption - Forensic Processing & USB Flashing
PPTX
DerbyCon 2014 - Making BadUSB Work For You
PPTX
USB Powerpoint
PDF
SanDisk SecureAccess Encryption 1.5
PDF
Am I being spied on: Low-tech ways of detecting high-tech surveillance (DEFCO...
PDF
Secret of Intel Management Engine by Igor Skochinsky
ODP
Malware analysis
PDF
How Google Glass Works
PPT
Preventing hard disk firmware manipulation attack and disaster recovery by Da...
PDF
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
PPTX
Powe piont idioms
PPS
USB 3.0 Product Info
PDF
USB Training - Silicon Labs -
PDF
Introduction to c#
PDF
BadUSB, and what you should do about it
PDF
BAD USB 2.0
PPTX
Ordenes del cmd
PPTX
Sistemas operativos
PPTX
Actividad 6.3
PPTX
Ordenes del cmd
SanDisk SecureAccess Encryption - Forensic Processing & USB Flashing
DerbyCon 2014 - Making BadUSB Work For You
USB Powerpoint
SanDisk SecureAccess Encryption 1.5
Am I being spied on: Low-tech ways of detecting high-tech surveillance (DEFCO...
Secret of Intel Management Engine by Igor Skochinsky
Malware analysis
How Google Glass Works
Preventing hard disk firmware manipulation attack and disaster recovery by Da...
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
Powe piont idioms
USB 3.0 Product Info
USB Training - Silicon Labs -
Introduction to c#
BadUSB, and what you should do about it
BAD USB 2.0
Ordenes del cmd
Sistemas operativos
Actividad 6.3
Ordenes del cmd
Ad

Similar to Controlling USB Flash Drive Controllers: Expose of Hidden Features (20)

PDF
Алексей Мисник - USB устройства для пентеста
PPTX
PDF
Gone in a flash v2
PDF
Gone in a flash pdf
PPTX
Flash drives
PDF
Flashcatusb manual
PPTX
Flash drive
PDF
Hardware hacking
PDF
DEF CON 23 - Phil Polstra - one device to pwn them all
PDF
BadUSB — On accessories that turn evil by Karsten Nohl
PPT
PSoC USB HID
PPT
13. Computer Systems Input And Output Architecture
PPTX
Biology of a computer
PDF
Portable storage device management
PPTX
Adventures in USB land
PDF
USB Hacking - LearnDay@Xoxzo #11
PDF
USB Complete Everything You Need to Develop Custom USB Peripherals Third Edit...
PDF
Microcontroller mayhem - ECTF & USSS 2011
PPT
101 1.1 hardware settings
PPTX
Ingles sena b
Алексей Мисник - USB устройства для пентеста
Gone in a flash v2
Gone in a flash pdf
Flash drives
Flashcatusb manual
Flash drive
Hardware hacking
DEF CON 23 - Phil Polstra - one device to pwn them all
BadUSB — On accessories that turn evil by Karsten Nohl
PSoC USB HID
13. Computer Systems Input And Output Architecture
Biology of a computer
Portable storage device management
Adventures in USB land
USB Hacking - LearnDay@Xoxzo #11
USB Complete Everything You Need to Develop Custom USB Peripherals Third Edit...
Microcontroller mayhem - ECTF & USSS 2011
101 1.1 hardware settings
Ingles sena b

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Modernizing your data center with Dell and AMD
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
Teaching material agriculture food technology
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Artificial Intelligence
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
Unlocking AI with Model Context Protocol (MCP)
Modernizing your data center with Dell and AMD
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Understanding_Digital_Forensics_Presentation.pptx

Controlling USB Flash Drive Controllers: Expose of Hidden Features