Skip to content

Instantly share code, notes, and snippets.

View klezVirus's full-sized avatar

klezVirus

View GitHub Profile
@klezVirus
klezVirus / crude_ioctl_fuzzer.py
Last active May 31, 2021 08:16 — forked from uf0o/crude_ioctl_fuzzer.py
A crude IOCTL fuzzer for windows driver testing
import random
import sys
import struct
import io
from ctypes import windll, POINTER, byref
from ctypes.wintypes import LPVOID, DWORD, LPCSTR, LPSTR, BOOL, HANDLE
from enum import Enum
'''
#define IOCTL_HEVD_TYPE_CONFUSION 0x222023
@klezVirus
klezVirus / CVE-2018-5701.py
Last active June 1, 2021 20:01
CVE-2018-5701: iolo System Mechanic Pro Local Privilege Escalation
# Exploit title: iolo System Mechanic Pro v. <= 15.5.0.61 - Arbitrary Write Local Privilege Escalation (LPE)
# Exploit Authors: d3adc0de
# CVE: CVE-2018-5701
# Date: 01/06/2021
# Vendor Homepage: https://www.iolo.com/
# Download: https://www.iolo.com/products/system-mechanic-ultimate-defense/
# https://mega.nz/file/xJgz0QYA#zy0ynELGQG8L_VAFKQeTOK3b6hp4dka7QWKWal9Lo6E
# Version: v.15.5.0.61
# Tested on: Windows 10 Pro x64 v.1903 Build 18362.30
# Category: local exploit
@klezVirus
klezVirus / EtwStartWebClient.cs
Last active May 21, 2024 20:52
A PoC in C# to enable WebClient Programmatically
using System.Runtime.InteropServices;
using System;
/*
* Simple C# PoC to enable WebClient Service Programmatically
* Based on the C++ version from @tirannido (James Forshaw)
* Twitter: https://twitter.com/tiraniddo
* URL: https://www.tiraniddo.dev/2015/03/starting-webclient-service.html
*
* Compile with:
@klezVirus
klezVirus / Workstation-Takeover.md
Created September 24, 2021 13:16 — forked from gladiatx0r/Workstation-Takeover.md
From RPC to RCE - Workstation Takeover via RBCD and MS-RPChoose-Your-Own-Adventure

Overview

In the default configuration of Active Directory, it is possible to remotely take over Workstations (Windows 7/10/11) and possibly servers (if Desktop Experience is installed) when their WebClient service is running. This is accomplished in short by;

  • Triggering machine authentication over HTTP via either MS-RPRN or MS-EFSRPC (as demonstrated by @tifkin_). This requires a set of credentials for the RPC call.
  • Relaying that machine authentication to LDAPS for configuring RBCD
  • RBCD takeover

The caveat to this is that the WebClient service does not automatically start at boot. However, if the WebClient service has been triggered to start on a workstation (for example, via some SharePoint interactions), you can remotely take over that system. In addition, there are several ways to coerce the WebClient service to start remotely which I cover in a section below.

@klezVirus
klezVirus / rbcd_demo.ps1
Created September 26, 2021 18:47 — forked from HarmJ0y/rbcd_demo.ps1
Resource-based constrained delegation computer DACL takeover demo
# import the necessary toolsets
Import-Module .\powermad.ps1
Import-Module .\powerview.ps1
# we are TESTLAB\attacker, who has GenericWrite rights over the primary$ computer account
whoami
# the target computer object we're taking over
$TargetComputer = "primary.testlab.local"
@klezVirus
klezVirus / GenericWriteRBCD.ps1
Last active February 16, 2023 15:43
Exploit the GenericWrite DACL on a computer object (from a user or computer account)
function Invoke-GenericWriteRBCD
{
<# Based on Gist by dirkjan - Packed to be used from a C2 #>
[CmdletBinding()]
param
(
[Parameter(Mandatory=$True, HelpMessage="The name for the newly created computer")]
[string]$Computer,
@klezVirus
klezVirus / crewl.py
Created October 22, 2022 22:02 — forked from FrankSpierings/crewl.py
CeWL alternative in Python, based on Scrapy Framework.
# -*- coding: utf-8 -*-
import scrapy
import argparse
import re
from scrapy import signals
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.crawler import CrawlerProcess
@klezVirus
klezVirus / rl_glue.py
Created November 14, 2022 08:10 — forked from niektuytel/rl_glue.py
RLGlue for python 3
class RLGlue:
"""RLGlue class
args:
env_name (string): the name of the module where the Environment class can be found
agent_name (string): the name of the module where the Agent class can be found
"""
def __init__(self, env_class, agent_class):
self.environment = env_class()
self.agent = agent_class()
@klezVirus
klezVirus / frier.py
Last active March 27, 2023 09:56
Attempt to hook a NT functionwhile also try to recover partial information about the caller (module, address)
import frida
import sys
import subprocess
import ctypes
import threading
import multiprocessing
import argparse
def inject_dummy():