Skip to content

Instantly share code, notes, and snippets.

View KurtDeGreeff's full-sized avatar

Kurt De Greeff KurtDeGreeff

View GitHub Profile
@KurtDeGreeff
KurtDeGreeff / adreplication_part2.ps1
Created May 5, 2018 20:53 — forked from nyanhp/adreplication_part2.ps1
Making sense of AD Replication schedules pt 2
function Get-ADReplicationSchedule
{
[CmdletBinding()]
param
(
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)]
[System.DirectoryServices.ActiveDirectory.ActiveDirectorySchedule]$ReplicationSchedule,
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)]
[string]$DistinguishedName
@KurtDeGreeff
KurtDeGreeff / PoSH_Postback.ps1
Created March 30, 2018 21:04 — forked from airtank20/PoSH_Postback.ps1
Script to download file from javascript Postback
#URL that needs to be fetched
$url = "https://site.state.gov/default.aspx"
#get the server name in case the process jumps to another script
$serverName = $env:computername
#wrapped it into a try/catch for some type of error handling
TRY {
#use invoke-webrequest to fetch a session from the site
Invoke-WebRequest $url -SessionVariable session -UseBasicParsing
@KurtDeGreeff
KurtDeGreeff / Inject.cs
Created March 22, 2018 21:42
DotNetToJScript Build Walkthrough
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
public class TestClass
{
public TestClass()
{}
@KurtDeGreeff
KurtDeGreeff / AnyBox_ProcessKiller.ps1
Created March 13, 2018 21:09 — forked from fresh2dev/AnyBox_ProcessKiller.ps1
AnyBox Demo - Process Killer
Import-Module AnyBox
[string]$default_input = 'localhost'
[hashtable]$answer = $null
[bool]$continue = $true
[hashtable]$common = @{WindowStyle = 'ToolWindow'; Title = 'Process Killer'; CancelButton = 'Cancel'}
while ($continue) {
$ModuleScript = {
$folders = @('functions', 'private', 'classes')
ForEach ($folder in $folders)
{
$currentPath = $PSScriptRoot | Join-Path -ChildPath $folder
If (Test-Path -Path $currentPath -PathType Container)
{
$functions = Get-ChildItem -Path $currentPath -Filter '*.ps1'
Verifying my Blockstack ID is secured with the address 16jwg75QpMSHynxFLb8DNHwSJTJnTvvDJ2 https://explorer.blockstack.org/address/16jwg75QpMSHynxFLb8DNHwSJTJnTvvDJ2
$cimSessionOption = New-CimSessionOption -Protocol Dcom
$cimSession = New-CimSession -ComputerName $env:computername -SessionOption $cimSessionOption
Invoke-CimMethod -CimSession $cimSession -ClassName win32_process -methodname Create -Arguments @{
commandline = "powershell.exe -executionpolicy bypass -file \\$env:computername\c`$\ps\test.ps1"
}
@KurtDeGreeff
KurtDeGreeff / Get-CertificateChain.ps1
Created February 28, 2018 15:28 — forked from CosmosKey/Get-CertificateChain.ps1
Get-CertificateChain.ps1
Function Get-CertificateChain {
param(
[string]$server=$(throw "Mandatory parameter -Server is missing."),
[int]$port=$(throw "Mandatory parameter -Port is missing."),
[switch]$ToBase64
)
$code=@"
using System;
using System.Collections;
using System.Net;
@KurtDeGreeff
KurtDeGreeff / Get-ADGroupMemberSamAccountName
Created February 28, 2018 15:25 — forked from CosmosKey/Get-ADGroupMemberSamAccountName
Get-ADGroupMemberSamAccountName
Function Get-ADGroupMemberSamAccountName {
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string]$GroupName
)
process {
$name = $GroupName
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$dc = $domain.FindDomainController([System.DirectoryServices.ActiveDirectory.LocatorOptions]::WriteableRequired)
@KurtDeGreeff
KurtDeGreeff / InstallUtilMouseKeyLogger.cs
Created February 27, 2018 17:30
Input Capture - InstallUtil Hosted MouseClick / KeyLogger -
using System;
using System.IO;
using System.Diagnostics;
using System.Windows.Forms;
using System.Configuration.Install;
using System.Runtime.InteropServices;
//KeyStroke Mouse Clicks Code
/*
* https://code.google.com/p/klog-sharp/
*/