Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Powerview : Add Get-NetComputerStartTime & Get-NetComputerVersion #249

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Recon/PowerView.ps1
Binary file not shown.
2 changes: 2 additions & 0 deletions Recon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ an array of hosts from the pipeline.
Get-NetShare - returns open shares on the local (or a remote) machine
Get-NetLoggedon - returns users logged on the local (or a remote) machine
Get-NetSession - returns session information for the local (or a remote) machine
Get-NetComputerStartTime - returns start time information for the local (or a remote) machine
Get-NetComputerVersion - returns workstation information for the local (or a remote) machine
Get-RegLoggedOn - returns who is logged onto the local (or a remote) machine through enumeration of remote registry keys
Get-NetRDPSession - returns remote desktop/session information for the local (or a remote) machine
Test-AdminAccess - rests if the current user has administrative access to the local (or a remote) machine
Expand Down
2 changes: 2 additions & 0 deletions Recon/Recon.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ FunctionsToExport = @(
'Get-NetSession',
'Get-RegLoggedOn',
'Get-NetRDPSession',
'Get-NetComputerStartTime',
'Get-NetComputerVersion',
'Test-AdminAccess',
'Get-NetComputerSiteName',
'Get-WMIRegProxy',
Expand Down
45 changes: 45 additions & 0 deletions Tests/Recon.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,51 @@ Describe "Get-NetRDPSession" {
}
}

Describe "Get-NetComputerStartTime" {
It "Should return results for the local host" {
if ( (Get-NetComputerStartTime | Measure-Object).count -lt 1) {
Throw "Incorrect start time results returned"
}
}
It "Should accept NETBIOS -ComputerName argument" {
if ( (Get-NetComputerStartTime -ComputerName "$env:computername" | Measure-Object).count -lt 1) {
Throw "Incorrect start time results returned"
}
}
It "Should accept IP -ComputerName argument" {
if ( (Get-NetComputerStartTime -ComputerName $LocalIP | Measure-Object).count -lt 1) {
Throw "Incorrect start time results returned"
}
}
It "Should accept pipeline input" {
if ( ( "$env:computername" | Get-NetComputerStartTime | Measure-Object).count -lt 1) {
Throw "Incorrect start time results returned"
}
}
}

Describe "Get-NetComputerVersion" {
It "Should return results for the local host" {
if ( (Get-NetComputerVersion | Measure-Object).count -lt 1) {
Throw "Incorrect workstation results returned"
}
}
It "Should accept NETBIOS -ComputerName argument" {
if ( (Get-NetComputerVersion -ComputerName "$env:computername" | Measure-Object).count -lt 1) {
Throw "Incorrect workstation results returned"
}
}
It "Should accept IP -ComputerName argument" {
if ( (Get-NetComputerVersion -ComputerName $LocalIP | Measure-Object).count -lt 1) {
Throw "Incorrect workstation results returned"
}
}
It "Should accept pipeline input" {
if ( ( "$env:computername" | Get-NetComputerVersion | Measure-Object).count -lt 1) {
Throw "Incorrect workstation results returned"
}
}
}

Describe "Invoke-CheckLocalAdminAccess" {
It "Should Not Throw for localhost" {
Expand Down