Code Monkey home page Code Monkey logo

defusingthedragon's Introduction

DefusingTheDragon

( Fun from POC || GTFO )

Earlier this year, Nathan Keltner and I started down the curious path of Qualcomm SoC security. The boot chain in particular piqued my interest, the lack of documentation double it... the following is a portion of the results. (btw: thx mudge).

Qualcomm internally utilizes a 16kb bank of one time programmable fuses (named QFPROM by the manufacturer) on the Snapdragon S4 Pro SoC (MSM8960) as well as the other processors manufactured. These fuses, though publicly undocumented, are purported to hold the bulk of inter-chip configuration settings as well as the cryptographic keys to the device. Analysis of leaked documentation has shown that the fuses contain the primary hardware keys used to verify the Secure Boot 3.0 process as well as the cryptographic information used to secure Trust Zone and other security related functionality embedded in the chip. Furthermore, the fuse bank controls hardwired security paths for Secure Boot functionality (including where on disk to acquire the bootable images). The 16k block of fuses also contains space for end user cryptographic key storage and vendor specific configurations.

These one time programmable fuses are not intended to be directly accessed by the end user of the device and in some cases, such as the basic cryptographic keys, the Android kernel itself is not allowed to view the contents of the QFPROM block. These fuses and keys are documented to be hardware locked and accessible only by very controlled paths. Preliminary research has shown the and unknown 4k subset of the 16k block is mapped into the kernel IMEM at physical location 0x700000. The fuses are also documented to be shadowed at 0x704000 in memory. Furthermore, there exists somewhat unused source code from the Code Aurora project in the Android kernel that documents how to read and write to the 4k block of exposed fuses.

Aside from the Aurora code, most vendors have also created and publicly shared code to play with the fuses. LG is the exemplar here, with a wonderful little kernel module that maps and explores LG specific bit-flags. In general, there is an acceptable amount of existing code that will walk an interested person through the process.

Below are simplistic excerpts for my tool that should help you explore these toys with a little more granularity. To note, writing eFuse or QFPROM values can and probably will brick your device, so be careful. A last interesting tidbit though, and one that will hopefully entice the reader... SoC and other hardware debugging is typically turned off with a blown fuse. This becomes interesting because there exists a secondary fuse that turns this functionality back on (specifically for the use of RMA and other requests). Also as stated, the fuses hold the blueprint for where and how Secure Boot 3.0 works as well as where the device should look for binary blobs to load during setup phases.

Writing is slightly more complex, but basically amounts to pushing a voltage to the eFuse for a specified temporal scope in order for the fuse to blow (covered in the complete tool). My complete introspection tool will be on github soon, look for it here: https://github.com/monk-dot/DefusingTheDragon

WARNING: Portions of the code are commented out and may need a little love for compilation. I leave this up to the reader, the blueprint is there. #JoinTheWar

Have fun, break with caution and enjoy.

defusingthedragon's People

Contributors

monk-dot avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.