Skip to content

Instantly share code, notes, and snippets.

View jsecurity101's full-sized avatar

Jonathan Johnson jsecurity101

View GitHub Profile
@jsecurity101
jsecurity101 / GrabTools.ps1
Last active November 7, 2024 12:15
Tools needed for DEATHCON 2024
$EtwInspectorURL = "https://github.com/jsecurity101/ETWInspector/releases/download/1.0/EtwInspector.exe"
$JonMonURL = "https://github.com/jsecurity101/JonMon/releases/download/Beta-0.01/JonMon.zip"
$EtwInspecter = "EtwInspector.exe"
$JonMonZIP = "JonMon.zip"
# Download the file using Invoke-WebRequest
Write-Output "Downloading EtwINspector..."
Invoke-WebRequest -Uri $EtwInspectorURL -OutFile $EtwInspecter
Write-Output "EtwInspector Downloaded"
PS > Get-FwFilter -Key 8560068a-cb5a-4521-84cf-e1c0072dc359 | Format-FwFilter
Name : Custom Outbound Filter
Action Type: Block
Key : 8560068a-cb5a-4521-84cf-e1c0072dc359
Id : 68421
Description:
Layer : FWPM_LAYER_ALE_AUTH_CONNECT_V4
Sub Layer : FWPM_SUBLAYER_UNIVERSAL
Flags : Persistent, Indexed
Weight : 274877906944
PS > Get-FwFilter -Id 68421 | Format-FwFilter
Name : Custom Outbound Filter
Action Type: Block
Key : 8560068a-cb5a-4521-84cf-e1c0072dc359
Id : 68421
Description:
Layer : FWPM_LAYER_ALE_AUTH_CONNECT_V4
Sub Layer : FWPM_SUBLAYER_UNIVERSAL
Flags : Persistent, Indexed
Weight : 274877906944
$LoadedDrivers = Get-CimInstance -ClassName Win32_SystemDriver
$LoadedDrivers | % {
if ($_.PathName -ne $null) {
# Check if the path starts with \??\ and adjust the relative path
if ($_.PathName.StartsWith("\??\")) {
$RelativePath = $_.PathName.Remove(0,4)
} else {
$RelativePath = $_.PathName
}
@jsecurity101
jsecurity101 / LDAPQueries.md
Created October 25, 2023 15:05
List of known LDAP queries used by attackers

List was compiled by Jonathan Johnson (@jsecurity101) and Carlos Perez (@Carlos_Perez)

Queries are not complete and are meant to be a reference. If you are using them for hunting use a contains within the query language.

  • Kerberoasting
    • (&(samAccountType=805306368)(servicePrincipalName=*)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))
    • (&(samAccountType=805306368)(servicePrincipalName=*)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))(!msds-supportedencryptiontypes:1.2.840.113556.1.4.804:=24))
    • (&(samAccountType=805306368)(servicePrincipalName=*)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))(msds-supportedencryptiontypes:1.2.840.113556.1.4.804:=24))
  • Attributes with passwords
  • (userpassword=*)
@jsecurity101
jsecurity101 / gist:dc8bfc035cdaa42f87b2937dd2cef83b
Created September 11, 2023 16:28
MACRO_STATUS Enum for IDA
enum MACRO_STATUS : __int64
{
STATUS_WAIT_0 = 0x0,
STATUS_SEVERITY_INFORMATIONAL = 0x1,
STATUS_SEVERITY_WARNING = 0x2,
STATUS_SEVERITY_ERROR = 0x3,
STATUS_SUCCESS = 0x0,
STATUS_WAIT_1 = 0x1,
STATUS_WAIT_2 = 0x2,
STATUS_WAIT_3 = 0x3,
@jsecurity101
jsecurity101 / LOLDriverConfig.ps1
Last active October 31, 2023 13:45
PowerShell script that creates an audit or block Sysmon config based off of LOLDrivers
#Author: Jonathan Johnson (@jsecurity101)
function New-DriverConfig {
<#
.EXAMPLE
New-DriverConfig -Block
Creates driver block config in the current directory
.EXAMPLE
EventId Event Description
1 THREATINT_ALLOCVM_REMOTE
2 THREATINT_PROTECTVM_REMOTE
3 THREATINT_MAPVIEW_REMOTE
4 THREATINT_QUEUEUSERAPC_REMOTE
5 THREATINT_SETTHREADCONTEXT_REMOTE
6 THREATINT_ALLOCVM_LOCAL
7 THREATINT_PROTECTVM_LOCAL
8 THREATINT_MAPVIEW_LOCAL
11 THREATINT_READVM_LOCAL
@jsecurity101
jsecurity101 / LogonSessionProcesses.ps1
Created September 27, 2022 21:40
Updated version of Lee Christensen's (@tifkin_) Get-LogonSessionProcesses script which will obtain information regarding processes tied to a given LogonID and with it any network connections that process may have.
if (-not ('TokenInformation.ProcessNativeMethods' -as [type])){
$TypeDef = @'
using System;
using System.Runtime.InteropServices;
namespace TokenInformation {
[Flags]
public enum ProcessAccess {
All = 0x001FFFFF,
Terminate = 0x00000001,
CreateThread = 0x00000002,