MAKE WI-FI HACKING ON SMARTPHONES GREAT AGAIN! Daniel Wegemer and Matthias Schulz

Similar documents
Eight ou two eleven. Dynamic inspec5on of Broadcom Wi- Fi cards on mobile devices. Ma5as Eissler HITBAMS2015

Complexity. An introduction to protocol chaos. Andrés Blanco. CC License - Swtiruty Rgbytw

How to hack WiFi with Android

Secure Mobile Networking Lab Exercise / Project

Black Box Debugging of Embedded Systems

In-Memory Fuzzing in JAVA

RESEARCHING MARVELL AVASTAR WI-FI: FROM ZERO KNOWLEDGE TO OVER-THE- AIR ZERO-TOUCH RCE. Denis Selianin

Computer Networks Security: intro. CS Computer Systems Security

Cortex-M3/M4 Software Development

General Pr0ken File System

HITB Amsterdam

Tutorial: Simple WEP Crack

Day 1: Wi-Fi Technology Overview

Building a reference IoT product with Zephyr. Ricardo Salveti Michael Scott Tyler Baker

IMPORTANT: PLEASE READ THESE INSTRUCTIONS COMPLETELY BEFORE PROCEEDING WITH THIS BETA UPGRADE

Exploring Qualcomm Baseband via ModKit. Tencent Blade Team Tencent Security Platform Department

Lecture #2 January 30, 2004 The 6502 Architecture

Abusing Calypso phones

ECE 598 Advanced Operating Systems Lecture 4

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

SharkFest 16 Europe. Troubleshooting with Monitoring Mode Finding Patterns in your pcaps

Software-Defined Networking (Continued)

Fixing/Making Holes in Binaries

Hacking Encrypted Wireless Network

Malware

Practical Malware Analysis

INFLUENTIAL OPERATING SYSTEM RESEARCH: SECURITY MECHANISMS AND HOW TO USE THEM CARSTEN WEINHOLD

Chapter 1 Getting Started

CEIBO FE-5122 Development System

Introduction to RISC-V

Figure 1 Common Sub Expression Optimization Example

Bluetooth Smart: The Good, The Bad, The Ugly... and The Fix

An Amazing Journey into the depth of my Hard Drive. Jonas Zaddach

SEG-X3 Smart Gateway. Quick Start Guide

Aircrack-ng python bindings Documentation

Multi ARCH Firmware Emulation

ECE 598 Advanced Operating Systems Lecture 12

19: Networking. Networking Hardware. Mark Handley

Welcome to Fetch. Welcome 3. Connect Fetch to your home Wi-Fi 4. Tips to improve Wi-Fi in your home 8. Can t connect to Wi-Fi 10

CEIBO FE-5131A Development System

Control Flow Integrity

JerryScript An ultra-lightweight JavaScript engine for the Internet of Things

Hello? It s Me, Your Not So Smart Device. We Need to Talk.

Wireless Troubleshooting Tips using AirPcaps: DFS & Module Debugging. Megumi Takeshita ikeriri network service co.,ltd 1

PRESENTED BY: SANTOSH SANGUMANI & SHARAN NARANG

64 bit Bare Metal Programming on RPI-3. Tristan Gingold

Walking is Good for the Health of Your Wi-Fi. Jussi Kiviniemi Ekahau

Linkus User Guide. Android Edition 1.2.6

DS-XA In-Circuit Emulator

How do I setup a Raspberry Pi?

1.1 For Fun and Profit. 1.2 Common Techniques. My Preferred Techniques

Once in BT3, click the tiny black box in the lower left corner to load up a "Konsole" window. Now we must prep your wireless card.

Lecture 4 Processes. Dynamic Analysis. GDB

L2 - C language for Embedded MCUs

ECS 153 Discussion Section. April 6, 2015

BECOMING MORE EFFECTIVE WITH THE ANDROID EMULATOR

ECE 471 Embedded Systems Lecture 15

WHY APPLICATIONS ARE STILL DRAINING OUR BATTERIES and how we can help. Aaron Schulman & Sachin Katti

Practical MU-MIMO User Selection on ac Commodity Networks

5 Steps Wifi Hacking Cracking WPA2 Password

Melon S3 FPGA Development Board Product Datasheet

PGT302 Embedded Software Technology. PGT302 Embedded Software Technology

Embedded Systems Programming - PA8001

The Road to CCSv4. Status Update

Preventing wireless deauthentication attacks over Networks

Networking. Robotics is networking. Liam Paull, co-inventor of Duckietown and professor at University of Montreal

Setup Error Code 404 Spotify Won't

DuraFon 1X Quick Reference Sheet

ECE4110 Internetwork Programming. Introduction and Overview

Digital Design and Computer Architecture

Hacking Windows CE.

Geolocating with ESP8266

Wi-Fi Advanced Stealth

ECE 3210 Laboratory 1: Develop an Assembly Program

Adafruit Feather nrf52840 Express

Dissecting the Teddy Ruxpin: Reverse Engineering the Smart Bear.

WHITE PAPER AX WAIT, DID WE JUST BUILD A WIRELESS SWITCH?

Introduction to Linux-wpan and Potential Collaboration. Stefan Schmidt Samsung Open Source Group

ARM mbed with us Debugging and Tracing

Embedded/Connected Device Secure Coding. 4-Day Course Syllabus

HOW TO INTEGRATE NFC FRONTENDS IN LINUX

Reversing with Radare2.

Exam : SCNS_EN. Title : SCNS SCNS Tactical Perimeter Defense. Version : Demo

64-bit ARM Unikernels on ukvm

Copyright 2017 Samsung. All Rights Reserved. O-Hoon Kwon, Ph.D. Samsung Electronics

Load Position-Independent Code (PIC) on a Kinetis Platform Using the IAR EWARM Compiler

Tutorial. How to use Keil µvision with Spansion templates Spansion Inc.

Network concepts introduction & wireshark. workshop

U.S. Government Configuration Baseline (USGCB) 2011 Wayne M Burke Sequrit CSi All rights reserved

Wind River. All Rights Reserved.

Lab Assignment for Chapter 1

Reverse Engineering Malware Dynamic Analysis of Binary Malware II

MobileFindr: Function Similarity Identification for Reversing Mobile Binaries. Yibin Liao, Ruoyan Cai, Guodong Zhu, Yue Yin, Kang Li

ARINC 664 / AFDX EDE support. MX-Foundation 4 API MAXIM AIR GUI TECHNOLOGIES. Version 2.1

CEIBO FE-51RD2 Development System

DuraFon SIP Quick Reference Sheet TIPS

CSE 509: Computer Security

WIND RIVER DIAB COMPILER

SOSCON 2016 JerryScript

Wi-Fi Advanced Stealth BlackHat US, Las Vegas August 2-3, 2006

Transcription:

MAKE WI-FI HACKING ON SMARTPHONES GREAT AGAIN! 1

Overview 1.Monitor Mode 1.Motivation 2.Code Extraction and Examination 3.Patching Framework 4.Demo 2.Native Monitor Mode 3.Related Projects 4.Future Work 2

Motivation: Monitor Mode 3

Motivation: Monitor Mode on Smartphones Receive arbitrary frames (incl. mgmt + ctl frames) Receive frames form all stations (promiscuous mode) Inject custom packets Run legacy tools like the aircrack-ng suite 4

Motivation: Driver Modifications It's open source, right? 5

Motivation: Wi-Fi Chip Types SoftMAC: MAC Layer handled in the driver FullMAC: MAC Layer handled in the Wi-Fi chip 6

Motivation: FullMAC vs SoftMAC From the firmware point of view: Full MAC Soft MAC Firmware needs to be modified! 7

Motivation: Prior Projects BCMON MONMOB But: Source: ifixit.com No source code No new hardware supported Source: ifixit.com Source: bcmon.blogspot.com 8

Motivation: Nexus 5 Wi-Fi Chip Google Nexus 5 Also a Broadcom chip: bcm4339 Supports 802.11n + ac (incl. 5GHz) Capable of 40 and 80MHz wide channels Only 1 antenna (1x1 MIMO) 9

Code Extraction: Firmware file Firmware file in Android file system /system/vendor/firmware/fw_bcmdhd.bin Hmmm... Lets load it into IDA Pro! But where? 10

Code Extraction: RAM location Problem: 0x0 Branch (jump) commands are relative: Code 1 Destination = Current Location + Offset => Code offset is important!...??? Code 2 11

Code Extraction: ROM offset The driver must know! 01001110 01000101 01011000 01001101 01001111 01001110 fw_file.bin Driver Source: http://lxr.freeelectrons.com/source/drivers/net/wireless/brcm80211/brcmfmac/chip.c? v=4.4#l670 12

Code Extraction: Missing Code >3000 unknown jump destinations We are missing some code! 13

Motivation: FullMAC vs SoftMAC On the Nexus 5 Wi-Fi chip: 14

Code Extraction: ROM Multiple possible ways: ROM 1.Via the Driver: membytes() function 2.No ROM access? Copy ROM to RAM first, then use membytes()... Copy RAM 15

Code Extraction: FW Structure Bare metal (but with heap and stack) Printf() => built-in console! Wrapper functions: Use Pointer Table at the beginning of the RAM Points to functions in ROM Thereby, calls to ROM functions can be modified via the Pointers in the RAM! 16

Code Extraction: Problems Lots of code No function names No variable names Looks ugly, even decompiled 17

Code Examination: Some tips Search for strings: Debug output via printf() e.g.: printf("wlc_tpc_get_current: 20in80 clm_limits failed\n"); Many similarities to SoftMAC driver (brcmsmac) Where is a function called? What other functions does this function call? Look at known byte sequences, e.g. LLC header 18

Code Examination: Stack Traces Stack Trace: List of functions called along the path to the current function Goal: Find incomming path of Wi-Fi frames e.g.: Function?() Function?() Function3() Problem: No frame pointer :-( Frame 3: Current Function Frame 2: Function? Frame 1: Function? Stack 19

Code Examination: Stack Traces Frame 3 Link Register Code in Function 2 Link Register Code in Function 1 Frame 2 Frame 1 Stack 20

Code Examination: Stack Traces 1.Find function which handles received raw frames 2.Find function which sends out frames to te driver 3.Directly call the outgoing function 21

Patching Framework: Overview Writing ARM assembly is tedious and error prone => Write Firmware pachtes in C instead! 01001110 01000101 01011000 01001101 01001111 01001110 fw_patched.bin patch.c patch.ld wrapper.h 22

Patching Framework: Details patch.c: Your code goes here, e.g. function hooks patch.ld: Where should you code be located in the firmware wrapper.h: Function declaration for existing FW functions patcher.py: Copy everything together, modify jump commands 23

Patching Framework: Benefits Modifiying any code in the RAM Calling existing firmware functions Easily modifying existing firmware functions e.g.: write function hooks and mess with the parameters Template Projects help you to create your own firmware patch! 24

We did it team! Working Monitor Mode Aircrack-ng tools work, tested: Airodump-ng Aireplay-ng (deautentication attack) 25

Demo Enough talk! Show me a Demo! 26

Native Monitor Mode: IOCTLs Monitor and Promisc IOCTLs WLC_SET_MONITOR WLC_SET_PROMISC In the firmware: wlc_monitor_amsdu(): Function for aggregated frames wlc_monitor(): Function for all other frames Most Broadcom chips got a built-in Monitor Mode! 27

Native Monitor Mode: Drawbacks No Radiotap header => airodump-ng will not work No Injection support => aireplay-ng will not work We fixed this in our current Monitor Mode patch! 28

Related Projects: Raspberry Pi 3 Raspberry Pi 3 (BCM43438) Simple Monitor Mode works! ToDo: Switching channels Injection Radiotap header infos: RSSI, Channel, Timestamps Checkout: rpi3.nexmon.org Source: raspberry.piaustralia.com.au 29

Related Projects D11 core modifications Separate firmware Responsible for time critical operations Disassembler available: https://github.com/mbuesch/b43tools 30

Future Work Fixing bugs in the Raspberry Pi 3 Monitor Mode ROM Modifications using FPB (Flash Patch and Breakpoint) Enalbe Monitor Mode on more devices Nexus 6P Other Broadcom Chips Source: ifixit.com 31

Thank you for listening Contact: Write us an E-Mail: Daniel Wegemer: dwegemer@seemoo.de Matthias Schulz: mschulz@seemoo.de Follow us on twitter: @nexmon_dev Visit nexmon.org and rpi3.nexmon.org for complete Source Code! 32