From 52289768a95dae478df1a9bdd97dcfd7e4d02455 Mon Sep 17 00:00:00 2001 From: HackJammer Date: Wed, 10 May 2017 00:31:44 +0100 Subject: Default Invoke-PrivEscAudit to return objects for parsing --- Privesc/PowerUp.ps1 | 251 +++++++++++++++++++++------------------------------- 1 file changed, 102 insertions(+), 149 deletions(-) diff --git a/Privesc/PowerUp.ps1 b/Privesc/PowerUp.ps1 index 50f8268..af2d79e 100644 --- a/Privesc/PowerUp.ps1 +++ b/Privesc/PowerUp.ps1 @@ -4670,9 +4670,14 @@ Required Dependencies: None Executes all functions that check for various Windows privilege escalation opportunities. +.PARAMETER Format + +String. Format to decide on what is returned from the command, an Object Array, List, or HTML Report. + .PARAMETER HTMLReport -Switch. Write a HTML version of the report to SYSTEM.username.html. +DEPRECATED - Switch. Write a HTML version of the report to SYSTEM.username.html. +Superseded by the Format parameter. .EXAMPLE @@ -4682,25 +4687,26 @@ Runs all escalation checks and outputs a status report for discovered issues. .EXAMPLE -Invoke-PrivescAudit -HTMLReport +Invoke-PrivescAudit -Format HTML Runs all escalation checks and outputs a status report to SYSTEM.username.html detailing any discovered issues. -.OUTPUTS - -System.String #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '')] - [OutputType('System.String')] [CmdletBinding()] Param( + [ValidateSet('Object','List','HTML')] + [String] + $Format = 'Object', [Switch] $HTMLReport ) - if ($HTMLReport) { + if($HTMLReport){ $Format = 'HTML' } + + if ($Format -eq 'HTML') { $HtmlReportFile = "$($Env:ComputerName).$($Env:UserName).html" $Header = "