Breaking Band
reverse engineering and exploiting the shannon baseband
Nico Golde <nico@comsecuris.com> @iamnion Daniel Komaromy <daniel@comsecuris.com> @kutyacica
Breaking Band reverse engineering and exploiting the shannon - - PowerPoint PPT Presentation
Breaking Band reverse engineering and exploiting the shannon baseband Nico Golde <nico@comsecuris.com> @iamnion Daniel Komaromy <daniel@comsecuris.com> @kutyacica Motivation All your baseband Reverse engineering a Baseband
reverse engineering and exploiting the shannon baseband
Nico Golde <nico@comsecuris.com> @iamnion Daniel Komaromy <daniel@comsecuris.com> @kutyacica
All your baseband belongs to us Ralf Weinmann Reverse engineering a Qualcomm baseband Guillaume Delugré
2010 2011
Baseband exploitation in 2013 Ralf Weinmann
2013
Cellular exploitation on a global scale Mathew Solnik, Mark Blanchou
2014
SMS fuzzing Charlie Miller Collin Mulliner Nico Golde
2009/10 2012 2015
Qualcomm basebands (AMSS)
Qualcomm :)
share with release of Samsung Galaxy S6/Edge
this is our story from 0 to 0-day
and write a full RCE exploit
successes and fails
GT-B3740)
Android RADIO device partition
bootstrap code
memory - likely baseband settings etc
also see http://www.devttys0.com/2013/06/differentiate-encryption-from-compression-using-math/
memory mapped-io -> hard
decryption -> dead end
CP Boot Daemon / Cellular Baseband Daemon
*yo HexRays, we would have appreciated that ARM64 decompiler plugin 6 months earlier ;)
/dev/umts_ramdump0 IOCTL_MODEM_RAMDUMP_START
ramdump)
*#9090# *#9900#
memory -> analysis in IDA will be broken
handler in boot can nicely translate into an IDA loader!
strings
(Layer2/3 GSM,UMTS,LTE)
functionality
functions, confuses code/data segments
IDA’s results by thousands of functions
in basebands due to debug tools, e.g. Samsung DM)
better than sub_*!
identify handlers with debug info fatal_error assert_fatal free debug_trace_ function names file names path info (module)
"exact" strings
sanitize remaining strings > 5 chars alphanumeric consonants vowels
"fuzzy/misc" strings
IDApython yields ~20k named functions
primitives are implemented via system control co- processor instructions (MCR/MRC)
these
annotation: ARM R7, ARM9, and ARM11
communication, separation?
MPU)?
components doing message (IE) parsing)?
SVC calls in user-space code, complex SVC handlers and RETs in kernel code.
and resets
* ultimately verified by issuing privileged instructions once we had RCE
frames
analysis
follows a BL
function —> initialization routine fills in task struct, kept on linked lists
tasks
stackframe’s top includes two DEADBEEF markers.
relatively easy to spot. free, realloc found from there
various sizes, with look-aside doubly-linked free lists
permission values. Wrote another script to automate all that.
segment precisely now.
main code regions start@0x04000000 and 0x40000000
including crash type. mildly useful.
memory
exception table we got really lucky here
register map
including crash type. mildly useful.
memory
exception table we got really lucky here
register map
almost proper crash debugging
ability to unlock device via AT command
than what authors released! (try AT+CLAC)
AT commands among other things
now… but we skipped that
*Roberto Paleari and Aristide
exploitable memory corruptions
parsing of messages we can send from a fake BTS/network
short signaling messages
(non-GPRS)
TLV-E (0-65535)
*also see 3GPP TS 24.007/24.008
MM RR CM
simplified LTE Layer 3
CC SMS SM SS
(non-GPRS)
response)
*also see 3GPP TS 24.007/24.008
id fptr log str
memcpy etc.
do more vuln hunting
behavior are normal during test
CC_decodeProgressInd literally a text book stack-based buffer overflow over-the-air!
beginning automatically processes next message (assuming registers are setup correctly)
persistence may exist (e.g. exploiting nv item parsing issues etc. )
loaded by apps processor! (pls get this right in public debates)
though (calls, text messages, data)
payload that changes signaling data (<100 bytes); implanted via patching callback code
* that's why you should use E2E crypto!
somehow cache flushing MCRs don't work as expected (maybe LLI related?)
names
unsecured update process (e.g. SwiftKey Keyboard, …)
* the old remoteFS directory traversal bug discussed by Replicant seems fixed ;)
mad ninja skills required
exploitation:
configuration, register dumps, read/write memory, unpack modem binaries, naming of message handlers etc.
contact@comsecuris.com
and proxy
though)