Update PowerHuntShares.psm1

Add unique share name count to folder group summary page.
This commit is contained in:
Scott Sutherland 2024-07-18 08:53:32 -05:00 committed by GitHub
parent 933d69a67f
commit 0830a520f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,7 @@
#-------------------------------------- #--------------------------------------
# Author: Scott Sutherland, 2024 NetSPI # Author: Scott Sutherland, 2024 NetSPI
# License: 3-clause BSD # License: 3-clause BSD
# Version: v1.71 # Version: v1.72
# References: This script includes custom code and code taken and modified from the open source projects PowerView, Invoke-Ping, and Invoke-Parrell. # 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 function Invoke-HuntSMBShares
{ {
@ -1579,10 +1579,11 @@ function Invoke-HuntSMBShares
$ThisFileCount = $ThisFileBars.FileCount $ThisFileCount = $ThisFileBars.FileCount
$ThisFileShareCount = $ThisFileBars.Sharecount $ThisFileShareCount = $ThisFileBars.Sharecount
$ThisFileShareNameList = $ExcessiveSharePrivs | where FileListGroup -eq $FileGroupName | select ShareName -unique -expandproperty sharename | foreach { "$_ <br>"} $ThisFileShareNameList = $ExcessiveSharePrivs | where FileListGroup -eq $FileGroupName | select ShareName -unique -expandproperty sharename | foreach { "$_ <br>"}
$ThisFileShareNameListUniqueCount = $ThisFileShareNameList | measure | select count -ExpandProperty count
$ThisRow = @" $ThisRow = @"
<tr> <tr>
<td> <td>
<button class="collapsible">$ThisFileShareCount</button> <button class="collapsible">$ThisFileShareNameListUniqueCount</button>
<div class="content"> <div class="content">
<div class="filelist" > <div class="filelist" >
$ThisFileShareNameList $ThisFileShareNameList
@ -1590,6 +1591,9 @@ function Invoke-HuntSMBShares
</div> </div>
</td> </td>
<td> <td>
$ThisFileShareCount
</td>
<td>
$FileGroupName $FileGroupName
</td> </td>
<td> <td>
@ -5158,12 +5162,13 @@ Folder groups are SMB shares that contain the exact same file listing. Each file
<table class="table table-striped table-hover tabledrop"> <table class="table table-striped table-hover tabledrop">
<thead> <thead>
<tr> <tr>
<th align="left">Affected Shares</th> <th align="left">Unique Share Name Count</th>
<th align="left">Affected Share Count</th>
<th align="left">File Group</th> <th align="left">File Group</th>
<th align="left">File Count</th> <th align="left">File Count</th>
<th align="left">Affected Computers</th> <th align="left">Affected Computers</th>
<th align="left">Affected Shares</th> <th align="left">Affected Shares</th>
<th align="left">Affected ACLs</th> <th align="left">Affected ACLs</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>