diff --git a/PowerHuntShares.psm1 b/PowerHuntShares.psm1 index ad48505..c4438ec 100644 --- a/PowerHuntShares.psm1 +++ b/PowerHuntShares.psm1 @@ -4,7 +4,7 @@ #-------------------------------------- # Author: Scott Sutherland, 2024 NetSPI # License: 3-clause BSD -# Version: v1.116 +# Version: v1.117 # 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 { @@ -2445,6 +2445,67 @@ function Invoke-HuntSMBShares $RemediationSavings = $RemediationSaveSnP } + # ---------------------------------------------------------------------- + # Generate Sankey Summary C H M L + # ---------------------------------------------------------------------- + + # Create critical edge + if($RiskLevelCountCritical -gt 0){ + $SanKeyCritical = @" + { + source: 'ACEs ($ExcessiveSharePrivsCount)', + target: 'Critical ($RiskLevelCountCritical)', + value: $RiskLevelCountCritical, + color: '#93E6C4', // Custom color for this edge + }, +"@ + }else{ + $SanKeyCrtiical = "" + } + + # Create high edge + if($RiskLevelCountHigh -gt 0){ + $SanKeyHigh = @" + { + source: 'ACEs ($ExcessiveSharePrivsCount)', + target: 'High ($RiskLevelCountHigh)', + value: $RiskLevelCountHigh, + color: '#FB897C', // Custom color for this edge + }, +"@ + }else{ + $SanKeyHigh = "" + } + + # Create medium edge + if($RiskLevelCountMedium -gt 0){ + $SanKeyMedium = @" + { + source: 'ACEs ($ExcessiveSharePrivsCount)', + target: 'Medium ($RiskLevelCountMedium)', + value: $RiskLevelCountMedium, + color: '#FDAC70', // Custom color for this edge + }, +"@ + }else{ + $SanKeyMedium = "" + } + + # Create low edge + if($RiskLevelCountLow -gt 0){ + $SanKeyLow = @" + { + source: 'ACEs ($ExcessiveSharePrivsCount)', + target: 'Low ($RiskLevelCountLow)', + value: $RiskLevelCountLow, + color: '#FEDA94', // Custom color for this edge + }, +"@ + }else{ + $SanKeyLow = "" + } + + # ---------------------------------------------------------------------- # Create ShareGraph Nodes and Edges # ---------------------------------------------------------------------- @@ -3943,6 +4004,7 @@ $NewHtmlReport = @" +