# virus

1. 以'-'为间隔，将flag的第一部分转换为整型数字，并且满足后项-前项分别为[0x13,0x19,0x1a,0x1c]。最后一项为len(flag)-lastpos('-')
3. 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

• d,l,h分别表示3x3块，列，行

• check1检测长度是否为9

• check2求和

flag{145327698839654127672918543496185372218473956753296481367542819984761235521839764}

posted @ 2020-09-29 11:15  Hk_Mayfly  阅读(574)  评论(0编辑  收藏  举报