Skip to content

Instantly share code, notes, and snippets.

View jimmwayans's full-sized avatar
💭
Expl0iting...

unkn0wn_11 jimmwayans

💭
Expl0iting...
View GitHub Profile
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()
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()
#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>
@jimmwayans
jimmwayans / AutomatedLab-With-2-AD-and-clients
Last active September 6, 2021 18:36
A PowerShell script to create an AutomatedLab with a domain controller, client hosts and windows exchange servers for security lab.
#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
@jimmwayans
jimmwayans / AutomatedLab_SQLServer.ps1
Created August 25, 2021 19:34 — forked from jpomfret/AutomatedLab_SQLServer.ps1
Create a SQL server lab with the AutomatedLab PowerShell module
# 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