Skip to content

Commit f91608f

Browse files
committed
yup
1 parent 7b014fe commit f91608f

File tree

1 file changed

+62
-56
lines changed

1 file changed

+62
-56
lines changed

README.md

Lines changed: 62 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
# Introduction
3-
* TODO: one todo item remains below. (remove this one last)
43

54
Throughout the past four months, members of the cloakware-ctf have been competing, part-time, on the rhme3 challenge (https://rhme.riscure.com/3/news). These challenges were extremely difficult, but also extremely fun. In the end, team Cloakware placed 3rd and was the highest placing Canadian team; completing 16/19 challenges!
65

@@ -640,57 +639,55 @@ The silkscreen says AREF, but that pin is the last one in the set of pins creati
640639

641640
In this challenge, we know that there are some pins which are being used to emulate a *scan chain* and that we need to figure out the challenge/response protocol in order to get the flag.
642641

643-
```
644-
We reverse engineered the firmware of a key-fob we found. There is an indication that there is a backdoor in a hardware module through a scan-chain that provides access to all the cars. It appears to use pin 1, 2, 43, and 44 from the chip. It also has a challenge-response mechanism of 128-bits. A list of possible password candidates is found in the firmware and printed below.
645-
646-
PS. The scan-chain is emulated in software. Therefore, the worst case branch takes around 0.54 ms, and therefore you shouldn't drive the clock faster than 1.8 khz.
647-
648-
princess
649-
fob
650-
qwerty
651-
secr3t
652-
admin
653-
backdoor
654-
user
655-
password
656-
letmein
657-
passwd
658-
123456
659-
administrator
660-
car
661-
zxcvbn
662-
monkey
663-
hottie
664-
love
665-
userpass
666-
wachtwoord
667-
geheim
668-
secret
669-
manufacturer
670-
tire
671-
brake
672-
gas
673-
riscurino
674-
delft
675-
sanfransisco
676-
shanghai
677-
gears
678-
login
679-
welcome
680-
solo
681-
dragon
682-
zaq1zaq1
683-
iloveyou
684-
monkey
685-
football
686-
starwars
687-
startrek
688-
cheese
689-
pass
690-
riscure
691-
aes
692-
des
693-
```
642+
> We reverse engineered the firmware of a key-fob we found. There is an indication that there is a backdoor in a hardware module through a scan-chain that provides access to all the cars. It appears to use pin 1, 2, 43, and 44 from the chip. It also has a challenge-response mechanism of 128-bits. A list of possible password candidates is found in the firmware and printed below.
643+
>
644+
> PS. The scan-chain is emulated in software. Therefore, the worst case branch takes around 0.54 ms, and therefore you shouldn't drive the clock faster than 1.8 khz.
645+
>
646+
> princess
647+
> fob
648+
> qwerty
649+
> secr3t
650+
> admin
651+
> backdoor
652+
> user
653+
> password
654+
> letmein
655+
> passwd
656+
> 123456
657+
> administrator
658+
> car
659+
> zxcvbn
660+
> monkey
661+
> hottie
662+
> love
663+
> userpass
664+
> wachtwoord
665+
> geheim
666+
> secret
667+
> manufacturer
668+
> tire
669+
> brake
670+
> gas
671+
> riscurino
672+
> delft
673+
> sanfransisco
674+
> shanghai
675+
> gears
676+
> login
677+
> welcome
678+
> solo
679+
> dragon
680+
> zaq1zaq1
681+
> iloveyou
682+
> monkey
683+
> football
684+
> starwars
685+
> startrek
686+
> cheese
687+
> pass
688+
> riscure
689+
> aes
690+
> des
694691
695692
(That challenge description changed a couple times over the course of the RHME3 competition, along with hints being added and corrected too, but let's start with this description). As mentioned above, this was a multi-month endeavour; there a mix of doing things the hard way, making dumb mistakes and also a bugged challenge.
696693

@@ -700,7 +697,7 @@ Given the description of a bunch of pins on the RHME3 target as constituting a *
700697

701698
![what is this?](car_key_fob_hardware_backdoor/isthisajtag.png)
702699

703-
The jtagulator didn't want to go slow, so we cooked up [a patch](https://github.com/grandideastudio/jtagulator/pull/16) -- which Joe says he's going to integrate in his own way :). We patched our jtagulator and jtagulated the RHME3 CKF HW Backdoor target.
700+
That clock rate limit is pretty slow, and the jtagulator didn't want to go slow, so we cooked up [a patch](https://github.com/grandideastudio/jtagulator/pull/16) -- which Joe says he's going to integrate in his own way :). We patched our jtagulator and jtagulated the RHME3 CKF HW Backdoor target.
704701

705702
![jtagulate!](car_key_fob_hardware_backdoor/jtagulate_it.png)
706703

@@ -709,7 +706,14 @@ The Riscure devs had put a fun trap into the challenge: it would issue a self-de
709706
![side effects](car_key_fob_hardware_backdoor/ckf-hw-backdoor_selfdestruct.png)
710707

711708
```
712-
Self-destruct' 'triggered.\r\n5\r\n4\r\n3\r\n2\r\n1\r\nBOOM!!!\r\nFake' 'explosion.' 'I' 'hope' 'it' 'scared' 'you' 'away\r\n
709+
Self-destruct triggered.
710+
5
711+
4
712+
3
713+
2
714+
1
715+
BOOM!!!
716+
Fake explosion. I hope it scared you away
713717
```
714718

715719
We later learned that this was happening only when a particular bit was asserted during shift-in and latch (see below). But the net effect here was that any time we tried to JTAGulated the target, it would emit this self-destruct! Fun.
@@ -961,7 +965,9 @@ There was no boundary scan implemented here, just that one LED control bit. Prob
961965

962966
#### The Last Straw
963967

964-
On April 9th (2018) we contacted Alex again:
968+
So, we were left with a search through roughly 384 offsets in frameB through a short (and known) list of password-pairs combined with only a couple variations of AES and bit orders. Which we searched through. Again. Still nothing.
969+
970+
On April 9th (2018) we contacted Alex again and kept working on side-channel analysis to try to figure out the actual AES key and offset.
965971

966972
> Hi Alex, I'm sorry to report that we haven't been able to convert all your help into something useful . Lots of the known space searched, but no flags. We think that either 1) we need to do something special in packing the response to avoid the stuck bits (the ones that read-back zero after a latch) or 2) there is a password-preparation routine that needs to be applied to the concatenation of the two words from the list before using it as an AES key. We think we can figure out 2 by SCA on the target during the operations is performs when the challenge bit is set -- so far we're just getting slowed down by our tooling setup requiring the CW instead of the picoscope for this challenge. I hope to remove that restriction today and get a better look at AES during latch of the challenge bit.
967973
@@ -971,7 +977,7 @@ On April 9th (2018) we contacted Alex again:
971977

972978
Sorry, reader. I honestly don't know :)
973979

974-
It turns out that the challenge binaries which were made available for download were different than the binaries that they tested for the challenge. This is somewhat understandable though -- recall that the challenges are individually encrypted for each board. SO... the testing we were doing against our RHME3 board was different than the verification that poor Alex was doing on his end. He eventually got back to us with the good/bad news:
980+
It turns out that the challenge binaries which were made available for download were different than the binaries that they tested for the challenge. This is somewhat understandable though -- recall that the challenges are individually encrypted for each board. SO... the testing we were doing against our RHME3 board was different than the verification that poor Alex was doing on his end. He eventually got back to us on April 13th with the good/bad news:
975981

976982
![bug](car_key_fob_hardware_backdoor/there_was_a_bug.png)
977983

0 commit comments

Comments
 (0)