1
mirror of https://github.com/carlospolop/PEASS-ng synced 2024-11-24 01:26:22 +01:00

Update winPEAS.ps1

This commit is contained in:
0x48756773 2024-10-09 09:23:46 -05:00 committed by GitHub
parent ac29863d3b
commit 54fcb8a98b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,7 +68,7 @@ Function Start-ACLCheck {
$Identity += "$env:COMPUTERNAME\$env:USERNAME"
if ($ACLObject.Owner -like $Identity ) { Write-Host "$Identity has ownership of $Target" -ForegroundColor Red }
# This should now work for any language. Command runs whoami group, removes the first two line of output, converts from csv to object, but adds "group name" to the first column.
whoami.exe /groups /fo csv | select-objet -skip 2 | ConvertFrom-Csv -Header 'group name' | Select-Object -ExpandProperty 'group name' | ForEach-Object { $Identity += $_ }
whoami.exe /groups /fo csv | select-object -skip 2 | ConvertFrom-Csv -Header 'group name' | Select-Object -ExpandProperty 'group name' | ForEach-Object { $Identity += $_ }
$IdentityFound = $false
foreach ($i in $Identity) {
$permission = $ACLObject.Access | Where-Object { $_.IdentityReference -like $i }
@ -1227,7 +1227,7 @@ Write-Host "Will enumerate SMB Shares and Access if any are available"
Get-SmbShare | Get-SmbShareAccess | ForEach-Object {
$SMBShareObject = $_
# see line 70 for explanation of what this does
whoami.exe /groups /fo csv | select-objet -skip 2 | ConvertFrom-Csv -Header 'group name' | Select-Object -ExpandProperty 'group name' | ForEach-Object {
whoami.exe /groups /fo csv | select-object -skip 2 | ConvertFrom-Csv -Header 'group name' | Select-Object -ExpandProperty 'group name' | ForEach-Object {
if ($SMBShareObject.AccountName -like $_ -and ($SMBShareObject.AccessRight -like "Full" -or "Change") -and $SMBShareObject.AccessControlType -like "Allow" ) {
Write-Host -ForegroundColor red "$($SMBShareObject.AccountName) has $($SMBShareObject.AccessRight) to $($SMBShareObject.Name)"
}