re | [NPUCTF2020]EzObfus-Chapter2

不好玩
参考:https://www.cnblogs.com/lxy8584099/p/13721868.html和https://www.cnblogs.com/harmonica11/p/13073221.html

import subprocess


for i in range(1):
    for j in range(ord('A'),ord('Z')+1):
        for k in range(ord('A'),ord('Z')+1):
            flag ="npuctf{WDNMD_"+chr(j)+chr(k)+"_OBFU!}"
            print(flag.encode())
            p = subprocess.Popen([r"attachment.exe"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            p.stdin.write(flag.encode())
            p.stdin.close()
            out=p.stdout.read()
            p.stdout.close()
            if b"E" not in out:
                print(flag)
                exit()
posted @ 2021-03-02 20:29  Mz1  阅读(187)  评论(0编辑  收藏  举报