Skip to content

Instantly share code, notes, and snippets.

View FrankSpierings's full-sized avatar

Frank Spierings FrankSpierings

View GitHub Profile
@FrankSpierings
FrankSpierings / pretty_print_ntlm_impacket.py
Created February 12, 2024 06:54
Impacket - Print NTLM packets in JSON format for further analysis
import datetime
import json
from impacket.structure import Structure
from enum import Flag, Enum
class NegotiateFlags(Flag):
NTLMSSP_NEGOTIATE_56 = 0x80000000
NTLMSSP_NEGOTIATE_KEY_EXCH = 0x40000000
NTLMSSP_NEGOTIATE_128 = 0x20000000
@FrankSpierings
FrankSpierings / mitmproxy-http-ntlm.py
Created February 4, 2024 08:28
Mitmproxy script to authenticate NTLM
from mitmproxy import http, ctx
from impacket.ntlm import getNTLMSSPType1, getNTLMSSPType3
import requests
import logging
import base64
username = "username"
password = "password"
domain = ''
@FrankSpierings
FrankSpierings / http-ntlm.py
Created February 4, 2024 06:36
Request website using NTLM (can do pass-the-hash if you change getNTLMSSPType3)
from impacket.ntlm import getNTLMSSPType1, getNTLMSSPType3
import requests
import base64
# Replace these values with your IIS server details
target_url = "http://localhost"
username = "username"
password = "password"
domain = ''
@FrankSpierings
FrankSpierings / deploy-applocker.ps1
Last active November 9, 2023 13:05
AppLocker On Windows 10 Pro
# Requires system privileges!
# Thank you: https://github.com/sandytsang/MSIntune/blob/master/Intune-PowerShell/AppLocker/Delete-AppLockerEXE.ps1
$path = "<PATH TO APPLOCKER XML'S>"
$xmls = (ls -filter '*.xml' $path |% {$_.FullName})
$Appx, $Dll, $Exe, $Msi, $Script = $null
$xmls |% {
@FrankSpierings
FrankSpierings / client-desync-error-path.bcheck
Created July 3, 2023 12:10
Tests for Client-Side Desync vulnerabilities on specifically erroneous paths
metadata:
language: v1-beta
name: "Potential Client-Side Desync on erroneous path"
description: "Tests for Client-Side Desync vulnerabilities on specifically erroneous paths"
author: "Frank Spierings"
run for each:
potential_path =
"/..%2f",
"/%2e%2e",
@FrankSpierings
FrankSpierings / BurpCAMagiskRooted.md
Created July 25, 2022 10:08
Install Burp CA Certificate on Magisk Rooted Device

Magisk Module

  • Use the modified Magisk module to install the certificate in both the user and the system store.
git clone https://github.com/Magisk-Modules-Repo/movecert.git
@FrankSpierings
FrankSpierings / lab-request-smuggling-h2-request-splitting-via-crlf-injection-solution.py
Created July 21, 2022 07:22
Python3 solution to Portswigger's Lab; HTTP/2 request splitting via CRLF injection
# Thanks to h2 for the example code and thanks to Portswigger for the awesome free labs!
# - https://python-hyper.org/projects/h2/en/stable/plain-sockets-example.html
# - https://portswigger.net/web-security/request-smuggling/advanced/lab-request-smuggling-h2-request-splitting-via-crlf-injection
#
import socket
import ssl
import h2.connection
import h2.events
@FrankSpierings
FrankSpierings / dinvoke-shellcode.cs
Last active May 19, 2022 10:09
D/Invoke Shellcode Runner
/*
- Compile: docker run --rm -it -v /tmp/data:/tmp/data mono csc /tmp/data/dinvoke-shellcode.cs -out:/tmp/data/dinvoke-shellcode.exe /platform:x64 /unsafe
- Reference (Thanks!) : https://jhalon.github.io/utilizing-syscalls-in-csharp-1/
*/
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.ComponentModel;
using Microsoft.Win32;
@FrankSpierings
FrankSpierings / Invoke-SQLCmd.ps1
Last active November 18, 2022 16:54
Very basic Powershell script to execute a SQL Query and show the result in a GridView
function Invoke-SQLCmd {
param(
[Parameter(Mandatory=$True)]
[string] $Server,
[Parameter(Mandatory=$True)]
[string] $Database,
[Parameter(Mandatory=$True)]
[string] $Query
);
@FrankSpierings
FrankSpierings / sharpshooter-hta.diff
Last active December 8, 2021 19:16
Make HTA's work on Windows 10
diff --git a/SharpShooter.py b/SharpShooter.py
index 9b10de1..50cece0 100644
--- a/SharpShooter.py
+++ b/SharpShooter.py
@@ -286,7 +286,7 @@ End Sub"""
raise Exception
if(payload_type == 1):
- if(args.comtechnique):
+ if(args.comtechnique or args.dotnetver == str(4)):