-
-
Notifications
You must be signed in to change notification settings - Fork 97
Computer Enumeration Functions
Description
[MS-SRVS] Query session information for the local or a remote computer
Syntax
PV > Get-NetSession
-Computer -ComputerName -Count -Hash -OutFile -Password
-Server -SortBy -TableView -UsernameExamples
PV > Get-NetSession -Computer DC01
PV > Get-NetSession -ComputerName DC01 -TableView
PV > Get-NetSession -Computer DC01 -Username admin -Password Secret123
PV > Get-NetSession -Computer DC01 -SortBy username -OutFile sessions.txtParameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
Query open shares on the local or a remote computer
Syntax
PV > Get-NetShare
-Computer -ComputerName -Count -OutFile -Server -TableViewExamples
PV > Get-NetShare -Computer DC01
PV > Get-NetShare -ComputerName DC01 -TableView
PV > Get-NetShare -Computer DC01 -OutFile shares.txtParameters
# With Argument
-Computer =
-ComputerName =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
[MS-WKST] Query logged on users on the local or a remote computer
Syntax
PV > Get-NetLoggedOn
-Computer -ComputerName -Count -Hash -OutFile -Password
-Server -SortBy -TableView -UsernameExamples
PV > Get-NetLoggedOn -Computer DC01
PV > Get-NetLoggedOn -ComputerName DC01 -TableView
PV > Get-NetLoggedOn -Computer DC01 -Username admin -Password Secret123
PV > Get-NetLoggedOn -Computer DC01 -SortBy username -OutFile loggedon.txtParameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
Query logged on users from remote registry
Syntax
PV > Get-RegLoggedOn
-Computer -ComputerName -Count -OutFile -Server -SortBy
-TableViewExamples
PV > Get-RegLoggedOn -Computer DC01
PV > Get-RegLoggedOn -ComputerName DC01 -TableView
PV > Get-RegLoggedOn -Computer DC01 -SortBy username -OutFile regloggedon.txtParameters
# With Argument
-Computer =
-ComputerName =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
Query computer system information via RPC
Syntax
PV > Get-NetComputerInfo
-Computer -ComputerName -Count -Hash -OutFile -Password
-Server -SortBy -TableView -UsernameExamples
PV > Get-NetComputerInfo -Computer DC01
PV > Get-NetComputerInfo -ComputerName DC01 -TableView
PV > Get-NetComputerInfo -Computer DC01 -Username admin -Hash aad3b435b51404eeaad3b435b51404ee:abc123Parameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
[MS-TSTS] Query active terminal sessions on the local or a remote computer
Aliases
PV > qwinstaSyntax
PV > Get-NetTerminalSession
-Computer -ComputerName -Count -Hash -OutFile -Password
-Server -SortBy -TableView -UsernameExamples
PV > Get-NetTerminalSession -Computer DC01
PV > qwinsta -Computer DC01
PV > Get-NetTerminalSession -ComputerName DC01 -TableView
PV > Get-NetTerminalSession -Computer DC01 -Username admin -Password Secret123Parameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
[MS-TSTS] Terminate a specific terminal session on a remote computer
Syntax
PV > Remove-NetTerminalSession
-Computer -ComputerName -Count -Hash -OutFile -Password
-Server -SessionId -TableView -UsernameExamples
PV > Remove-NetTerminalSession -Computer DC01 -SessionId 2
PV > Remove-NetTerminalSession -ComputerName DC01 -SessionId 5 -Username admin -Password Secret123Parameters
# With Argument
-Computer =
-ComputerName =
-SessionId =
-Username =
-Password =
-Hash =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
[MS-TSTS] Query running processes on a remote computer
Aliases
PV > tasklistSyntax
PV > Get-NetProcess
-Computer -ComputerName -Count -Hash -Name -OutFile
-Password -Pid -Server -SortBy -TableView -UsernameExamples
PV > Get-NetProcess -Computer DC01
PV > tasklist -Computer DC01
PV > Get-NetProcess -Computer DC01 -Name svchost
PV > Get-NetProcess -Computer DC01 -Pid 1234
PV > Get-NetProcess -Computer DC01 -TableView -SortBy nameParameters
# With Argument
-Computer =
-ComputerName =
-Pid =
-Name =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Note:
-Pidand-Nameare mutually exclusive. Use one or the other to filter processes.
Description
[MS-TSTS] Terminate a specific process on a remote computer
Aliases
PV > taskkillSyntax
PV > Stop-NetProcess
-Computer -ComputerName -Count -Hash -Name -OutFile
-Password -Pid -Server -TableView -UsernameExamples
PV > Stop-NetProcess -Computer DC01 -Pid 1234
PV > taskkill -Computer DC01 -Pid 1234
PV > Stop-NetProcess -Computer DC01 -Name calc.exe
PV > Stop-NetProcess -Computer DC01 -Pid 5678 -Username admin -Password Secret123Parameters
# With Argument
-Computer =
-ComputerName =
-Pid =
-Name =
-Username =
-Password =
-Hash =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Note: One of
-Pidor-Nameis required. They are mutually exclusive.
Description
[MS-TSTS] Shutdown a remote computer
Aliases
PV > Shutdown-ComputerSyntax
PV > Stop-Computer
-Computer -ComputerName -Hash -OutFile -Password -Server
-TableView -UsernameExamples
PV > Stop-Computer -Computer WKS01
PV > Shutdown-Computer -Computer WKS01
PV > Stop-Computer -Computer WKS01 -Username admin -Password Secret123Parameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-Server =
-OutFile =
# No Argument
-TableView =Description
[MS-TSTS] Restart a remote computer
Aliases
PV > Reboot-ComputerSyntax
PV > Restart-Computer
-Computer -ComputerName -Hash -OutFile -Password -Server
-TableView -UsernameExamples
PV > Restart-Computer -Computer WKS01
PV > Reboot-Computer -Computer WKS01
PV > Restart-Computer -Computer WKS01 -Username admin -Password Secret123Parameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-Server =
-OutFile =
# No Argument
-TableView =Description
[MS-TSTS] Logoff a specific terminal session on a remote computer
Syntax
PV > Logoff-Session
-Computer -ComputerName -Count -Hash -OutFile -Password
-Server -SessionId -TableView -UsernameExamples
PV > Logoff-Session -Computer DC01 -SessionId 2
PV > Logoff-Session -ComputerName DC01 -SessionId 3 -Username admin -Password Secret123Parameters
# With Argument
-Computer =
-ComputerName =
-SessionId =
-Username =
-Password =
-Hash =
-Server =
-OutFile =
# No Argument
-TableView =
-Count =Description
[MS-EVEN6] Query Windows Event Logs from a remote computer via RPC
Syntax
PV > Get-EventLog
-Channel -Computer -ComputerName -Count -EventId -Export
-Hash -LogonType -MaxEvents -NewestFirst -NoWrap -OutFile
-Password -Raw -Server -SortBy -TableView -TargetUser
-UsernameExamples
PV > Get-EventLog -Computer DC01
PV > Get-EventLog -Computer DC01 -EventId 4625 -MaxEvents 50
PV > Get-EventLog -Computer DC01 -Channel Security -TargetUser Administrator
PV > Get-EventLog -Computer DC01 -EventId 4624,4625 -LogonType 3,10
PV > Get-EventLog -Computer DC01 -Export events.evtx
PV > Get-EventLog -Computer DC01 -Raw -OutFile raw_events.txtParameters
# With Argument
-Computer =
-ComputerName =
-Channel = (default: Security)
-EventId = (default: 4624, accepts multiple comma-separated values)
-LogonType = (list of integers)
-TargetUser =
-MaxEvents = (default: 100)
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-Export =
-OutFile =
# No Argument
-NewestFirst = (default: true)
-Raw =
-TableView =
-NoWrap =
-Count =Description
[MS-EVEN6] List event log channels on a remote computer with security product detection
Syntax
PV > Get-EventLogChannel
-Computer -ComputerName -Count -Hash -NoWrap -OutFile
-Password -Server -SortBy -TableView -UsernameExamples
PV > Get-EventLogChannel -Computer DC01
PV > Get-EventLogChannel -ComputerName DC01 -TableView
PV > Get-EventLogChannel -Computer DC01 -OutFile channels.txtParameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-NoWrap =
-Count =Description
[MS-EVEN6] List event log publishers on a remote computer with security product detection
Syntax
PV > Get-EventLogPublisher
-Computer -ComputerName -Count -Hash -NoWrap -OutFile
-Password -Server -SortBy -TableView -UsernameExamples
PV > Get-EventLogPublisher -Computer DC01
PV > Get-EventLogPublisher -ComputerName DC01 -TableView
PV > Get-EventLogPublisher -Computer DC01 -OutFile publishers.txtParameters
# With Argument
-Computer =
-ComputerName =
-Username =
-Password =
-Hash =
-SortBy =
-Server =
-OutFile =
# No Argument
-TableView =
-NoWrap =
-Count =Description
[MS-SCMR] Query running services on the local or a remote computer
Syntax
PV > Get-NetService
-Computer -ComputerName -Count -IsRunning -IsStopped -Name
-OutFile -SortBy -TableViewExamples
PV > Get-NetService -Computer DC01
PV > Get-NetService -Computer DC01 -Name Spooler
PV > Get-NetService -Computer DC01 -IsRunning
PV > Get-NetService -Computer DC01 -IsStopped -TableView
PV > Get-NetService -Computer DC01 -SortBy name -OutFile services.txtParameters
# With Argument
-Computer =
-ComputerName =
-Name =
-SortBy =
-OutFile =
# No Argument
-IsRunning =
-IsStopped =
-TableView =
-Count =Note:
-IsRunningand-IsStoppedare mutually exclusive.
Description
[MS-SCMR] Start a specific service on a remote computer
Syntax
PV > Start-NetService
-Computer -NameExamples
PV > Start-NetService -Computer DC01 -Name SpoolerParameters
# With Argument
-Computer = (required)
-Name = (required)Description
[MS-SCMR] Stop a specific service on a remote computer
Syntax
PV > Stop-NetService
-Computer -NameExamples
PV > Stop-NetService -Computer DC01 -Name SpoolerParameters
# With Argument
-Computer = (required)
-Name = (required)Description
[MS-SCMR] Delete a specific service on a remote computer
Syntax
PV > Remove-NetService
-Computer -NameExamples
PV > Remove-NetService -Computer DC01 -Name EvilSvcParameters
# With Argument
-Computer = (required)
-Name = (required)Description
[MS-SCMR] Create a new service on a remote computer
Syntax
PV > Add-NetService
-Computer -DelayedStart -DisplayName -ErrorControl -Name -Password
-Path -ServiceStartName -ServiceType -StartTypeExamples
PV > Add-NetService -Computer DC01 -Name TestSvc -DisplayName "Test Service" -Path "C:\Windows\System32\cmd.exe"
PV > Add-NetService -Computer DC01 -Name MySvc -DisplayName "My Service" -Path "C:\svc.exe" -StartType autoParameters
# With Argument
-Computer = (required)
-Name = (required)
-DisplayName = (required)
-Path = (required)
-Password =
-ServiceType =
-StartType =
-DelayedStart =
-ErrorControl =
-ServiceStartName =Description
[MS-SCMR] Modify an existing service on a remote computer
Syntax
PV > Set-NetService
-Computer -DelayedStart -DisplayName -ErrorControl -Name -Password
-Path -ServiceStartName -ServiceType -StartTypeExamples
PV > Set-NetService -Computer DC01 -Name TestSvc -Path "C:\Windows\System32\calc.exe"
PV > Set-NetService -Computer DC01 -Name TestSvc -DisplayName "Updated Service" -StartType disabledParameters
# With Argument
-Computer = (required)
-Name = (required)
-DisplayName =
-Path =
-Password =
-ServiceType =
-StartType =
-DelayedStart =
-ErrorControl =
-ServiceStartName =Description
[MS-SRVS] Kill a specific network session on a remote computer
Syntax
PV > Remove-NetSession
-Computer -Count -Hash -OutFile -Password -Server
-TargetSession -UsernameExamples
PV > Remove-NetSession -Computer DC01 -TargetSession "\\10.10.10.5"
PV > Remove-NetSession -Computer DC01 -TargetSession "\\10.10.10.5" -Username admin -Password Secret123Parameters
# With Argument
-Computer = (required)
-TargetSession = (required)
-Username =
-Password =
-Hash =
-Server =
-OutFile =
# No Argument
-Count =
- Introduction
- Installation
- Supported Authentication
- Cheatsheets
- Obfuscation
- User Defined Rules
- Public Writeups
LDAP Operations
- Get-DomainUser
- Get-DomainComputer
- Get-DomainGroup
- Get-DomainGroupMember
- Get-DomainOU
- Get-Domain
- Get-DomainController
- Get-DomainDNSRecord
- Get-DomainDNSZone
- Get-DomainObject
- Get-DomainObjectAcl
- Get-DomainObjectOwner
- Get-DomainSCCM
- Get-DomainRBCD
- Get-DomainWDS
- Get-LocalUser
- Set-DomainObject
- Set-DomainObjectDN
- Set-DomainObjectOwner
- Set-DomainUserPassword
- Set-DomainComputerPassword
- Set-DomainRBCD
- Set-DomainDNSRecord
- Add-DomainUser
- Add-DomainComputer
- Add-DomainGroup
- Add-DomainGroupMember
- Add-DomainOU
- Add-DomainGPO
- Add-DomainObjectAcl
- Add-DomainDNSRecord
- Remove-DomainUser
- Remove-DomainComputer
- Remove-DomainObject
- Remove-DomainGroupMember
- Remove-DomainOU
- Remove-DomainObjectAcl
- Remove-DomainDNSRecord
- Disable-DomainDNSRecord
- Restore-DomainObject
- Unlock-ADAccount
- Enable-ADAccount
- Disable-ADAccount
- Login-As
- Clear-Cache
Computer Enumeration
- Get-NetSession
- Get-NetShare
- Get-NetLoggedOn
- Get-RegLoggedOn
- Get-NetComputerInfo
- Get-NetTerminalSession
- Get-NetProcess
- Stop-NetProcess
- Get-EventLog
- Get-EventLogChannel
- Get-EventLogPublisher
- Get-NetService
- Start-NetService
- Stop-NetService
- Add-NetService
- Set-NetService
- Remove-NetService
- Stop-Computer
- Restart-Computer
- Remove-NetTerminalSession
- Remove-NetSession
- Logoff-Session