Private/New-KerberoastingAttack.ps1

function New-KerberoastingAttack {

    ################################################################################
    ##### #####
    ##### Description ######
    ##### #####
    ################################################################################


    #Param([string] $param1, [string] $para2)

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

    Update-WindowTitle -NewTitle $Script:Phase27
    Set-KeyValue -key "LastStage" -NewValue $Script:Phase27
    #Show-Phases -Phase "phase_007.html"
    Do {

        If (-not $SkipClearHost){Clear-Host}
        Write-Host "____________________________________________________________________`n" 
        Write-Host " Attack Phase - Kerberoasting Attack "
        Write-Host ""
        Write-Host " AS2Go uses $Script:RUBEUS to request a service ticket "
        Write-Host " for any service with a registered SPN`n"
        Write-Host "____________________________________________________________________`n" 

        Start-KerberoastingAttack    

        If (-not $SkipClearHost){Clear-Host}

        Write-Host "____________________________________________________________________`n" 
        Write-Host " ??? REPEAT | Attack Phase - Kerberoasting Attack ??? "
        Write-Host "____________________________________________________________________`n" 

        # End "Do ... Until" Loop?

        If ($UnAttended) {
            $repeat = $no
        }
        else {
            $question = "Would you like to repeat this attack phase? Please enter Y or N. Default "
            $repeat = Get-Answer -question $question -defaultValue $no
        }

        Write-Log -Message " >> using $CAtemplate"
    } Until ($repeat -eq $no)

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

    #
}