-
-
[原创] KCTF 2019 Q2 第六题 XBase64
-
2019-6-24 21:04 3801
-
改版的base64
b64str = 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/' ', '.join(["'{}'".format(c) for c in b64str]) a = [] for i in range(0,0x100): if chr(i) in b64str: a.append(b64str.index(chr(i))) else: a.append(0xFF) def charEncrypt(i): global b64str icv = c_ubyte(ord(b64str[i])).value if (icv > 0x40) and (icv <= 0x5A): return chr(c_ubyte(0x9B-icv).value) elif (icv > 0x60) and (icv <= 0x7A): return chr(c_ubyte(icv-0x40).value) elif (icv > 0x2F) and (icv <= 0x39): return chr(c_ubyte(icv+0x32).value) elif icv==0x2B: return chr(c_ubyte(0x77).value) elif icv==0x2F: return chr(c_ubyte(0x79).value) else: return chr(c_ubyte(icv).value) dicv = [] for i in range(0,b64str.__len__()): v = charEncrypt(i) if v not in dicv: dicv.append(v) else: raise Exception("") ''.join(b64str[dicv.index(c)] if c!='=' else '=' for c in "!NGV%,$h1f4S3%2P(hkQ94==" ) "aMTEeld6q4tHserKh69Jyt=="
根据
b64str = 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/'
生成加密和解密码表,放进github开源base64编译跑一下就出来
[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界
最后于 2019-6-26 09:33
被HHHso编辑
,原因:
赞赏
他的文章
鸿蒙通识
22862
谁下载
无
看原图