import zipfile
import sys
import tkinter as tk
import threading
import queue
class
brute_zip
(object):
def__init__
(self)
: self.flag=
false
# 用來判斷是否在字典中找到密碼,找到標記成true
self.q=queue.queue(
) self.thread_list=
window = tk.tk(
) window.title(
'暴力破解zip壓縮檔案小工具1.0'
) window.geometry(
'500x500'
) self.zip_file=tk.strin**ar(
) self.dict_file=tk.strin**ar(
) self.thread_num=tk.intvar(
) self.thread_num.
set(2)
tk.label(window,text=
'壓縮檔案'
).place(x=
100,y=
100)
tk.label(window, text=
'字典檔案'
).place(x=
100, y=
150)
tk.label(window, text=
'執行緒數'
).place(x=
100, y=
200)
tk.entry(window,textvariable=self.zip_file)
.place(x=
150,y=
100)
tk.entry(window, textvariable=self.dict_file)
.place(x=
150, y=
150)
tk.entry(window, textvariable=self.thread_num)
.place(x=
150, y=
200)
tk.label(window, text=
'輸出框'
).place(x=
50, y=
300)
self.t=tk.text(window,height=
3,width=40)
self.t.place(x=
100,y=
300)
tk.button(window,text=
'攻擊'
,command=self.run)
.place(x=
250,y=
400)
tk.button(window,text=
'結束攻擊'
,command=self.exit_exploit)
.place(x=
300,y=
400)
window.mainloop(
)def
brute
(self)
:#print('執行緒')
try:
zip=zipfile.zipfile(self.zip_file.get())
while
true
:if self.q.empty(
)or self.flag:
break
password=self.q.get(
)try
:zip
.extractall(pwd=password.encode(
'utf-8'))
self.t.delete(
0.0,
'end'
) self.t.insert(
'insert'
,'zip密碼:'
+password)
self.flag=
true
except exception as e:
#print(password)
pass
except exception as e:
self.t.delete(
0.0,
'end'
) self.t.insert(
'insert'
,'壓縮檔案不存在'
)def
exit_exploit
(self)
: sys.exit(
)def
run(self)
:try
:with
open
(self.dict_file.get(),
'r')
as fp:
for password in fp.readlines():
self.q.put(password.strip())
except exception as e:
self.t.delete(
0.0,
'end'
) self.t.insert(
'insert'
,'字典並不存在'
)for i in
range
(self.thread_num.get())
:)for i in
range
(self.thread_num.get())
: self.thread_list[i]
.start(
)if __name__ ==
'__main__'
: brute=brute_zip(
)
暴力破解zip檔案密碼
lb2.config text 密碼 password flag true except exception as e pass def fn zippath,pwdpath zfile zipfile.zipfile zippath passfile open pwdpath n 0lines p...
暴力破解指令碼 shell
突然間懵生了乙個想法 然後就做了 第一次覺得工作這麼有趣!內網已經測試能夠成功 外網正在測試,字典比較大估計要跑好幾天 先把指令碼貼出來 bin bash gateway 172.16.80 nmap p 22 172.16.81.grep open a3 grep for cut d f5 hos...
Python暴力破解ZIP檔案密碼
通過python內建的zipfile模組實現對zip檔案的解壓,加點料完成口令破解 zipfile模組用來做zip格式編碼的壓縮和解壓縮的,zipfile裡有兩個非常重要的class,分別是zipfile和zipinfo,在絕大多數的情況下,我們只需要使用這兩個class就可以了。zipfile是主...