From 1453248011d3eb8f9585c3c4d0740e927ffeb163 Mon Sep 17 00:00:00 2001 From: Scott Sutherland Date: Fri, 9 Aug 2024 14:17:22 -0500 Subject: [PATCH] Update Analyze-HuntSMBShares.ps1 Updated left menu style. --- Scripts/Analyze-HuntSMBShares.ps1 | 196 +++++++++++++++++++++--------- 1 file changed, 137 insertions(+), 59 deletions(-) diff --git a/Scripts/Analyze-HuntSMBShares.ps1 b/Scripts/Analyze-HuntSMBShares.ps1 index a5433e1..cffa211 100644 --- a/Scripts/Analyze-HuntSMBShares.ps1 +++ b/Scripts/Analyze-HuntSMBShares.ps1 @@ -5,7 +5,7 @@ #-------------------------------------- # Author: Scott Sutherland, 2024 NetSPI # License: 3-clause BSD -# Version: v1.74 +# Version: v1.75 # References: This script includes custom code and code taken and modified from the open source projects PowerView, Invoke-Ping, and Invoke-Parrell. function Analyze-HuntSMBShares { @@ -3304,6 +3304,7 @@ $NewHtmlReport = @" + Report - +
@@ -4780,7 +4782,7 @@ input[type="checkbox"]:checked::before {
@@ -4839,7 +4841,7 @@ input[type="checkbox"]:checked::before {
- ACEs + ACEs
@@ -4898,7 +4900,7 @@ input[type="checkbox"]:checked::before {
@@ -4933,7 +4935,7 @@ input[type="checkbox"]:checked::before { In total, $RiskLevelCountCritical critical, $RiskLevelCountHigh high, $RiskLevelCountMedium medium, and $RiskLevelCountLow low risk ACE configurations were discovered across shares in the $TargetDomain Active Directory domain. The affected shares were found hosting $InterestingFilesAllObjectsSecretCount files that may contain passwords and $InterestingFilesAllObjectsSensitiveCount files that may contain sensitive data. Overall, $InterestingFilesAllFilesCount interesting files were found that could potentially lead to unauthorized data access or remote code execution. Click the chart titles below to explore the details.

- +
Share ACL Count by Risk Level
@@ -4949,7 +4951,7 @@ input[type="checkbox"]:checked::before {
- +
Interesting Files Count
@@ -6350,15 +6352,15 @@ Invoke-HuntSMBShares -Threads 20 -RunSpaceTimeOut 10 -OutputDirectory c:\folder\ // side menu collapse function // -------------------------- - function toggleMenu() { + function toggleMenu() { const menu = document.getElementById('sideMenu'); const icon = document.querySelector('.menu-button .icon'); menu.classList.toggle('collapsed'); - if (menu.classList.contains('collapsed')) { - icon.textContent = '☰'; // Collapsed state icon (hamburger menu) - } else { - icon.textContent = '☰'; // Expanded state icon (hamburger menu) - } + if (menu.classList.contains('collapsed')) { + icon.innerHTML = ''; + } else { + icon.innerHTML = ''; + } } // -------------------------- @@ -7288,6 +7290,82 @@ function extractAndDownloadCSV(tableId, columnIndex) { document.body.removeChild(link); } +function updateLabelColors(divId, objectId) { + // Get the div element by its ID + var divElement = document.getElementById(divId); + + // Check if the div element exists + if (divElement) { + // Get all label elements that are children of the div + var labels = divElement.getElementsByTagName('label'); + + // Loop through all label elements + for (var i = 0; i < labels.length; i++) { + var label = labels[i]; + + // Check if the ID does not start with "noactionmenu" + if (!label.id.startsWith("noactionmenu")) { + // Reset the styles for labels that do not start with "noactionmenu" + label.style.fontWeight = ''; + label.style.color = ''; + label.style.backgroundColor = ''; + label.style.transition = ''; + label.style.textDecoration = ''; + label.style.paddingLeft = ''; + label.style.borderRadius = ''; + label.style.paddingTop = ''; + label.style.paddingBottom = ''; + label.style.marginRight = ''; + label.style.marginLeft = ''; + } + } + } else { + console.error("Div with id '" + divId + "' not found."); + } + + // Check if the div element exists + if (divElement) { + // Get all label elements that are children of the div + var labels = divElement.getElementsByTagName('label'); + + // Loop through all label elements and clear their classes and inline styles, then reapply + for (var i = 0; i < labels.length; i++) { + // Save the class name and inline styles + var className = labels[i].className; + var style = labels[i].style.cssText; + + // Remove all classes and inline styles + labels[i].className = ''; + labels[i].style.cssText = ''; + + // Reapply the saved class name and inline styles + labels[i].className = className; + labels[i].style.cssText = style; + } + } else { + console.error("Div with id '" + divId + "' not found."); + } + + // Get the element by its object ID and set its background color to #25648C + var objectElement = document.getElementById(objectId); + + if (objectElement) { + // Apply the desired styles + objectElement.style.fontWeight = 'normal'; + objectElement.style.color = 'white'; + objectElement.style.backgroundColor = '#17405A'; + objectElement.style.transition = 'background-color 0.9s ease, color 0.3s ease'; + objectElement.style.textDecoration = 'none'; + objectElement.style.paddingLeft = '15px'; + objectElement.style.borderRadius = '5px'; + objectElement.style.paddingTop = '5px'; + objectElement.style.paddingBottom = '5px'; + objectElement.style.marginRight = '5px'; + objectElement.style.marginLeft = '5px'; + } else { + console.error("Element with id '" + objectId + "' not found."); + } +}