Skip to content

Instantly share code, notes, and snippets.

View hugsy's full-sized avatar
:octocat:
‎just hacking on

crazy hugsy hugsy

:octocat:
‎just hacking on
View GitHub Profile
@hugsy
hugsy / ProcessHollower.c
Created April 25, 2016 11:00
ProcessHollower: Hide a executable inside the runtime of another one
/**
*
* ProcessHollower: Hide a executable inside the runtime of another one
*
* Compile with
* C:> cl.exe ProcessHollower.c
*
* Execute with:
* C:> ProcessHollower.exe notepad.exe myevilbinary.exe
*
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@hugsy
hugsy / PatchClean.ps1
Last active April 19, 2024 15:00
PatchExtract.ps1 & PatchClean.ps1 from Greg Linares (all credits to @Laughing_Mantis)
<#
================
PATCHCLEAN.PS1
=================
Version 1.0 Patch Folder Cleaner by Greg Linares (@Laughing_Mantis)
This Tool will go through the patch folders created by PatchExtract.PS1 and look for files created older
than 30 days prior to the current date and move these to a sub folder named "OLD" in the patch folders.
@hugsy
hugsy / offbyonesec-sync-binja.py
Created February 16, 2024 21:27
Scripts written during Off by One Security stream
#
# Port to binary ninja of the script written during the Off-by-One Security stream
# (https://youtu.be/FnIQTL9w-Ow) to synchronize GEF with Binary Ninja
# Requires `rpyc` and `pygments`
#
# In IDA, first download and load https://gist.githubusercontent.com/hugsy/714e0038d5d0b1deb7fad1907928252f/raw/87bd608a859c1699f9fc2fb556394d618747bdc8/binja_rpyc_snippet.py
#
# @_hugsy_
#
import rpyc
@hugsy
hugsy / binja_rpyc_snippet.py
Created February 12, 2024 22:50
Run Binary Ninja headlessly using RPyC
import binaryninja
import threading
import typing
import logging
import rpyc
import rpyc.utils.helpers
import rpyc.utils.server
if typing.TYPE_CHECKING:
import rpyc.core.protocol
@hugsy
hugsy / README.md
Last active October 4, 2023 21:02
A list of command line Rust tool (replacing the Unix legacy ones), showing Windows compat
Unix tool Rust version Windows compatible? Has prebuild?
cat bat
cd zoxide
cloc tokei
@hugsy
hugsy / rundll_payload_interactive_session.cc
Created September 10, 2020 22:01
dll payload to execute code from session 0 to first interactive session
#include <windows.h>
#include <wtsapi32.h>
#include <Userenv.h>
#include <TlHelp32.h>
#include <Lmcons.h>
#include <iostream>
#pragma comment(lib, "Wtsapi32.lib")
#pragma comment(lib, "Userenv.lib")
/**
* Curated exploit of @tirranido leaked handle race condition
*
* Tested on
* - Win7 x64
* - Win8.1 x64
* - Win10 x64
*
* Ref: https://googleprojectzero.blogspot.com.au/2016/03/exploiting-leaked-thread-handle.html
* @_hugsy_
@hugsy
hugsy / kdnetdebugvm.ps1
Created December 15, 2022 01:50
KdNet Debug VM script
#
# Argument initialization
#
$nextarg = "none"
$DebugPort = "unassigned"
$targetcomputer = "."
$VMName = ""
$VMGuid = ""
$AutoAssign = "false"
@hugsy
hugsy / docker-compose.yml
Last active December 2, 2022 00:12
Basic docker-compose for Elastic+Kibana
version: "3.0"
services:
es00:
image: "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- "es-data-es00:/usr/share/elasticsearch/data"
es01: