/
CVE-2020-16898_Checker.ps1
30 lines (28 loc) · 1.21 KB
/
CVE-2020-16898_Checker.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#######################################################################################################
### 14/10/2020 - Written by Cyril Pineiro / SYNAPSYS-IT
### Check if Network Interface is Vulnerable to CVE-2020-16898 & CVE-2020-16899
### Returns Interface Index and Alias
#######################################################################################################
Clear
$interfaces = (Get-NetIPInterface | where {$_.AddressFamily -eq "IPv6"}).ifIndex
foreach ($interface in $interfaces)
{
[bool]$vuln = $false
$output = netsh int ipv6 sh interfaces interface=$interface
foreach ($Line in $output)
{
if($Line.Contains("6106") -and $Line.Contains("enabled"))
{
[bool]$vuln = $true
}
}
$NetIPInterfaceAlias = ((Get-NetIPAddress -InterfaceIndex $interface | Select-Object InterfaceAlias)[0]).InterfaceAlias
if ($vuln)
{
Write-Host "Interface '$($interface)' named '$($NetIPInterfaceAlias)' is Vulnerable to CVE-2020-16898 & CVE-2020-16899" -ForegroundColor Red
}
else
{
Write-Host "Interface '$($interface)' named '$($NetIPInterfaceAlias)' is Not Vulnerable to CVE-2020-16898 & CVE-2020-16899" -ForegroundColor Green
}
}