题目链接
https://buuoj.cn/challenges#[QCTF2018]X-man-Keyword
注意:在Github里有题目描述,而BUUCTF平台上没有提示。
Welcome to QCTF
hint1:把给出的keyword放到前面试试
hint2:一种把关键词提前的置换
解题过程
题目是张图片:
”lovekfc“应该是和hint2里提到的关键词。用binwalk分析,没有什么东西。在stegsolve里也没有发现异常。在kali用lsb.py试试:
python2 lsb.py extract attachment.png attachment.txt lovekfc
查看attachment.txt文件,得到密文:
PVSF{vVckHejqBOVX9C1c13GFfkHJrjIQeMwf}
根据“hint1:把给出的keyword放到前面试试”的提示,从26个英文字母里把 “lovekfc”提出来放到前面做密钥。
lovekfcabdghijmnpqrstuwxyz
然后根据密钥替换密文中的字母解密(应该是Nihilist加密),这步用脚本来实现:
# -*- coding:utf-8 -*-
import string
ciphertext = 'PVSF{vVckHejqBOVX9C1c13GFfkHJrjIQeMwf}'
secretkey = 'lovekfcabdghijmnpqrstuwxyz'
plaintext = ''
for letter in ciphertext:
if letter in string.ascii_lowercase:
index = secretkey.lower().index(letter)
plaintext += string.ascii_lowercase[index]
continue
if letter in string.ascii_uppercase:
index = secretkey.upper().index(letter)
plaintext += string.ascii_uppercase[index]
continue
plaintext += letter
print(plaintext)
运行结果:
QCTF{cCgeLdnrIBCX9G1g13KFfeLNsnMRdOwf}
小结
知识点:lsb隐写、Nihilist加解密。