首页
社区
课程
招聘
[原创] KCTF 第六题 Writeup
发表于: 2022-11-28 16:14 6623

[原创] KCTF 第六题 Writeup

2022-11-28 16:14
6623

写了一个丑陋的爆破脚本hh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int check(unsigned int * cmp){
 
    for(int i=0;i<20;i++){
        if(cmp[i] != rand()){
            return 0;
        }
    }
    return 1;
}
int main()
{
    unsigned char print[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~";
    unsigned char tmp[8];
    unsigned int cmp1[20] = {
    0x00003BFC, 0x00002173, 0x000025BB, 0x0000380B, 0x00002C13, 0x000075BE, 0x00007366, 0x000046A3,
    0x000013C1, 0x0000159B, 0x00005B5F, 0x0000534F, 0x00004E37, 0x00003A04, 0x00001301, 0x00005D0C,
    0x00004155, 0x000048E9, 0x000061D2, 0x00006158
};
unsigned int cmp2[20] = {
    0x00002BB6, 0x00006B5A, 0x000003D4, 0x0000152B, 0x00006E04, 0x0000254C, 0x000040AE, 0x000056CA,
    0x000017E1, 0x000055C7, 0x00003641, 0x00002D3C, 0x00000A41, 0x00004BC5, 0x00006233, 0x00001FE7,
    0x00006E05, 0x00000F6E, 0x00006398, 0x00006AD7
};
    memset(tmp, 0, 8);
    for (int a = 0; a < strlen(print); a++)
    {
        tmp[0] = print[a];
        for (int b = 0; b < strlen(print); b++)
        {
            tmp[1] = print[b];
            for (int c = 0; c < strlen(print); c++)
            {
                tmp[2] = print[c];
                for (int d = 0; d < strlen(print); d++)
                {
                    tmp[3] = print[d];
                    for (int e = 0; e < strlen(print); e++)
                    {
                        tmp[4] = print[e];
                        int num = atoi(tmp);
                        srand(num);
                        if(check(cmp2)){
                            printf("%s",tmp);
                            exit(0);
                        }
                    }
                }
            }
        }
    }
}

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//