Skip to content

Instantly share code, notes, and snippets.

View benfairless's full-sized avatar

Ben Fairless benfairless

View GitHub Profile
alert('XSS remote execution example')
@benfairless
benfairless / statetest.sh
Created December 6, 2017 11:48
Test Session IDs in JBoss EAP
#!/usr/bin/env bash
endpoint='127.0.0.1'
filename="/tmp/$(date +%Y-%m-%d-%H-%M-%S)"
cookiejar="${filename}_cookie.txt"
first="${filename}_first.txt"
second="${filename}_second.txt"
cmd="curl http://${endpoint}/balancer/ -c ${cookiejar} -b ${cookiejar}"
# Run curl twice, first to get sessionid and second to see if the sessionid results in the same response
@benfairless
benfairless / nothebestbutitworks.yml
Created September 23, 2016 09:57
Automagical patching
---
- hosts: all
serial: 4
tasks:
- name: gather information on services not currently running
sudo: true
shell: systemctl | grep failed > pre.log
- name: patch all yum packages
#!/usr/bin/env python
import requests
import yaml
with open('./config.yaml','r') as f:
config = yaml.load(f.read())
# Returns boolean based on exit status
def checkhealth(url):
response = {}
#!/usr/bin/env python
import sys
import os
import subprocess
import csv
#
# hertz/daemon/collection.py
#
# This module contains functions regarding the collection of monitoring data
#
@benfairless
benfairless / SETUP.sh
Last active March 7, 2024 20:28
Fedora development environment setup
#!/usr/bin/env bash
# Sets up a workstation environment with all the tools necessary to get crackin!
NAME='Fedora development setup'
VERSION='0.5.5'
AUTHOR='Ben Fairless'
################################################################################
#################################### CHECKS ####################################
################################################################################
@benfairless
benfairless / openvpn.sh
Last active June 25, 2016 17:52
OpenVPN installation
#!/usr/bin/env bash
# Installs OpenVPN server on CentOS 7
# Check yo' privilege
[[ $(id -u) != 0 ]] && echo 'You must run this script as root!' && exit 1
################################################################################
################################## VARIABLES ###################################
################################################################################
@benfairless
benfairless / pretty_output.sh
Last active August 29, 2015 14:15
Pretty bash output
# Purely cosmetic function to prettify output
# Set OUTPUT_LABEL to change the label
# Supports ERROR, SUCCESS, and WARN as arguments
output() {
local label=${OUTPUT_LABEL:-$0}
local timestamp=$(date +%H:%M)
local colour='\033[34m' # Blue
local reset='\033[0m' # Standard
case $1 in
ERROR) local colour='\033[31m' ;; # Red
@benfairless
benfairless / ipfreely.sh
Last active August 29, 2015 14:14
Test for free IP addresses
#!/bin/bash
echo "Test of free IP addresses in 192.168.4.0/24 - Generated $(date +%d/%m/%Y\ %H:%M)"
for i in {1..254}; do
ADDR=192.168.4.$i
ping -c 1 $ADDR 2>&1 >/dev/null
if [ $? != 0 ]; then
echo "FREE - $ADDR"
else
@benfairless
benfairless / kiosk.py
Last active May 15, 2021 15:45
Python GTK kiosk web browser
#!/usr/bin/env python
import pygtk
import gtk
import webkit
import sys
class Browser:
def __init__(self):