From 80e445b094bdc1384a9816471724398f440ef1bf Mon Sep 17 00:00:00 2001 From: Derek Jamison Date: Wed, 19 Apr 2023 15:31:49 -0400 Subject: [PATCH] Fix bug + add commented test code. --- marauder/scan.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/marauder/scan.ps1 b/marauder/scan.ps1 index 720617d..7224867 100644 --- a/marauder/scan.ps1 +++ b/marauder/scan.ps1 @@ -65,6 +65,9 @@ Function Get-Decoded-SSID { $result = $result + $dict[$ch - $index] $i = $i + 1 $index = $ch + if ($index -ge $cypherLetters.Count) { + $index = $index - $cypherLetters.Count + } $index = $index + (([int][char]$cypherLetters[$index]) * $i) $index = $index % $cypherLetters.Count } @@ -97,6 +100,19 @@ Function Get-SSIDS { } } +## Test that Get-Decoded-SSID can get back original string that was passed to Get-Encoded-SSID +# For($i = 0; $i -lt 100000; ++$i) { +# $r = (""+(Get-Random -Maximum 1000000 -Minimum 0)+(Get-Random -Maximum 1000000 -Minimum 0)) +# $r = $r.Substring((Get-Random) % $r.Length) +# $p = (""+(Get-Random 9)) +# $d = Get-Decoded-SSID (Get-Encoded-SSID -Message $r -Prefix $p) +# if ($r -ne $d) { +# Write-Host ("Fail. r:"+$r+" p:"+$p+" d:"+$d) +# } else { +# # Write-Host ("Pass. r:"+$r+" p:"+$p+" d:"+$d) +# } +# } + while ($true) { Show-Available-Networks-UI For( $i = 0; $i -le 6; ++$i ) {