Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/powershell/tests/Test-Assessment.25395.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ function Test-Assessment-25395 {
[CmdletBinding()]
param()

# Active Directory well-known ports
$AD_WELL_KNOWN_PORTS = @('53','88','135','389','445','464','636','3268','3269')

#region Helper Functions

function Test-IsBroadCidr {
Expand Down Expand Up @@ -98,11 +101,10 @@ function Test-Assessment-25395 {
System.Boolean - True if port is a valid AD well-known port, false otherwise.
#>
param([string]$Port)
$valid = @('53','88','135','389','445','464','636','3268','3269')
if ($Port -match '^(\d+)-(\d+)$') {
return ($matches[1] -eq $matches[2] -and $valid -contains $matches[1])
return ($matches[1] -eq $matches[2] -and $AD_WELL_KNOWN_PORTS -contains $matches[1])
}
return ($valid -contains $Port)
return ($AD_WELL_KNOWN_PORTS -contains $Port)
}

#endregion Helper Functions
Expand Down