Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 0-startup-overview.md
Created October 5, 2021 21:20 — forked from dideler/0-startup-overview.md
Startup Engineering notes
@craig-m-unsw
craig-m-unsw / github_bugbountyhunting.md
Created October 5, 2021 21:20 — forked from EdOverflow/github_bugbountyhunting.md
My tips for finding security issues in GitHub projects.

GitHub for Bug Bounty Hunters

GitHub repositories can disclose all sorts of potentially valuable information for bug bounty hunters. The targets do not always have to be open source for there to be issues. Organization members and their open source projects can sometimes accidentally expose information that could be used against the target company. in this article I will give you a brief overview that should help you get started targeting GitHub repositories for vulnerabilities and for general recon.

Mass Cloning

You can just do your research on github.com, but I would suggest cloning all the target's repositories so that you can run your tests locally. I would highly recommend @mazen160's GitHubCloner. Just run the script and you should be good to go.

$ python githubcloner.py --org organization -o /tmp/output
@craig-m-unsw
craig-m-unsw / docker-help.md
Created October 9, 2021 13:29 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@craig-m-unsw
craig-m-unsw / README.md
Last active October 29, 2021 01:55
manage Ubuntu machine with Canonicals Landscape - quick learning/test lab
@craig-m-unsw
craig-m-unsw / log4j_rce_detection.md
Created December 16, 2021 20:07 — forked from Neo23x0/log4j_rce_detection.md
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@craig-m-unsw
craig-m-unsw / Example-of-Lookups-Plugin-ansible.md
Created February 2, 2022 23:12 — forked from devops-school/Example-of-Lookups-Plugin-ansible.md
Deep Dive into Lookup Plugins in Ansible with Example

Example 1: Lookups and variables

vars:
  motd_value: "{{ lookup('file', '/etc/motd') }}"
tasks:
  - debug:
      msg: "motd value is {{ motd_value }}"

Example 2: Lookups and loops items