-
-
看雪CTF2019Q2-第6题 消失的岛屿
-
发表于: 2019-6-18 23:58 2807
-
base64
.text:004016A4 call _base64_encode .text:004016A9 mov dword ptr [esp+48h], offset aNgvH1f4s32pHkq ; "!NGV%,$h1f4S3%2P(hkQ94==" .text:004016C0 call _strcmp .rdata:00404064 aTuvwxtulmnopqr db 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/',0 字符映射 .text:004013C0 ; char __cdecl charEncrypt
.text:004016A4 call _base64_encode .text:004016A9 mov dword ptr [esp+48h], offset aNgvH1f4s32pHkq ; "!NGV%,$h1f4S3%2P(hkQ94==" .text:004016C0 call _strcmp .rdata:00404064 aTuvwxtulmnopqr db 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/',0 字符映射 .text:004013C0 ; char __cdecl charEncrypt
脚本
import base64 import binascii import string def test(): old_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' new_chars = 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/' chars_map = ['']*256 for i in range(len(new_chars)): v = ord(new_chars[i]) if 0x41 <= v <= 0x5A: v = 0x9B - v elif 0x61 <= v <= 0x7A: v = v - 0x40 elif 0x30 <= v <= 0x39: v = v + 0x32 elif v == 0x2B: v = 0x77 elif v == 0x2F: v = 0x79 chars_map[v] = new_chars[i] s = '!NGV%,$h1f4S3%2P(hkQ94==' b64 = '' for i in range(len(s)): b64 += chars_map[ord(s[i])] b64 += '==' print binascii.a2b_base64(b64.translate(string.maketrans(new_chars, old_chars))) return test()
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
- KCTF2022春季赛 第三题 石像病毒 8855
- KCTF2022春季赛 第二题 末日邀请 16176
- KCTF2021秋季赛 第二题 迷失丛林 18803
- KCTF2020秋季赛 第十题 终焉之战 8862
- KCTF2020秋季赛 第九题 命悬一线 6462
看原图
赞赏
雪币:
留言: