diff --git a/PowerHuntShares.psm1 b/PowerHuntShares.psm1 index 618033c..7a2eb54 100644 --- a/PowerHuntShares.psm1 +++ b/PowerHuntShares.psm1 @@ -4,7 +4,7 @@ #-------------------------------------- # Author: Scott Sutherland, 2024 NetSPI # License: 3-clause BSD -# Version: v1.199 +# Version: v2.0 # 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 { @@ -2995,9 +2995,10 @@ function Invoke-HuntSMBShares # Send fingerprint request to LLM for share name + group $LLMResult = Invoke-FingerprintShare -OutputFile "$OutputDirectory\$TargetDomain-Shares-Inventory-LLM-Fingerprint.csv" -ShareName $_.ShareName -FileList $_.FileList -FolderGroup $_.FileListGroup -MakeLog -APIKEY $ApiKey -Endpoint $Endpoint - + # Return results $LLMResult + } # Show completion @@ -3736,12 +3737,27 @@ function Invoke-HuntSMBShares $FgAppName = $FgAppInfo | Select ShareGuessApp -ExpandProperty ShareGuessApp $FgAppJust = $FgAppInfo | Select ShareGuessLLM -ExpandProperty ShareGuessLLM + # Set $FgAppName to unknown if blank + If ($FgAppName -like ""){ + $FgAppName = "Unknown" + } + }else{ # Check static libraries $FgAppInfo = $ExcessiveSharePrivsFinal | where FileListGroup -eq $FileGroupName | where ShareGuessStatic -notlike "" | select ShareGuessStatic -first 1 $FgAppName = $FgAppInfo | select ShareGuessStatic -ExpandProperty ShareGuessStatic $FgAppJust = "" + + # Set $FgAppName to unknown if blank + If ($FgAppName -like ""){ + $FgAppName = "Unknown" + } + } + + # Set $FgAppName to unknown if blank + If ($FgAppName -like ""){ + $FgAppName = "Unknown" } # Grab the risk level for the highest risk acl for the foldergroup @@ -4753,6 +4769,12 @@ function Invoke-HuntSMBShares # ---------------------------------------------------------------------- # Build Share Name Summary Page Rows # ---------------------------------------------------------------------- + + # If no llm guess set to unknown + if($SnLLmMatchesList -like ""){ + $SnLLmMatchesList = "Unknown" + } + # Build Rows $ThisRow = @"