西瓜杯 WP

RE

一个西瓜切两半你一半我一半

有点谜语,文本给的是输出和key

# Visit https://www.lddgo.net/string/pyc-compile-decompile for more information
# Version : Python 3.6

flag=''
key = '一个西瓜切两半你一半我一半'
# output='乃乾觅甯剏乳厡侻丨厏扝乌博丿乜规甲剌乶厝侥丿卻扚丠厘丿乎覟瓬剤'
tmp='乃乾觅甯剏乳厡侻丨厏扝乌博丿乜规甲剌乶厝侥丿卻扚丠厘丿乎覟瓬剤'
for i in range(len(flag)):
    tmp += chr(ord(flag[i]) - 32)

output = ''
for i in range(len(tmp)):
    output += chr(ord(tmp[i]) + ord(key[i % len(key)]))

for i in range(len(output)):
    output += chr(ord(tmp[i]) - ord(key[i % len(key)])+32)
    
print(output)

探索进制的奥秘

image-20240707183701123

在线反编译pyd

image-20240707182951466

给的txt里面就是tmp和key

pe

image-20240707182720481

E

明文存放flag

image-20240707182758497

image-20240707182907252

easy_re

硬爆

table=[ord(i) for i in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ']
code=[ 0x6D, 0x97, 0x86, 0x85, 0x97, 0xDE, 0xA8, 0x92, 0x86, 0x85, 0x97, 0x0F, 0x42, 0x7F, 0x80, 0x85, 
    0x97, 0x86, 0x6D, 0x76, 0x86, 0x85, 0x97, 0x45, 0xD0, 0x1E, 0x63, 0x06, 0x7B, 0x96, 0x6D, 0xCC, 
    0x87, 0x85, 0x97, 0x0F, 0x81, 0xB3, 0x3E, 0xEB, 0x97, 0x86, 0x85, 0x96, 0x7E, 0x0C, 0xD3, 0xA2, 
    0x81, 0x7F, 0xDA, 0x84, 0x97, 0x86, 0x3E, 0xEC, 0x86, 0x85, 0x97, 0x87, 0x7E, 0x1E, 0x85, 0x3D, 
    0xE8, 0x86, 0x85, 0x97, 0x87, 0x7D, 0x1E, 0x82, 0xA1, 0x7F, 0x5D, 0x85, 0x97, 0x86, 0x0C, 0x93, 
    0xA2, 0x3D, 0x11, 0x86, 0x85, 0x97, 0x87, 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 0x0C, 0x7B, 0xDB, 0x46]


for i in table:
    for j in table:
        for k in table:
            password = [i,j,k]
            code2 = [0] * len(code)
            for m in range(len(code)):
                code2[m]= (password[m%3]^~code[m])&0xff
            # search if "ctf" in the result
            if "ctfshow" in ''.join([chr(i) for i in code2]):
                print(password)
                print(''.join([chr(i) for i in code2]))
            
            
            

image-20240706011730113

posted @ 2024-07-07 21:49  BediveRe_RE  阅读(89)  评论(0编辑  收藏  举报