Decode详解

http://www.shiyanbar.com/ctf/1831
Decode:
flag格式:ctf{}
0x25346425353425343525333525343325366125343525373725346425353125366625373825346425343425363725346225346625353425366225346225346425353425343525373825343325366125343525373725346625353125366625373825346425343425343525346225346425353425343525333225343325366125343525373825346425353125366625373825346425353425353525346225346
4253534253431253330253433253661253435253737253465253531253666253738253464253661253435253462253466253534253633253
4622534642535342534352537372534332536612536622533342534332536612536622533332534332536612534352537382534652534312
53364253364
解:
1.Decode,肯定是运用各种解码
ox表示十六进制,从网上了解到十六进制编码是把整个数字4个一分求一个字符这样会超出ascii码范围,
网上的数据都是以ox开头比如网上数据ox12ox96ox48....
而本题数据就开头是ox唯一一个,那么我们就两个一分。

十六进制解码转化字符代码如下:

#十六进制解码转化字符代码如下
str='253464253534253435253335253433253661253435253737253464253531253666253738253464253434253637253462253466253534253662253462253464253534253435253738253433253661253435253737253466253531253666253738253464253434253435253462253464253534253435253332253433253661253435253738253464253531253666253738253464253534253535253462253464253534253431253330253433253661253435253737253465253531253666253738253464253661253435253462253466253534253633253462253464253534253435253737253433253661253662253334253433253661253662253333253433253661253435253738253465253431253364253364'
def HexDe(str):
	decstr = ''
	#i+=4
	for i in range(0,len(str),2):
		decstr +=chr(int(str[i:i + 2],16))#unichr()跟chr()一样,只不过返回的是Unicode字符
	return decstr
print(HexDe(str))


2.这就得到结果,很显然这是url编码
%4d%54%45%35%43%6a%45%77%4d%51%6f%78%4d%44%67%4b%4f%54%6b%4b%4d%54%45%78%43%6a%45%77%4f%51%6f%78%4d%44
%45%4b%4d%54%45%32%43%6a%45%78%4d%51%6f%78%4d%54%55%4b%4d%54%41%30%43%6a%45%77%4e%51%6f%78%4d%6a%45%4b
%4f%54%63%4b%4d%54%45%77%43%6a%6b%34%43%6a%6b%33%43%6a%45%78%4e%41%3d%3d


提供一个网址解它http://tool.chinaz.com/Tools/Unicode.aspx
3.解得:
MTE5CjEwMQoxMDgKOTkKMTExCjEwOQoxMD
EKMTE2CjExMQoxMTUKMTA0CjEwNQoxMjEK
OTcKMTEwCjk4Cjk3CjExNA==

4.利用Base64代码得到:

#-*- coding: utf-8 
import base64

str=b'MTE5CjEwMQoxMDgKOTkKMTExCjEwOQoxMDEKMTE2CjExMQoxMTUKMTA0CjEwNQoxMjEKOTcKMTEwCjk4Cjk3CjExNA=='
str=base64.b64decode(str)
print(str)
str=str.decode('ascii')#bytes解码会得到str
print(str)


119
101
108
99
111
109
101
116
111
115
104
105
121
97
110
98
97
114


5.利用Ascii代码得到welcometoshiyanbar

#从数字转换到字母  按照ASCII编码
L=[119,101,108,99,111,109,101,116,111,115,104,105,121,97,110,98,97,114]

for x in L:
	print(chr(x),end='')


得到flag:ctf:{welcometoshiyanbar}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值