From 0eef2d6c5320a5b51062a3187fcb5221bd01b7ba Mon Sep 17 00:00:00 2001 From: Scott Sutherland Date: Sun, 2 Jun 2024 08:40:04 -0500 Subject: [PATCH] Update PowerHuntShares.psm1 Added unique folder group count column to "top share name" page. --- PowerHuntShares.psm1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/PowerHuntShares.psm1 b/PowerHuntShares.psm1 index d73cd16..bc76aa6 100644 --- a/PowerHuntShares.psm1 +++ b/PowerHuntShares.psm1 @@ -4,7 +4,7 @@ #-------------------------------------- # Author: Scott Sutherland, 2024 NetSPI # License: 3-clause BSD -# Version: v1.40 +# Version: v1.41 # 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 { @@ -1597,7 +1597,7 @@ function Invoke-HuntSMBShares $CommonShareNamesTopString = $CommonShareNamesTop5 | foreach { $ShareCount = $_.count - $ShareName = $_.name + $ShareName = $_.name Write-Output "$ShareCount $ShareName
" } @@ -1606,6 +1606,7 @@ function Invoke-HuntSMBShares foreach { $ShareCount = $_.count $ShareName = $_.name + $ShareFolderGroupCount = $ExcessiveSharePrivs | where sharename -like "$ShareName" | select filelistgroup -Unique | measure | select count -ExpandProperty count $ShareNameBars = Get-GroupNameBar -DataTable $ExcessiveSharePrivs -Name $ShareName -AllComputerCount $ComputerCount -AllShareCount $AllSMBSharesCount -AllAclCount $ShareACLsCount $ComputerBar = $ShareNameBars.ComputerBar $ShareBar = $ShareNameBars.ShareBar @@ -1646,7 +1647,10 @@ function Invoke-HuntSMBShares $ShareName - + + + $ShareFolderGroupCount + $ShareFolderGroupList @@ -3604,7 +3608,8 @@ This section contains a list of the most common SMB share names. In some cases, Share Count Share Name - Folder Groups + Unique Folder Group Count + Unique Folder Groups Affected Computers Affected Shares Affected ACLs