首页
社区
课程
招聘
1
[原创] KCTF 2019 Q2 第六题 XBase64
发表于: 2019-6-24 21:04 4691

[原创] KCTF 2019 Q2 第六题 XBase64

HHHso 活跃值
22
2019-6-24 21:04
4691

改版的base64






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
b64str = 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/'
 
 
', '.join(["'{}'".format(c) for in b64str])
 
 
= []
for 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 > 0x40and (icv <= 0x5A):
    return chr(c_ubyte(0x9B-icv).value)
  elif (icv > 0x60and (icv <= 0x7A):
    return chr(c_ubyte(icv-0x40).value)
  elif (icv > 0x2Fand (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 in range(0,b64str.__len__()):
  = charEncrypt(i)
  if not in dicv:
    dicv.append(v)
  else:
    raise Exception("")
 
''.join(b64str[dicv.index(c)] if c!='=' else '=for in "!NGV%,$h1f4S3%2P(hkQ94==" )
 
"aMTEeld6q4tHserKh69Jyt=="

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
b64str = 'tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/'
 
 
', '.join(["'{}'".format(c) for in b64str])
 
 
= []
for 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 > 0x40and (icv <= 0x5A):
    return chr(c_ubyte(0x9B-icv).value)
  elif (icv > 0x60and (icv <= 0x7A):
    return chr(c_ubyte(icv-0x40).value)
  elif (icv > 0x2Fand (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 in range(0,b64str.__len__()):
  = charEncrypt(i)
  if not in dicv:
    dicv.append(v)
  else:
    raise Exception("")
 
''.join(b64str[dicv.index(c)] if c!='=' else '=for in "!NGV%,$h1f4S3%2P(hkQ94==" )
 
"aMTEeld6q4tHserKh69Jyt=="

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

最后于 2019-6-26 09:33 被HHHso编辑 ,原因:
上传的附件:
收藏
免费 1
支持
分享
赞赏记录
参与人
雪币
留言
时间
PLEBFE
为你点赞~
2023-1-25 01:06
最新回复 (0)
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册