From 2125aef32c6669840f268d2b0e1e1f885be20cb3 Mon Sep 17 00:00:00 2001 From: Scott Sutherland Date: Wed, 7 Aug 2024 16:34:49 -0500 Subject: [PATCH] Update PowerHuntShares.psm1 Added ACEs page. --- PowerHuntShares.psm1 | 300 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 280 insertions(+), 20 deletions(-) diff --git a/PowerHuntShares.psm1 b/PowerHuntShares.psm1 index 2497ebb..e0e6c9f 100644 --- a/PowerHuntShares.psm1 +++ b/PowerHuntShares.psm1 @@ -4,7 +4,7 @@ #-------------------------------------- # Author: Scott Sutherland, 2024 NetSPI # License: 3-clause BSD -# Version: v1.100 +# Version: v1.101 # 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 { @@ -2003,7 +2003,84 @@ function Invoke-HuntSMBShares $RiskLevelCountLow = $ExcessiveSharePrivsFinal | where RiskLevel -eq 'Low' | measure | select count -ExpandProperty count $RiskLevelCountMedium = $ExcessiveSharePrivsFinal | where RiskLevel -eq 'Medium' | measure | select count -ExpandProperty count $RiskLevelCountHigh = $ExcessiveSharePrivsFinal | where RiskLevel -eq 'High' | measure | select count -ExpandProperty count - $RiskLevelCountCritical = $ExcessiveSharePrivsFinal | where RiskLevel -eq 'Critical' | measure | select count -ExpandProperty count + $RiskLevelCountCritical = $ExcessiveSharePrivsFinal | where RiskLevel -eq 'Critical' | measure | select count -ExpandProperty count + + # Create table for ACEs page + $AceTableRows = $ExcessiveSharePrivsFinal | + foreach { + + # Risk Level + $AceRowRiskScore = $_.RiskScore + $AceRowRiskLevel = $_.RiskLevel + + # Read + $AceRowHasRead = $_.HasRead + + # Write + $AceRowHasWrite = $_.HasWrite + + # HR + $AceRowHasHR = $_.HasHR + + # RCE + $AceRowHasRCE = $_.HasRCE + + # Has sesntive secrests + $AceRowHasSecrets = $_.HasSecrets + + # Has sesntive data + $AceRowHasIF = $_.HasIF + + # Computer + $AceRowComputer = $_.ComputerName + + # Share Name + $AceRowShareName = $_.ShareName + + # Share Path + $AceRowSharePath = $_.SharePath + + # ACE + $AceRowACE = $_.FileSystemRights + + # Identity + $AceRowIdentity = $_.IdentityReference + + # Share Owner + $AceRowShareOwner = $_.ShareOwner + + # Created + $AceRowCreated = $_. CreationDate + + # Modified + $AceRowModified = $_.LastModifiedDate + + # Files + $AceRowFilecount = $_.FileCount + $AceRowFileList = $_.FileList + + $AceRow = @" + + $AceRowRiskScore $AceRowRiskLevel + $AceRowComputer + $AceRowShareName + $AceRowSharePath + $AceRowACE + $AceRowIdentity + $AceRowShareOwner + $AceRowCreated + $AceRowModified + + +
+ $AceRowFileList +
+ + +"@ + # Return row + $AceRow + } # ---------------------------------------------------------------------- # Create Computer Insight Summary Information @@ -4312,7 +4389,7 @@ $NewHtmlReport = @" display:block; margin:10px; margin-bottom:20px; - --border-radius: 10px; + border-radius: 3px; } .card:hover{ @@ -4393,7 +4470,9 @@ $NewHtmlReport = @" border-bottom:1px solid #ccc; --border-bottom-right-radius: 10px; --border-bottom-left-radius: 10px; - } + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + } .cardbarouter{ background:#d9d7d7; @@ -4827,15 +4906,12 @@ input[type="checkbox"]:checked::before {
- - - - - - + + - + + @@ -4843,8 +4919,8 @@ input[type="checkbox"]:checked::before { - - + +
@@ -4934,7 +5010,7 @@ input[type="checkbox"]:checked::before {
-

Excessive Share Privileges Dashboard

+

Results Overview

@@ -4955,7 +5031,7 @@ input[type="checkbox"]:checked::before { -->
@@ -5014,7 +5090,7 @@ input[type="checkbox"]:checked::before {
@@ -5073,7 +5149,7 @@ input[type="checkbox"]:checked::before {
- ACLs + ACLs
@@ -5143,7 +5219,7 @@ input[type="checkbox"]:checked::before { Below is a summary of number of share ACLs by risk level and a summary of file name counts that may contain passwords, sensitive data, or result in remote code execution. Click the titles for more detail.

+ + + + +