应该是这一段
'''将方法体中的host字段进行替换'''
def get_raw_body(self, req, ip):
ip = self.get_host_from_url(ip)
host_reg = re.compile(r'Host:\s([a-z.A-Z0-9]+)')
host = host_reg.findall(req)
if not host or host[0] == '':
print ('[-]ERROR MESSAGE!Wrong format for request body')
sys.exit()
req, num = re.subn(host_reg, "Host: %s", req)
return req % ip
错误提示:
return req % (ip)
ValueError: unsupported format character '{' (0x7b) at index 31
源程序是2.7,我的是3.6,不想卸载去下2.7,为了这一个程序不值得...