BUUCTF [ACTF新生赛2020]base64隐写 1

简介: BUUCTF [ACTF新生赛2020]base64隐写 1

BUUCTF:https://buuoj.cn/challenges

题目描述:

得到的 flag 请包上 flag{} 提交。

密文:

下载附件,解压得到.zip文件,再次解压得到两个文件。


解题思路:

1、打开ComeOn!.txt文件,发现一大串经过Base64加密的密文,如下图。

STJsdVkyeDFaR1U4YVc5emRISmxZVzArQ2c9PQ1=
STJsdVkyeDFaR1U4YzNSeWFXNW5QZ289DQ==
STJsdVkyeDFaR1U4WTNOMGNtbHVaejRLDV==
STJsdVkyeDFaR1U4WTNOMFpHbHZQZ289DQ==
STJSbFptbHVaU0J0WVhodUlEazVPUW89Dd==
Q2c9PQ1=
ZFhOcGJtY2dibUZ1WlhOd1lXTmxJSE4wWkRzSw1=
Q2c9PQ0=
WTJoaGNpUmpZVnR0WVhodVhTd2dZMkpiYldGNGJsMDdDZz09DU==
Q2c9PQ1=
YVc1MElHTnRjQ2h6ZEhKcGJtY2dZU3dnYzNSeWFXNW5JR2lwQ2c9PQ2=
ZXdvPQ1=
SUNBZ3lHbG1LR3V1YzJsNlpTZ3BJRDRnWWk1emFYcGxLQ2twQ2c9PQ3=
SUNBZ0lDbWdJb0J5WlhSMWNtNGdNVHNLDb==
SUNBZ0lHVnNjMlVnYVdZb1lTNXphWHBsS0NrZ1BDQmlMbk5wZW1Vb0tTa0sN
SUNBZ0lDQWdJQ0J5WlhSMWNtNGdMVEU3Q2c9PQ0=
SUNBZ0lHVnNjMlVLDd==
SUNBZ0lIc0sN
SUNBZ0lDQWdJQ0JtYjNJb2FXNTBJR2tnUFNBd095QnBJRHdnWVM1emFYcGxLQ2s3SUdrckt5a0sN
SUNBZ2lDQWdJQ2I3Q2c9PQ2=
SUNBZ1lDQWdJQ1FnSUNBZ2FXWW9ZVnRwWFNBOElHSmJhVjBwQ2c9PQ1=
SUNBZ0lDYWdJY0FnSUNBZ0lDYWdJSEpsZEhWeWJpYXRNVHNLDY==
SUNBZ1lDQWdJQ1F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a0sN
ZXdvPQ0=
SUNBZ0lITjBjbWx1WnlCNExDQjVPd289DQ==
SUNBZ0lIQnlhVzUwWmlnaTZLKzM2TDZUNVlXbDVMaWs1TGlxNUxxTTZMK2I1WWkyNXBXdzVhMlhPaUFpS1RzSw0=
SUNBZ0lHTnBiajQrZUQ0K2VUc0sN
SUNBZ0lITjBjbWx1WnlCaGJuTWdQU0J0ZFd3b2VDd2dlU2s3Q2c9PQ0=
SUNBZ0lHTnZkWFE4UEdGdWN6c0sN
ZlFvPQ0=

2、结合题目提示和密文特征,猜测为Base64隐写,使用如下Python脚本进行解密。

base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
binstr=""
strings = open('./base64.txt').read()
e = strings.splitlines()
for i in e:
    if i.find("==") > 0:
        temp = bin((base64.find(i[-3]) & 15))[2:]
        # 取倒数第3个字符,在base64找到对应的索引数(就是编码数),取低4位,再转换为二进制字符
        binstr = binstr + "0" * (4 - len(temp)) + temp  # 二进制字符补高位0后,连接字符到binstr
    elif i.find("=") > 0:
        temp = bin((base64.find(i[-2]) & 3))[2:]  # 取倒数第2个字符,在base64找到对应的索引数(就是编码数),取低2位,再转换为二进制字符
        binstr = binstr + "0" * (2 - len(temp)) + temp  # 二进制字符补高位0后,连接字符到binstr
str = ""
for i in range(0, len(binstr), 8):
    str = str + chr(int(binstr[i:i + 8], 2))  # 从左到右,每取8位转换为ascii字符,连接字符到字符串
print(str)

运行脚本,得到flag。

flag:

flag{6aseb4_f33!}
目录
相关文章
|
7月前
BUUCTF [SWPU2019]我有一只马里奥 1
BUUCTF [SWPU2019]我有一只马里奥 1
228 0
BUUCTF [SWPU2019]我有一只马里奥 1
|
4月前
[SWPUCTF 2022 新生赛]base64
[SWPUCTF 2022 新生赛]base64
63 0
BUUCTF[ACTF2020 新生赛]Exec1
BUUCTF[ACTF2020 新生赛]Exec1
|
4月前
|
数据安全/隐私保护
NSS [SWPUCTF 2022 新生赛]奇妙的MD5
NSS [SWPUCTF 2022 新生赛]奇妙的MD5
44 0
|
存储
[ACTF新生赛2020]SoulLike 题解
[ACTF新生赛2020]SoulLike 题解
150 0
|
7月前
|
PHP
BUUCTF---[ACTF2020 新生赛]BackupFile1
BUUCTF---[ACTF2020 新生赛]BackupFile1
|
7月前
|
Python
BUUCTF---misc---[ACTF新生赛2020]base64隐写
BUUCTF---misc---[ACTF新生赛2020]base64隐写
|
7月前
|
PHP
[ACTF2020 新生赛]Include1
[ACTF2020 新生赛]Include1
|
7月前
|
数据安全/隐私保护
BUUCTF [ACTF新生赛2020]swp 1
BUUCTF [ACTF新生赛2020]swp 1
173 1
|
7月前
|
数据安全/隐私保护
BUUCTF [ACTF新生赛2020]outguess 1
BUUCTF [ACTF新生赛2020]outguess 1
144 0
BUUCTF [ACTF新生赛2020]outguess 1