• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language
    C
  • License
    MIT License
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scripts, plugins, and information for working with Samsung's Shannon baseband.

Samsung's Shannon Baseband Tool Repository Build and test ShannonLoader

Scripts, tools, and information to help reverse engineer Samsung's EXYNOS cellular baseband platform, codenamed Shannon. These tools were released for the talk "Emulating Samsung's Shannon Baseband for Security Testing" at Black Hat USA'2020, August 5th.

Index

ShannonLoader: reversing/ghidra/ShannonLoader

A Ghidra extension for loading modem.bin binaries from nearly all known modems to date. All firmware images from https://github.com/grant-h/ShannonFirmware are loaded during CI tests for the loader to ensure its compatibility.

Ghidra Scripts: reversing/ghidra/scripts

Ghidra post-loading Python scripts that help annotate Shannon modem images. This includes recovering debug strings and auto-naming functions. Use after loading with ShannonLoader.

Modem Binary Scripts: reversing/modem

Raw modem.bin extraction script into sub parts and others as they are developed.

Modem Log File Processing: reversing/btl

Scripts and info to parse Back Trace Log (BTL) files. These are included during modem crashes / dumps or via the "CP RAM Logging" functionality. These are compressed log files from the actual running modem.

Extracted Firmware Structures: firmware/

Information on firmware acquistion and some extracted data dumps.

Getting started with Shannon Firmware

Here's a quick tutorial to start reversing this firmware with GHIDRA.

  1. Download the firmware binary of choice. Make sure you have extracted the CP partition from official Samsung firmware and have further extracted the modem.bin file. Make sure to unlz4 the binary if it is compressed.
  2. Install the ShannonLoader at the splash screen using File Β» Install Extensions.... Target the ShannonLoader.zip release that is in the latest release tag
  3. Now start a new GHIDRA project and add a new file. Select the modem.bin file. You should see that this file's loader is automatically selected as "Samsung Shannon Modem Binary". If you do not see this, make sure that you have loaded the right file and installed the extension properly. Open GHIDRA debug console (bottom right on splash screen) to double check if there are any errors.
  4. Import the file, let the loader finish and once again make sure there were no errors during loading.
  5. Double click on the imported file to open CodeBrowser and hit no to auto-analysis for now.
  6. Now run the ShannonTraceEntry.py python script from Script Manager under the "Shannon" category. Make sure to either place scripts into your user home directory at ~/ghidra_scripts (Linux) or add the path to them in the manager. This script will identify all trace debugging information before analysis and avoid diassembling data.
  7. Go to Analysis Β» Auto analyze..., and uncheck the "Non-returning Functions - Discovered" analyzer as this causes broken recovery of the log_printf function, leading to broken disassembly throughout the binary. If you do not uncheck this, you will need to restart your import from scratch.
  8. Hit analyze and let GHIDRA churn away until it settles.
  9. Next optionally run the auto-renamer script, ShannonRename.py. This will help you navigate the binary, but remember that the names are heuristically determined, so quality may vary. Functions with the same guessed name will have a numeric prefix appended.
  10. Start reversing!

If you want a quick look around, we exported a GHIDRA project for a 2017 modem image.

Related Resources

License

The repository's license is MIT. NOTE: The top-level license covers only files that explicitly contain SPDX markings, not the entire repository. For other files, they may not be licensable (e.g. binary dumps, firmware) or may contain other permissive licenses.

More Repositories

1

qu1ckr00t

A PoC application demonstrating the power of an Android kernel arbitrary R/W.
C
410
star
2

shannon_s5000

A code skeleton of Samsung's Shannon S5000 baseband modem.
C
40
star
3

ShannonEE

FirmWire has replaced ShannonEE. OLD: A dynamic analysis environment for Samsung's Shannon baseband.
36
star
4

ShannonFirmware

Samples of Shannon baseband firmware for research purposes.
34
star
5

uOS

An in progress learning kernel for x86.
C
13
star
6

YateBTS-USRP

A fork of YateBTS that still works with USRP devices.
C
11
star
7

gdbscripts

An assorted collection of GDB scripts.
Python
9
star
8

shannon_S5123

A code skeleton of Samsung's Shannon5123 5G baseband modem.
C
9
star
9

ffff

File Fuzzing For Fun (FFFF). A bare minimum file format fuzzer. Easily extensible corruption types.
C
7
star
10

omap_loader

A USB BootROM uploading utility for TI ARM OMAP3 family processors. Rewrite of omap3_usbload. Supports USBLOAD functionality in TI's X-Loader.
C
5
star
11

SM-G973F-Kernel

Samsung S10 SM-G973F Exynos 9820 Kernel (G973FXXU3ASG8)
C
4
star
12

pwgen

A simple password generator from a wordlist and seed. Used for CCDC.
Python
4
star
13

usbutils-portable

A portable version of Linux's usbutils (lsusb) for macOS.
C
4
star
14

ctf

A sampling of CTF solutions from me over the years.
Python
3
star
15

OuterRealm

A very minimal Three.JS demoscene prod tracked using GNU Rocket for Javascript.
JavaScript
2
star
16

vocode

Enabling you to program with your voice.
Python
2
star
17

hunter_remote

Notes and tools to send and receive signals from Hunter fan remote controls.
Python
2
star
18

benchasm

A personal collection of x86 assembly snippets for learning and performance tests.
C
2
star
19

nest-toolkit

An old release of a Nest UI Toolkit from my BlackHat '14 talk.
C
2
star
20

gfx

Some C++ graphics fun
C++
1
star
21

roguesolver

A ASCII based rogue AI that finds keys and exits on an unknown map.
C
1
star
22

grant-h.github.io

HTML
1
star
23

dotfiles

Grant Hernandez's personal dotfiles.
Vim Script
1
star
24

fractal

A quick-n-dirty fractal viewer written in good-ol' C and SDL.
C
1
star
25

sierpinski-chaos

A simple SDL app to generate sierpinski's triangle using the chaos game.
C++
1
star
26

BuildIt-2014

My submission for the Build it Break it Fix 2014 competition.
Python
1
star