Skip to content

Instantly share code, notes, and snippets.

View bgrewell's full-sized avatar

Ben Grewell bgrewell

View GitHub Profile
@bgrewell
bgrewell / procwatcher.go
Last active April 19, 2018 15:22
ProcWatcher is a tool to watch newly created processes on a Linux system. The main purpose of this was to have a way to watch for very short lived randomly executed processes so that their command line arguments could be captured. Note: This is intentinally designed to run under conditions with minimal privillages and no external dependencies.
package main
import (
"fmt"
"io/ioutil"
"log"
"strings"
)
// Map to hold a list of "currently running" processes.
@bgrewell
bgrewell / rotten_pickle.py
Last active May 13, 2021 09:18
This Gist creates payloads to exploit pythons pickle function. It is pre-setup to create reverse shells but could be tweaked for whatever fun uses you can think of.
import marshal
import urllib
import base64
import os
"""
Script: rotten_pickle.py
Date: 5/4/2018
Author: Benjamin Grewell
Purpose: This script creates a reverse shell that will be executed when the python pickle package attempts to unpickle it.
@bgrewell
bgrewell / bash64coder.py
Last active May 11, 2018 01:06
bash64coder.py is a simple python script for creating base64 encoded payloads that have any undesirable character sequences quoted out. It was written as a tool for generating base64 encoded bash payload that could pass through a WAF that was filtering out commands (and subsequently would also block any base64 strings that happened to contain so…
import base64
SEQUENCE_FILE = "blocked_commands.txt"
filtered_sequences = [
]
def LoadFilteredSequences(wordlist):
'''
Loads a list of character sequences which aren't allowed in our final output
@bgrewell
bgrewell / PenTesters_Framework_Install.txt
Last active February 5, 2024 22:11
Steps required to install and setup PenTesters Framework (PTF) from TrustedSec
## run in terminal ##
sudo su -
apt-get update
apt-get install python
git clone https://github.com/trustedsec/ptf /opt/ptf
cd /opt/ptf
./ptf
## run inside PTF ##
use modules/exploitation/install_update_all
package main
import (
"net"
"fmt"
"math/rand"
"flag"
"bufio"
"os"
"strconv"
import sys
import struct
import codecs
import binascii
sample_string = """
4C 00 00 00 01 14 02 00 00 00 00 00 C0 00 00 00
00 00 00 46 81 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
@bgrewell
bgrewell / msf.lnk.hex
Last active October 23, 2018 20:52
msf.lnk file in hex view
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
=====================================================
000 | 4C 00 00 00 01 14 02 00 00 00 00 00 C0 00 00 00
010 | 00 00 00 46 81 00 00 00 00 00 00 00 00 00 00 00
020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
040 | 00 00 00 00 00 00 00 00 00 00 00 00 80 00 14 00
050 | 1F 00 E0 4F D0 20 EA 3A 69 10 A2 D8 08 00 2B 30
060 | 30 9D 14 00 2E 1E 20 20 EC 21 EA 3A 69 10 A2 DD
070 | 08 00 2B 30 30 9D 56 00 00 00 00 00 00 00 00 00

Usage Examples for WEMO REST API version 1

Overview

Conventions

  1. REST calls follow standard convention.
REQUEST TYPE  ACTION
@bgrewell
bgrewell / timing-loop.js
Last active January 9, 2020 21:59
Example for getting performance timing from chrome
const puppeteer = require('puppeteer');
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function requestPageTiming(url) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://www.amazon.com");
@bgrewell
bgrewell / setup-powerline.sh
Last active January 16, 2020 15:52
Simple script to setup powerline
python3 -m pip install git+git://github.com/powerline/powerline
[ -d "~/.local/share/fonts" ] || mkdir -p ~/.local/share/fonts
wget -O ~/.local/share/fonts/PowerlineSymbols.otf https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
fc-cache -vf ~/.local/share/fonts/
[ -d "~/.config/fontconfig/conf.d" ] || mkdir -p ~/.config/fontconfig/conf.d/
wget -O ~/.config/fontconfig/conf.d/10-powerline-symbols.conf https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
sudo apt install -y fontconfig
sudo apt install -y fonts-powerline
sudo apt install -y powerline-gitstatus
[ -d "~/.config/powerline" ] || mkdir -p "~/.config/powerline"