携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第12天,点击查看活动详情
[b01lers2020]image_adjus
原图做了高度随机变换,需要进行还原,还原时可以利用红色部分进行对齐。
找了个大佬的脚本
import cv2
from PIL import Image
import numpy as np
img = cv2.imread('attachment.png')
flag = np.array([[255]*1500]*200,np.uint8)
for col in range(1500): # 对每一列进行处理
for i in range(200): # 遍历一列中的像素,找到 白(255,255,255) 红(0,0,255) 相间的索引值(通道顺序:BGR)
if img[i-1,col,0]==255 and img[i,col,0]==0 and img[i,col,2]==255:
for j in range(200):
flag[(j+(189-i))%200,col] = img[j,col,0] # 这个地方的算法自己体会吧
Image.fromarray(flag).save('flag.bmp')
flag{ShuFfLiNg_Fl4gs}
[INSHack2018]GCorp - Stage 1
While loosing some time on the Internet you fell on a old blog-post aboutconspiracy theories...
A self proclaimed hacker attached a network capture in a comment of this posttelling that he will be 0xdeadbeef before finishing the work.
Even if the job seems risky you can't help it, you wanna look at it...the adventure begins...
流量包,我们追踪TCP流,发现了一串bas编码,解码即可。
flag{c1807a0b6d7713274d7bf3c6477562ac47570e452f77b7d202b81e149172d6a7}
[GWCTF2019]huyao
两张差不多的图片,猜测是盲水印隐写,这题比较特殊是频域盲水印隐写。我们需要找个脚本。
# coding=utf-8
import cv2
import numpy as np
import random
import os
from argparse import ArgumentParser
ALPHA = 5
def build_parser():
parser = ArgumentParser()
parser.add_argument('--original', dest='ori', required=True)
parser.add_argument('--image', dest='img', required=True)
parser.add_argument('--result', dest='res', required=True)
parser.add_argument('--alpha', dest='alpha', default=ALPHA)
return parser
def main():
parser = build_parser()
options = parser.parse_args()
ori = options.ori
img = options.img
res = options.res
alpha = options.alpha
if not os.path.isfile(ori):
parser.error("original image %s does not exist." % ori)
if not os.path.isfile(img):
parser.error("image %s does not exist." % img)
decode(ori, img, res, alpha)
def decode(ori_path, img_path, res_path, alpha):
ori = cv2.imread(ori_path)
img = cv2.imread(img_path)
ori_f = np.fft.fft2(ori)
img_f = np.fft.fft2(img)
height, width = ori.shape[0], ori.shape[1]
watermark = (ori_f - img_f) / alpha
watermark = np.real(watermark)
res = np.zeros(watermark.shape)
random.seed(height + width)
x = range(height / 2)
y = range(width)
random.shuffle(x)
random.shuffle(y)
for i in range(height / 2):
for j in range(width):
res[x[i]][y[j]] = watermark[i][j]
cv2.imwrite(res_path, res, [int(cv2.IMWRITE_JPEG_QUALITY), 100])
if __name__ == '__main__':
main()
python decode.py --original huyao.png --image stillhuyao.png --result res.png
flag{BWM_1s_c00l}
[INSHack2018]Self Congratulation
附件是一张图片,我们发现类似于二维码的黑白块。
黑白相间块的话就按照二维的方式来转化为二进制,白为0,黑为1 。得到
001100010011001000110011001101000011010100110110001101110011100000
直接二进制转字符串
flag{12345678}
[GKCTF 2021]你知道apng吗
先根据题目,可以联想用浏览器打开。是一种动图格式。火狐浏览器就可以打开。
这里我们需要工具来分解动图
得到的图片中有几个含有二维码,但是被拉扯的,我们可以用PS扭曲修复,其他的不清楚的二维码可以用StegSolve查看,扫出来拼接就是flag
flag{a3c7e4e5-9b9d-ad20-0327-288a235370ea}
[DDCTF2018]第四扩展FS
附件是一个jpg,大小不符合常规,怀疑图片里面藏东西了,我们用binwalk分离一下,得到一个zip压缩包,需要密码。
接着用exiftool工具跑一下,发现隐藏数据Pactera。
解压后得到TXT文本,里面全是类似flag的字符串与{},找个字频统计网站按顺序排列就是flag
或者找个脚本
from collections import Counter
with open('file.txt', 'r') as f:
data = f.read()
result = Counter(data)
flag = [key for key, value in sorted(result.items(), key=lambda k: k[1], reverse=True)]
print(''.join(flag))
DCTF{huanwe1sik4o!}