Skip to content

Instantly share code, notes, and snippets.

@craig-m-unsw
craig-m-unsw / ufw_setup_notes.MD
Last active October 17, 2022 10:00
Uncomplicated Firewall example

ufw (Uncomplicated Firewall) example setup

install from ufw if missing:

sudo dnf install -y ufw
sudo apt install -y ufw
@craig-m-unsw
craig-m-unsw / create_berootbin.sh
Created February 14, 2020 03:23
A setuid backdoor bin. Useful when testing sudoers rules etc and you do not want to get locked out of root.
#!/bin/bash
# Create a bin for privilege escalation.
where_gcc=$(which gcc || exit 1)
TMPFILE="devtest.c"
FILEDEST="/usr/local/bin/beroot"
TMPDIR=$(mktemp -d)
CURWD=$(pwd)
cd $TMPDIR || exit 1;
@craig-m-unsw
craig-m-unsw / install-ansible.sh
Last active March 31, 2023 10:47
install ansible on Debian/Ubuntu and RedHat/CentOS/Rocky
#!/usr/bin/env bash
# A script to install ansible as per:
# https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
#
# For Debian/Ubuntu and RedHat/CentOS
#
# Installation functions
@craig-m-unsw
craig-m-unsw / automation.md
Created March 8, 2020 22:38 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@craig-m-unsw
craig-m-unsw / role-puppet-bolt.yml
Created May 15, 2020 00:17
Single file ansible role to install Puppet Bolt
---
# Install Puppet Bolt on RHEL/CentOS 8 - https://puppet.com/docs/bolt/
#
# To use on localhost:
#
# ansible-playbook --connection=local -i "127.0.0.1," role-puppet-bolt.yml
- name: Install puppet bolt
hosts: all
gather_facts: no
@craig-m-unsw
craig-m-unsw / role-custom-facts-demo.yml
Last active August 6, 2020 08:24
An ansible role to demo setting and using custom facts
---
# Ansible role to show creating and using custom facts.
# https://docs.ansible.com/ansible/latest/modules/setup_module.html
#
# ansible-playbook --connection=local -i "127.0.0.1," role-custom-facts-demo.yml
- name: Ansible custom facts
hosts: all
gather_facts: no
@craig-m-unsw
craig-m-unsw / README.md
Last active April 29, 2024 12:38
VirtualBox VM pentest lab with Kali linux and Metasploitable 3 Vagrant boxes.

Linux pentest lab

Install Vagrant and VirtualBox (MacOS, Windows, Linux).

Start the virtual machines:

vagrant validate Vagrantfile
vagrant up
@craig-m-unsw
craig-m-unsw / README.md
Last active December 18, 2022 12:28
vagrant based CentOS 7 Development environment example
@craig-m-unsw
craig-m-unsw / 01-Vagrant_Fedora-Podman-(vbox_and_libvirt).md
Last active October 17, 2022 07:59
A Vagrant setup (Vbox + Libvirt) for Podman on Fedora-Cloud-Base. Use Podman remote-client from MacOS.
@craig-m-unsw
craig-m-unsw / README.md
Last active January 22, 2024 05:09
The scaffold that starts all my projects - for my own copy/paste convenience

minimum project

For a minimum viable proof of concept or as a place to run some tools, I keep coming back to this same pattern.

foo-bar/
    ├── .gitignore
    ├── README.md
    ├── playbook.yml
 └── Vagrantfile