Added Chocolatey Package

This commit is contained in:
Michael Grafnetter 2019-05-08 17:35:52 +02:00
parent 7dfbbbf4e9
commit 3da4233034
11 changed files with 118 additions and 7 deletions

View File

@ -0,0 +1,12 @@
<#
.SYNOPSIS
Generates a Chocolatey package. Requires Chocolatey to be installed.
#>
#Requires -Version 3
$repoRoot = Join-Path $PSScriptRoot '..\'
$nuspecPath = Join-Path $repoRoot 'Src\DSInternals.PowerShell.Chocolatey\dsinternals.nuspec'
$outputDir = Join-Path $repoRoot 'Build\packages\Chocolatey'
mkdir $outputDir -Force | Out-Null
choco pack $nuspecPath --outputdirectory $outputDir

View File

@ -6,7 +6,7 @@ Generates NuGet Packages.
$repoRoot = Join-Path $PSScriptRoot '..\'
$solutionDir = Join-Path $repoRoot 'Src\'
$outputDir = Join-Path $repoRoot 'Build\packages\'
$outputDir = Join-Path $repoRoot 'Build\packages\NuGet\'
$toolsDir = Join-Path $repoRoot 'Scripts\Tools'
$nuget = Join-Path $toolsDir 'nuget.exe'

View File

@ -6,7 +6,7 @@
<title>DSInternals Common</title>
<authors>Michael Grafnetter</authors>
<owners>Michael Grafnetter</owners>
<licenseUrl>https://raw.githubusercontent.com/MichaelGrafnetter/DSInternals/master/LICENSE.md</licenseUrl>
<licenseUrl>https://github.com/MichaelGrafnetter/DSInternals/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/MichaelGrafnetter/DSInternals/</projectUrl>
<iconUrl>https://www.dsinternals.com/wp-content/uploads/ad.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

View File

@ -6,7 +6,7 @@
<title>DSInternals DataStore</title>
<authors>Michael Grafnetter</authors>
<owners>Michael Grafnetter</owners>
<licenseUrl>https://raw.githubusercontent.com/MichaelGrafnetter/DSInternals/master/LICENSE.md</licenseUrl>
<licenseUrl>https://github.com/MichaelGrafnetter/DSInternals/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/MichaelGrafnetter/DSInternals/</projectUrl>
<iconUrl>https://www.dsinternals.com/wp-content/uploads/ad.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesnt appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>DSInternals</id>
<version>3.4</version>
<packageSourceUrl>https://github.com/MichaelGrafnetter/DSInternals</packageSourceUrl>
<owners>MichaelGrafnetter</owners>
<title>DSInternals PowerShell Module</title>
<authors>Michael Grafnetter</authors>
<projectUrl>https://github.com/MichaelGrafnetter/DSInternals</projectUrl>
<iconUrl>https://www.dsinternals.com/wp-content/uploads/ad.png</iconUrl>
<copyright>(c) 2015-2019 Michael Grafnetter. All rights reserved.</copyright>
<licenseUrl>https://github.com/MichaelGrafnetter/DSInternals/blob/master/LICENSE.md</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/MichaelGrafnetter/DSInternals/tree/master/Src</projectSourceUrl>
<docsUrl>https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Readme.md</docsUrl>
<bugTrackerUrl>https://github.com/MichaelGrafnetter/DSInternals/issues</bugTrackerUrl>
<tags>admin dsinternals powershell activedirectory ad security ntds passwords dpapi lsa sam audit</tags>
<summary>The DSInternals PowerShell Module exposes several internal features of Active Directory. These include offline ntds.dit file manipulation, password auditing, DC recovery from IFM backups and password hash calculation.</summary>
<description>
The [DSInternals PowerShell Module](https://www.powershellgallery.com/packages/DSInternals/) has these main features:
- [Active Directory password auditing](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Test-PasswordQuality.md) that discovers accounts sharing the same passwords or having passwords in a public database like [HaveIBeenPwned](https://haveibeenpwned.com) or in a custom dictionary.
- [Bare-metal recovery of domain controllers](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/New-ADDBRestoreFromMediaScript.md) from just IFM backups (ntds.dit + SYSVOL).
- Offline ntds.dit file manipulation, including [hash dumping](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Get-ADDBAccount.md), [password resets](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Set-ADDBAccountPassword.md), [group membership changes](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Set-ADDBPrimaryGroup.md), [SID History injection](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Add-ADDBSidHistory.md) and [enabling](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Enable-ADDBAccount.md)/[disabling](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Disable-ADDBAccount.md) accounts.
- [Online password hash dumping](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Get-ADReplAccount.md) through the Directory Replication Service (DRS) Remote Protocol (MS-DRSR). This feature is commonly called DCSync.
- [Domain or local account password hash injection](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Set-SamAccountPasswordHash.md) through the Security Account Manager (SAM) Remote Protocol (MS-SAMR) or [directly into the database](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Set-ADDBAccountPasswordHash.md).
- [LSA Policy modification](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Set-LsaPolicyInformation.md) through the Local Security Authority (Domain Policy) Remote Protocol (MS-LSAD / LSARPC).
- [Extracting credential roaming data](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Save-DPAPIBlob.md) and DPAPI domain backup keys, either online through [directory replication](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Get-ADReplBackupKey.md), [LSARPC](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Get-LsaBackupKey.md) and [offline from ntds.dit](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/Get-ADDBBackupKey.md).
- Password hash calculation, including [NT hash](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/ConvertTo-NTHash.md), [LM hash](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/ConvertTo-LMHash.md) and [kerberos keys](https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/ConvertTo-KerberosKey.md).
&gt; Installation Notes: The module will be installed to the *$PSHome\Modules* directory. This is to avoid conflicts with the *PowerShell Gallery* and still support module autoloading.
&gt; DISCLAIMER: Features exposed through these tools are not supported by Microsoft. Improper use might cause irreversible damage to domain controllers or negatively impact domain security.
</description>
<releaseNotes>
- The performance of the Test-PasswordQuality cmdlet had significantly been increased, expecially when used with HaveIBeenPwned.
- The PWDump export format is now more compatible with some 3rd party tools, e.g. ElcomSoft Distributed Password Recovery.
</releaseNotes>
<dependencies>
<!-- Windows Management Framework 3+. For OS prior to Windows 8 or Windows Server 2012. -->
<dependency id="powershell" version="[3.0.20121027]" />
<!-- Universal C Runtime. For RTM OS prior to Windows 10 and Windows Server 2016. -->
<dependency id="kb2999226" />
<!-- .NET Framework 4.5.1+. For RTM OS prior to Windows 8.1 and Windows Server 2012 R2. -->
<dependency id="dotnet4.5.1" />
</dependencies>
<conflicts>dsinternals-psmodule</conflicts>
<replaces>dsinternals-psmodule</replaces>
</metadata>
<files>
<file src="tools\**" target="tools" />
<file src="..\..\Build\bin\Release\DSInternals\**" target="DSInternals" />
</files>
</package>

View File

@ -0,0 +1,5 @@
VERIFICATION
This is the official DSInternals PowerShell Module Chocolatey package.
The package is self-contained and contains the same files as the GitHub ZIP release (https://github.com/MichaelGrafnetter/DSInternals/releases).

View File

@ -0,0 +1,16 @@
$ErrorActionPreference = 'Stop'
# Copy Files
$toolsDir = Split-Path -Parent ($MyInvocation.MyCommand.Definition)
$sourceDir = Join-Path -Path $toolsDir -ChildPath '..\DSInternals' -Resolve
$destinationDir = Join-Path -Path $PSHOME -ChildPath 'Modules\DSInternals'
robocopy $sourceDir $destinationDir /MIR /MOVE /NJS /NJH /NDL /NFL /NS /NP
# Cleanup
Remove-Item -Path $sourceDir -Recurse -Force -ErrorAction SilentlyContinue
# Create Start Menu Link
$psPath = (Get-Command -Name 'powershell.exe').Path
$psArguments = '-NoExit -Command "& { Import-Module -Name DSInternals; Get-Help -Name about_DSInternals }"'
$shortcutPath = Join-Path -Path $env:ProgramData -ChildPath 'Microsoft\Windows\Start Menu\Programs\DSInternals PowerShell Module.lnk'
Install-ChocolateyShortcut -ShortcutFilePath $shortcutPath -TargetPath $psPath -Arguments $psArguments -WorkingDirectory "$env:SystemDrive\"

View File

@ -0,0 +1,9 @@
$ErrorActionPreference = 'Stop'
# Remove Module Files
$destinationDir = Join-Path -Path $PSHOME -ChildPath 'Modules\DSInternals'
Remove-Item -Path $destinationDir -Recurse -Force -ErrorAction SilentlyContinue
# Remove Start Menu Icon
$shortcutPath = Join-Path -Path $env:ProgramData -ChildPath 'Microsoft\Windows\Start Menu\Programs\DSInternals PowerShell Module.lnk'
Remove-Item -Path $shortcutPath -Force -ErrorAction SilentlyContinue

View File

@ -6,7 +6,7 @@
<title>DSInternals Replication</title>
<authors>Michael Grafnetter</authors>
<owners>Michael Grafnetter</owners>
<licenseUrl>https://raw.githubusercontent.com/MichaelGrafnetter/DSInternals/master/LICENSE.md</licenseUrl>
<licenseUrl>https://github.com/MichaelGrafnetter/DSInternals/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/MichaelGrafnetter/DSInternals/</projectUrl>
<iconUrl>https://www.dsinternals.com/wp-content/uploads/ad.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

View File

@ -6,7 +6,7 @@
<title>DSInternals SAM</title>
<authors>Michael Grafnetter</authors>
<owners>Michael Grafnetter</owners>
<licenseUrl>https://raw.githubusercontent.com/MichaelGrafnetter/DSInternals/master/LICENSE.md</licenseUrl>
<licenseUrl>https://github.com/MichaelGrafnetter/DSInternals/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/MichaelGrafnetter/DSInternals/</projectUrl>
<iconUrl>https://www.dsinternals.com/wp-content/uploads/ad.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.352
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSInternals.PowerShell", "DSInternals.PowerShell\DSInternals.PowerShell.csproj", "{C7EECC1F-1F9C-400B-A981-A8106E2A75F7}"
EndProject
@ -49,6 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{A6D9
..\Scripts\Build-Solution.ps1 = ..\Scripts\Build-Solution.ps1
..\Scripts\Invoke-SmokeTests.ps1 = ..\Scripts\Invoke-SmokeTests.ps1
..\Scripts\Make.ps1 = ..\Scripts\Make.ps1
..\Scripts\Pack-Chocolatey.ps1 = ..\Scripts\Pack-Chocolatey.ps1
..\Scripts\Pack-NuGetPackages.ps1 = ..\Scripts\Pack-NuGetPackages.ps1
..\Scripts\Pack-PSModule.ps1 = ..\Scripts\Pack-PSModule.ps1
..\Scripts\Publish-NuGetPackages.ps1 = ..\Scripts\Publish-NuGetPackages.ps1
@ -113,6 +114,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PowerShell", "PowerShell",
..\Documentation\PowerShell\Test-PasswordQuality.md = ..\Documentation\PowerShell\Test-PasswordQuality.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DSInternals.PowerShell.Chocolatey", "DSInternals.PowerShell.Chocolatey", "{DA5C8A2B-710B-417A-B646-A512C3B90801}"
ProjectSection(SolutionItems) = preProject
DSInternals.PowerShell.Chocolatey\dsinternals.nuspec = DSInternals.PowerShell.Chocolatey\dsinternals.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{AFB60B81-6978-434C-9224-C7A63960A6A1}"
ProjectSection(SolutionItems) = preProject
DSInternals.PowerShell.Chocolatey\tools\chocolateyinstall.ps1 = DSInternals.PowerShell.Chocolatey\tools\chocolateyinstall.ps1
DSInternals.PowerShell.Chocolatey\tools\chocolateyuninstall.ps1 = DSInternals.PowerShell.Chocolatey\tools\chocolateyuninstall.ps1
DSInternals.PowerShell.Chocolatey\tools\VERIFICATION.txt = DSInternals.PowerShell.Chocolatey\tools\VERIFICATION.txt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -223,6 +236,7 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A47D652E-5EF7-44C0-AD85-4F0F9B738567} = {9735D030-AEE6-415A-BF03-074076FF776A}
{AFB60B81-6978-434C-9224-C7A63960A6A1} = {DA5C8A2B-710B-417A-B646-A512C3B90801}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {20AC2CF5-7C26-407B-B0A5-1BDE0FABABA8}