Skip to content

Instantly share code, notes, and snippets.

View bman46's full-sized avatar

Brendan McShane bman46

View GitHub Profile
@bman46
bman46 / quartus.sh
Last active January 20, 2025 03:12
Launch Quartus in docker on MacOS with XQuartz GUI passthrough. Also bypasses the CPU check to allow for use on M series Mac.
#!/bin/sh
# Launch Quartus in docker on MacOS with XQuartz GUI passthrough.
quartus () {
defaults write org.xquartz.X11 enable_render_extension 0 # Fixes black background issue (ref: https://github.com/XQuartz/XQuartz/issues/31)
open /Applications/Utilities/XQuartz.app # open quartz
mkdir -p ~/Desktop/quartus/
sleep 3; # Wait for XQuartz to open.
# launch quartus:
DISPLAY=:0 xterm -e zsh -c 'del_stopped ghidra; xhost + 127.0.0.1; docker run --init -it --rm --name quartus --cpus 4 --memory 6g -e MAXMEM=6G -e DISPLAY=host.docker.internal:0 -v ~/Desktop/quartus:/build ghcr.io/raetro/quartus:21.1 /bin/bash -c "echo c2VkIC1pIC1lICdzX2dyZXAgc3NlIC9wcm9jL2NwdWluZm8gPiAvZGV2L251bGwgMj4mMV9lY2hvICJieXBhc3MgY3B1IGNoZWNrIl9nJyAvb3B0L2ludGVsRlBHQS9xdWFydHVzL2FkbS9xZW52LnNoICYmIHF1YXJ0dXM= | base64 -d | bash"; xhost - 127.0.0.1'
echo "Exiting Quartus"
@bman46
bman46 / ghidra.sh
Last active January 20, 2025 03:10
Launch Ghidra in docker on MacOS with XQuartz GUI passthrough.
#!/bin/sh
# Launch Ghidra in docker on MacOS with XQuartz GUI passthrough.
ghidra () {
defaults write org.xquartz.X11 enable_render_extension 0 # Fixes black background issue (ref: https://github.com/XQuartz/XQuartz/issues/31)
open /Applications/Utilities/XQuartz.app # open quartz
mkdir -p ~/Desktop/ghidra/projects
mkdir -p ~/Desktop/ghidra/samples
sleep 3; # Wait for XQuartz to open.
# launch ghidra:
DISPLAY=:0 xterm -e zsh -c 'del_stopped ghidra; xhost + 127.0.0.1; docker run --init -it --rm --name ghidra --cpus 4 --memory 6g -e MAXMEM=6G -e DISPLAY=host.docker.internal:0 -v ~/Desktop/ghidra/samples:/samples -v ~/Desktop/ghidra/projects:/root blacktop/ghidra:10; xhost - 127.0.0.1'

Powershell Scripts

A collection of useful powershell scripts.

ch-ad-pass.ps1

Get-ADUser -Filter * | ForEach-Object { Set-ADAccountPassword -Identity $_.SamAccountName -NewPassword (Read-Host "Enter the new password" -AsSecureString) -Reset }

ch-pass.bat

@echo off
heat_template_version: 2013-05-23
description: >-
Setup Kali with a public IP and a new relevant security group
Source: https://gist.github.com/bman46/3179294e3d4d63c10550ef71ab8229bb
parameters:
passwd:
type: string
label: Root and User Password
@bman46
bman46 / ewfscript.sh
Last active September 11, 2024 19:05
EFW Mounter
#!/bin/bash
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
echo "efw file mounter"
read -e -p "Enter E01 file: " srcfile
read -p "Enter dest name (just a name, not a path): " dstfolder
UUIDMNT=/tmp/efw_$(uuidgen)
mkdir -p $UUIDMNT

Install dependencies

apt-get install gcc-arm-linux-gnueabihf qemu

Prepare work directory

mkdir qemu-arm-sandbox && cd qemu-arm-sandbox