Created
June 20, 2023 02:17
-
-
Save Wind010/809fd8c93520c35a5c6b0f2bfb0d5c22 to your computer and use it in GitHub Desktop.
Script to create a new file with ASCII SSIDs/ESSIDs from Hashcat potfile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to create a new file with ASCII SSIDs/ESSIDs from Hashcat potfile. | |
# Usage .\potfile_hex_to_ascii.ps1 hashcat.potfile | |
param( | |
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$false)] | |
[string] | |
$potFilePath | |
) | |
Get-Content $filePath | ForEach-Object { | |
Write-Host "Processing $_" | |
$line = $_ | |
$start = $line.IndexOf('*') | |
$end = $line.IndexOf(':') | |
$lengthOfHexSsid = $end - $start - 1 | |
$hexString = $line.SubString($start+1, $lengthOfHexSsid) | |
Write-Host "SSID_HEX = $hexString" | |
$ascii_ssid = ($hexString -split '(..)' -ne '' | ForEach-Object {[char][byte]"0x$_"}) -join '' | |
Write-Host "SSID_ACII = $ascii_ssid" | |
$newLine = $line.SubString(0, $start+1) + $ascii_ssid + $line.SubString($end, $line.length-$end) | |
#Write-Host $newLine | |
$newLine | Out-File -potFilePath "$filePath.txt" -Append | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment