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/Privesc/PowerUp.ps1 b/Privesc/PowerUp.ps1 index edd31b9..45edcec 100644 --- a/Privesc/PowerUp.ps1 +++ b/Privesc/PowerUp.ps1 @@ -1390,6 +1390,7 @@ Outputs a custom object containing the token privilege (name/attributes) for the if ($PSBoundParameters['Special']) { if ($SpecialPrivileges -Contains $_.Privilege) { $_ | Add-Member Noteproperty 'ProcessId' $ProcessID + $_ | Add-Member Aliasproperty Name ProcessId $_ } } @@ -2086,6 +2087,7 @@ https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/wind $Out | Add-Member Noteproperty 'StartName' $Service.startname $Out | Add-Member Noteproperty 'AbuseFunction' "Write-ServiceBinary -Name '$($Service.name)' -Path " $Out | Add-Member Noteproperty 'CanRestart' ([Bool]$CanRestart) + $Out | Add-Member Aliasproperty Name ServiceName $Out.PSObject.TypeNames.Insert(0, 'PowerUp.UnquotedService') $Out } @@ -2145,6 +2147,7 @@ PowerUp.ModifiablePath $Out | Add-Member Noteproperty 'StartName' $ServiceStartName $Out | Add-Member Noteproperty 'AbuseFunction' "Install-ServiceBinary -Name '$ServiceName'" $Out | Add-Member Noteproperty 'CanRestart' ([Bool]$CanRestart) + $Out | Add-Member Aliasproperty Name ServiceName $Out.PSObject.TypeNames.Insert(0, 'PowerUp.ModifiableServiceFile') $Out } @@ -2192,6 +2195,7 @@ PowerUp.ModifiablePath $Out | Add-Member Noteproperty 'StartName' $ServiceDetails.startname $Out | Add-Member Noteproperty 'AbuseFunction' "Invoke-ServiceAbuse -Name '$($ServiceDetails.name)'" $Out | Add-Member Noteproperty 'CanRestart' ([Bool]$CanRestart) + $Out | Add-Member Aliasproperty Name ServiceName $Out.PSObject.TypeNames.Insert(0, 'PowerUp.ModifiableService') $Out } @@ -3157,6 +3161,7 @@ http://www.greyhathacker.net/?p=738 ForEach ($ModifidablePath in $ModifidablePaths) { if ($Null -ne $ModifidablePath.ModifiablePath) { $ModifidablePath | Add-Member Noteproperty '%PATH%' $_ + $ModifidablePath | Add-Member Aliasproperty Name '%PATH%' $ModifidablePath.PSObject.TypeNames.Insert(0, 'PowerUp.HijackableDLL.Path') $ModifidablePath } @@ -3587,6 +3592,7 @@ Custom PSObject containing results. $Out | Add-Member Noteproperty 'Key' "$ParentPath\$Name" $Out | Add-Member Noteproperty 'Path' $Path $Out | Add-Member Noteproperty 'ModifiableFile' $_ + $Out | Add-Member Aliasproperty Name Key $Out.PSObject.TypeNames.Insert(0, 'PowerUp.ModifiableRegistryAutoRun') $Out } @@ -3659,6 +3665,7 @@ Custom PSObject containing results. $Out | Add-Member Noteproperty 'TaskName' $TaskName $Out | Add-Member Noteproperty 'TaskFilePath' $_ $Out | Add-Member Noteproperty 'TaskTrigger' $TaskTrigger + $Out | Add-Member Aliasproperty Name TaskName $Out.PSObject.TypeNames.Insert(0, 'PowerUp.ModifiableScheduledTaskFile') $Out } @@ -3669,6 +3676,7 @@ Custom PSObject containing results. $Out | Add-Member Noteproperty 'TaskName' $TaskName $Out | Add-Member Noteproperty 'TaskFilePath' $_ $Out | Add-Member Noteproperty 'TaskTrigger' $TaskTrigger + $Out | Add-Member Aliasproperty Name TaskName $Out.PSObject.TypeNames.Insert(0, 'PowerUp.ModifiableScheduledTaskFile') $Out } @@ -3733,6 +3741,7 @@ Custom PSObject containing results. $SearchLocations | Where-Object { Test-Path $_ } | ForEach-Object { $Out = New-Object PSObject $Out | Add-Member Noteproperty 'UnattendPath' $_ + $Out | Add-Member Aliasproperty Name UnattendPath $Out.PSObject.TypeNames.Insert(0, 'PowerUp.UnattendedInstallFile') $Out } @@ -4681,9 +4690,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 @@ -4693,25 +4707,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 = "