Skip to content

Instantly share code, notes, and snippets.

View ExZyle's full-sized avatar

Exzyle ExZyle

  • Wherever, Earth
View GitHub Profile
@ExZyle
ExZyle / htbprompt.sh
Last active November 11, 2023 23:32
HTB Bash prompt
# Direct from CLI
export PS1="-[\[$(tput sgr0)\]\[\033[38;5;10m\]\d\[$(tput sgr0)\]-\[$(tput sgr0)\]\[\033[38;5;10m\]\t\[$(tput sgr0)\]]-[\[$(tput sgr0)\]\[\033[38;5;214m\]\u\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;196m\]\h\[$(tput sgr0)\]]-\n-[\[$(tput sgr0)\]\[\033[38;5;33m\]\w\[$(tput sgr0)\]]\\$ \[$(tput sgr0)\]"
# .bashrc
echo 'export PS1="-[\[$(tput sgr0)\]\[\033[38;5;10m\]\d\[$(tput sgr0)\]-\[$(tput sgr0)\]\[\033[38;5;10m\]\t\[$(tput sgr0)\]]-[\[$(tput sgr0)\]\[\033[38;5;214m\]\u\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;196m\]\h\[$(tput sgr0)\]]-\n-[\[$(tput sgr0)\]\[\033[38;5;33m\]\w\[$(tput sgr0)\]]\\$ \[$(tput sgr0)\]"' >> .bashrc
# .profile
echo 'export PS1="-[\[$(tput sgr0)\]\[\033[38;5;10m\]\d\[$(tput sgr0)\]-\[$(tput sgr0)\]\[\033[38;5;10m\]\t\[$(tput sgr0)\]]-[\[$(tput sgr0)\]\[\033[38;5;214m\]\u\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;196m\]\h\[$(tput sgr0)\]]-\n-[\[$(tput sgr0)\]\[\033[38;5;33m\]\w\[$(tput sgr0)\]]\\$ \[$(tput sgr0)\]"' >> .profile
@ExZyle
ExZyle / dumpdns.sh
Last active September 25, 2023 04:07
Dumps into TSV format all the DNS records for all the zones across all the accounts configured by aws-vault. Prerequisites: awscli (all profiles configured), aws-vault, jq.
#!/bin/bash
#
# Prerequisites: awscli (all profiles configured), aws-vault, jq
#
# Usage: dumpdns.sh
# Trap ctrl-c user interrupt and exit cleanly
trap ctrl_c INT
ctrl_c() {
echo "Cancelled by user" >&2

Port Usage for Windows/WSL2/Docker

Problem

Overnight (2022-09-15) a personal windows machine I have running a few docker services rebooted and docker containers failed to bind to ports:

Attaching to gitlab-gitlab-1
Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:51443 -> 0.0.0.0:0: listen tcp 0.0.0.0:51443: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
git clone --mirror <URL to my OLD repo location>
cd <New directory where your OLD repo was cloned>
git remote set-url origin <URL to my NEW repo location>
git push --mirror origin
@ExZyle
ExZyle / exzyle.sh
Last active May 25, 2022 04:33
Ansible container persistence helper for use with lesson 12, USYD CyberSecurity Bootcamp 2022
#!/usr/bin/env bash
#
# Written by ExZyle <exzyle@protonmail.com>
#
# Save this script into your VM, make sure you make it executable (chmod a+x exzyle.sh)
#
# From the same directory you save this script, run the following to get
# some persistence out of your docker ansible container:
#
# docker run -it --rm -v `pwd`:/exzyle --entrypoint /exzyle/exzyle.sh cyberxsecurity/ansible
@ExZyle
ExZyle / keybase.md
Created December 19, 2019 06:14
keybase.md

Keybase proof

I hereby claim:

  • I am exzyle on github.
  • I am exzyle (https://keybase.io/exzyle) on keybase.
  • I have a public key whose fingerprint is 24DD DC8B 9874 4A38 D436 2A2B 5B2B B2C7 E5F2 2D37

To claim this, I am signing this object: