UNCTF2022wp

whereisyourkey

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
v5 = [0] * 10
v5[0] = 0x76
v5[1] = 0x67
v5[2] = 0x70
v5[3] = 0x6B
v5[4] = 0x63
v5[5] = 0x6D
v5[6] = 0x68
v5[7] = 0x6E
v5[8] = 0x63
v5[9] = 0x69

for i in range(10):
if v5[i] == 0x6D:
print("",end="")
elif(v5[i] <= 110):
v5[i] -= 2
else:
v5[i] += 3
print(chr(v5[i]&0xff), end="")

ezzzzre

upx壳,用工具脱

简单的加密

image-20221117221123453

1
2
3
flag = "HELLOCTF"
for i in flag:
print(chr( ((ord(i)*2)-69) & 0xff), end="")

Sudoku

动调

v12

1
2
3
4
5
6
7
8
9
8 5 2 4 9 1 6 7 3
1 9 6 7 3 8 2 5 4
4 3 7 5 6 2 9 1 8
5 2 8 1 4 6 3 9 7
3 7 4 9 2 5 8 6 1
9 6 1 3 8 7 4 2 5
2 1 9 8 5 4 7 3 6
7 4 3 6 1 9 5 8 2
6 8 5 2 7 3 1 4 9
1
2
3
4
5
6
vme = 50
print("UNCTF{" +
chr(29 + vme) + chr(15 + vme) + chr(29 + vme) + chr(24 + vme) +
chr(39 + vme) + chr(25 + vme) + chr(29 + vme) + chr(20 + vme) +
chr(32 + vme) + "}")

halo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
flag = [0x55, 0x0B, 0x68, 0x0C, 0x73, 0x3E, 0x0C, 0x3A, 0x5D, 0x1B,
0x21, 0x75, 0x4F, 0x20, 0x4C, 0x71, 0x58, 0x7B, 0x59, 0x2C,
0x00, 0x77, 0x58, 0x77, 0x0E, 0x72, 0x5B, 0x26, 0x0B, 0x70,
0x0A, 0x77, 0x66, 0x77, 0x36, 0x76, 0x37, 0x76, 0x62, 0x72,
0x6D, 0x27, 0x3F, 0x77, 0x26]

enc = ""

for i in range(1):
flag[i] ^= 0x33

for i in range(len(flag)-1, 0, -1):
flag[i] = flag[i] ^ i ^ flag[i-1]

for i in flag:
print(chr(i), end="")
image-20221113213011482

异或满足交换律

Rusty CPU

ida64位无壳

image-20221115234054163

image-20221115234200492

看到将输入编码后塞进switch,猜测是虚拟机

找到操作码后就直接写脚本了

我是选择倒着运行去逆向的。

不过这题比较简单每一位都是单独加密的

手写也不是不行

脚本

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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
flag = [
0x67, 0x83, 0x67, 0x70, 0x29, 0x27, 0x7F, 0x68, 0x6B, 0x76,
0x69, 0x76, 0x74, 0x59, 0x73, 0x74, 0x6F, 0x83, 0x24, 0x91,
0x7B, 0x20, 0x54, 0x16, 0x84, 0x58, 0x93, 0x62, 0x5D, 0x66,
0x59, 0x4F
]

op = [
0x11, 0x11,

0x22, 0x22,
0x80, 0x14, 0x1D,
0x81, 0x11,

0x80, 0x14, 0x13,
0x81, 0x13,

0x80, 0x14, 0x19,
0x80, 0x12,

0x80, 0x05,

0x22, 0x22,

0x80, 0x14, 0x1F,
0x81, 0x11,

0x80, 0x14, 0x10,
0x81, 0x13,

0x80, 0x14, 0x15,
0x80, 0x12,

0x80, 0x05,

0x22, 0x22,
0x80, 0x14, 0x1D,
0x81, 0x11,
0x80, 0x14, 0xFA,
0x81, 0x02,
0x80, 0x05,

0x22, 0x22,
0x80, 0x14, 0x1B,
0x81, 0x11,
0x80, 0x14, 0xFA,
0x81, 0x02,
0x80, 0x05,

0x22, 0x22,
0x80, 0x14, 0x1E,
0x81, 0x11,
0x80, 0x14, 0x18,
0x81, 0x13,
0x80, 0x14, 0x22,
0x80, 0x12,
0x80, 0x05,

0x22, 0x22,
0x80, 0x14, 0x17,
0x81, 0x13,
0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x24, 0x81, 0x11, 0x80, 0x14, 0x1A,
0x81, 0x13, 0x80, 0x14, 0x1A, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x1E, 0x81, 0x11, 0x80, 0x14, 0x16, 0x81,
0x13, 0x80, 0x14, 0x1C, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22,
0x80, 0x14, 0x20, 0x81, 0x11, 0x80, 0x14, 0xFA, 0x81, 0x02,
0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x24, 0x81, 0x11, 0x80,
0x14, 0x14, 0x81, 0x13, 0x80, 0x14, 0x21, 0x80, 0x12, 0x80,
0x05,

0x22, 0x22, 0x80, 0x14, 0x24, 0x81, 0x11, 0x80, 0x14,
0xFA, 0x81, 0x02, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x1D,
0x81, 0x13, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x29, 0x81,
0x11, 0x80, 0x14, 0x1F, 0x81, 0x13, 0x80, 0x14, 0x23, 0x80,
0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x2B, 0x81, 0x11,
0x80, 0x14, 0x1A, 0x81, 0x13, 0x80, 0x14, 0x1D, 0x80, 0x12,
0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x1E, 0x81, 0x13, 0x80,
0x05,

0x22, 0x22, 0x80, 0x14, 0x27, 0x81, 0x11, 0x80, 0x14,
0x1B, 0x81, 0x13, 0x80, 0x14, 0x23, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x1D, 0x81, 0x13, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x2A, 0x81, 0x11, 0x80, 0x14, 0x24, 0x81,
0x13, 0x80, 0x14, 0x26, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22,
0x80, 0x14, 0x2A, 0x81, 0x11, 0x80, 0x14, 0x1C, 0x81, 0x13,
0x80, 0x14, 0x23, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80,
0x14, 0x30, 0x81, 0x11, 0x80, 0x14, 0x27, 0x81, 0x13, 0x80,
0x14, 0x25, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14,
0x2D, 0x81, 0x11, 0x80, 0x14, 0x26, 0x81, 0x13, 0x80, 0x14,
0x2F, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x2B,
0x81, 0x11, 0x80, 0x14, 0x22, 0x81, 0x13, 0x80, 0x14, 0x30,
0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x26, 0x81,
0x13, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x2F, 0x81, 0x11,
0x80, 0x14, 0x21, 0x81, 0x13, 0x80, 0x14, 0x2D, 0x80, 0x12,
0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x36, 0x81, 0x11, 0x80,
0x14, 0x27, 0x81, 0x13, 0x80, 0x14, 0x2C, 0x80, 0x12, 0x80,
0x05,

0x22, 0x22, 0x80, 0x14, 0x2C, 0x81, 0x13, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x37, 0x81, 0x11, 0x80, 0x14, 0x28,
0x81, 0x13, 0x80, 0x14, 0x2B, 0x80, 0x12, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x37, 0x81, 0x11, 0x80, 0x14, 0xFA, 0x81,
0x02, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x36, 0x81, 0x11,
0x80, 0x14, 0xFA, 0x81, 0x02, 0x80, 0x05,

0x22, 0x22, 0x80,
0x14, 0x33, 0x81, 0x11, 0x80, 0x14, 0xFA, 0x81, 0x02, 0x80,
0x05,

0x22, 0x22, 0x80, 0x14, 0x38, 0x81, 0x11, 0x80, 0x14,
0xFA, 0x81, 0x02, 0x80, 0x05,

0x22, 0x22, 0x80, 0x14, 0x3D,
0x81, 0x11, 0x80, 0x14, 0x2F, 0x81, 0x13, 0x80, 0x14, 0x35,
0x80, 0x12, 0x80, 0x05
]

pos = len(flag)
tmp = 0

for i in range(len(op) - 2, -1, -1):
if op[i] == 0x80 and op[i + 1] == 0x05:
pos -= 1

elif op[i] == 0x80 and op[i + 1] == 0x14:
tmp = op[i + 2]
if op[i + 3] == 0x81 and op[i + 4] == 0x13:
flag[pos] ^= tmp
elif op[i + 3] == 0x81 and op[i + 4] == 0x11:
flag[pos] -= tmp
elif op[i + 3] == 0x80 and op[i + 4] == 0x12:
flag[pos] += tmp
elif op[i + 3] == 0x81 and op[i + 4] == 0x02:
flag[pos] = tmp - flag[pos]

for i in range(0, len(flag)):
print(chr(flag[i] & 0xff), end="")

vivo50_to_mk_Amerc1a_Gr3at_again

UNCTF{B1den_will_make_Ch1na_gr3at!}

shelled_babyxor

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
flag = [
0x73, 0x68, 0x65, 0x72,
0x60, 0x5D, 0x5F, 0x49,
0X53, 0x79, 0x4C, 0x53,
0x55, 0x52, 0x79, 0x53,
0x48, 0x56, 0x47, 0x45,
0x4D, 0x43, 0x42, 0x79,
0x5F, 0x49, 0x53, 0x54,
0x79, 0x40, 0x4F, 0x54,
0x55, 0x52, 0x79, 0x56,
0x54, 0x49, 0x41, 0x54,
0x47
]

for i in flag:
print(chr( (i^0x26) & 0xff), end="")