From cc657745b5a5e2853942d92a306674609b5c5812 Mon Sep 17 00:00:00 2001 From: DidierA <1620015+didiera@users.noreply.github.com> Date: Tue, 28 Oct 2025 14:45:02 +0100 Subject: [PATCH] wifi: Add HEX dump of preshared kzy --- dploot/triage/wifi.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dploot/triage/wifi.py b/dploot/triage/wifi.py index b6a1d78..052c197 100755 --- a/dploot/triage/wifi.py +++ b/dploot/triage/wifi.py @@ -1,4 +1,4 @@ -from binascii import unhexlify +from binascii import hexlify, unhexlify import itertools import logging import ntpath @@ -33,7 +33,7 @@ def __init__( ssid: str, auth: str, encryption: str, - password: Optional[str] = None, + password: Optional[bytes] = None, xml_data: Any = None, eap_username: Optional[str] = None, eap_domain: Optional[str] = None, @@ -76,7 +76,8 @@ def dump(self) -> None: if self.auth.upper() in ["WPAPSK", "WPA2PSK", "WPA3SAE"]: print("AuthType:\t%s" % self.auth.upper()) print("Encryption:\t%s" % self.encryption.upper()) - print("Preshared key:\t%s" % self.password) + print("Preshared key:\t%s" % self.password.decode("latin-1", errors="backslashreplace")) + print("Preshared key(hex):\t%s" % hexlify(self.password).decode('ascii')) elif self.auth.upper() in ["WPA", "WPA2"]: print("AuthType:\t%s EAP" % self.auth.upper()) print("Encryption:\t%s" % self.encryption.upper()) @@ -209,9 +210,10 @@ def triage_wifi(self) -> List[WifiCred]: ssid=ssid, auth=auth_type, encryption=encryption, - password=password.decode( - "latin-1", errors="backslashreplace" - ), + password=password, + # password=password.decode( + # "latin-1", errors="backslashreplace" + #), xml_data=main, ) elif auth_type in ["WPA", "WPA2"]: