Public/Invoke-Phase11ExfiltrateSensitiveData.ps1

function Invoke-Phase11ExfiltrateSensitiveData {

    ################################################################################
    ##### #####
    ##### Run the Attack Phase - Exfiltrate Sensitive Data #####
    ##### #####
    ################################################################################
    
    Param (  
        [switch]$UnAttended,
        [switch]$Continue,
        [Switch]$EnableLogging,
        [switch]$SkipImages,
        [switch]$SkipClearHost,
        [switch]$AS2GoDemo
    )

    $CurrentFunction = Get-FunctionName
    Write-Log -Message "### Start Function $CurrentFunction ###"
    $StartRunTime = (Get-Date).ToString($Script:DateFormatLog)
    #################### main code | out- host #####################

    If ($SkipSensitiveDataAccess) {
        Write-Log -Message "Skipped Attack Phase - $($Script:Phase11.toupper())"
    }
    else {
        If (-not $SkipClearHost) { Clear-Host }
        If (-not $AS2GoDemo) { 
            Set-NewColorSchema -NewStage $Script:InitialStart
            Get-AS2GoSettings 
        }
        Update-WindowTitle -NewTitle $Script:Phase11 
        Set-KeyValue -key "LastStage" -NewValue $Script:Phase11 

        If (-not $SkipImages) { Show-Phases -Phase "phase_011.html" }
        If (-not $SkipClearHost) { Clear-Host }
        Invoke-Output -T Header -M "Attack Phase - $($Script:Phase11.toupper())"
        Invoke-Output -T Bullet "Attempt to exfiltrate sensitive data over an SMB share"

        If ($UnAttended) {
            $answer = $Yes
        }
        else {
            $answer = Show-DecisionPrompt
        }

        If ($answer -eq $yes) {
            Start-Phase11DataExfiltration
        }
    }

    ######################## main code ############################
    $runtime = Get-RunTime -StartRunTime $StartRunTime
    Write-Log -Message " Run Time: $runtime [h] ###"
    Write-Log -Message "### End Function $CurrentFunction ###"
}