Hacking the Bluetooth Pairing Authentication Process Graduate Operating System Mini Project Siyuan Jiang and Haipeng Cai.

Slides:



Advertisements
Similar presentations
Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
Advertisements

Chap 2 System Structures.
Operating-System Structures
Bluetooth Hardware CS215 Rohit Kapoor Prabhakar Pundir.
Modifying the SCSI / Fibre Channel Block Size Presented by Keith Bonneau, John Chrzanowski and Craig O’Brien Advised by Robert Kinicki and Mark Claypool.
Semester 4 - Chapter 4 – PPP WAN connections are controlled by protocols In a LAN environment, in order to move data between any two nodes or routers two.
1 Overview of Bluetooth technology Bluetooth protocol stack The Ericsson Bluetooth module Alternate solutions Wireless LANs Conclusions References Networking.
1 Review of Important Networking Concepts Introductory material. This module uses the example from the previous module to review important networking concepts:
OUTLINE WHAT ? HOW ? WHY ? BLUEPOST Poster and Message Content Specified by the User Displaying the Poster Content on a Monitor Sending Messages to.
Design and Implementation of a Server Director Project for the LCCN Lab at the Technion.
Universal Plug and Play (UPnP) Presented by: Kamal Kamal Kamal Kamal Mohammad Atieh Mohammad Atieh.
Project proposal Java Bluetooth stack. What is a Bluetooth stack? In short, to get any functionality out of a Bluetooth device, one needs to implement.
File Transfer Protocol CS-328 Dick Steflik. FTP RFC 959 uses two TCP Ports –one for control –one for data transfers command-response protocol control.
Implementing RADIUS AAA Phil & Rick. Content Terms and Concepts Access Control What is AAA? Benefits of AAA What is RADIUS? Microsoft IAS Overview Installation.
2011 Embedded Systems Software Training Center BluRapport SDK.
BLUETOOTH. Introduction Bluetooth technology discussed here aims at so-called ad- hoc piconets, which are local area networks with a very limited coverage.
Distributed systems – Part 2  Bluetooth – 2 nd set of slides Anila Mjeda.
Bluetooth Architecture and Applications Chris Greco, Wesley Kunzler, Koy Rehme, Zhuo Ruan.
Graduate Operating Systems Mini-Project: Hacking Bluetooth In Linux Alan Joseph J Caceres.
CSR Firmware Sony Training Seminar 10th April 2002.
ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
Characteristics of Communication Systems
Robert E. Meyers CCNA, CCAI Youngstown State University Cisco Regional Academy Instructor Cisco Networking Academy Program Semester 4, v Chapter.
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
Bluetooth Kirthika Parmeswaran Telcordia Technologies OOPSLA’2000.
Slide 1 DESIGN, IMPLEMENTATION, AND PERFORMANCE ANALYSIS OF THE ISCSI PROTOCOL FOR SCSI OVER TCP/IP By Anshul Chadda (Trebia Networks)-Speaker Ashish Palekar.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
Distributed systems – Part 2  Bluetooth 4 Anila Mjeda.
IP Forwarding.
FTP Client Application CSC 8560 Brian Jorgage 4/27/2004.
1. Insert the Resource CD into your CD-ROM drive, click Start and choose Run. In the field that appears, enter F:\XXX\Setup.exe (if “F” is the letter of.
10/15/ Short-Range Radio Frequency Networking B. Ramamuthy.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
---- IT Acumens. COM IT Acumens. COMIT Acumens. COM.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
1 Network Administration Module 3 ARP/RARP. 2 Address Resolution The problem Physical networks use physical addresses, not IP addresses Need the physical.
The Alternative Larry Moore. 5 Nodes and Variant Input File Sizes Hadoop Alternative.
OS2014 PROJECT 2 Supplemental Information. Outline Sequence Diagram of Project 2 Kernel Modules Kernel Sockets Work Queues Synchronization.
Bluetooth Techniques Chapter 15. Overview of Bluetooth Initially developed by Swedish mobile phone maker in 1994 to let laptop computers make calls over.
Bluetooth on CE. Mid - Presentation Roman Zoltsman & Oren Haggai Group /2001 Instructor: Nir Borenshtein HSDSL Lab. Technion.
Oracle Data Integrator Agents. 8-2 Understanding Agents.
1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Dynamic Host Configuration Protocol (DHCP)
EXPOSING OVS STATISTICS FOR Q UANTUM USERS Tomer Shani Advanced Topics in Storage Systems Spring 2013.
GPRS functionality overview in Horner OCS. GPRS functionality – Peer to Peer communication over GPRS – CSCAPE connectivity over GPRS – Data exchange using.
Mapping Salutation to Bluetooth 4 Overview 4 Bluetooth Summary 4 Salutation Architecture Summary 4 Mapping Bluetooth SDP to Salutation APIs 4 Mapping Bluetooth.
Mapping IP Addresses to Hardware Addresses Chapter 5.
JPMA PROJECT PRESENTATION (ITU) 1 INTRODUCTION BLUETOOTH CHAT DESIGN JAVA ON MOBILE DEVICE Presenters Benjamin Boateng Abass Omer Venkateshwar Rao Namilakonda.
Sem 2v2 Chapter 5 Router Startup and Setup. A router initializes by loading the bootstrap, the operating system, and a configuration file. If the router.
Slide 1 2/22/2016 Policy-Based Management With SNMP SNMPCONF Working Group - Interim Meeting May 2000 Jon Saperia.
DICOMwebTM 2015 Conference & Hands-on Workshop University of Pennsylvania, Philadelphia, PA September 10-11, 2015 DICOMweb Workflow API (UPS-RS) Jonathan.
Address Resolution Protocol Yasir Jan 20 th March 2008 Future Internet.
LonWorks Introduction Hwayoung Chae.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Point-Point Protocol (PPP) by William F. Widulski.
Router Startup and Setup
Chapter 2: System Structures
A Wireless LAN technologies IEEE
BOOTP and DHCP Objectives
BLUETOOTH Personal Area Networking [ PAN ] over Bluetooth
Router Startup and Setup
Short-Range Radio Frequency Networking
Short-Range Radio Frequency Networking
Active Tests and Traffic Simulation: Module Objectives
Active Tests and Traffic Simulation: Module Objectives
Chapter 7 Network Applications
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Message Passing Systems
Presentation transcript:

Hacking the Bluetooth Pairing Authentication Process Graduate Operating System Mini Project Siyuan Jiang and Haipeng Cai

Content Overview Linux Bluetooth Architecture o structure of the kernel and user code Protocol Stack o including where passcode request starts Pairing Authentication o details of the authentication process Adapt to Using Byte Sequence Passcode o modifications required for byte-seq passcode Conclusion

-RF and Baseband - physical layer - IEEE GHz band (ISM) -Link manager and L2CAP 2 - Media Access Control - link setup, security Linux Bluetooth Architecture Module Architecture of Common Bluetooth 1 1: figure from 2: Logical Link Control and Adaptation Protocol User Modules Kernel Module

User Modules Kernel Module -Host Controller Interface - command interface to the layers below - part in kernel, part in user space -RFCOMM - serial port emulation over L2CAP -Service Discovery - search pair devices Linux Bluetooth Architecture Module Architecture of Common Bluetooth 1

Pairing Authentication by Passcode/PinCode Protocol Stack - Pairing with passcode goes through the HCI interface 1.figure from us/library/ms aspx 2. "Winsock" can be general socket instead

Pairing Authentication - Normally done with PinCode, an ASCII string up to 32 characters in length - Transfer of the pincode as a string happens only to the user space code User initiates the pairing process

Pairing Authentication - Connect 1. kernel module loaded (auto with the kernel boot) - sub-modules loaded in order: bluetooth->bnep->rfcomm->btusb - Bluetooth core started - HCI device and connection manager initialized - HCI socket layer initialized - L2CAP socket layer initialized - Bluetooth USB driver initialized (kernel module: kernel/driver/bluetooth/btusb.c)

Pairing Authentication - BNEP (Ethernet Emulator) started - HCI device (hci0, for instance) opened (kernel module: kernel/net/bluetooth/hci_event.c) - RFCOMM TTY and socket layer initialized (now HCI device will send frames by socket to the peer from the next step to respond connection/authentication event handling) 2. Bluetooth daemon started (bluetoothd in user space) - SDP (service discovery protocol) server started with configurations loaded (user module: src/sdpd-server.c) - adapter (sub-component of the bluez user space module) enabled (user module: src/adapter.c) - start waiting for HCI events from the device opened before (hci0, for instance)

Pairing Authentication 3. Connection established - adapter launches an SDP session to search for available peer devices once user opened the "device setup" interface provided via the GUI plugin (user module: plugins/hciops.c) - available devices listed (devices previously paired do not show up again) and user selects one to connect. Now adapter initiates an agent for the selected peer - SDP session stops once the plugin starts connecting to the picked device via the HCI interface, which connects to the peer by sending connection event to the kernel module that then connects to the device via socket (through the protocol stack with the driver code invoked) (user module: plugins/hciops.c --> src/device.c --> kernel module: net/bluetooth/hci_event. --> net/bluetooth/hci_core.c --> driver code...)

Pairing Authentication - Pairing 4. User module request sent - plugin sends "authentication pin request" to adapter after connection completed (user module: src/hciops.c --> src/adapter.c --> src/event.c) - adapter responds to the event and requests the HCI device for authentication with pincode via the agent (created before) (user module: src/adapter.c --> src/device.c --> src/agent.c) - agent generates a pincode (according to user options received from the plugin) and sends a "pincode reply" event back to adapter, which returns to the plugin (user module: src/agentr.c --> src/event.c) Passcode request starts here

Pairing Authentication - plugin received the pincode and showed it on the plugin GUI (a string pincode, 6 digits in length by default) (user module: src/hciops.c --> src/adapter.c --> src/event.c) - adapter starts waiting for the response from the peer device with a preset timeout (30s as default) (user module: src/adapter.c --> src/event.c,agent.c) - agent sends request for pincode to the peer device via the HCI by socket for authentication, which goes to kernel module (user module: src/agent.c --> src/hci.c --> kernel module: net/bluetooth/hci_core.c --> net/bluetooth/hci_event.c)

Pairing Authentication 5. Kernel module request sent - kernel module sends request to peer device - if the peer does not respond, goto step 8, otherwise goto 6 (kernel module: net/bluetooth/hci_event.c --> net/bluetooth/hci_core.c --> driver code) 6. Kernel module received peer response - net layer sends peer passcode back to user space via socket (kernel module: net/bluetooth/hci_core --> net/bluetooth/hci_event.c --> user module: src/event.c --> src/adapter.c) 7. User module received passcode - adapter returns to plugin (user module: src/device.c --> src/adapter.c --> plugins/hciops.c) - if pincode does not match the one sent out, goto 8 (user module: src/adapter.c --> src/event.c,agent.c --> src/hciops.c) Switched from user to kernel space Switched back from kernel to user space

Pairing Authentication - if matched, adapter retrieves further info of the peer device and then created a serial device and added it to the "paired device list" via a serial manager (app-level). (user module: src/adapter.c --> src/device.c --> serial/manager.c) 8. Pairing finished - adapter cancels the authentication, releases the connection and related agent. - an "authentication complete" event sent to kernel module (user module: src/adapter.c --> src/device.c, serial/manager.c --> src/event.c,agent.c --> src/hciops.c --> kernel module: net/bluetooth/hci_core.c --> net/bluetooth/hci_event.c) * If pairing successfully finished, as next time connection to the same peer device is initiated, no passcode will be asked again until user deletes the paired device in the plugin GUI

Adapt to Byte Sequence Pincode - Overview -viability: affirmatively it is viable -change from the string (char*) type to byte sequence will use a unit64 type - 8-byte is long enough for a pincode, using the bdaddr for wiimote auto-pair for instance) -code modifications do NOT involve everywhere the pincode is defined and used (sent or received) in the pairing process detailed before

Adapt to Byte Sequence Pincode - No code changes needed in kernel module -kernel module uses _u8[16] (16 bytes) to store the pincode as byte sequence already (net/bluetooth/hci.h) -bdaddr (bluetooth MAC) takes 6 bytes only (_u8[6]). we can specify the "pin_len" field (to 6 instead of 16 by default) in the pincode structure at the user module level to easily adapt to this mere change in data length.

Adapt to Byte Sequence Pincode - Changes required in the user modules -modify everywhere the pincode is defined and passed between functions throughout all the following files (resprented in the form of file::function) -Plugin will still use the string to show pincode but convert to byte sequence when invoking the functions in HCI, adapter and agent, etc. plugins/hciops.c::hciops_pincode_reply plugins/mgmtops.c::mgmtops_pincode_reply src/device.c::pincode_cb (and the "authoentication_req struct) src/agent.c::display_pincode_request_new,agent_display_pincode src/adapter.h,adapter.c::pincode_reply, btd_adapter_pincode_reply, btd_adapter_get_pin src/event.c::pincode_cb src/storage.c::read_pin_code

Adapt to Byte Sequence Pincode - Wiimote auto-pairing proposal -plugin will not show pincode prompt since we do auto- pairing -the entry point where the pincode is first used as a string and sent out for authentication is: src/event.c::btd_event_request_pin -eventual code changes: in src/adapter.c::btd_adapter_get_pin, bypass the call to read_pin_code, retrieve the bdaddr of the peer device and copy it into the in-out parameter "pin_buf" and let the length of the bdaddr (6 bytes by default) as the function return * alternative: directly change src/storage.c::read_pin_code to copy the bdaddr to the in-out parameter "pin" and return the length

Conclusion - Bluetooth pairing authentication process, across the kernel and user modules, fully presented (where and how the passcode is requested) - Code changes for using byte sequence pincode instead of string described (what modifications necessary for the adaption are) - Auto-pairing for wiimote connection roughly proposed (Demo planned, to be shown)

Appendex Some hacking screen shots o Kernel module loaded o Pincode request received in the kernel space

Appendex Some hacking screen shots o User module and the plugin in the pairing process