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 files6
dungnm24/cve-2020-0796Revision fe7aebbe1789
- ↑..Parent directory
- GetGroupMembers.ps1
- GetGroupSid.ps1
- GetGroups.ps1
- GetUserMemberships.ps1
- GetUserSid.ps1
- GetUsers.ps1
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
WindowsProtocolTestSuites/TestSuites/FileServer/src/Common/TestSuite/bin/Debug/net7.0/SutCommonControlAdapter/GetUsers.ps1
PowerShell · 1,460 bytes# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
$domainName = $PtfProp_Common_DomainName
$sutComputerName = $PtfProp_Common_SutComputerName
$dcName = $PtfProp_Common_DCServerComputerName
$adminUserName = $PtfProp_Common_AdminUserName
$isDomainEnv = (-not [string]::IsNullOrEmpty($domainName)) -and ($domainName -ne $sutComputerName)
$remoteComputerName = if ($isDomainEnv) {
$dcName
}
else {
$sutComputerName
}
$commandForDomain = {
param(
[string]$domainName
)
$domainFqn = "DC=" + $domainName.Replace(".", ",DC=")
$usersFqn = "CN=Users,$domainFqn"
[array]$domainUsers = Get-ADUser -Filter "*" -SearchBase $usersFqn
return $domainUsers
}
$commandForLocalComputer = {
return @(Get-LocalUser)
}
try {
[array]$results = if ($isDomainEnv) {
Invoke-Command -HostName $remoteComputerName -UserName "$domainName\$adminUserName" -ScriptBlock $commandForDomain -ArgumentList @($domainName)
}
else {
Invoke-Command -HostName $remoteComputerName -UserName "$adminUserName" -ScriptBlock $commandForLocalComputer
}
}
catch {
Get-Error
}
$users = @()
foreach ($result in $results) {
$user = @{
Name = $result.Name
Sid = $result.SID
}
$users += $user
}
if ($users.Length -eq 0) {
return "[]"
}
else {
return ($users | ConvertTo-Json -AsArray)
}