Back

DASCTF 2021-09 Writeup

被队友鸽了,久违的个人赛

[RE]ea5ycpp

一开始还被逻辑绕了一下,结果发现核心部分就是brainfuck

有一些结构体,可以恢复一下,会比较好看

brainfuck解析出来就是简单的加减法

#include <stdio.h>
#include <stdlib.h>

	unsigned char a[9999];
	int c;
int main(int argc, char **argv)
{
		a[24] += 2;
	while (a[24]) {
		++a[0];
		--a[24];
	}
		a[24] += 3;
	while (a[24]) {
		++a[1];
		--a[24];
	}
		a[24] += 4;
	while (a[24]) {
		++a[2];
		--a[24];
	}
		a[24] += 5;
	while (a[24]) {
		++a[3];
		--a[24];
	}
		a[24] += 6;
	while (a[24]) {
		++a[4];
		--a[24];
	}
		a[24] += 7;
	while (a[24]) {
		++a[5];
		--a[24];
	}
		a[24] += 8;
	while (a[24]) {
		++a[6];
		--a[24];
	}
		a[24] += 9;
	while (a[24]) {
		++a[7];
		--a[24];
	}
		a[24] += 10;
	while (a[24]) {
		++a[8];
		--a[24];
	}
		a[24] += 11;
	while (a[24]) {
		++a[9];
		--a[24];
	}
		a[24] += 12;
	while (a[24]) {
		++a[10];
		--a[24];
	}
		a[24] += 13;
	while (a[24]) {
		++a[11];
		--a[24];
	}
		a[24] += 14;
	while (a[24]) {
		++a[12];
		--a[24];
	}
		a[24] += 15;
	while (a[24]) {
		++a[13];
		--a[24];
	}
		a[24] += 16;
	while (a[24]) {
		++a[14];
		--a[24];
	}
		a[24] += 18;
	while (a[24]) {
		++a[15];
		--a[24];
	}
		a[24] += 19;
	while (a[24]) {
		++a[16];
		--a[24];
	}
		a[24] += 20;
	while (a[24]) {
		++a[17];
		--a[24];
	}
		a[24] += 21;
	while (a[24]) {
		++a[18];
		--a[24];
	}
		a[24] += 22;
	while (a[24]) {
		++a[19];
		--a[24];
	}
		a[24] += 23;
	while (a[24]) {
		++a[20];
		--a[24];
	}
		a[24] += 24;
	while (a[24]) {
		++a[21];
		--a[24];
	}
		a[24] += 25;
	while (a[24]) {
		++a[22];
		--a[24];
	}
		a[24] += 26;
	while (a[24]) {
		++a[23];
		--a[24];
	}

	return 0;
}

根据字符串就能看到比较的位置,密文减一下就行

[RE]easy_math

几个加减法解一下就行,甚至不需要z3

    if ( v20 - v16 == 0x61536369217Di64 )
    {
      if ( v19 - v16 == 0x586531316Fi64 )
      {
        if ( v18 - v16 == 0x5F3631626F4Ei64 )
        {
          if ( v16 + v18 + v19 + v20 == 0xC121F9FCC23Ai64 )

完事之后需要把flag拼一下,而且第一个输入好像没有用?

反正我的输入是这个

439904987003
107079497490813
448374321519
104755080884046
439904987003

[RE]pig_brain_king

玩了一下,发现是个记忆游戏,字符串越来越长,逻辑没有细看,感觉可能找到了flag生成函数吧,不过不重要,pwntools玩通就完事了

from pwn import *

p = process('./pig_brain_king.exe')
context.log_level='debug'

for _ in range(1000):
    p.recvuntil(b'questions!\r\n')
    ans = p.recvline()
    print (ans)
    p.recvuntil(b'enter:')
    p.send(ans)

p.interactive()

脚本没写好,最后一关需要自己动手复制一下(手动狗头)

AK的人有点多,沉思(

[Misc]Girlfriend’s account

一开始还想着找个工具,然后发现各种bug

但认认真真写代码转码是不可能的,这辈子也不可能的,用vscode批量操作一把梭不香吗

girl = [
    (4 * 100 + 6 * 10 + 7 + 3 * 0.1 + 4 * 0.01) * 6,
    (1 * 100 + 6 * 10 + 9 + 0) * 9,
    (4 * 100 + 7 * 10 + 8 + 0) * 8,
    (9 * 100 + 6 * 10 + 2 + 6 * 0.1 + 4 * 0.01) * 5,
    (1 * 100 + 4 * 10 + 5 + 8 * 0.1 + 1 * 0.01) * 9,
    # ...
    (5 * 100 + 8 * 10 + 3 + 2 * 0.1 + 9 * 0.01) * 7,
    (7 * 100 + 8 * 10 + 1 + 9 * 0.1 + 0) * 5,
    (7 * 100 + 7 * 10 +  + 0) * 4,
    (1 * 100 + 1 * 10 + 9 + 9 * 0.1 + 9 * 0.01) * 5,
]

spend = 0

for g in girl:
    spend += g
print (spend)

这账单,幸好没有npy

[Misc]blind

压缩包里有俩“一样”的图片,用工具xor一看,发现只有一点蓝色,猜测可能是个盲水印,上网找工具装环境

解出来发现是个盲文

网上找了半天,才发现是拼音盲文,麻了

[Crypto]签到

说出来可能不信,这求解脚本是我在贴吧找到的…

e=discrete_log(c,mod(m,n))
Built with Hugo
Theme Stack designed by Jimmy