解决盲注编码问题

Traceback (most recent call last):
File "E:/Pycharm Project/CTF/xman-ctf��¼.py", line 56, in <module>
if accesss(urllib.unquote(sub_tables(i, w))):
File "E:/Pycharm Project/CTF/xman-ctf��¼.py", line 31, in accesss
if "成功" in text:
UnicodeDecodeError: 'gb2312' codec can't decode bytes in position 0-1: illegal multibyte sequence

解决盲注中,当判断为TRUE的时候,关键词为中文时,产生的编码问题,对返回包进行 encode('utf-8'),形如下面

1 response = requests.post(url, data=data, headers=headers)
2     print response.text
3     text = response.text
4 
5     print data['username']
6     text = text.encode('utf-8')
7     if "成功" in text:
8         ...

就可解决

原文地址:https://www.cnblogs.com/deen-/p/7191588.html