AUSTCTF2023 WriteUp

Basic

basic1

C语言基础,没啥好说的。。

basic2

2022蓝桥杯真题,其实搜一下答案就出来了

#include 

const int N = 2022, k = 10;

long long pd[N + 1][k + 1]{1};

int main() {
    for (int i = 1; i <= N; ++i)
        for (int j = 1; j <= k; ++j)
            if (i >= j) pd[i][j] = pd[i - j][j] + pd[i - j][j - 1];
    printf("%lld", pd[N][k]);
}

basic3

右键查看网页源代码

找一下就能发现austctf{}关键字

Misc

misc1

第一张图:20%和80% 猜测可能是 28或82 第二张图:一张八卦图 猜测是08 第三张图:而立之年 30而立嘛 肯是30 第四张图:北斗七星图 07 第五张图:江南四大才子 04 第六张图:飞机歼-20 20 第七张图:两只黄鹂鸣翠柳 02 第八张图:一起去看流星雨 17 第九张图:乔丹 23 第十张图:一马当先 01 第十一张图:12星座 12 第十二张图: 新闻联播 一般我晚上 7点或者19.00

misc2

ctf中常见的二维码修复,由图可知缺上面两角,使用草料二维码生成一个普通二维码,裁剪上面左右两角拼接,识别失败。。。发现左下的角有点特别,裁掉换成类似上面左右的角,识别成功,解得flag。

misc3

不会爆破。。

Crytpe

crytpe1

社会主义核心价值观编码,找个网站解下码

crytpe2

《球球你不要再套娃辣》第一反应就是basexx嵌套加密的,但是但是我只记得有base100,base91啥的,愣是想不到有base32编码。。。最后没解出来,遗憾。。

crytpe3

不会。。。

Reveser

re1

简单编程题,写个脚本即可

s = input()
n = 0
for i in s:
    if i=='*':
        n+=1
print(n)

re2

没做出来。。。

re3

最遗憾的一题呜呜呜

求迷宫路径

第一关 用眼可以看出路径:

sssssaawwwdd

不行

加空格 s s s s s a a w w w d d

过了

然后一个闪屏,窗口结束了

于是我写了一个bat脚本防止exe结束

    @echo off
    call %1
    echo.
    echo.
    pause

然后重复上面步骤直接就到了第三关。。。(后面跟学长交流发现这好像是bug

第三关给了一个迷宫

1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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0 0 0 0 0 0 0 0 0 0
1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

python解迷宫脚本:

from collections import deque

def solve_maze(maze):
    start = find_start(maze)
    end = find_exit(maze)
    queue = deque([(start, "")])
    visited = set()

    while queue:
        curr, path = queue.popleft()
        row, col = curr

        if curr == end:
            return path

        if curr in visited:
            continue
        visited.add(curr)
        if row > 0 and maze[row-1][col] == 0:
            queue.append(((row-1, col), path + "w"))

        if row < len(maze) - 1 and maze[row+1][col] == 0:
            queue.append(((row+1, col), path + "s"))

        if col > 0 and maze[row][col-1] == 0:
            queue.append(((row, col-1), path + "a"))


        if col < len(maze[0]) - 1 and maze[row][col+1] == 0:
            queue.append(((row, col+1), path + "d"))

    return None

def find_start(maze):
    for i in range(len(maze)):
        for j in range(len(maze[0])):
            if maze[i][j] == 0:
                return (i, j)

def find_exit(maze):
    for i in range(len(maze)):
        if maze[i][-1] == 0:
            return (i, len(maze[0])-1)

# 迷宫地图
maze = [
...
]

path = solve_maze(maze)

if path:
    print(path)
else:
    print("no path")

求解出路径:

ssddddddddddddddddddssssssssssdddddddddddddddddddddddddddddddwwwwwwaaaaaaaaassddddddssaaaaaaaaaaaaawwdddwwwwwddddddddddddddddddddddddddsssssssssssssssddddddddddddddddwwwwwwwwwwwwwaaaaaaawwwwddddddddddddsssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaawwwwdddddddddddddddddddddsddddddddddddddwwwaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssdddddwwwddddsssssaaaaaaaaassssddddddddddwwwddddddddddddddddddddddddddddddddddddddddddddddddssssssdddddddddddddddddddddddddddd

由于flag为AustCtf{md5(最后一个迷宫的path),需要求上面路径的MD5,于是用在线工具求出了md5,提交,但是但是,不知道是哪里的问题,提交的flag全都过不了,后面一度以为是我路径求错了,但是后面结束后问学长,路径并没有错,但终究是没过,太难受了。

通过这次比赛,深刻体会了竞技体育的残酷,CTF如此,ACM亦如是,菜是原罪,赛后懊恼了很久,这种感觉很熟悉,感觉像是回到了高中,过程全对结果算错最后拿了零分的那种感觉,上了大学后才第一次体会到。但是,想到我之前从未接触过ctf,甚至考前一天才开始做ctf题目,题目能做出来全靠自己平时无意的积累,能拿到这个名次还是很不错的,如果有下次,一定会更好!

end

你可能感兴趣的:(python,网络安全)