From c34fdfda132c75839b5936e582b8f5bf9e03fd5d Mon Sep 17 00:00:00 2001 From: Bryan McNulty Date: Thu, 3 Oct 2024 01:39:27 -0500 Subject: [PATCH] Add support for Linux filesystem paths in Write-CookiesToFile & Write-TokensToFile --- MFASweep.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MFASweep.ps1 b/MFASweep.ps1 index 3068958..45fdcfa 100644 --- a/MFASweep.ps1 +++ b/MFASweep.ps1 @@ -1077,7 +1077,7 @@ Function Write-TokensToFile { ) if ($WriteTokens) { - $tokenFilePath = "$PSScriptRoot\AccessTokens.json" + $tokenFilePath = Join-Path ("$PSScriptRoot" ? "$PSScriptRoot" : ".") "AccessTokens.json" $currentDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss" # Create the new token entry @@ -1115,7 +1115,7 @@ Function Write-CookiesToFile { [string]$UserAgent ) - $tokenFilePath = "$PSScriptRoot\AccessTokens.json" + $tokenFilePath = Join-Path ("$PSScriptRoot" ? "$PSScriptRoot" : ".") "AccessTokens.json" $currentDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss" # Prepare cookie data