Last month we gave a presentation at REcon about Samsung baseband security. The slides are available here. In the talk, we discuss steps for understanding the proprietary firmware format, reverse engineering the RTOS, figuring out the security architecture, analyzing the attack surface to find vulnerabilities, and, finally, writing an exploit to achieve remote code execution.

During our journey, we found several tricks that often prove useful during the reverse engineering of embedded devices nicely applicable to our usecase. We hope that our collection of custom-built reverse engineering tools will prove valuable for others wanting to build on our research on Shannon, or in the baseband/embedded security space in general. With that, as we promised at REcon, today we are releasing our tools. Hop on over to our github and check them out!

If you have a comment or a question, get in touch or submit a pull request!

Tools Overview

├── 010
│   └── [010 template for Shannon's TOC header format]
├── android
│   ├── [Collect ramdumps using cbd directly, requires root]
│   └── [Collect ramdumps using the menu, does not require root]
├── idapython
│   ├── loader
│   │   └── [IDA loader for the Shannon MAIN image]
│   ├── misc
│   │   └── [Clean up an IDC by removing {comments, filenames, *_something named labels, deletes}]
│   │   └── typeinfo.idc [Structure definitions for a Shannon idb]
│   └── plugins
│       ├── [Auto-find more functions by scanning for prologues]
│       ├── [Find and label all the mcr instructions in an idb]
│       ├── [Label function names automatically using string references]
│       ├── [Name an L3 task's message handlers in its dispatch table automatically]
│       ├── [Parse the modem's MPU config table and pretty print all the configuration rules]
│       ├── [Save/Restore pseudocode comments from/to an idb. This is useful because IDCs lack these.]
│       ├── [Label the register map inside a modem ramdump]
│       ├── [Identify possible stackframes inside a modem ramdump]
│       └── [Walk the task linked list in a modem ramdump to enumerate and label tasks]
└── modem
    ├── [Dump memory ranges live from the modem]
    ├── [Read memory from a modem address]
    ├── [Split up a modem image into its TOC parts (Boot, Main, etc)]
    └── [Write memory to a modem address]