BadUSB On accessories that turn evil



Similar documents
BadUSB On accessories that turn evil

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 2 Systems Threats and Risks

Windows Operating Systems. Basic Security

That Point of Sale is a PoS

The care and feeding of Pythons at the Redmond Zoo. (Using Micro Python and pyboard with Windows)

Security Technology for Smartphones

Reviving smart card analysis

What the student will need:

Chapter 1 Hardware and Software Introductions of pcduino

Lesson 06: Basics of Software Development (W02D2

Full Drive Encryption Security Problem Definition - Encryption Engine

Building a Penetration Testing Virtual Computer Laboratory

Practice Test for the Domain 1 - PC Hardware (Brought to you by RMRoberts.com)

Advanced Diploma In Hardware, Networking & Server Configuration

Threat Events: Software Attacks (cont.)

Endpoint protection for physical and virtual desktops

CMPT 471 Networking II

An overwhelming majority of IaaS clouds leverage virtualization for their foundation.

13 Ways Through A Firewall

Virtualization Technology

Implementation and Implications of a Stealth Hard-Drive Backdoor

Endpoint protection for physical and virtual desktops

Secure USB Flash Drive. Biometric & Professional Drives

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Leading by Innovation McAfee Endpoint Security The Future of Malware-Detection: Activate protection on all Layers outside the Operating System

VMWARE Introduction ESX Server Architecture and the design of Virtual Machines

Attacking Hypervisors via Firmware and Hardware

Chapter 5 Busses, Ports and Connecting Peripherals

"EZHACK" POPULAR SMART TV DONGLE REMOTE CODE EXECUTION

OpenCPN Garmin Radar Plugin

Minimum Requirements for Cencon 4 with Microsoft R SQL 2008 R2 Express

Electronic Crime Scene Investigation: A Guide for First Responders, Second Edition

The Trivial Cisco IP Phones Compromise

Firmware security features in HP Compaq business notebooks

CITRIX 1Y0-A14 EXAM QUESTIONS & ANSWERS

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

This session was presented by Jim Stickley of TraceSecurity on Wednesday, October 23 rd at the Cyber Security Summit.

Melde- und Analysestelle Informationssicherung MELANI Torpig/Mebroot Reverse Code Engineering (RCE)

Strategies for Firmware Support of Self-Encrypting Drives

Information Security Training. Assignment 1 Networking

McAfee Deep Safe. Security beyond the OS. Kai-Ping Seidenschnur Senior Security Engineer. October 16, 2012

DESIGNING SECURE USB-BASED DONGLES

Program: Systems Engineering Certificate. Prerequisite: None. Hardware/Software required:

Bootloader with AES Encryption

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

Lecture 6: Operating Systems and Utility Programs

Critical Security Controls

CLASS FINAL REPORT UNIVERSITY OF CENTRAL FLORIDA FRONTIERS IN INFORMATION TECHNOLOGY COP 4910

Data Transfer between Two USB Flash SCSI Disks using a Touch Screen

AKIPS Network Monitor Installation, Configuration & Upgrade Guide Version 16. AKIPS Pty Ltd

ViPNet ThinClient 3.3. Quick Start

XTreme Files OS & Data Backup/Restore User Manual Please read the Instruction manual before using the XTreme Files (F Series) 1.

Sistemi ad agenti Principi di programmazione di sistema

STLinux Software development environment

i.mx USB loader A white paper by Tristan Lelong

Minimum Requirements for Cencon 4 with Microsoft R SQL 2008 R2 Standard

Network Projector Operation Guide

Remote PC Guide Series - Volume 1

KASPERSKY SECURITY INTELLIGENCE SERVICES. EXPERT SERVICES.

CS 356 Lecture 25 and 26 Operating System Security. Spring 2013

Nessus Agents. October 2015

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

13 Ways Through A Firewall What you don t know will hurt you

Section 12 MUST BE COMPLETED BY: 4/22

NetPoint Configuration Guide. for thin clients

Exploring Layer 2 Network Security in Virtualized Environments. Ronny L. Bull & Jeanna N. Matthews

Using AORUS Notebook for the First Time

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

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

Low- Cost Chip Microprobing

Windows Phone 8 Security Overview

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

Security+ Guide to Network Security Fundamentals, Fourth Edition. Chapter 10 Authentication and Account Management

Certified Ethical Hacker (CEH)

Matrix 510/520 User Guide

CSE331: Introduction to Networks and Security. Lecture 32 Fall 2004

Vantage RADIUS 50. Quick Start Guide Version 1.0 3/2005

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

Migrating to ESXi: How To

Attack Frameworks and Tools

A DIY Hardware Packet Sniffer

Certified Ethical Hacker Exam Version Comparison. Version Comparison

Check Point and Security Best Practices. December 2013 Presented by David Rawle

New Mexico Broadband Program. Basic Computer Skills. Module 1 Types of Personal Computers Computer Hardware and Software

Wireless Presentation Adaptor User s Manual

Best Practice Document Hints and Tips

5 Steps to Advanced Threat Protection

FAQ for USB Flash Drive

Practical Mac OS X Insecurity. Security Concepts, Problems and Exploits on your Mac

Spyware Analysis. Security Event - April 28, 2004 Page 1

Trusteer Rapport Virtual Implementation Scenarios

Transcription:

BadUSB On accessories that turn evil Karsten Nohl <nohl@srlabs.de> Sascha Krißler <sascha@srlabs.de> Jakob Lell <jakob@srlabs.de> SRLabs Template v12

Demo 1 USB s&ck takes over Windows machine 2

Agenda USB background Reprogramming peripherals BadUSB alack scenarios BadUSB exposure Defenses and next steps 3

USB devices are recognized using several idenpfiers USB devices Connectors + hubs Host Root hub Iden&fier Interface class End points Serial number (opponal) Examples USB thumb drive 8 Mass Storage 0 Control 1 Data transfers AA627090820000000702 Webcam a. 1 Audio b. 14 Video 0 Control 1 Video transfers 6 Audio transfers 7 Video interrupts 0258A350 4

USB devices are inipalized in several steps USB device USB plug- and- play Devices can have several iden&&es Power- on + Firmware init Register Set address Send descriptor Set configurapon Normal operapon OpPonal: deregister Load driver A device indicates its capabilipes through a descriptor A device can have several descriptors if it supports mulpple device classes; like webcam + microphone Register again Load another driver Device can deregister and register again as a different device 5

USB devices include a micro- controller, hidden from the user USB controller Flash 8051 CPU Bootloader Controller firmware Mass storage The only part visible to the user 6

Agenda USB background Reprogramming peripherals BadUSB alack scenarios BadUSB exposure Defenses and next steps 7

Reversing and patching USB firmware took 2 months A Document firmware B C Reverse- engineer firmware update process Patch firmware 1. Find leaked firmware and flash tool on the net 2. Sniff update communicapon using Wireshark 3. Replay custom SCSI commands used for updates 4. (Reset bricked devices through short- circuipng Flash pins) 1. Load into disassembler (complicapon: MMU- like memory banking) 2. Apply heurispcs: Count how olen funcpon starts match up with funcpon calls for different memory locapon guesses; the most matches indicate that you guessed right Find known USB bit fields such as descriptors 3. Apply standard solware reversing to find hooking points 1. Add hooks to firmware to add/change funcponality 2. Custom linker script compiles C and assembly code and injects it into unused areas of original firmware Other possible targets We focused on USB spcks, but the same approach should work for: External HDDs Webcams, keyboards Probably many more 8

Agenda USB background Reprogramming peripherals BadUSB akack scenarios BadUSB exposure Defenses and next steps 9

Demo 2 Windows infects USB s&ck which then takes over Linux machine 10

Keyboard emulapon is enough for infecpon and privilege escalapon (w/o need for solware vulnerability) Challenge Linux malware runs with limited user privileges, but needs root privileges to infect further spcks Approach Steal sudo password in screensaver Restart screensaver (or policykit) with password stealer added via an LD_PRELOAD library User enters password to unlock screen Malware intercepts password and gains root privileges using sudo 11

Demo 3 Android phone changes DNS sepngs in Windows 12

Network traffic can also be diverted by DHCP on USB DNS assignment in DHCP over spoofed USB- Ethernet adapter All DNS queries go to alacker s DNS server AKack steps 1. USB spck spoofs Ethernet adapter 2. Replies to DHCP query with DNS server on the Internet, but without default gateway Result 3. Internet traffic is spll routed through the normal Wi- Fi connecpon 4. However, DNS queries are sent to the USB- supplied server, enabling redirecpon alacks 13

Can I charge my phone on your laptop? Android phones are the simplest USB alack plaworm DHCP overrides default gateway over USB- Ethernet Computer sends all Internet traffic through phone Prepara&on Android comes with an Ethernet- over- USB emulapon needing lille configurapon AKack Phone supplies default route over USB, effecpvely interceppng all Internet traffic Proof- of- concept released at: srlabs.de/badusb Hacked by the second factor? Using keyboard emulapon, a virus- infected smartphone could hack into the USB- connected computer. This compromises the second factor security model of online banking. 14

Bonus: Virtual Machine break- out 1. VM tenant reprograms USB device (e.g., using SCSI commands) Malicious VM Host 2. USB peripherals spawns a second device that gets connected to the VM host 3. USB device spoofs key strokes, changes DNS, 15

Boot- sector virus, USB style Fingerprint OS/BIOS. Patched USB spck firmware can dispnguish Win, Mac, Linux, and the BIOS based on their USB behavior Hide rootkit from OS/AV. When an OS accesses the spck, only the USB content is shown Infect machine when boo&ng. When the BIOS accesses the spck, a secret Linux is shown, boopng a root kit, infecpng the machine, and then boopng from hard disk USB content, for example Linux install image Secret Linux image 16

Demo 4 USB thumb drive emulates keyboard and second drive to infect computer during boot 17

Family of possible USB alacks is large More akack ideas Effect AKacks shown Emulate keyboard Spoof network card USB boot- sector virus Hide data on s&ck or HDD Rewrite data in- flight Update PC BIOS Spoof display External storage can choose to hide files instead of delepng them Viruses can be added to files added to storage First access by virus scanner sees original file, later access sees virus Emulate a keyboard during boot and install a new BIOS from a file in a secret storage area on a USB spck Emulate a USB display to access security informapon such as Captchas and randomly arranged PIN pads 18

Agenda USB background Reprogramming peripherals BadUSB alack scenarios BadUSB exposure Defenses and next steps 19

We analyzed the possible reach of BadUSB from two perspecpves Top- down analysis Start from largest USB controller vendors Find their chip families for popular use cases Analyze datasheets and web sites for whether chips can be reprogrammed 5 device classes: Host, Hub, Charger, Storage, Peripheral From top 8 chip vendors Totaling 52 chip families (not every vendor serves each class) BoKom- up analysis Start from actual hardware Open device to find which chips are used Determine whether bootloader and firmware storage (e.g. SPI flash) are available Try to find firmware update tools for their chips Analyzed 33 devices from six device classes: Hub, Input/HID, Webcam, SD adapter, SATA adapter Results released at opensource.srlabs.de 20

Both analyses suggest that up to half of USB chips are BadUSB- vulnerable Top- down analysis Probably vulnerable Top- down: Perhaps vulnerable, depends on design / configurapon; BoLom- up: more research needed Unlikely vulnerable BoKom- up analysis Host 4 1 Hub 4 4 4 3 5 Charger 1 4 Storage 6 2 5 3 4 Peripheral 4 8 5 Input 2 2 Webcam 1 1 SD adapter 4 4 SATA adapter 1 3 21

Small hardware design differences can determine BadUSB- vulnerability These USB hubs both contain the same controller chip Only one of them also contains an SPI flash that can store BadUSB modificapons 22

Recent trends suggest that BabUSB- exposure is further growing Trend 1 Newer and more complex devices are more vulnerable Trend 2 Chips become more versa&le, and thereby more vulnerable Trend 3 Most controllers that can be programmed are vulnerable Insight Some device types appear more reprogrammable / BadUSB- vulnerable: The early devices of a new standard (e.g. the first available USB 3 devices) Peripherals with special funcponality (e.g. SATA adapter that can copy disks) High- end peripherals Custom- tailored chips in high- volume devices were tradiponally less likely to be reprogrammable; probably because mask ROMs are cheaper than Flash Many such use cases are increasingly served with reprogrammable mulp- purpose chips, that realize economies of scale by combining applicapons USB controllers found not to be reprogrammable were missing an essenpal component for upgrades, such as bootloader or Flash to store the update All those controllers that bring the essenpals seem to be upgradable ProtecPon from malicious updates is very rare: Only one (large) chip family brings fuse bits; none implement firmware signing 23

Agenda USB background Reprogramming peripherals BadUSB alack scenarios BadUSB exposure Defenses and next steps 24

No effecpve defenses from USB alacks exist Protec&on idea Whitelist USB devices Block cri&cal device classes, block USB completely Scan peripheral firmware for malware Use code signing for firmware updates Disable firmware updates in hardware Limita&on USB devices do not always have a unique serial number OS s don t (yet) have whitelist mechanisms Obvious usability impact Very basic device classes can be used for abuse; not much is lel of USB when these are blocked The firmware of a USB device can typically only be read back with the help of that firmware (if at all): A malicious firmware can spoof a legipmate one ImplementaPon errors may spll allow installing unauthorized firmware upgrades Secure cryptography is hard to implement on small microcontrollers Billions of exispng devices stay vulnerable Simple and effec&ve (but mostly limited to new devices) 25

Responsibility for BadUSB mipgapon is unclear No response from chip vendors No response from peripheral vendors No OS vendor response Fixes are not yet in sight Phison, the mostly discussed vendor, notes that they are already offering beler chips. Their customers don t seem to chose them olen Other affected vendors have stayed quiet No affected vendor offers patches or a threat advisory OS implementers do not appear to work on solupon; with one exceppon: FreeBSD adds an oppon to switch off USB enumerapon BadUSB malware vs. becomes more realis&c Sample exploit code for Phison USB 3 controllers was released by Adam Caudill and Brandon Wilson at Derbycon in September Only mipgapon alempts right now are quick fixes such as GData s Keyboard Guard 26

USB peripherals can also be re- programmed for construcpve purposes Idea 1 Speed up database queries Data can be parsed on the spck before (or instead of) sending it back to the host Our original mopvapon was to speed up of A5/1 rainbow table lookups Idea 2 Repurpose cheap controller chips Use the reprogrammable chips for other applicapons than USB storage The flowswitch / phison project, for example, aims for a low- cost USB 3 interface for FPGAs 27

Take aways USB peripherals provide for a versaple infec&on path Once infected through USB or otherwise malware can use peripherals as a hiding place, hindering system clean- up As long as USB controllers are re- programmable, USB peripherals should not be shared with others QuesPons? usb@srlabs.de 28

The USB microcontroller market is split among many vendors Wired USB Market Share (2012 Cypress Shareholders MeePng) Others 26% Scope of top- down analysis Microchip (SMSC) 10% Cypress 8% PLX 1% Via Labs 1% Alcor 7% Fresco 1% Displaylink 2% Silicon Labs 3% Exar 2% Silicon MoPon 3% TI 3% JMicron 3% ST- E 4% FTDI 4% Phison 5% Renesas 6% Genesys 5% ASMedia 5% Source: goo.gl/ntn0cf 29