Exploit databaseDownload repository ZIP
GH-88d8bc551618926a04536090300b4292
dungnm24/cve-2020-0796
Sources for CVE-2020-0796
81 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files33
dungnm24/cve-2020-0796Revision fe7aebbe1789
- ↑..Parent directory
- Config-CDC.ps1
- Config-DM.ps1
- Config-ENDPOINT.ps1
- Config-PDC.ps1
- Config-RODC.ps1
- Config-SDC.ps1
- Config-TDC.ps1
- ConfigGroupPolicyForClaims.ps1
- Create-ADObject.ps1
- Create-Account.ps1
- CreateLocalSideForestTrust.ps1
- Get-CertHash.ps1
- GetAvailablePort.ps1
- GetLDSInstanceGUID.ps1
- GetVmParameters.ps1
- GetVmParametersByComputerName.ps1
- GptTmpl.txt
- InstallADLDS.ps1
- InstallADLDSAnswerFile.txt
- Join-Domain.ps1
- NewCentralAccessPolicy.ps1
- NewCentralAccessRule.ps1
- NewClaimType.ps1
- NewResourceProperty.ps1
- PromoteChildDomain.ps1
- PromoteDomainController.ps1
- PromoteRODC.ps1
- Protocol.xml
- RestartAndRun.ps1
- RestartAndRunFinish.ps1
- SetAutoLogon.ps1
- SetNetworkConfiguration.ps1
- WaitFor-ComputerReady.ps1
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
WindowsProtocolTestSuites/TestSuites/ADFamily/Setup/Scripts/SetNetworkConfiguration.ps1
PowerShell · 3,668 bytes# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]]$IPAddress,
[AllowNull()]
[AllowEmptyCollection()]
[string[]]$SubnetMask,
[AllowNull()]
[AllowEmptyCollection()]
[string[]]$Gateway,
[AllowNull()]
[AllowEmptyCollection()]
[string[]]$DNS
)
Function ValidateArgument([string[]]$StringCollection)
{
if (($StringCollection -eq $null) -or ($StringCollection.Count -eq 0))
{
return $null
}
[bool]$EmptyCollection = $true
foreach ($item in $StringCollection)
{
if($item -ne "")
{
$EmptyCollection = $false
# Validate IP Address format
$Temp = New-Object System.Net.IPAddress -ArgumentList 0
$IsValid = [System.Net.IPAddress]::TryParse($item, ([ref]$Temp))
if($IsValid -eq $false)
{
throw "Invalid argument"
}
}
}
if($EmptyCollection -eq $true)
{
return $null
}
return $StringCollection
}
try
{
# Convert to array
[String[]]$IPAddressArray = ValidateArgument -StringCollection $IPAddress
[String[]]$SubnetMaskArray = ValidateArgument -StringCollection $SubnetMask
[String[]]$GatewayArray = ValidateArgument -StringCollection $Gateway
[String[]]$DNSArray = ValidateArgument -StringCollection $DNS
# If no subnet mask specified, take the default value.
if ($SubnetMaskArray -eq $null)
{
foreach ($IP in $IPAddressArray)
{
$SubnetMaskArray += "255.255.255.0"
}
}
# If the number of the subnet masks does not match the number of IP addresses,
# make them the same length.
else
{
if($SubnetMaskArray.Length -lt $IPAddressArray.Length)
{
$LastValue = $SubnetMaskArray[$SubnetMaskArray.Length - 1]
for ($count = $SubnetMaskArray.Length; $count -lt $IPAddressArray.Length; $count ++)
{
$SubnetMaskArray += $LastValue
}
}
elseif($SubnetMaskArray.Length -gt $IPAddressArray.Length)
{
$Temp = @()
for ($count = 0; $count -lt $IPAddressArray.Length; $count ++)
{
$Temp += $SubnetMaskArray[$count]
}
$SubnetMaskArray = $Temp
}
}
}
catch
{
throw "Invalid arguments. "+$_.Exception.Message
}
# WMI will return an array of values.
# If any of these values is zero, return zero;
# Or return the last return value.
Function GetExitCode($Obj)
{
$ReturnValues = [int[]]$Obj.ReturnValue
foreach ($Value in $ReturnValues)
{
if ($Value -eq 0)
{
$ExitCode = 0
break
}
else
{
$ExitCode = $Value
}
}
return $ExitCode
}
# Get WMI Object
$NetObj = Get-WmiObject Win32_NetworkAdapterConfiguration -ErrorAction Stop
$ExitCode = 0
# Set IP Addresses
$ReturnObj = $NetObj.EnableStatic($IPAddressArray,$SubnetMaskArray)
$ExitCode += GetExitCode $ReturnObj
# Set Gateways
if ($GatewayArray -ne $null)
{
$ReturnObj = $NetObj.SetGateways($GatewayArray)
$ExitCode += GetExitCode $ReturnObj
}
# Set DNS
if($DNSArray -ne $null)
{
$ReturnObj = $NetObj.SetDNSServerSearchOrder($DNSArray)
$ExitCode += GetExitCode $ReturnObj
}
# If any of the tasks above failed, throw an exception
if($ExitCode -ne 0)
{
throw "Error happened in setting the computer IP and DNS."
}