Skip to content

Instantly share code, notes, and snippets.

View ariary's full-sized avatar

Ariary ariary

View GitHub Profile
@ariary
ariary / k8s-quickstart.sh
Last active November 9, 2022 17:40
Kubernetes VM quick setup
#!/usr/bin/env bash
export BLUE='\033[0;34m'
export NC='\033[0m'
echo -e "${BLUE}[*] Install zsh..${NC}"
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo -e "${BLUE}[*] Change zsh theme..${NC}"
sed -i '/ZSH_THEME/c\ZSH_THEME="afowler"' ${HOME}/.zshrc
@ariary
ariary / wrap-rs.sh
Last active October 8, 2022 07:51
wrapper for reverse shell as a service
#!/usr/bin/env bash
if [[ -z "${TMUX}" ]]; then
echo "Must be run in tmux"
exit 92
fi
IFS=$'\n'
IPS=$(ip -brief -j -c address | jq -r '.[] | select((.operstate=="UP") or (.operstate=="UNKNOWN")) | "\(.ifname): \(.addr_info[0].local)\n"')
IP_CHOICE=$(gum choose $IPS "tunnel: ngrok" "tunnel: bore")
@ariary
ariary / surge-binary-deployment.sh
Last active July 12, 2022 14:25
Deploy binary to a worlwide reachable HTTP endpoint using surge (binary raw + binary embed in HTML)
#!/bin/bash
export ROSE='\033[1;35m'
export NC='\033[0m'
if [ $# -lt 1 ];then
echo "Usage: ./surge-binary-deployment.sh [BINARY_FILE]"
else
BINARY_PATH=$1
@ariary
ariary / gorilla_afowler.sh
Last active February 1, 2022 15:04
Change your afowler theme with a random animal
#!/bin/bash
ANIMAL="🦍"
sed -i "/PROMPT=/c\PROMPT=\'%{\$fg_bold[green]%}$ANIMAL %m%{\$reset_color%} %{\${fg_bold[blue]}%}:: %{\$reset_color%}%{\${fg[green]}%}%3~ \$(git_prompt_info)%{\${fg_bold[\$CARETCOLOR]}%}»%{\${reset_color}%} \'" ~/.oh-my-zsh/themes/afowler.zsh-theme
@ariary
ariary / WASMExtractor.md
Created January 26, 2022 08:59
Gather wasm file used by webpages

wasme.sh is the pendant of jse to extract wasm file. It is within a shell as long as Webassembly won't be integrated with <script type='module'> or ES2015 import statements

Note: It provides a way to detect if the webpage use WebAssembly. Fetching the wasm module eventually need js code review.

To use it:

export URL=[endpoint]
curl $URL -s | jse -gather-src -u $URL | ./wasme.sh
@ariary
ariary / bombshell.sh
Created January 13, 2022 13:07
Launch a countdown bomb inside your shell
#!/bin/bash
## Useless, just for the pleasure to make a "bombshell"
## 10s countdown + delete all file from current directory (it is a bomb after all)
## Credit: Antony Fuentes - https://stackoverflow.com/questions/12628327/how-to-show-and-update-echo-on-same-line
clear (){
tput cuu1
tput el
@ariary
ariary / Remote-gobuild.md
Last active December 1, 2021 09:32
Compile go code with remote go installation (without local one)

Prerequisites

2 Machines:

  • Local: nc
  • Remote: nc and go

Remote go build 👽

On local you have your toto.go. You want to compile it w/o installing go (You are lazy or you don't want to install go for stealth/quickness reasons or whatever)

On Remote machine: