小猪佩奇
用stegsolve打开,发现Green plane 0 和Blue plane 0,两张图那个小猪里面好像有一个二维码的线条,证明了这个题目是lsb加密图片隐写 根据出题人提示,
把得到的字典倒过来
代码语言:javascript复制file = open('passwd.txt', "r")
list = file.readlines()
file.close()
list.reverse()
file = open('12.txt', "w")
for value in list:
file.write(value)
file.close()
用大佬写好的脚本爆破 https://github.com/livz/cloacked-pixel 需要下载上面的脚本 和 下面的脚本放在一个目录下
代码语言:javascript复制#coding:utf-8
import threading
from PIL import Image
from lsb import extract
import re
with open('pass.txt','r ') as f:
f=f.readlines()
filename='flag.png'
def to_decode():
for i in f:
i=i.replace('n','')
if len(i)==7 and re.search('[0-9!?]',i)==None:
out_file=i '.txt'
extract(filename,out_file,i)
to_decode()
得到很多txt文件, 写脚本读取所有的文件名
代码语言:javascript复制#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import os
def file_name(file_dir):
for root, dirs, files in os.walk(file_dir):
print(files) # 当前路径下所有非目录子文件
file_name('./')
然后写批量shell命令查看得到的txt内容类型
代码语言:javascript复制#-*-coding:utf-8-*-
import os
a = ['abcdefg.txt', 'america.txt', 'anthony.txt', 'antonio.txt', 'arsenal.txt', 'asshole.txt',
'barbara.txt', 'blessed.txt', 'bonjour.txt', 'brandon.txt', 'bubbles.txt', 'cameron.txt',
'charles.txt', 'charlie.txt', 'chelsea.txt', 'chester.txt', 'chicago.txt', 'chicken.txt',
'claudia.txt', 'cowboys.txt', 'crystal.txt', 'daniela.txt', 'destiny.txt', 'diamond.txt',
'dolphin.txt', 'Exigent.txt', 'ferrari.txt', 'fishing.txt', 'florida.txt', 'flowers.txt',
'forever.txt', 'freedom.txt', 'friends.txt', 'fuckoff.txt', 'fuckyou.txt', 'gabriel.txt',
'heather.txt', 'hotmail.txt', 'iloveme.txt', 'jackass.txt', 'jackson.txt', 'jasmine.txt',
'jessica.txt', 'krishna.txt', 'letmein.txt', 'loveyou.txt', 'madison.txt', 'martina.txt',
'matthew.txt', 'maxwell.txt', 'melanie.txt', 'melissa.txt', 'michael.txt', 'mnbvcxz.txt',
'monster.txt', 'mustang.txt', 'myspace.txt', 'natalia.txt', 'natalie.txt', 'natasha.txt',
'newyork.txt', 'nicolas.txt', 'nirvana.txt', 'nothing.txt', 'october.txt', 'onelove.txt',
'orlando.txt', 'passion.txt', 'patrick.txt', 'peaches.txt', 'phoenix.txt', 'playboy.txt',
'pokemon.txt', 'popcorn.txt', 'pumpkin.txt', 'qwertyu.txt', 'raiders.txt', 'rainbow.txt',
'rangers.txt', 'rebecca.txt', 'richard.txt', 'ronaldo.txt', 'sabrina.txt', 'samsung.txt',
'scooter.txt', 'scorpio.txt', 'shannon.txt', 'stalker.txt', 'success.txt', 'thunder.txt',
'tiffany.txt', 'trinity.txt', 'tudelft.txt', 'vanessa.txt', 'vincent.txt', 'welcome.txt',
'william.txt', 'windows.txt', 'winston.txt', 'yankees.txt', 'zxcvbnm.txt']
for i in range(0,len(a)):
os.system('file ' a[i])
把那个文件后缀改为png 打开图像发现是个二维码, 扫码得到flag