标签:utf-8 blog decode 动手 程序 exce div ctf 编码
题目复现链接:https://buuoj.cn/challenges
参考链接:2019 SUCTF wp
SUCTF_2019_部分复现
https://bugs.python.org/issue36216
抄个脚本
from urllib.parse import urlparse,urlunsplit,urlsplit
from urllib import parse
def get_unicode():
for x in range(65536):
uni=chr(x)
url="http://suctf.c{}".format(uni)
try:
if getUrl(url):
print("str: "+uni+' unicode: \\u'+str(hex(x))[2:])
except:
pass
def getUrl(url):
url = url
host = parse.urlparse(url).hostname
if host == 'suctf.cc':
return False
parts = list(urlsplit(url))
host = parts[1]
if host == 'suctf.cc':
return False
newhost = []
for h in host.split('.'):
newhost.append(h.encode('idna').decode('utf-8'))
parts[1] = '.'.join(newhost)
finalUrl = urlunsplit(parts).split(' ')[0]
host = parse.urlparse(finalUrl).hostname
if host == 'suctf.cc':
return True
else:
return False
if __name__=="__main__":
get_unicode()
虽然想到可能是编码的问题,但是没动手去写脚本跑,懒狗一条。
还有wp是github上搜到的,不愧是全球最大同性交友网站,下次不能局限于百度
标签:utf-8 blog decode 动手 程序 exce div ctf 编码
原文地址:https://www.cnblogs.com/20175211lyz/p/11470200.html