-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandshake_try
117 lines (91 loc) · 3.79 KB
/
handshake_try
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import tkinter as tk
from tkinter import filedialog, messagebox
import hmac
import hashlib
# Wordlist oluşturma fonksiyonu
def create_wordlist():
string_input = entry_string.get()
start_num = int(entry_start.get())
end_num = int(entry_end.get())
wordlist = [f"{string_input}{i}" for i in range(start_num, end_num + 1)]
# Dosya kaydetme
file_path = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text files", "*.txt")])
if file_path:
with open(file_path, 'w') as file:
for word in wordlist:
file.write(word + "\n")
label_result.config(text="Wordlist başarıyla kaydedildi!")
# Wordlist yükleme fonksiyonu
def upload_wordlist():
global wordlist_file
wordlist_file = filedialog.askopenfilename(filetypes=[("Text files", "*.txt")])
if wordlist_file:
messagebox.showinfo("Bilgi", f"Wordlist yüklendi: {wordlist_file}")
# Handshake yükleme fonksiyonu
def upload_handshake():
global handshake_file
handshake_file = filedialog.askopenfilename(filetypes=[("Handshake files", "*.hccapx")])
if handshake_file:
messagebox.showinfo("Bilgi", f"Handshake yüklendi: {handshake_file}")
# Handshake doğrulama fonksiyonu
def verify_password(handshake_data, ssid, password):
# PMK (Pairwise Master Key) hesaplama
pmk = hashlib.pbkdf2_hmac('sha1', password.encode(), ssid.encode(), 4096, 32)
# PTK (Pairwise Transient Key) hesaplama
ptk = hashlib.sha1(pmk + handshake_data).digest()
# Message Integrity Code (MIC) doğrulama
mic = hmac.new(ptk, handshake_data, hashlib.sha1).digest()
return mic
# Handshake ve wordlist ile parola deneme fonksiyonu
def test_handshake():
ssid = entry_ssid.get()
if not handshake_file or not wordlist_file or not ssid:
messagebox.showwarning("Uyarı", "Lütfen handshake dosyasını, wordlist dosyasını ve SSID'yi giriniz.")
return
with open(handshake_file, "rb") as f:
handshake_data = f.read()
with open(wordlist_file, "r") as f:
passwords = f.readlines()
for password in passwords:
password = password.strip()
mic = verify_password(handshake_data, ssid, password)
# MIC doğrulama başarılı ise şifre bulunmuştur
if mic == expected_mic:
messagebox.showinfo("Sonuç", f"Şifre bulundu: {password}")
return
messagebox.showinfo("Sonuç", "Parola bulunamadı.")
# Tkinter arayüzü oluşturma
root = tk.Tk()
root.title("Wi-Fi Şifre Tahmin Programı")
root.geometry("400x400")
# Giriş kutuları
tk.Label(root, text="Wordlist String Girişi:").pack()
entry_string = tk.Entry(root)
entry_string.pack()
tk.Label(root, text="Başlangıç Numarası:").pack()
entry_start = tk.Entry(root)
entry_start.pack()
tk.Label(root, text="Bitiş Numarası:").pack()
entry_end = tk.Entry(root)
entry_end.pack()
# SSID girişi
tk.Label(root, text="SSID:").pack()
entry_ssid = tk.Entry(root)
entry_ssid.pack()
# Wordlist oluşturma butonu
btn_create = tk.Button(root, text="Wordlist Oluştur ve Kaydet", command=create_wordlist)
btn_create.pack(pady=10)
# Wordlist yükleme butonu
btn_upload_wordlist = tk.Button(root, text="Wordlist Yükle", command=upload_wordlist)
btn_upload_wordlist.pack(pady=10)
# Handshake yükleme butonu
btn_upload_handshake = tk.Button(root, text="Handshake Yükle", command=upload_handshake)
btn_upload_handshake.pack(pady=10)
# Handshake test butonu
btn_test_handshake = tk.Button(root, text="Handshake ile Parola Deneme", command=test_handshake)
btn_test_handshake.pack(pady=10)
# Sonuç etiketi
label_result = tk.Label(root, text="")
label_result.pack()
# Tkinter döngüsü
root.mainloop()