黑与白

原题链接:http://www.shiyanbar.com/ctf/1925

首先打开扫描二维码得到博客地址:HttP://pcat.cnbloGs.cOM?Hh

用StegDetect扫描得到隐写工具:


jphide打开图片,提取隐藏信息需要密码

根据博客地址的大小写判断为培根密码,运行脚本解密得到密码 tacp


得到文件用记事本查看得到flag

CTF{123pcat321_Jphide}

培根密码解密脚本

#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
first_cipher = ["aaaaa","aaaab","aaaba","aaabb","aabaa","aabab","aabba","aabbb","abaaa","abaab","ababa","ababb","abbaa","abbab","abbba","abbbb","baaaa","baaab","baaba","baabb","babaa","babab","babba","babbb","bbaaa","bbaab"]
second_cipher = ["aaaaa","aaaab","aaaba","aaabb","aabaa","aabab","aabba","aabbb","abaaa","abaaa","abaab","ababa","ababb","abbaa","abbab","abbba","abbbb","baaaa","baaab","baaba","baabb","baabb","babaa","babab","babba","babbb"]
e_string = raw_input("please input string to decode:\n")
e_array = re.findall(".{5}",e_string)
d_string1 = ""
d_string2 = ""
for index in e_array:
    for i in range(0,26):
        if index == first_cipher[i]:
            d_string1 += alphabet[i]
        if index == second_cipher[i]:
            d_string2 += alphabet[i]
print "first decode method result is:\n"+d_string1
print "second decode method result is:\n"+d_string2


你可能感兴趣的:(CTF,隐写术,实验吧)