2020 巅峰极客 Re部分WriteUp
virus
附件下载:https://wwa.lanzous.com/iZh5tgy9gbg
代码分为三部分
- 以'-'为间隔,将flag的第一部分转换为整型数字,并且满足后项-前项分别为[0x13,0x19,0x1a,0x1c]。最后一项为len(flag)-lastpos('-')
- 以'-'为间隔,将中间的字符串分别存储到road中
- checkflag,即走四个20x...的迷宫,从s->d。以第1点存储的顺序,决定迷宫的顺序。通过确定后面的字符串顺序,前面的数字也会被确定。
1~4为:-dddddddddsssssaaaaaaaaawww-sdsdsdsdsdsdsddwdwdwdwdwdwdw-aaaaaaaaasssssssddddddddd-wwwwwdddddddddsssss
import itertools
a = ['-dddddddddsssssaaaaaaaaawww','-sdsdsdsdsdsdsddwdwdwdwdwdwdw','-aaaaaaaaasssssssddddddddd','-wwwwwdddddddddsssss']
b = list(itertools.permutations(a, len(a)))
s = []
m = [0x13,0x19,0x1a,0x1c]
for val in b:
s.append(''.join(val))
for elem in s:
index = -1
pos = []
while elem.find('-',index+1) != -1:
index = elem.find('-', index+1)
pos.append(index)
pos.append(len(elem))
print (pos)
flag = True
right = 0
for k in range(len(pos)-1):
right = k
if(pos[k+1] - pos[k] - 1 != m[k]):
flag = False
break
if (flag == True):
print (elem)
flag{4312-wwwwwdddddddddsssss-aaaaaaaaasssssssddddddddd-dddddddddsssssaaaaaaaaawww-sdsdsdsdsdsdsddwdwdwdwdwdwdw}
fu!k_py
附件下载:https://wwa.lanzous.com/iy2Hegy9g9e
将pyc文件转换为py
-
d,l,h分别表示3x3块,列,行
-
check1检测长度是否为9
-
check2求和
实际就是一个9x9的数独游戏,根据已知数据,求解未知就行。
flag{145327698839654127672918543496185372218473956753296481367542819984761235521839764}