< Return to Video

https:/.../38c3-178-eng-From_fault_injection_to_RCE_Analyzing_a_Bluetooth_tracker.mp4

  • 0:17 - 0:20
    *38C3 preroll music*
    thank you all for being
  • 0:20 - 0:28
    here to be honest this is my first CCC is it 
    the case for somebody in the audience great
  • 0:28 - 0:33
    I usually cannot be here because of for family 
    reasons and the only way I could find to get here
  • 0:33 - 0:42
    is to get accepted as a speaker so here I am so as 
    the angel says I'm a security researcher I live in
  • 0:42 - 0:50
    the French speaking part of Switzerland I do a lot 
    of embedded devices I'm also part of uh organizing
  • 0:50 - 0:56
    a way smaller conference called BlackAlps in 
    Switzerland and also I'm responsible of the main
  • 0:56 - 1:04
    I'm the main core developer of the HydraBus 
    it's basically Hardware Swiss Army Knife
  • 1:04 - 1:10
    so the target that we will see today is 
    the Chipolo ONE it has been released in
  • 1:10 - 1:17
    2019 so 3 years before the air tag went so that 
    means that there's no specific protocol for the
  • 1:17 - 1:24
    Bluetooth tracker it was it's plain Bluetooth 
    device so it has the exact same functionalities
  • 1:24 - 1:30
    basically it's a Bluetooth tracker it has an 
    application that you can use to make it ring
  • 1:30 - 1:35
    *ring*
    like that and it helps you
  • 1:35 - 1:40
    recover your keys your cats it's really in the on 
    the website it helps you recover your cats never
  • 1:40 - 1:50
    tested but I will first start by the end you will 
    see why later so at the end of This research on
  • 1:50 - 1:58
    September 15 we sent an email to Chipolo and on 
    September 20 we got an acknowledge from them they
  • 1:58 - 2:04
    asked for more details and we set up an online 
    meeting with the the Chipolo team so there was
  • 2:04 - 2:10
    eight different people from the engineering from 
    the management various people from Chipolo they
  • 2:10 - 2:16
    were really interested we did a presentation kind 
    of this one with a bit more context and several
  • 2:16 - 2:23
    questions the good thing was that they were 
    really open for discussion so we had some weird
  • 2:23 - 2:28
    things that we found in the firmware so we asked 
    questions and they were really kind and willing to
  • 2:28 - 2:38
    explain the issues some of them were let's say by 
    design some others were plain mistake by them
  • 2:38 - 2:46
    by the end of this meeting what what really 
    stand out was that the device they used had
  • 2:46 - 2:53
    a really small memory for storing the firmware 
    that means that they had to make some choices and
  • 2:53 - 2:58
    remove some features and some security checks 
    in order to make the firmware fit within the
  • 2:58 - 3:05
    microcontroller so this is why you will see some 
    of the the issues but they also acknowledge that
  • 3:05 - 3:12
    they did some mistakes and overlooked several 
    security features they were also kind enough
  • 3:12 - 3:17
    to let me present here the only thing is that 
    they asked me to not publish the encryption
  • 3:17 - 3:28
    keys so they will be redacted in those slides
    okay back then so we got the device we crack this
  • 3:28 - 3:33
    is just a simple plastic case so we can just 
    crack it open and this will give us this small
  • 3:33 - 3:39
    white PCB here and there are three components 
    that are really interesting uh the first one
  • 3:39 - 3:46
    being the microcontroller itself the second one is 
    the sound driver it's mostly used for the beeping
  • 3:46 - 3:57
    and stuff and as you can see there are a lot of 
    various test points so this chip is the DA14580
  • 3:57 - 4:02
    I will just say the dialogue for now so it's 
    was produced by dialogue which has been bought
  • 4:02 - 4:10
    by Renesas nowadays uh it's a Cortex-M0 and one 
    interesting thing is there's no flash memory in
  • 4:10 - 4:16
    this chip there's only a one-time programmable 
    memory that means that you can flash it once
  • 4:16 - 4:22
    and then the firmware is stayed there forever you 
    cannot update it you cannot change it nothing but
  • 4:22 - 4:31
    the good thing for us is that this chip has a data 
    sheet available on the internet so the first thing
  • 4:31 - 4:40
    we did is to set the pin out and locate the debug 
    interface on the various test points we added some
  • 4:40 - 4:47
    wires very poorly to be honest *laughter* but 
    in the end it worked so that's perfectly fine
  • 4:48 - 4:54
    now I regret I regret registering for 
    the soldering challenge tomorrow
  • 4:54 - 4:57
    *laughter*
    so we connected
  • 4:57 - 5:06
    uh debug probe and unfortunately for us the SWD 
    interface is unresponsive that means that there's
  • 5:06 - 5:12
    absolutely no access to the debug interface so 
    we cannot extract the firmware from the device
  • 5:12 - 5:19
    so back to the documentation we can see that in 
    the red square here it's written the debug lock
  • 5:19 - 5:26
    JTAG it's not JTAG it's say WG but whatever so it 
    supports this JTAG lock features that means that
  • 5:26 - 5:32
    apparently Chipolo did a good good job and 
    disabled the debug interface that's pretty
  • 5:32 - 5:40
    great for them but not for us because we really 
    want that firmware so what we did is start by the
  • 5:40 - 5:46
    fault injection when I say we I want just to thank 
    and give credit where it's due I had a friend who
  • 5:46 - 5:52
    who worked with me on the fault injection on all 
    the hardware side so thanks a lot to Azacs who
  • 5:52 - 6:02
    helped me on this so fault injection who everybody 
    knows about fault injection nobody great okay
  • 6:03 - 6:09
    so fault injection basically the idea of fault 
    injection is to perturbate the CPU or the
  • 6:09 - 6:15
    microcontroller to make it behave a bit weirdly 
    namely corrupting instructions or as we say is
  • 6:15 - 6:22
    skipping an instruction basically we make the CPU 
    do something different than what it's supposed to
  • 6:22 - 6:30
    do if we do it correctly this perturbation allows 
    us to just modify one or a few instructions and
  • 6:30 - 6:35
    then the CPU continues its processing that 
    means that we can just change a little bit of
  • 6:35 - 6:42
    uh execution and then it resumes the execution 
    that would be great for us because if we can
  • 6:42 - 6:50
    let's say corrupt the set the debug lock then that 
    would be great there are a lot of different fault
  • 6:50 - 6:57
    injection techniques that exist namely voltage 
    glitching electromagnetic fault injection and
  • 6:57 - 7:02
    for this one we went with the electromagnetic 
    fault injection using the ChipSHOUTER which is
  • 7:02 - 7:08
    showed here so this is a tool that has been 
    developed to especially to create a small
  • 7:08 - 7:16
    electromagnetic pulses that will perturbate the 
    CPU hence making some instructions go weird
  • 7:18 - 7:24
    but now we need to know exactly where to fault 
    that means that we have to to spot the exact
  • 7:24 - 7:32
    instructions that will that will enable or 
    disable the JTAG and how to do this first
  • 7:32 - 7:38
    with the documentation we know exactly the 
    boot process how it works so it first boots
  • 7:38 - 7:44
    setups the hardware then it will copy the OTP 
    so the firmware from the one-time programmable
  • 7:44 - 7:52
    memory into RAM and then it will remap the RAM 
    at address zero and then it will reset the CPU
  • 7:52 - 8:02
    so the CPU will start on the firmware that is 
    in RAM that's how this specific CPU boots
  • 8:02 - 8:10
    so our idea was to use power analysis the idea 
    is to monitor the power consumption of the the
  • 8:10 - 8:18
    microcontroller in order to see some patterns that 
    will help us know exactly where this copy from OTP
  • 8:18 - 8:27
    to RAM happens so what we did was simply add some 
    various devices to measure the power consumption
  • 8:27 - 8:32
    and use an oscilloscope to actually see the trace 
    and try to map the trace with what we see from
  • 8:32 - 8:39
    the documentation and this is how it looks like so 
    basically we have the boot start at the beginning
  • 8:39 - 8:46
    here and then from the data sheet it says that it 
    waits for 100 milliseconds and then it will start
  • 8:46 - 8:51
    the copy and if you squint the eyes a bit you will 
    see that you have a lot of activities right there
  • 8:51 - 8:59
    after the 100 millisecs so that's not that good 
    when you are doing fault injection because with
  • 8:59 - 9:05
    100 milliseconds that means that you have a lot 
    of jitter so when you want to be really precise
  • 9:05 - 9:12
    on one specific instruction that's quite difficult 
    to do so there are a lot of ways to synchronize
  • 9:12 - 9:19
    on the power consumption itself and this will 
    be covered later but the thing is that using
  • 9:19 - 9:26
    electromagnetic injection we have to be really 
    precise also on the parameters of the injections
  • 9:26 - 9:35
    that we will do basically if we put a fault if we 
    inject an EMP pulse too hard usually the target
  • 9:35 - 9:43
    resets or crashes or burns or doesn't work anymore 
    that happens or if you do it too softly that means
  • 9:43 - 9:49
    that the CPU won't behave differently and you 
    will basically have no effect at all so what we
  • 9:49 - 9:56
    usually do is we take the the development kit for 
    that specific microcontroller we create a small
  • 9:56 - 10:03
    firmware that we control so that we can actually 
    see whether we have some instruction corruption
  • 10:03 - 10:11
    or not in that specific case we didn't do it 
    first of all because we we didn't have any dev
  • 10:11 - 10:17
    kits available we didn't want to buy them and it 
    was pretty fun to actually test it as a blackbox
  • 10:17 - 10:24
    so using just the power analysis so the idea is 
    to take the trace set some various parameters
  • 10:24 - 10:31
    like the width of the EMP pulse the voltage
    that you provide the actual coil that will
  • 10:31 - 10:37
    generate the EMP pulse and also the physical 
    location over the chip has some importance
  • 10:37 - 10:45
    so we tried to do this but what happens is that 
    during this small characterization phase suddenly
  • 10:45 - 10:52
    the SWD interface appeared so we were really lucky 
    really really lucky because it worked nearly after
  • 10:52 - 11:01
    2 or 3 hours of testing various parameters and we 
    we by luck found the exact timing that allowed us
  • 11:01 - 11:08
    to get access to the SWD so first of all we are 
    quite surprised of course but since it was still
  • 11:08 - 11:13
    open and the device was still working that means 
    it was the perfect conditions to actually dump
  • 11:13 - 11:18
    the RAM so we stopped the CPU we started the 
    dumping process from address zero because we
  • 11:18 - 11:25
    know that the firmware is located at address zero 
    and then we tried to replicate it of course and
  • 11:25 - 11:30
    remember when I said that the chip can die and 
    burn that's exactly what happens a few attempts
  • 11:30 - 11:37
    later so the chip just died and it didn't work 
    anymore so at least we have this firmware now
  • 11:37 - 11:43
    so that's pretty great and if we just have 
    a quick look at the RAM dump it's exactly 44
  • 11:43 - 11:51
    kiloby of data which is exactly the size of the 
    RAM available from the data sheet that's perfect
  • 11:51 - 11:57
    and if we dump the data we show some readable 
    strings like the company name and other other
  • 11:57 - 12:07
    strings that I unfortunately I cannot show you
    for posterity this is the setup that we have so
  • 12:07 - 12:14
    as you can see there's no XY table it's just 
    a bunch of various devices connected together
  • 12:14 - 12:20
    in the middle there I think the German word is 
    cable salad that's correct *laughter* yeah and the
  • 12:20 - 12:25
    chip is right here so all the various components 
    around is just for triggering the fault doing the
  • 12:25 - 12:33
    power analysis monitoring etc etc it was a nice 
    afternoon with a lot of beers and a good friend
  • 12:35 - 12:42
    so now that we have this firmware what we usually 
    do when analyzing a firmware of an embedded device
  • 12:42 - 12:47
    is first to load the firmware at the correct 
    address in that case it's quite easy because it's
  • 12:47 - 12:53
    uh from address zero so it starts right there 
    we try to populate the known peripherals and
  • 12:53 - 12:59
    registers that's also very helpful to understand 
    what exactly some specific function do when they
  • 12:59 - 13:05
    trying to access some specific memory regions 
    and then we analyze the code that's usually how
  • 13:05 - 13:13
    it works to do this for the peripheral s registers 
    usually you have for arm chips you have something
  • 13:13 - 13:20
    that is called the CMSIS-SVD which is an XML 
    file that describes all the various registers and
  • 13:20 - 13:26
    memory regions for a specific chip it's usually 
    published by the manufacturers so that's great and
  • 13:26 - 13:33
    there's a nice plugin which is called SVD loader 
    for Ghidra and others that allows you to basically
  • 13:33 - 13:38
    take this XML file and populate all the memory 
    regions within your favorite disassembler that's
  • 13:38 - 13:47
    pretty great unfortunately of course there's no 
    SVD for this specific chip so what I would what
  • 13:47 - 13:53
    I did is get a simple idea is if we have the data 
    sheet with all the information there we just need
  • 13:53 - 14:00
    to pass the PDF generate a Ghidra script that will 
    just take those values and generate the python
  • 14:00 - 14:07
    script that can can just copy and paste into the 
    python console of Ghidra and that will be fine
  • 14:07 - 14:12
    except it just doesn't work because if you look 
    at those you can already see that I have two table
  • 14:12 - 14:21
    number ones that means that the PDF is absolutely 
    awful there's a lot of messed tables some cells
  • 14:21 - 14:28
    are merged together sometimes there are ghost 
    cells with no values inside of it so in the end
  • 14:28 - 14:34
    after the extractions I had to basically rewrite 
    everything by hand just to make sure that it works
  • 14:34 - 14:42
    correctly but after a lot of time I was able to 
    get something that looks quite nice so I first
  • 14:42 - 14:49
    already have all the registers and the memory 
    regions that's already a good result but we are
  • 14:49 - 14:54
    not there yet because looking at the code
    I saw that uh there are a lot of calls to a
  • 14:54 - 15:01
    specific memory region that I haven't dumped and 
    I cannot either and those hardcoded functions
  • 15:02 - 15:10
    looking at the at the data sheet again it's in 
    a specific region in RAM so it's it's burned
  • 15:10 - 15:14
    directly within the chip and it has a lot 
    of helper functions and functions that are
  • 15:14 - 15:21
    used a lot so this these functions I couldn't 
    have them so I don't know their names I cannot
  • 15:21 - 15:29
    reverse them nothing but luckily for me uh I was 
    able to find a symdef file on GitHub a symdef
  • 15:29 - 15:37
    file is a way for the ARM compiler to have some 
    specific values some specific function names that
  • 15:37 - 15:43
    correspond to a specific address and the linker 
    will automatically convert those values to make
  • 15:43 - 15:49
    sure that you are calling the right function so 
    I wrote a Ghidra script the link is there uh it's
  • 15:49 - 15:56
    on GitHub if you need it because there was none 
    before that so with that specific Ghidra script
  • 15:56 - 16:01
    and if we pull that all together you'll start with 
    the function on the left and in the end you have
  • 16:01 - 16:08
    the function of the right you can see that they 
    implemented memcopy and memcmp directly in RAM
  • 16:08 - 16:13
    so that's pretty convenient so you don't need to 
    implement your own memcopy it's already written
  • 16:13 - 16:19
    into the chip and you have other functions and 
    other helpers that typically tell you okay this
  • 16:19 - 16:31
    is the Bluetooth address of the device
    so now that we have everything the registers
  • 16:31 - 16:38
    the memory regions the function names a bit we 
    can start the reversing so after fiddling around
  • 16:38 - 16:45
    I found the main application logic which is this 
    nice graph on the right here so it's a huge state
  • 16:45 - 16:50
    machine that basically handles all the various 
    Bluetooth communication and depending on the state
  • 16:50 - 16:57
    it is it will call various functions and other 
    callbacks etc etc so it's pretty messy to do but
  • 16:57 - 17:03
    at first the first thing it does is some kind 
    of comparison and if the user sends a specific
  • 17:03 - 17:10
    Bluetooth value then the chip will enable all the 
    other functions looks like an authentication so
  • 17:10 - 17:18
    looking at how this authentication data is sent 
    basically it's a comparison between six byte that
  • 17:18 - 17:26
    the the user sends to the device and a value that 
    is stored within the device and that value that
  • 17:26 - 17:36
    is stored is first the CR the CRC32 of some random 
    16 byte buffer so they are using CRC32 it's quite
  • 17:36 - 17:41
    easy to find because you have those constant 
    values you can use Google you can just Google
  • 17:41 - 17:46
    for the values and it will directly tell you the 
    kind of function it is that's pretty great there's
  • 17:46 - 17:52
    also another script that is called FindCrypt that 
    will help you understand which constants are used
  • 17:52 - 18:00
    for specific crypto algorithm and that helps a 
    lot so it does a CRC32 over a 16 byte buffer and
  • 18:00 - 18:07
    that specific buffer comes from another function 
    that takes as an input the Bluetooth address a
  • 18:07 - 18:15
    fixed value that that I cannot tell you and some 
    other value that I cannot tell you but it's fixed
  • 18:15 - 18:21
    and that function again uses a specific constant 
    and if you Google for it you will see that it's
  • 18:21 - 18:28
    TEA so it's the tiny encryption algorithm so 
    basically this value this spe this secret that
  • 18:28 - 18:36
    you need to discover is only dependent on the 
    Bluetooth address that you can know but there's
  • 18:36 - 18:44
    even more because the CRC is only four bytes and 
    it compares to six bytes so that CRC the secret
  • 18:44 - 18:50
    uh that I will call secret is a 4 byte value 
    it is then mangled with a random value that
  • 18:50 - 18:57
    is generated at boot this value can be carried 
    over Bluetooth that's how the application knows
  • 18:57 - 19:03
    the random seed let's say let's call it that 
    way and how the seed is and how the password
  • 19:03 - 19:11
    is calculated it's based on the random and that 
    specific CRC you have all the the token values
  • 19:11 - 19:18
    the token positions and the formulas associated 
    and if you are quite decent at math especially
  • 19:18 - 19:26
    with source you will see that if you can sniff one 
    specific one valid authentication you can recover
  • 19:26 - 19:33
    the the CRC hence the secret key for 
    that authentication that also means that
  • 19:33 - 19:39
    with one authentication you can re-create any new 
    authentication it's even easier because after a
  • 19:39 - 19:46
    first a first successful authentication the random 
    value is incremented by one it's not regenerated
  • 19:46 - 19:54
    it's just incremented by one that means there are 
    only two bytes that change within the token
  • 19:54 - 20:00
    so that was also very nice what I did then is 
    I installed the application to confirm that
  • 20:01 - 20:07
    you can recover the the secret value and it 
    works perfectly fine and then I was thinking
  • 20:07 - 20:12
    okay so maybe there might be some other 
    vulnerabilities there so I installed the
  • 20:12 - 20:19
    app I used the Bluetooth snoop plug from Android 
    to access all the various Bluetooth traffic and
  • 20:19 - 20:27
    I found out that the protocol uses some kind of 
    TLV encoding so tag length and value so I looked
  • 20:27 - 20:34
    at how the TLV encoding the TLV decoding works 
    within the firmware and oh boy the thing is it
  • 20:34 - 20:42
    takes the whole input and it will split the input 
    in three different stack based buffer so the tags
  • 20:42 - 20:48
    will go in the tags buffer the length will go in 
    the length buffer and the values will go into the
  • 20:48 - 20:55
    values buffer there's absolutely no bounce check 
    so that means it's should be quite easy you just
  • 20:55 - 21:02
    send a very big packet and you will be able to 
    overflow any of those stack based buffers except
  • 21:02 - 21:09
    that on that specific chip the Bluetooth stack 
    does not support changing the size of the payload
  • 21:09 - 21:17
    in a Bluetooth packet so it's stuck to the default 
    of 23 bytes and unfortunately all the buffers are
  • 21:17 - 21:23
    larger enough they they thought about it so 
    unfortunately there's no way to really control
  • 21:23 - 21:30
    the data we can overflow we can still overflow by 
    setting a very large length value but you cannot
  • 21:30 - 21:38
    really control the exact values that you will 
    overflow so we have to go a bit deeper then in
  • 21:38 - 21:46
    the application you have a way to upload a custom 
    melody on the device some of you already see where
  • 21:46 - 21:51
    I'm going there so you have nine different 
    Melodies there so you can say you can ask
  • 21:51 - 22:00
    to upload a new melody at slot number from 0 to 8 
    fun fact those melodies are stored in an array so
  • 22:00 - 22:06
    there's a there's an array of pointer to melodies 
    structures and two of them are have a null pointer
  • 22:06 - 22:12
    it's a it's a bug they confirmed it's a bug it 
    it shouldn't happen but what's funny is that it
  • 22:12 - 22:18
    it allows you to overwrite directly the vector 
    table from the chip and that's a possibility
  • 22:18 - 22:26
    to have to have remote code execution but there's 
    even a simper way because once you say okay I want
  • 22:26 - 22:34
    to add to change the melody what you can do is you 
    will just send data as chunks to the device and it
  • 22:34 - 22:40
    will just copy it in the melody buffer of course 
    with absolutely no bounce checking whatever so
  • 22:40 - 22:49
    you can just overwrite up to the end of the RAM 
    if you want to fun fact also there's a way to
  • 22:49 - 22:54
    at the end in the application it will send a 
    check sum of all the melody data and if it's
  • 22:54 - 23:01
    valid then it allows you to play that specific 
    uh melody but in reality you don't need to send
  • 23:01 - 23:09
    that CRC and you can just ask to play the 
    melody that's I don't know why it's there
  • 23:09 - 23:16
    so once I know that I can overwrite basically 
    everything I want I scrolled in the in Ghidra
  • 23:16 - 23:22
    because remember since it's OTP copied to RAM all 
    the data that I copied is the RAM so you have both
  • 23:22 - 23:29
    the firmware and also all the buffers and pointers 
    that means that I just scrolled down in Ghidra
  • 23:29 - 23:38
    after the last melody structure and the exact 
    first value that is used lucky for me is a call
  • 23:38 - 23:44
    back function it's a pointer to a function that 
    is called after every received Bluetooth packet or
  • 23:44 - 23:50
    whenever I click on the button that means that I 
    have a way to trigger the the code execution and I
  • 23:50 - 23:59
    have a pointer to rewrite to points to exactly my 
    my own shell code so the strategy it's quite easy
  • 23:59 - 24:06
    you authenticate to the device using one of the 
    authentication bypasses I explained earlier then
  • 24:06 - 24:13
    you start to update the melody number five because 
    it's the furthest down in memory so you send a
  • 24:13 - 24:20
    huge NOP sled then the code and then you overwrite 
    this callback function and then you just send some
  • 24:20 - 24:26
    random Bluetooth packets and it will trigger your 
    payload every time that's quite easy to do so
  • 24:26 - 24:32
    the first payload I did is simply hello world by 
    reversing the firmware I also found the address of
  • 24:32 - 24:38
    the function that will send the notification so 
    it takes the different parameters there but you
  • 24:38 - 24:46
    can just give it a specific value then a pointer 
    to a buffer and then the length and it will start
  • 24:47 - 25:04
    it will send you a notification directly so now 
    it's time to a small demo hope it will work
  • 25:04 - 25:20
    *laughter*
    just waiting for it to connect
  • 25:20 - 25:25
    of course
    *laughter*
  • 25:25 - 25:41
    okay just in case let's do this
    yeah don't blame me blame that device
  • 25:41 - 25:44
    *laughter*
    okay so this will
  • 25:44 - 25:48
    basically wait until the connection even the demo 
    doesn't work that's even the backup doesn't oh no
  • 25:48 - 25:53
    it works okay really it works okay so now 
    it's uploading the NOP sled that's pretty
  • 25:53 - 26:00
    nice what I did is I changed a bit the 
    the the shell code this shell code will
  • 26:00 - 26:05
    uh complete the circle so it will dump the 
    firmware from the device over Bluetooth directly
  • 26:05 - 26:17
    to the user so if we wait a bit here after the 
    end once the NOP sled is written it will then
  • 26:17 - 26:26
    add the shell code then overwrite the function 
    pointer and now you have the device spitting its
  • 26:26 - 26:30
    firmware directly to the user
    *applause*
  • 26:44 - 26:49
    so as a conclusions they say attackers only 
    need to be lucky once fortunately for me it
  • 26:49 - 26:54
    was lucky more than once to get everything 
    to be aligned and work perfectly that's great
  • 26:55 - 27:00
    the not so good news is that those devices 
    since they are using a one-time programmable
  • 27:00 - 27:05
    memory they cannot be updated that means 
    that you can still purchase them if you
  • 27:05 - 27:13
    want to test for yourself if you want thanks 
    again for to Chipolo because they sent us
  • 27:13 - 27:22
    several devices to play with that's 
    really nice to them and that's it
  • 27:22 - 27:32
    *applause*
    -
  • 27:32 - 27:41
    so thank you very much for your talk and also 
    the demonstration do we have questions here so
  • 27:41 - 27:48
    I see someone lining up on the left
    - yeah so I have a question you said
  • 27:49 - 27:58
    there's no way to update the firmware okay 
    fair but we can upload melodies right
  • 27:58 - 28:00
    - yes
    - and it will be stored
  • 28:00 - 28:05
    I think with changing the battery right
    - it will be stored in RAM yes
  • 28:05 - 28:15
    - yeah correct so is it possible to just insert 
    your own code on the melody store like we do the
  • 28:15 - 28:22
    remote code execution right and then store 
    our own custom code and like that's kind of
  • 28:22 - 28:27
    have our custom firmware is that possible
    - that's possible the only thing is that if
  • 28:27 - 28:32
    the device reboots then the the patch will 
    be gone as well because it will restart then
  • 28:32 - 28:38
    reload the firmware from the OTP memory to 
    RAM etc so you you will have to exploit your
  • 28:38 - 28:41
    device every time it reboots
    - oh okay yeah yeah and now
  • 28:41 - 28:44
    I understand okay thank you
    - that was also quite helpful
  • 28:44 - 28:50
    because whenever the the the shell code 
    crashed and it crashed a lot at the beginning
  • 28:51 - 28:57
    every time the the the device crashes it 
    automatically reboots and does this small
  • 28:58 - 29:04
    oh there no melody now because it's exploited 
    but it does this this small melody every time
  • 29:04 - 29:09
    it reboots so I knew exactly when the the 
    exploit failed and I had to rewrite it etc
  • 29:09 - 29:12
    - okay thank you
    - okay we also
  • 29:12 - 29:21
    have a question from the internet
    - I think the question was already covered it was
  • 29:23 - 29:30
    if the melody feature is only working until the 
    device is rebooted so it's only stored in RAM and
  • 29:30 - 29:33
    lost after reboot
    - yes
  • 29:33 - 29:40
    - okay thanks then we have a 
    question in the middle on the right
  • 29:40 - 29:49
    - question one question can you can you enable 
    JTAG or SWD debugging once you have your own
  • 29:49 - 29:53
    firmware loaded
    - thank you
  • 29:53 - 29:56
    * laugher*
    you yes you can basically I did
  • 29:56 - 30:03
    after I had this way of dumping every memory 
    region I dumped the RAM code so I looked at
  • 30:03 - 30:09
    the part of the code that is responsible 
    for locking or unlocking the chip and it
  • 30:09 - 30:15
    does exactly that so it's just sets a specific 
    bit in that specific register and you can do it
  • 30:15 - 30:20
    by using remote code execution as well yes so you 
    can create a shell code that will just update one
  • 30:20 - 30:26
    specific value at a specific memory location 
    and you have JTAG again SWD to be correct
  • 30:26 - 30:30
    - thanks
    - thanks microphone 2
  • 30:30 - 30:37
    - hi thank you for this great talk and I have one 
    question just for the record so do you think they
  • 30:37 - 30:42
    used the same keys in every device so
    - no idea
  • 30:42 - 30:46
    - they did they don't
    - I have no idea
  • 30:46 - 30:53
    - did did you did you exploit more than one
    - uh on this device it's the same key yes on
  • 30:53 - 30:59
    every on every device but on the other the other 
    models I honestly didn't have time to try them
  • 30:59 - 31:02
    already so I don't know
    - all right thank you
  • 31:02 - 31:12
    - so I guess since no one is rushing to the 
    microphones again and we don't have any questions
  • 31:12 - 31:20
    from the internet I want to thank you again for 
    the wonderful talk and a warm applause please
  • 31:20 - 31:32
    - thank you
    *applause*
  • 31:32 - 31:34
    thanks
    *postroll music*
Title:
https:/.../38c3-178-eng-From_fault_injection_to_RCE_Analyzing_a_Bluetooth_tracker.mp4
Video Language:
English
Duration:
31:38

English, British subtitles

Incomplete

Revisions