Skip to content

Instantly share code, notes, and snippets.

@Und3rf10w
Und3rf10w / custom-azure-openai-completion-provider.ts
Last active June 17, 2024 15:45
A custom azure-openai-completion-provider for the vercel ai-sdk, provided as one file
import {
type LanguageModelV1,
type LanguageModelV1FinishReason,
type LanguageModelV1LogProbs,
type LanguageModelV1StreamPart,
UnsupportedFunctionalityError,
InvalidPromptError,
type LanguageModelV1Prompt,
} from '@ai-sdk/provider';
import {
@Und3rf10w
Und3rf10w / shitty_overlay.py
Created December 17, 2023 06:07
Shitty tkinter overlay that diplays over all other apps that aren't fullscreen. Importable.
import tkinter as tk
from queue import Queue, Empty
import logging
import threading
import sys
# Configure stream redirection as a context manager
class StdoutRedirector:
def __init__(self, write_func):
self.write_func = write_func
@Und3rf10w
Und3rf10w / cuda_flowcontrol_xor_shellcode.c
Created December 15, 2023 13:35
Offloading tasks to CUDA
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
// CUDA runtime
#include <cuda_runtime.h>
__global__ void xorObfuscatePayload(char* data, int len, char key) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
@Und3rf10w
Und3rf10w / Headscale setup.md
Last active May 30, 2024 14:14
How to set up headscale with SWAG in docker-compose

Overview

This document descrives the process of setting up headscale with swag, using letsencrypt certs.

This assumes you have a subdomain (e.g. wg.example.com) pointing to your SWAG instance and want to use it as a reverse proxy.

Swag .env

Add the subdomain for your desired headscale domain to your .env file.

For example: SWAG_EXTRA_DOMAINS=wg.example.com

@Und3rf10w
Und3rf10w / DynamicStructResolution.go
Last active September 30, 2022 05:09
I have no idea how this works, but it does?
package main
import (
"fmt"
)
type methodArgumentsInterface interface {
determineStruct() interface{}
}
@Und3rf10w
Und3rf10w / extract_msft_graph_content_bytes_from_odata_response.sh
Created August 31, 2022 13:39
Extracts the contentBytes from a Microsoft Graph (o365) response and writes them to raw files using jq
for line in `cat response.json| jq '.value[].contentBytes'`; do
echo $line | tr -d '"' | base64 -d > $(echo -n $line | cut -c2-5).file;
done
@Und3rf10w
Und3rf10w / notify-matrix-hookshot.cna
Last active July 8, 2022 01:54
Send Cobalt Strike notifications to your Matrix Server via matrix-hookshot
# This script adds matrix-hookshot support via generic webhooks to Cobalt Strike
# Ensure that you configure the variables necessary at the beginning
# @Und3rf10w
# Modified from @vysecurity 's pushover-ng.cna
$version = "0.1a";
##########################
# MODIFY THESE VARIABLES #
##########################
@Und3rf10w
Und3rf10w / HermeticWiper Driver Name Resolver.py
Created February 25, 2022 18:55
Algo that resolves the driver name used by #HermeticWiper. Should likley be converted to idapython or something.
alpha_list = []
for x in range(0x61,0x7a):
alpha_list.append(chr(x))
alpha_list.append(0) # To represent Null Bytes
def generate_driver_name(current_pid, address_of_az_array):
"""
Generates the current driver name based off of the PID of hermeticWiper
:param current_pid: The current Process ID of the HermeticWiper.exe
@Und3rf10w
Und3rf10w / vtapi.zsh
Created January 11, 2022 18:53
VirusTotal API shell functions
# Add this to .zshrc
vtapidownload () {
if [ "$#" -ne 2 ]; then
echo "Get a download url for a sha256sum via VirusTotal\n\nUsage: vtapidownload <vtapikey> <sha256 sum of file>"
else;
curl -H "x-apikey: $1" https://www.virustotal.com/api/v3/files/$2/download_url
fi
}
@Und3rf10w
Und3rf10w / IRP Structure
Created November 4, 2021 14:02 — forked from matterpreter/IRP Structure
(Semi)Full IRP Structure in Win10 1903
0: kd> dt -b nt!_IRP
+0x000 Type : Int2B
+0x002 Size : Uint2B
+0x004 AllocationProcessorNumber : Uint2B
+0x006 Reserved : Uint2B
+0x008 MdlAddress : Ptr64
+0x010 Flags : Uint4B
+0x018 AssociatedIrp : <anonymous-tag>
+0x000 MasterIrp : Ptr64
+0x000 IrpCount : Int4B