Skip to content

Instantly share code, notes, and snippets.

View jaredhaight's full-sized avatar

Jared Haight jaredhaight

View GitHub Profile
$token = '' # Get from: https://api.slack.com/custom-integrations/legacy-tokens
$user = Invoke-RestMethod -Uri "https://slack.com/api/auth.test?token=$token"
# Making sure we're on the right account. Thanks @veegr!
$user | Select-Object Url, Team, User | format-list
Write-Output "Is this the correct account?"
$choice = Read-Host "[Y/N]"
Switch ($choice) {
Y {Write-Output "`nDeleting with great vengeance and furious anger`n"}
N {
@jaredhaight
jaredhaight / windows_hardening.cmd
Last active July 21, 2025 11:06 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS.
::
::#######################################################################
::
:: Change file associations to protect against common ransomware attacks
:: Note that if you legitimately use these extensions, like .bat, you will now need to execute them manually from cmd or powershell
:: Alternatively, you can right-click on them and hit 'Run as Administrator' but ensure it's a script you want to run :)
:: ---------------------
ftype htafile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype WSHFile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype batfile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
@jaredhaight
jaredhaight / givingbacktoinfosec.md
Last active January 28, 2018 13:34
Giving Back to Infosec Talk Resources
@jaredhaight
jaredhaight / unattend.xml
Last active August 23, 2024 18:21
Simple Sysprep Answer File
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>0c09:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
@jaredhaight
jaredhaight / bash_prompt.sh
Created July 29, 2018 18:50 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@jaredhaight
jaredhaight / katz.cs
Created August 1, 2018 00:35
Updated Katz.cs - Latest Mimikatz, I mean honestly it is 2018...
This file has been truncated, but you can view the full file.
using System;
using System.IO;
using System.Text;
using System.IO.Compression;
using System.EnterpriseServices;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
/*
@jaredhaight
jaredhaight / Get-VideoLength.ps1
Last active May 9, 2019 01:04
Get Total Length of Time from a Directory of Videos
# Stolen from here: https://social.technet.microsoft.com/Forums/en-US/bad2dbb1-5deb-48b8-8f8c-45e2b353dba0/how-do-i-get-video-file-duration-in-powershell-script?forum=winserverpowershell#de6ee12a-1c1e-474f-b5ba-ece4b17e0144
function Get-VideoLength {
param (
$Path
)
if (-not $Path) {
$Path = (Get-Location).Path
}
@jaredhaight
jaredhaight / Split-String.ps1
Last active November 7, 2018 14:17
PowerShell script to split a string into arbitrary sizes, formatting the string for use in C# or PowerShell
function Split-String {
param (
[Parameter(Mandatory = $true)]
[string]$String,
[int]$MinLength = 50,
[int]$MaxLength = 120,
[string]$VariableName = "data",
[ValidateSet("PowerShell", "CSharp")]
$Format = "PowerShell"
)
@jaredhaight
jaredhaight / kerberos_attacks_cheatsheet.md
Created August 28, 2019 02:52 — forked from TarlogicSecurity/kerberos_attacks_cheatsheet.md
A cheatsheet with commands that can be used to perform kerberos attacks

Kerberos cheatsheet

Bruteforcing

With kerbrute.py:

python kerbrute.py -domain <domain_name> -users <users_file> -passwords <passwords_file> -outputfile <output_file>

With Rubeus version with brute module: