This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Retrieves all of the trust relationships for this domain - Does not Grab Forest Trusts | |
([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).GetAllTrustRelationships() | |
Grab Forest Trusts. | |
([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).GetAllTrustRelationships() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from impacket.dcerpc.v5 import transport, rrp, scmr, rpcrt, samr | |
from impacket.smbconnection import SMBConnection | |
def trigger_samr(remoteHost, username, password): | |
print("[*] Connecting to SAMR RPC service") | |
try: | |
rpctransport = transport.SMBTransport(remoteHost, 445, r'\samr', username, password, "", "", "", "") | |
dce = rpctransport.get_dce_rpc() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_NO_STATUS | |
#define SECURITY_WIN32 | |
#include "pch.h" | |
#include <windows.h> | |
#include <psapi.h> | |
#include <ntsecapi.h> | |
#include <sspi.h> | |
#include <sddl.h> | |
#include <wincred.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create an empty lab template and define path to files where VMs will be stored | |
New-LabDefinition -Name 'CreativeLabENV' -DefaultVirtualizationEngine HyperV -VmPath "C:\AutomatedLab-VMs\VMs\CreativeLabENV\" # If you want to place vm files in custom dir add -VmPath "drive:\path\to\directory" | |
#defining default parameter values, as these ones are the same for all the machines | |
$PSDefaultParameterValues = @{ | |
'Add-LabMachineDefinition:DomainName' = 'creativelab.com' | |
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2012 R2 Datacenter Evaluation (Server with a GUI)' | |
'Add-LabMachineDefinition:UserLocale' = 'en-US' | |
} | |
#Network Definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the Lab, specify the virtualization engine and the path for the VMs to live | |
New-LabDefinition -Name SQLLab -DefaultVirtualizationEngine HyperV -VmPath C:\AutomatedLab-VMs\VMs | |
# Configure the Lab Network | |
Add-LabVirtualNetworkDefinition -Name SQLLab | |
Add-LabVirtualNetworkDefinition -Name 'Default Switch' -HyperVProperties @{ SwitchType = 'External'; AdapterName = 'Wi-Fi' } | |
$netAdapter = @() | |
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch SQLLab | |
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch 'Default Switch' -UseDhcp |