From 8446663598bf7fd6187b2daa3ef20bf223fb941d Mon Sep 17 00:00:00 2001 From: Scott Sutherland Date: Mon, 9 May 2022 16:21:30 -0500 Subject: [PATCH] Update PowerHuntShares.psm1 --- PowerHuntShares.psm1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PowerHuntShares.psm1 b/PowerHuntShares.psm1 index e7e5547..fb5d179 100644 --- a/PowerHuntShares.psm1 +++ b/PowerHuntShares.psm1 @@ -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