有趣的Hack-A-Sat黑掉卫星挑战赛——AES加密通信链路侧信道攻击leaky

国家太空安全是国家安全在空间领域的表现。随着太空技术在政治、经济、军事、文化等各个领域的应用不断增加,太空已经成为国家赖以生存与发展的命脉之一,凝聚着巨大的国家利益,太空安全的重要性日益凸显[1]。而在信息化时代,太空安全与信息安全紧密地结合在一起。

2020年9月4日,美国白宫发布了首份针对太空网络空间安全的指令——《航天政策第5号令》,其为美国首个关于卫星和相关系统网络安全的综合性政策,标志着美国对太空网络安全的重视程度达到新的高度。在此背景下,美国自2020年起,连续两年举办太空信息安全大赛“黑掉卫星(Hack-A-Sat)”,在《Hack-A-Sat太空信息安全挑战赛深度解析》一书中有详细介绍,本文介绍了Hack-A-Sat黑掉卫星挑战赛的AES加密通信链路侧信道攻击leaky这道赛题的解题过程。

题目介绍

My crypto algorithm runs in constant time, so I'm safe from sidechannel leaks, right?

Note: To clarify, the sample data is plaintext inputs, NOT ciphertext

Given files: leaky-romeo86051romeo.tar.bz2

题目很短,使用netcat连接上主办方给出的链接地址后,会得到更多的信息,如下所示:

Hello, fellow space enthusiasts!

I have been tracking a specific satellite and managed to intercept an interesting

piece of data. Unfortunately, the data is encrypted using an AES-128 key with ECB-Mode.

Encrypted Data:

7972c157dad7b858596ecdb798877cc4ed4b03d6822295954e69b7ecebb704af08c054a03a374f8bdaa18ff16ba09be2b6b25f1ef73ef80111646de84cd3af2514501e056889e95c680f7d199b6531e9dd6ee599aeb23835327e6e853a9a40a9f405bd1443e014363ea46631582b97c3d3f83f4e1101da2557f9b03808a61968

Using proprietary documentation, I have learned that the process of generating the

AES key always produces the same first 6 bytes, while the remaining bytes are random:

Key Bytes 0..5: 97ca6080f575

The communication protocol hashes every message into a 128bit digest, which is encrypted

with the satellite key, and sent back as an authenticated ACK. This process fortunately

happens BEFORE the satellite attempts to decrypt and process my message, which it will

immediately drop my message as I cannot encrypt it properly without the key.

I have read about "side channel attacks" on crypto but don't really understand them,

so I'm reaching out to you for help. I know timing data could be important so I've

already used this vulnerability to collect a large data set of encryption times for

various hash values. Please take a look!

上述信息很长,从中可以分析出如下关键信息:

(1)这是一道密码破译的题目,使用的加密算法是ECB模式的AES-128,AES是高级加密标准(Advanced Encryption Standard),后文会有介绍。

(2)可知密钥的前6个字节是97ca6080f575。

(3)已经知道了加密后的密文,要获取该密文对应的明文,该明文应该就是flag值。

(4)应该会用到AES侧信道攻击,并且该攻击利用了加解密时间信息。

(5)在给出的压缩文件中,有一个test.txt,其中有100 000条数据,每一行包括两部分,前一部分是明文字符串,后一部分是使用AES加密该明文字符串的时间(时间的单位未知,但是这个也不重要,不影响解题),部分数据示例如下:

ed74cd51ab28e765d1e98965e86ba749,10584

ea0c914e1ff97edbe3bd46228f53771e,10656

3e8d4ed226d2ffea86fcf8be22af3e33,10704

3bd7f7bb63745fc45940220e417a116d,10632

99c5843576a344f0d8ec990795912a38,10632

34239b24eef47313a14e0a55767810dd,10632

7b9ae4bdb410862d12de1d94cd40853a,10656

f54c322e63f3b169fdfb4b161decc9b6,10680

91359a6820ecadafd2e616aa2c0baa42,10680

c4ce053a2df7f883d24905856df2b180,10656

......

(6)参考以前的挑战题,知道明文的前几个字节是“flag”。

总的来说,这道挑战题就是已知加密算法是AES,还已知密钥的部分字节、明文信息的部分字节,并且已经有了大量的加密测试数据,要求使用侧信道攻击的方式,获取正确的密钥。

编译及测试

为了检验下载的源代码是否正确,可以先编译并测试一下。进入hackasat2020的leaky目录下,查看challenge、solver目录下的Dockerfile,发现其中用到的是python:3.7-slim,为了加快题目的编译进度,在leaky目录下新建一个文件sources.list,内容如下:

deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib

deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib

deb https://mirrors.aliyun.com/debian-security/ bullseye-security main

deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main

deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib

deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib

deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

将sources.list复制到leaky、challenge、solver目录下,修改challenge、solver目录下的Dockerfile,在所有的FROM python:3.7-slim下方添加:

ADD sources.list /etc/apt/sources.list

在所有的pip命令后方添加指定源:

-i Simple Index

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值