一段Base64

一段Base64

 

 本来看到题目名字和分数以为是一道水题,后来解的时候才发现有这么多编码方式,当然如果熟悉这些编码方式找在线工具解得话很快就能拿到flag,

这篇writeup主要是记录一下用python实现所有解码

第一种方法:python跑一下

import base64
import re
import html
import urllib

with open('1.txt', 'r') as f:
    C = f.read()
    
C1 = base64.b64decode(C).decode('utf-8')
# print(C1)
# \134\170\65\143\134\170\67\65\134\170\63\60


C2 = re.findall(r'\d+',C1)
# print(C2)
# ['134', '170', '65', '143', '134', '170', '67', '65', '134', '170', '63', '60',

C3 = ""
for i in C2:
    C3 += chr(int(i,8))

# print(C3)
# \x5c\x75\x30


C4 = C3.split('\\x')
C4.pop(0)
# print(C4)
# ['5c', '75', '30',

C5 = ""
for i in C4:
    C5 += chr(int(i,16))

# print(C5)
# \u0053\u0074\u0072\u0069\u006e\u0067\u002e\u0066

C6 = C5.encode().decode('unicode-escape')
# print(C6)

C7 = C6[20:-1]
# print(C7)

C8 = C7.split(',')
# print(C8)

C9 = ""
for i in C8:
    C9 += chr(int(i,10))
# print(C9)

C10 = html.unescape(C9)
C11 = html.unescape(C10)
C12 = urllib.parse.unquote(C11)
print(C12)

 第二种方法:用工具

安利一款工具Converter,很强大的一款原子弹,链接:https://pan.baidu.com/s/10kHmAsjCKf1_5Pc8IoL0AA 密码:3jy0

 将base64编码复制粘贴到Converter这个软件里面

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

在线Unicode编码转换得到flag 

http://www.ofmonkey.com/encode/unicode

 

 

 

 

%7B和%7D是url编码,解出来就是{}

flag{ctf_tfc201717qwe}
参考链接:
https://zhuanlan.zhihu.com/p/140576516

Bingo!

posted @ 2020-11-20 09:51  浩琦很好奇  阅读(614)  评论(0编辑  收藏  举报