Skip to content

Instantly share code, notes, and snippets.

View klezVirus's full-sized avatar

klezVirus

View GitHub Profile
#!/bin/bash
# Create a timestamp
ts="$(date +%Y%m%d)"
# Determine running directory
cwd="$(pwd $(dirname $0))"
# Define build_file
build_file=
@klezVirus
klezVirus / gist:909b6eac40e87e1b7a3d63431f74b630
Created September 19, 2023 07:20 — forked from pcmoritz/gist:4b0e1be7f2dfcc4e51e2ace50426f67d
Powerpoint create slides for animations while retaining slide numbers
Option Explicit
Sub AddElements()
Dim shp As Shape
Dim i As Integer, n As Integer
n = ActivePresentation.Slides.Count
For i = 1 To n
Dim s As Slide
Set s = ActivePresentation.Slides(i)
@klezVirus
klezVirus / ios_xcarchive-to-ipa.txt
Created August 29, 2023 12:52 — forked from Bruno-Furtado/ios_xcarchive-to-ipa.txt
Convert Xcarchive to IPA
xcodebuild
-exportArchive
-exportOptionsPlist {PATH_TO_PROJECT_ROOT}/ios/build/info.plist
-archivePath {PATH_TO_ARCHIVE_MADE_USING_XCODE}/App.xcarchive
-exportPath {PATH_TO_EXPORT_THE_APP}/App.ipa
@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 / 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 / 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 / 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.