mirror of
https://github.com/NetSPI/PowerHuntShares.git
synced 2025-05-05 03:38:42 +02:00
Update PowerHuntShares.psm1
This commit is contained in:
parent
9f68bf82a9
commit
8446663598
@ -4,7 +4,7 @@
|
||||
#--------------------------------------
|
||||
# Author: Scott Sutherland, 2022 NetSPI
|
||||
# License: 3-clause BSD
|
||||
# Version: v1.29
|
||||
# Version: v1.30
|
||||
# References: This script includes custom code and code taken and modified from the open source projects PowerView, Invoke-Ping, and Invoke-Parrell.
|
||||
function Invoke-HuntSMBShares
|
||||
{
|
||||
@ -1031,7 +1031,7 @@ function Invoke-HuntSMBShares
|
||||
$Subnets = $ExcessiveSharePrivs | Select IPAddress -Unique |
|
||||
Foreach{
|
||||
|
||||
$LastOctStart = (($_.IPAddress | Select-String '\.' -AllMatches).Matches | select -last 1 | select index -ExpandProperty index)
|
||||
[int]$LastOctStart = (($_.IPAddress | Select-String '\.' -AllMatches).Matches | select -last 1 | select index -ExpandProperty index)
|
||||
$Subnet = $_.IPAddress.substring(0,$LastOctStart)
|
||||
$Subnet
|
||||
} | select -Unique
|
||||
@ -1109,7 +1109,9 @@ function Invoke-HuntSMBShares
|
||||
$Object | Add-Member Computers $subnetcomputersCount
|
||||
|
||||
# Return object
|
||||
$Object
|
||||
if($Subnetdisplay -ne ".0"){
|
||||
$Object
|
||||
}
|
||||
|
||||
} | sort Acls -Descending
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user