mirror of
https://github.com/NetSPI/PowerHuntShares.git
synced 2025-05-04 19:28:42 +02:00
Update Analyze-HuntSMBShares.ps1
Added exports on share names page. Updated a few table styles.
This commit is contained in:
parent
e21a0e9a76
commit
bd7c8fe3b6
@ -5,7 +5,7 @@
|
|||||||
#--------------------------------------
|
#--------------------------------------
|
||||||
# Author: Scott Sutherland, 2024 NetSPI
|
# Author: Scott Sutherland, 2024 NetSPI
|
||||||
# License: 3-clause BSD
|
# License: 3-clause BSD
|
||||||
# Version: v1.40
|
# Version: v1.45
|
||||||
# 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 Analyze-HuntSMBShares
|
function Analyze-HuntSMBShares
|
||||||
{
|
{
|
||||||
@ -1821,18 +1821,10 @@ function Analyze-HuntSMBShares
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="collapsible"><span style="color:#CE112D;"></span>$ThisFileCount Files</button>
|
<button class="collapsible"><span style="color:#CE112D;"></span>$ThisFileCount Files</button>
|
||||||
<div class="content">
|
<div class="content" style="font-size:11px;width:100px;">
|
||||||
<div class="filelist" >
|
|
||||||
$ThisFileList
|
$ThisFileList
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</td>
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
$ComputerBarF
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
$ShareBarF
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
$AclBarF
|
$AclBarF
|
||||||
</td>
|
</td>
|
||||||
@ -1899,12 +1891,11 @@ function Analyze-HuntSMBShares
|
|||||||
$MyFdListBr = $MyFdList -replace "`n", "<br>"
|
$MyFdListBr = $MyFdList -replace "`n", "<br>"
|
||||||
|
|
||||||
$ThisFileDirList = @"
|
$ThisFileDirList = @"
|
||||||
<strong style="font-size: 10px;">$fdcount</strong>
|
|
||||||
<button class="collapsible" style="font-size: 10px;">$fdname ($FdFileCount Files)</button>
|
<button class="collapsible" style="font-size: 10px;">$fdcount of $ShareCount shares ($FdFileCount Files)</button>
|
||||||
<div class="content">
|
<div class="content" style="font-size: 10px;background-color: white;padding-left:2px;top: 2px;">
|
||||||
<div class="filelist" style="font-size: 10px;">
|
<!-- $fdname<br><br> -->
|
||||||
$MyFdListBr
|
$MyFdListBr
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
"@
|
"@
|
||||||
$ThisFileDirList
|
$ThisFileDirList
|
||||||
@ -2780,6 +2771,13 @@ function Analyze-HuntSMBShares
|
|||||||
If($ShareNameRiskScore -lt .80){ $RiskLevel = "$ShareNameRiskScoreP Medium"}
|
If($ShareNameRiskScore -lt .80){ $RiskLevel = "$ShareNameRiskScoreP Medium"}
|
||||||
If($ShareNameRiskScore -lt .50){ $RiskLevel = "$ShareNameRiskScoreP Low"}
|
If($ShareNameRiskScore -lt .50){ $RiskLevel = "$ShareNameRiskScoreP Low"}
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# Build UNC Path Lists
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
$GetRowUncPathsRaw = $ExcessiveSharePrivs | where ShareName -EQ "$ShareName" | Select SharePath -Unique
|
||||||
|
$GetRowUncPathsCount = $GetRowUncPathsRaw | measure | select count -ExpandProperty count
|
||||||
|
$GetRowUncPaths = $GetRowUncPathsRaw | ForEach-Object { $ASDF = $_.SharePath; "$ASDF<br>" } | Out-String
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Build Share Name Summary Page Rows
|
# Build Share Name Summary Page Rows
|
||||||
@ -2787,8 +2785,13 @@ function Analyze-HuntSMBShares
|
|||||||
# Build Rows
|
# Build Rows
|
||||||
$ThisRow = @"
|
$ThisRow = @"
|
||||||
<tr h="$ShareRowHasHighRisk" w="$ShareRowHasWrite" r="$ShareRowHasRead" i="$ShareRowCountInteresting" e="$ShareRowHasEmpty" s="$ShareRowHasStale" n="$ShareRowHasDefault" >
|
<tr h="$ShareRowHasHighRisk" w="$ShareRowHasWrite" r="$ShareRowHasRead" i="$ShareRowCountInteresting" e="$ShareRowHasEmpty" s="$ShareRowHasStale" n="$ShareRowHasDefault" >
|
||||||
<td>
|
<td style="text-align:Center;">
|
||||||
$ShareCount
|
<button class="collapsible">
|
||||||
|
$GetRowUncPathsCount
|
||||||
|
</button>
|
||||||
|
<div class="content" style="width:80px;overflow-wrap: break-word;text-align:left;font-size: 10px;">
|
||||||
|
$GetRowUncPaths
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="vertical-align: top;text-align:left">
|
<td style="vertical-align: top;text-align:left">
|
||||||
<button class="collapsible" style="text-align:left">
|
<button class="collapsible" style="text-align:left">
|
||||||
@ -2840,7 +2843,7 @@ function Analyze-HuntSMBShares
|
|||||||
<strong>$RiskLevel</strong>
|
<strong>$RiskLevel</strong>
|
||||||
</button>
|
</button>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="filelistparent" style="font-size: 10px;">
|
<div class="filelistparent" style="font-size: 10px;width:90px;">
|
||||||
<strong>Risk Summary</strong><br>
|
<strong>Risk Summary</strong><br>
|
||||||
<table class="subtable">
|
<table class="subtable">
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
@ -2874,10 +2877,10 @@ function Analyze-HuntSMBShares
|
|||||||
<td>
|
<td>
|
||||||
<button class="collapsible" style="font-size: 10px;"><strong>$SimLevel</strong></button>
|
<button class="collapsible" style="font-size: 10px;"><strong>$SimLevel</strong></button>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="filelistparent" style="font-size: 10px;">
|
<div class="filelistparent" style="font-size: 10px;width:120px;">
|
||||||
<table class="subtable">
|
<table class="subtable">
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td><strong>Final Weighted Score: </strong>:</td><td> <strong>$FinalSimilarityScoreP</strong></td>
|
<td><strong>Final Score: </strong>:</td><td> <strong>$FinalSimilarityScoreP</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>File Name Coverage:</td><td> $SimularityFileCoverageScoreP</td>
|
<td>File Name Coverage:</td><td> $SimularityFileCoverageScoreP</td>
|
||||||
@ -2894,68 +2897,68 @@ function Analyze-HuntSMBShares
|
|||||||
<strong>File Name Metrics</strong><Br>
|
<strong>File Name Metrics</strong><Br>
|
||||||
<table class="subtable">
|
<table class="subtable">
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 10%:</td><td> $SimularityFileCoverage10</td>
|
<td>FG Coverage 10%:</td><td> $SimularityFileCoverage10</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 20%:</td><td> $SimularityFileCoverage20</td>
|
<td>FG Coverage 20%:</td><td> $SimularityFileCoverage20</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 30%:</td><td> $SimularityFileCoverage30</td>
|
<td>FG Coverage 30%:</td><td> $SimularityFileCoverage30</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 40%:</td><td> $SimularityFileCoverage40</td>
|
<td>FG Coverage 40%:</td><td> $SimularityFileCoverage40</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 51%:</td><td> $SimularityFileCoverage50</td>
|
<td>FG Coverage 51%:</td><td> $SimularityFileCoverage50</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 60%:</td><td> $SimularityFileCoverage60</td>
|
<td>FG Coverage 60%:</td><td> $SimularityFileCoverage60</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 70%:</td><td> $SimularityFileCoverage70</td>
|
<td>FG Coverage 70%:</td><td> $SimularityFileCoverage70</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 80%:</td><td> $SimularityFileCoverage80</td>
|
<td>FG Coverage 80%:</td><td> $SimularityFileCoverage80</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 90%:</td><td> $SimularityFileCoverage90</td>
|
<td>FG Coverage 90%:</td><td> $SimularityFileCoverage90</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 File FG Coverage 100%:</td><td> $SimularityFileCoverage100</td>
|
<td>FG Coverage 100%:</td><td> $SimularityFileCoverage100</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<Br><Br><strong>Folder Group Metrics</strong><Br>
|
<Br><Br><strong>Folder Group Metrics</strong><Br>
|
||||||
<table class="subtable">
|
<table class="subtable">
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 10% of shares:</td><td> $SimularityFolderGroupCoverage10</td>
|
<td>1 FG 10%/shares:</td><td> $SimularityFolderGroupCoverage10</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 20% of shares:</td><td> $SimularityFolderGroupCoverage20</td>
|
<td>1 FG 20%/shares:</td><td> $SimularityFolderGroupCoverage20</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 30% of shares:</td><td> $SimularityFolderGroupCoverage30</td>
|
<td>1 FG 30%/shares:</td><td> $SimularityFolderGroupCoverage30</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 40% of shares:</td><td> $SimularityFolderGroupCoverage40</td>
|
<td>1 FG 40%/shares:</td><td> $SimularityFolderGroupCoverage40</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 51% of shares:</td><td> $SimularityFolderGroupCoverage50</td>
|
<td>1 FG 51%/shares:</td><td> $SimularityFolderGroupCoverage50</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 60% of shares:</td><td> $SimularityFolderGroupCoverage60</td>
|
<td>1 FG 60%/shares:</td><td> $SimularityFolderGroupCoverage60</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 70% of shares:</td><td> $SimularityFolderGroupCoverage70</td>
|
<td>1 FG 70%/shares:</td><td> $SimularityFolderGroupCoverage70</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 80% of shares:</td><td> $SimularityFolderGroupCoverage80</td>
|
<td>1 FG 80%/shares:</td><td> $SimularityFolderGroupCoverage80</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 90% of shares:</td><td> $SimularityFolderGroupCoverage90</td>
|
<td>1 FG 90%/shares:</td><td> $SimularityFolderGroupCoverage90</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ignore">
|
<tr id="ignore">
|
||||||
<td>1 FG Covers 100% of shares:</td><td> $SimularityFolderGroupCoverage100</td>
|
<td>1 FG 100%/shares:</td><td> $SimularityFolderGroupCoverage100</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@ -2990,49 +2993,39 @@ function Analyze-HuntSMBShares
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="collapsible" style="font-size: 10px;"><strong>$ShareFolderGroupCount</strong></button>
|
<button class="collapsible" style="font-size: 10px;text-align:left;"><strong>$ShareFolderGroupCount</strong></button>
|
||||||
<div class="content">
|
<div class="content" style="width:100px;">
|
||||||
<div class="filelistparent" >
|
|
||||||
$ShareFolderGroupList
|
$ShareFolderGroupList
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 10px;">
|
<td style="font-size: 10px;">
|
||||||
<button class="collapsible" style="font-size: 10px;"><strong>$SimularityFileCommonListTopNum Files</strong></button>
|
<button class="collapsible" style="font-size: 10px;"><strong>$SimularityFileCommonListTopNum Files</strong></button>
|
||||||
<div class="content">
|
<div class="content" style="width:100px;overflow-wrap: break-word;">
|
||||||
<div class="filelistparent">
|
<table class="subtable" style="width:80%;"`>
|
||||||
<table class=`"subtable`" style=`"width:80%"`>
|
|
||||||
$SimularityFileCommonListTop
|
$SimularityFileCommonListTop
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 10px;">
|
<td style="font-size: 10px;">
|
||||||
|
|
||||||
<button class="collapsible" style="font-size: 10px;"><strong>$ShareRowInterestingFileTotalCount Files</strong></button>
|
<button class="collapsible" style="font-size: 10px;"><strong>$ShareRowInterestingFileTotalCount Files</strong></button>
|
||||||
<div class="content">
|
<div class="content" style="font-size: 10px;width:100px;overflow-wrap: break-word;">
|
||||||
<div class="filelistparent" style="font-size: 10px;">
|
|
||||||
|
|
||||||
<button class="collapsible"><span style="font-size: 10px;">$ShareRowInterestingFileListSecretsCount Secrets Files</span></button>
|
<button class="collapsible"><span style="font-size: 10px;">$ShareRowInterestingFileListSecretsCount Secrets Files</span></button>
|
||||||
<div class="content">
|
<div class="content" style="font-size: 10px;">
|
||||||
<div class="filelistparent" style="font-size: 10px;">
|
<table class="subtable" style="width:80%">
|
||||||
<table class=`"subtable`" style=`"width:80%"`>
|
|
||||||
$ShareRowInterestingFileListSecrets
|
$ShareRowInterestingFileListSecrets
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="collapsible"><span style="font-size: 10px;">$ShareRowInterestingFileListDataCount Data Files</span></button>
|
<button class="collapsible"><span style="font-size: 10px;">$ShareRowInterestingFileListDataCount Data Files</span></button>
|
||||||
<div class="content">
|
<div class="content" style=";font-size: 10px;">
|
||||||
<div class="filelistparent" style="font-size: 10px;">
|
<table class="subtable" style="width:80%"`>
|
||||||
<table class=`"subtable`" style=`"width:80%"`>
|
|
||||||
$ShareRowInterestingFileListData
|
$ShareRowInterestingFileListData
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
"@
|
"@
|
||||||
$ThisRow
|
$ThisRow
|
||||||
@ -3182,8 +3175,10 @@ $NewHtmlReport = @"
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
max-height: 0;
|
max-height: 0;
|
||||||
|
--max-width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: max-height 0.2s ease-out;
|
transition: max-height 0.2s ease-out;
|
||||||
|
transition: max-width 0.2s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs{
|
.tabs{
|
||||||
@ -3757,7 +3752,7 @@ $NewHtmlReport = @"
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
width: 90%
|
--width: 90%
|
||||||
}
|
}
|
||||||
|
|
||||||
.filelistparent {
|
.filelistparent {
|
||||||
@ -3770,7 +3765,7 @@ $NewHtmlReport = @"
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
width: 90%
|
--width: 90%
|
||||||
}
|
}
|
||||||
|
|
||||||
.tablecolinfo {
|
.tablecolinfo {
|
||||||
@ -4314,7 +4309,7 @@ input[type="checkbox"]:checked::before {
|
|||||||
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('sharesum');radiobtn.checked = true;">Share Summary</label>
|
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('sharesum');radiobtn.checked = true;">Share Summary</label>
|
||||||
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('ACLsum');radiobtn.checked = true;">ACL Summary</label>
|
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('ACLsum');radiobtn.checked = true;">ACL Summary</label>
|
||||||
<label class="tabLabel" style="width:100%;color:#07142A;background-color:#F56A00;padding-top:5px;padding-bottom:5px;margin-top:2px;margin-bottom:2px;"><Strong>Data Insights</Strong></label>
|
<label class="tabLabel" style="width:100%;color:#07142A;background-color:#F56A00;padding-top:5px;padding-bottom:5px;margin-top:2px;margin-bottom:2px;"><Strong>Data Insights</Strong></label>
|
||||||
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('InterestingFiles');radiobtn.checked = true;">Interesting Files</label>
|
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('InterestingFiles');radiobtn.checked = true;applyFiltersAndSort('InterestingFileTable', 'filterInputIF', 'filterCounterIF', 'paginationIF');">Interesting Files</label>
|
||||||
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('ShareName');radiobtn.checked = true;">Share Names</label>
|
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('ShareName');radiobtn.checked = true;">Share Names</label>
|
||||||
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('ShareFolders');radiobtn.checked = true;">Folder Groups</label>
|
<label href="#" class="stuff" style="width:100%;" onClick="radiobtn = document.getElementById('ShareFolders');radiobtn.checked = true;">Folder Groups</label>
|
||||||
<label href="#" class="stuff" style="width:100%;" onclick="radiobtn = document.getElementById('SubNets');radiobtn.checked = true;">Affected Subnets</label>
|
<label href="#" class="stuff" style="width:100%;" onclick="radiobtn = document.getElementById('SubNets');radiobtn.checked = true;">Affected Subnets</label>
|
||||||
@ -4349,10 +4344,8 @@ input[type="checkbox"]:checked::before {
|
|||||||
<div class="LargeCard" style="width:25%; ">
|
<div class="LargeCard" style="width:25%; ">
|
||||||
|
|
||||||
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
||||||
<button class="toggle-button" onclick="toggleDiv('FileTotal')" style="width: 100%;font-size: 15px; "><strong>Interesting File Names Found</strong></button>
|
<strong>Interesting File Names Found</strong>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="FileTotal" class="toggle-content">
|
|
||||||
<div class="LargeCardContainer" style="height:165px;text-align:center;vertical-align: middle;">
|
<div class="LargeCardContainer" style="height:165px;text-align:center;vertical-align: middle;">
|
||||||
<br><br>
|
<br><br>
|
||||||
<span class="percentagetext" style = "font-size: 50px; color:#f08c41;">
|
<span class="percentagetext" style = "font-size: 50px; color:#f08c41;">
|
||||||
@ -4361,7 +4354,7 @@ input[type="checkbox"]:checked::before {
|
|||||||
<br>
|
<br>
|
||||||
($InterestingFilesAllFilesCountU unique file names)
|
($InterestingFilesAllFilesCountU unique file names)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -4369,19 +4362,15 @@ input[type="checkbox"]:checked::before {
|
|||||||
<div class="LargeCard" style="width:68.5%">
|
<div class="LargeCard" style="width:68.5%">
|
||||||
|
|
||||||
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
||||||
<button class="toggle-button" onclick="toggleDiv('ChartContent')" style="width: 100%;font-size: 15px; ">
|
<strong>File Name Category Distribution</strong>
|
||||||
<strong>Filename Category Distribution</strong>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="ChartContent" class="toggle-content">
|
|
||||||
<div class="LargeCardContainer" align="center">
|
<div class="LargeCardContainer" align="center">
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<div id="chart"></div>
|
<div id="chart"></div>
|
||||||
<div class="chart-controls"></div>
|
<div class="chart-controls"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -4625,42 +4614,34 @@ input[type="checkbox"]:checked::before {
|
|||||||
<h4 style="color:gray;">Exposure Summary</h4>
|
<h4 style="color:gray;">Exposure Summary</h4>
|
||||||
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.<Br><Br>
|
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.<Br><Br>
|
||||||
</div>
|
</div>
|
||||||
<div class="LargeCard" style="width:385px;">
|
<div class="LargeCard" style="width:385px;">
|
||||||
<a href="#" id="DashLink" onClick="radiobtn = document.getElementById('ShareName');radiobtn.checked = true;">
|
<a href="#" id="DashLink" onClick="radiobtn = document.getElementById('ShareName');radiobtn.checked = true;" style="text-decoration:none;">
|
||||||
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
||||||
<button class="toggle-button" onclick="toggleDiv('ChartContent')" style="width: 100%;font-size: 15px; ">
|
<strong>Share ACL Count by Risk Level</strong>
|
||||||
<strong>Share ACL Count by Risk Level</strong>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div id="ChartContent" class="toggle-content">
|
|
||||||
<div class="LargeCardContainer" align="center">
|
<div class="LargeCardContainer" align="center">
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<div id="ChartDashboardRisk"></div>
|
<div id="ChartDashboardRisk"></div>
|
||||||
<div class="chart-controls"></div>
|
<div class="chart-controls"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="LargeCard" style="width:385px;">
|
<div class="LargeCard" style="width:385px;">
|
||||||
<a href="#" id="DashLink" onClick="radiobtn = document.getElementById('InterestingFiles');radiobtn.checked = true;">
|
<a href="#" id="DashLink" onClick="radiobtn = document.getElementById('InterestingFiles');radiobtn.checked = true;" style="text-decoration:none;">
|
||||||
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
<div class="LargeCardTitle" style = "font-size: 15px; background-color: #07142A">
|
||||||
<button class="toggle-button" onclick="toggleDiv('ChartContent')" style="width: 100%;font-size: 15px; ">
|
<strong>Exposed File Count by Category</strong>
|
||||||
<strong>Exposed File Count by Category</strong>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div id="ChartContent" class="toggle-content">
|
|
||||||
<div class="LargeCardContainer" align="center">
|
<div class="LargeCardContainer" align="center">
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<div id="ChartDashboardIF"></div>
|
<div id="ChartDashboardIF"></div>
|
||||||
<div class="chart-controls"></div>
|
<div class="chart-controls"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -5167,7 +5148,8 @@ This section contains a list of the most common SMB share names. In some cases,
|
|||||||
<label><input type="checkbox" class="filter-checkbox" name="e"> Empty</label>
|
<label><input type="checkbox" class="filter-checkbox" name="e"> Empty</label>
|
||||||
<label><input type="checkbox" class="filter-checkbox" name="s"> Stale</label>
|
<label><input type="checkbox" class="filter-checkbox" name="s"> Stale</label>
|
||||||
<label><input type="checkbox" class="filter-checkbox" name="n"> Default</label>
|
<label><input type="checkbox" class="filter-checkbox" name="n"> Default</label>
|
||||||
<div id="filterCounter" style="margin-top:10px;height: 25px;font-size:11">Loading...</div>
|
<div id="filterCounter" style="margin-top:10px;height: 25px;font-size:11">Loading...</div>
|
||||||
|
<div style="margin-top:-25px;height: 25px;font-size:11;text-align: left; margin-left: 100px;"><a style="margin-top:46px;height: 25px;font-size:11;" href="#" onclick="extractAndDownloadCSV('sharenametable', 0)">Export</a></div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<table id="sharenametable" class="table table-striped table-hover tabledrop" style="width: 95%;">
|
<table id="sharenametable" class="table table-striped table-hover tabledrop" style="width: 95%;">
|
||||||
@ -5214,7 +5196,7 @@ This section contains a list of the most common SMB share names. In some cases,
|
|||||||
iTHD/4Hv7s1i9NTblIwDvS+2PbHOBDYBVoN2/4+tu3WCeB/Bq60jr/WBOY+SW90tPARMLQNXFx3NHkPuNwBRp50yZAcyU9TKBaB9zP6pjwwfAv0r7m9tfdx+gBkqavlG+DgEIiUKHvd49193b39e6bd3w/VdnLO67/jCAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0
|
iTHD/4Hv7s1i9NTblIwDvS+2PbHOBDYBVoN2/4+tu3WCeB/Bq60jr/WBOY+SW90tPARMLQNXFx3NHkPuNwBRp50yZAcyU9TKBaB9zP6pjwwfAv0r7m9tfdx+gBkqavlG+DgEIiUKHvd49193b39e6bd3w/VdnLO67/jCAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0
|
||||||
SU1FB+gHDA40BpbiKy8AAAEjSURBVBjTXZAxS4JhFIWfe5XqA6NIBSvK1pak2tqjvb8Q/oUImgPnqL/R7tbYVPCtUb46iKYoSUGK3tvQK0hnu889HO49Uq1eyOXVtRby+Q1VrSBSBpaBMRDMLG2GMLi/uzV5fXvPFIvFHRE5A0qAAVMgCyjQNbN6v99vyfBzVFTVc2ArprWAHrAJbANLQNts9qCqWom
|
SU1FB+gHDA40BpbiKy8AAAEjSURBVBjTXZAxS4JhFIWfe5XqA6NIBSvK1pak2tqjvb8Q/oUImgPnqL/R7tbYVPCtUb46iKYoSUGK3tvQK0hnu889HO49Uq1eyOXVtRby+Q1VrSBSBpaBMRDMLG2GMLi/uzV5fXvPFIvFHRE5A0qAAVMgCyjQNbN6v99vyfBzVFTVc2ArprWAHrAJbANLQNts9qCqWom
|
||||||
JAB/u9uzuPXd/AjqRl1T1QIEyIBGuiuiJiJwCGeArcgHZy8Zn5loHcsBL5IWF3bLGOxf1DUxEZP+feazgAfAF+OOOAGuxDQB396BmloJ3F8w5EXbjOXN1zCzVZggDM68D7dhxEttJ/mZvu1u92QyDzGw25fDoeJQkK0FExiAKTIAhkJrZY2g0urXajf0CiVl4icFa+XEAAAAASUVORK5CYII=" /><span class="tooltiptext"><strong>Interesting Files</strong><br>are filenames that<br>may be sensitive.</span></div> </th>
|
JAB/u9uzuPXd/AjqRl1T1QIEyIBGuiuiJiJwCGeArcgHZy8Zn5loHcsBL5IWF3bLGOxf1DUxEZP+feazgAfAF+OOOAGuxDQB396BmloJ3F8w5EXbjOXN1zCzVZggDM68D7dhxEttJ/mZvu1u92QyDzGw25fDoeJQkK0FExiAKTIAhkJrZY2g0urXajf0CiVl4icFa+XEAAAAASUVORK5CYII=" /><span class="tooltiptext"><strong>Interesting Files</strong><br>are filenames that<br>may be sensitive.</span></div> </th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@ -5298,16 +5280,14 @@ Folder groups are SMB shares that contain the exact same file listing. Each file
|
|||||||
<div id="filterCounterTwo" style="margin-top:14px;height: 25px;font-size:11">Loading...</div>
|
<div id="filterCounterTwo" style="margin-top:14px;height: 25px;font-size:11">Loading...</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<table class="table table-striped table-hover tabledrop" id="foldergrouptable">
|
<table class="table table-striped table-hover tabledrop" id="foldergrouptable" style="width:95%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th onclick="sortTable('foldergrouptable',0,'number')" align="left">Unique Share Name Count</th>
|
<th onclick="sortTable('foldergrouptable',0,'number')" align="left">Unique Share Names</th>
|
||||||
<th onclick="sortTable('foldergrouptable',1,'number')" align="left">Affected Share Count</th>
|
<th onclick="sortTable('foldergrouptable',1,'number')" align="left">Share Count</th>
|
||||||
<th onclick="sortTable('foldergrouptable',2,'alpha')" align="left">File Group</th>
|
<th onclick="sortTable('foldergrouptable',2,'alpha')" align="left">File Group</th>
|
||||||
<th onclick="sortTable('foldergrouptable',3,'number')" align="left">File Count</th>
|
<th onclick="sortTable('foldergrouptable',3,'number')" align="left">File Count</th>
|
||||||
<th onclick="sortTable('foldergrouptable',4,'number')" align="left">Affected Computers</th>
|
<th onclick="sortTable('foldergrouptable',4,'number')" align="left">Affected ACLs</th>
|
||||||
<th onclick="sortTable('foldergrouptable',5,'number')" align="left">Affected Shares</th>
|
|
||||||
<th onclick="sortTable('foldergrouptable',6,'number')" align="left">Affected ACLs</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -5871,6 +5851,7 @@ const ChartDashboardRiskOptions = {
|
|||||||
const ChartDashboardRisk = new ApexCharts(document.querySelector("#ChartDashboardRisk"), ChartDashboardRiskOptions);
|
const ChartDashboardRisk = new ApexCharts(document.querySelector("#ChartDashboardRisk"), ChartDashboardRiskOptions);
|
||||||
ChartDashboardRisk.render();
|
ChartDashboardRisk.render();
|
||||||
|
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// Function to support collapsing and expanding sections
|
// Function to support collapsing and expanding sections
|
||||||
// --------------------------
|
// --------------------------
|
||||||
@ -5882,10 +5863,18 @@ for (i = 0; i < coll.length; i++) {
|
|||||||
this.classList.toggle("active");
|
this.classList.toggle("active");
|
||||||
var content = this.nextElementSibling;
|
var content = this.nextElementSibling;
|
||||||
if (content.style.maxHeight){
|
if (content.style.maxHeight){
|
||||||
|
|
||||||
content.style.maxHeight = null;
|
content.style.maxHeight = null;
|
||||||
|
|
||||||
|
// Adjust width
|
||||||
|
content.style.width = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
content.style.Height = content.scrollHeight + "px";
|
content.style.Height = content.scrollHeight + "px";
|
||||||
content.style.maxHeight = "100%";
|
content.style.maxHeight = "100%";
|
||||||
|
|
||||||
|
// Adjust width
|
||||||
|
content.style.width = "auto";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -5893,9 +5882,10 @@ for (i = 0; i < coll.length; i++) {
|
|||||||
function toggleDiv(TargetObjectId) {
|
function toggleDiv(TargetObjectId) {
|
||||||
var content = document.getElementById(TargetObjectId);
|
var content = document.getElementById(TargetObjectId);
|
||||||
if (content.style.display === "none") {
|
if (content.style.display === "none") {
|
||||||
content.style.display = "block";
|
content.style.display = "block";
|
||||||
} else {
|
} else {
|
||||||
content.style.display = "none";
|
content.style.display = "none";
|
||||||
|
content.style.width = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5975,7 +5965,7 @@ const chartOptions = {
|
|||||||
},
|
},
|
||||||
plotOptions: {
|
plotOptions: {
|
||||||
bar: {
|
bar: {
|
||||||
borderRadius: 4,
|
borderRadius: 0,
|
||||||
horizontal: false,
|
horizontal: false,
|
||||||
colors: {
|
colors: {
|
||||||
ranges: [{
|
ranges: [{
|
||||||
@ -6239,24 +6229,38 @@ applyFiltersAndSort('InterestingFileTable', 'filterInputIF', 'filterCounterIF',
|
|||||||
|
|
||||||
// CSV export function
|
// CSV export function
|
||||||
function extractAndDownloadCSV(tableId, columnIndex) {
|
function extractAndDownloadCSV(tableId, columnIndex) {
|
||||||
const regex = /\\\\[^\s\\]+\\[^\s\\]+\\[^\s\\]+/g; // UNC path regex
|
// Regex to match \\server\share, \\server\share folder, and \\server\share\file.ext formats, allowing spaces
|
||||||
|
const regex = /\\\\[^\\\s]+\\[^\\]+(?:\\[^\\]*)*/g;
|
||||||
const uncPaths = [];
|
const uncPaths = [];
|
||||||
|
|
||||||
// Loop through each filtered row
|
// Get the table element by ID
|
||||||
currentFilteredRows.forEach(row => {
|
const table = document.getElementById(tableId);
|
||||||
|
|
||||||
|
// Determine rows to process: filtered rows or all rows if no filter is applied
|
||||||
|
const rowsToProcess = currentFilteredRows.length > 0 ? currentFilteredRows : Array.from(table.rows);
|
||||||
|
|
||||||
|
// Loop through each row to process
|
||||||
|
rowsToProcess.forEach(row => {
|
||||||
const cells = row.getElementsByTagName('td');
|
const cells = row.getElementsByTagName('td');
|
||||||
if (cells[columnIndex]) {
|
if (cells[columnIndex]) {
|
||||||
const cellValue = cells[columnIndex].innerText;
|
// Get the div with class 'content' inside the cell
|
||||||
const matches = cellValue.match(regex);
|
const contentDiv = cells[columnIndex].querySelector('.content');
|
||||||
if (matches) {
|
if (contentDiv) {
|
||||||
uncPaths.push(...matches);
|
const cellValue = contentDiv.innerText;
|
||||||
|
const matches = cellValue.match(regex);
|
||||||
|
if (matches) {
|
||||||
|
uncPaths.push(...matches);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Remove empty or whitespace-only entries
|
||||||
|
const cleanUncPaths = uncPaths.map(path => path.trim()).filter(path => path.length > 0);
|
||||||
|
|
||||||
// Generate CSV content
|
// Generate CSV content
|
||||||
let csvContent = 'data:text/csv;charset=utf-8,';
|
let csvContent = 'data:text/csv;charset=utf-8,';
|
||||||
csvContent += uncPaths.join('\n');
|
csvContent += cleanUncPaths.join('\n');
|
||||||
|
|
||||||
// Create a link to download the CSV file
|
// Create a link to download the CSV file
|
||||||
const encodedUri = encodeURI(csvContent);
|
const encodedUri = encodeURI(csvContent);
|
||||||
@ -6291,6 +6295,7 @@ function extractAndDownloadCSV(tableId, columnIndex) {
|
|||||||
"@
|
"@
|
||||||
|
|
||||||
$NewHtmlReport | Out-File "$OutputDirectory\Summary-Report-$TargetDomain.html"
|
$NewHtmlReport | Out-File "$OutputDirectory\Summary-Report-$TargetDomain.html"
|
||||||
|
$Time = Get-Date -UFormat "%m/%d/%Y %R"
|
||||||
Write-Output " [*][$Time] - Done."
|
Write-Output " [*][$Time] - Done."
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user