Exploit database

GH-88d8bc551618926a04536090300b4292

dungnm24/cve-2020-0796

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2020-0796

81 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files33

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

WindowsProtocolTestSuites/TestSuites/ADFamily/Setup/Scripts/CreateLocalSideForestTrust.ps1

PowerShell · 869 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]$TargetForestName,

    [Parameter(Mandatory=$true)]
    [ValidateNotNullOrEmpty()]
    [String]$TrustPassword
)

$LocalForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()

try
{
    # Build trust relationship on local forest only
    $LocalForest.CreateLocalSideOfTrustRelationship($TargetForestName, "Bidirectional", $TrustPassword)
}
# If trust relationship already exists
catch [System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectExistsException]
{
    Write-Host "Trust relationship already exists."
}
catch
{
    throw "Failed to create trust relationship. Error: " + $_.Exception.Message
}