ev3_basic——HITCON CTF 2018

[MISC]python


EN-US

This challenge provides a jpg file and a pklg file. The jpg is shown a part of string on LEGO EV3 device. Length of the string, I guess, might be 58. EV3 is supported USB or Bluetooth connection. Bluetooth connection is hinted in the pklg file opened with Wireshark. Transmission is wored between two RFCOMM protocol entities. There are two types in all RFCOMM packages. Much attention should be focused on "Sent", while the "Rcvd" packages are botrh same like each other.ide

There are three different length of packages: 32, 33, 34. After analysising, I notice three key position, shown below (I called them in turn as: Order in group, Group number, Data):調試

if length == 32:日誌

Order in group        0x81  Group number  0x84  Data

if length == 33:code

0x81  Order in group        0x81  Group number  0x84  Data

if length == 34:blog

0x82  Order in group  0x00  0x81  Group number  0x84  Data

Sort them by Group number at first. If equal, sorted by Order in group排序

h,b0017 2711 0a 28 68
i,b0017 2711 14 28 69
t,b0017 2711 1e 28 74
c,c0018 2912 28 28 63
o,c0018 2912 32 28 6f
n,c0018 2912 3c 28 6e
{,c0018 2912 46 28 7b
m,c0018 2912 50 28 6d
1,c0018 2912 5a 28 31
n,c0018 2912 64 28 6e
d,c0018 2912 6e 28 64 
5,c0018 2912 78 28 35 
t,d0019 2b13 82 28 74
0,d0019 2b13 8c 28 30 
r,d0019 2b13 96 28 72
m,d0019 2b13 a0 28 6d 

_,b0017 2711 0a 36 5f
c,b0017 2711 14 36 63 
o,b0017 2711 1e 36 6f
m,c0018 2912 28 36 6d
m,c0018 2912 32 36 6d 
u,c0018 2912 3c 36 75
n,c0018 2912 46 36 6e
i,c0018 2912 50 36 69
c,c0018 2912 5a 36 63
a,c0018 2912 64 36 61
t,c0018 2912 6e 36 74
i,c0018 2912 78 36 69
o,d0019 2b13 82 36 6f
n,d0019 2b13 8c 36 6e
_,d0019 2b13 96 36 5f 
a,d0019 2b13 a0 36 61

n,b0017 2711 0a 44 6e
d,b0017 2711 14 44 64
_,b0017 2711 1e 44 5f 
f,c0018 2912 28 44 66
i,c0018 2912 32 44 69
r,c0018 2912 3c 44 72 
m,c0018 2912 46 44 6d
w,c0018 2912 50 44 77
a,c0018 2912 5a 44 61
r,c0018 2912 64 44 72
e,c0018 2912 6e 44 65
_,c0018 2912 78 44 5f 
d,d0019 2b13 82 44 64
e,d0019 2b13 8c 44 65 
v,d0019 2b13 96 44 76 
e,d0019 2b13 a0 44 65

l,b0017 2711 0a 52 6c
o,b0017 2711 14 52 6f
p,b0017 2711 1e 52 70
e,c0018 2912 28 52 65
r,c0018 2912 32 52 72
_,c0018 2912 3c 52 5f
k,c0018 2912 46 52 6b
i,c0018 2912 50 52 69
t,c0018 2912 5a 52 74
},c0018 2912 64 52 7d

ZH-CN

題目給了一個圖片和一個流量包。three

圖片給了一個樂高LEGO EV3設備。屏幕上有"hitcon{"開頭的字樣,中間有單獨字符和間隔,看來是關鍵是要找字符了。順帶根據間隔的位置,大體數出來每行可能有16個字符,最後一行是10個字符,一共是58個。查了一下這個設備,支持USB、藍牙等方式鏈接,而後再流量包裏也看到被wireshark識別出來的HCI和RFCOMM。數量最多的那種包可能只是一個調試器日誌。其餘信息,能夠看到出題人是用mac下的python鏈接的,不過這沒什麼用。圖片

簡單介紹一下這幾個協議的關係。string

因此基本肯定了數據在RFCOMM協議中。基本爲兩種包,一種是發送,另外一個是接受確認。接受確認基本都同樣,很短,辨識度很高,因此不會有信息。就剩下sent發送包。而後就找到了"{"和"}",信息在send裏,基本就坐實了。

send分爲三種長度,分別是32,33,34。
三種數據包的以下

圈出來三者的含義我姑且定義爲分別表示了組內序號,組號,字符:

變化的部分有價值的主要是組內序號的部分
32的:直接是組內訊號
33的:組內序號前加了0x81
34的:組內序號前加了0x82,序號後加了0x00

摘出來數據後排序便可。至此解出。下附結果

h,b0017 2711 0a 28 68
i,b0017 2711 14 28 69
t,b0017 2711 1e 28 74
c,c0018 2912 28 28 63
o,c0018 2912 32 28 6f
n,c0018 2912 3c 28 6e
{,c0018 2912 46 28 7b
m,c0018 2912 50 28 6d
1,c0018 2912 5a 28 31
n,c0018 2912 64 28 6e
d,c0018 2912 6e 28 64 
5,c0018 2912 78 28 35 
t,d0019 2b13 82 28 74
0,d0019 2b13 8c 28 30 
r,d0019 2b13 96 28 72
m,d0019 2b13 a0 28 6d 

_,b0017 2711 0a 36 5f
c,b0017 2711 14 36 63 
o,b0017 2711 1e 36 6f
m,c0018 2912 28 36 6d
m,c0018 2912 32 36 6d 
u,c0018 2912 3c 36 75
n,c0018 2912 46 36 6e
i,c0018 2912 50 36 69
c,c0018 2912 5a 36 63
a,c0018 2912 64 36 61
t,c0018 2912 6e 36 74
i,c0018 2912 78 36 69
o,d0019 2b13 82 36 6f
n,d0019 2b13 8c 36 6e
_,d0019 2b13 96 36 5f 
a,d0019 2b13 a0 36 61

n,b0017 2711 0a 44 6e
d,b0017 2711 14 44 64
_,b0017 2711 1e 44 5f 
f,c0018 2912 28 44 66
i,c0018 2912 32 44 69
r,c0018 2912 3c 44 72 
m,c0018 2912 46 44 6d
w,c0018 2912 50 44 77
a,c0018 2912 5a 44 61
r,c0018 2912 64 44 72
e,c0018 2912 6e 44 65
_,c0018 2912 78 44 5f 
d,d0019 2b13 82 44 64
e,d0019 2b13 8c 44 65 
v,d0019 2b13 96 44 76 
e,d0019 2b13 a0 44 65

l,b0017 2711 0a 52 6c
o,b0017 2711 14 52 6f
p,b0017 2711 1e 52 70
e,c0018 2912 28 52 65
r,c0018 2912 32 52 72
_,c0018 2912 3c 52 5f
k,c0018 2912 46 52 6b
i,c0018 2912 50 52 69
t,c0018 2912 5a 52 74
},c0018 2912 64 52 7d
相關文章
相關標籤/搜索