0

I want to get automaticly wpa key data from WireShark I try everything my last code is

But when i do this i got lot of information about key but i only want wpa key data

Encryption Key (Hex): 00000000000000000000000000000000000000000000000000000000000000000000000000000000
Encryption Key (Hex): 00000000000000000000000000000000000000000000d2a78daf047c2753d60a2f8dc0e10e9d001630140100000fac020100000fac040100000fac020000

I need to get only 30140100000fac020100000fac040100000fac020000

Can anyone help? I try to pyshark but can't

from scapy.all import *

 

# Putanja do datoteke folder5-01.cap na Desktopu
file_path = '/home/kali/Desktop/folder5-01.cap'

 

def extract_wpa_keys(packet):
    if packet.haslayer(EAPOL):
        if packet[EAPOL].type == 3:  # EAPOL type 3 represents EAPOL-Key frames
            wpa_key_data = packet[EAPOL].load[55:]  # Preskačemo 16 bajtova zaglavlja + 2 bajta za tip operacije + 2 bajta za dužinu ključa
            encryption_key = wpa_key_data.hex()  # Pretvaranje u heksadecimalni format
            print("Encryption Key (Hex):", encryption_key)

 

# Učitavanje datoteke
packets = rdpcap(file_path)

 

# Filtriranje paketa i izlistavanje WPA ključeva
for packet in packets:
    extract_wpa_keys(packet)
Alexander
  • 16,091
  • 5
  • 13
  • 29
  • 1
    The first thing I would try is ignoring what the comment on the [55:] line says it does, and removing the slicing. (so just remove the `[55:]` – Yarin_007 May 28 '23 at 04:23

0 Answers0