From f9b95c5cf2812ddf7691940b26eac89bce5e03f8 Mon Sep 17 00:00:00 2001 From: James McGinnigle Date: Sun, 7 May 2017 16:32:55 +0100 Subject: Fix build for import and run of Invoke-PrivescAudit --- PowerSploit.psd1 | 4 ++-- PowerSploit.psm1 | 2 +- Recon/PowerView.ps1 | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PowerSploit.psd1 b/PowerSploit.psd1 index 065ea68..3b6976f 100644 --- a/PowerSploit.psd1 +++ b/PowerSploit.psd1 @@ -90,11 +90,11 @@ FunctionsToExport = @( 'Get-RegistryAutoLogon', 'Get-SecurityPackages', 'Get-ServiceDetail', - 'Get-ServiceUnquoted', 'Get-SiteListPassword', 'Get-System', 'Get-TimedScreenshot', 'Get-UnattendedInstallFile', + 'Get-UnquotedService', 'Get-UserEvent', 'Get-UserProperty', 'Get-VaultCredential', @@ -103,7 +103,6 @@ FunctionsToExport = @( 'Install-ServiceBinary', 'Install-SSP', 'Invoke-ACLScanner', - 'Invoke-AllChecks', 'Invoke-CheckLocalAdminAccess', 'Invoke-CredentialInjection', 'Invoke-DllInjection', @@ -114,6 +113,7 @@ FunctionsToExport = @( 'Invoke-Mimikatz', 'Invoke-NinjaCopy', 'Invoke-Portscan', + 'Invoke-PrivescAudit', 'Invoke-ProcessHunter', 'Invoke-ReflectivePEInjection', 'Invoke-ReverseDnsLookup', diff --git a/PowerSploit.psm1 b/PowerSploit.psm1 index 9bc0240..42a9174 100644 --- a/PowerSploit.psm1 +++ b/PowerSploit.psm1 @@ -1 +1 @@ -Get-ChildItem $PSScriptRoot | ? { $_.PSIsContainer -and ($_.Name -ne 'Tests') } | % { Import-Module $_.FullName -DisableNameChecking } +Get-ChildItem $PSScriptRoot | ? { $_.PSIsContainer -and !('Tests','docs' -contains $_.Name) } | % { Import-Module $_.FullName -DisableNameChecking } diff --git a/Recon/PowerView.ps1 b/Recon/PowerView.ps1 index c6cb5ff..487ed09 100755 --- a/Recon/PowerView.ps1 +++ b/Recon/PowerView.ps1 @@ -6634,19 +6634,19 @@ System.Security.AccessControl.AuthorizationRule [ValidateSet('AccessSystemSecurity', 'CreateChild','Delete','DeleteChild','DeleteTree','ExtendedRight','GenericAll','GenericExecute','GenericRead','GenericWrite','ListChildren','ListObject','ReadControl','ReadProperty','Self','Synchronize','WriteDacl','WriteOwner','WriteProperty')] $Right, - [Parameter(Mandatory = $True, ParameterSetName=’AccessRuleType’)] + [Parameter(Mandatory = $True, ParameterSetName='AccessRuleType')] [ValidateSet('Allow', 'Deny')] [String[]] $AccessControlType, - [Parameter(Mandatory = $True, ParameterSetName=’AuditRuleType’)] + [Parameter(Mandatory = $True, ParameterSetName='AuditRuleType')] [ValidateSet('Success', 'Failure')] [String] $AuditFlag, - [Parameter(Mandatory = $False, ParameterSetName=’AccessRuleType’)] - [Parameter(Mandatory = $False, ParameterSetName=’AuditRuleType’)] - [Parameter(Mandatory = $False, ParameterSetName=’ObjectGuidLookup’)] + [Parameter(Mandatory = $False, ParameterSetName='AccessRuleType')] + [Parameter(Mandatory = $False, ParameterSetName='AuditRuleType')] + [Parameter(Mandatory = $False, ParameterSetName='ObjectGuidLookup')] [Guid] $ObjectType, -- cgit v1.2.3 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 = "