Skip to content

Instantly share code, notes, and snippets.

@brandon15811
brandon15811 / ns-inet.sh
Last active Nov 18, 2016 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
View ns-inet.sh
#!/usr/bin/env bash
set -x
NS="openvpn"
VETH="vethopenvpn"
VPEER="vpeeropenvpn"
#NS="ns1"
#VETH="veth1"
#VPEER="vpeer1"
@brandon15811
brandon15811 / dump.py
Last active Aug 12, 2016 — forked from Intyre/bytes.js
MCPE 0.15 Packet dumper
View dump.py
"""
Setup (requires root on Android device):
pip install frida #(may require root on host machine)
curl -O https://build.frida.re/frida/android/arm/bin/frida-server
adb push frida-server /data/local/tmp/
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell "/data/local/tmp/frida-server &"
Usage:
@brandon15811
brandon15811 / template.sh
Last active Aug 29, 2015
Bash templating. {{VARIABLE}} renders to the env variable $VARIABLE
View template.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "No file specified"
exit 1
fi
if [ ! -f "$1" ]; then
echo "File doesn't exist"
exit 1
View keybase.md

Keybase proof

I hereby claim:

  • I am brandon15811 on github.
  • I am brandon15811 (https://keybase.io/brandon15811) on keybase.
  • I have a public key whose fingerprint is 6901 A3FA EFC8 B82A 7FF0 F881 BEA5 04AE 1525 A22D

To claim this, I am signing this object:

@brandon15811
brandon15811 / dns_server.sh
Created Dec 13, 2014
Very basic DNS server written in bash
View dns_server.sh
#!/bin/bash
#Based off of http://code.activestate.com/recipes/491264/
if [ "$1" == "startserver" ]; then
ncat -u -l 5355 -c $(readlink -f $0) -k
exit
fi
timeout 1s cat /dev/stdin > input
req=$(cat input | xxd -p)
#Functions from http://ubuntuforums.org/showthread.php?t=735140&p=4584216#post4584216
View video-client.html
<!-- https://gist.github.com/mahemoff/443933
This is a Node+WebSocket powered demo to sync videos
across different browsers. This file is the client,
the other one is the Node server. Powered by Node and
https://github.com/einaros/ws -->
<style>
.inactive { display: none; }
.active { display: block; }
</style>
@brandon15811
brandon15811 / index.lua
Created Jun 27, 2014
webscript.io HTML Pastebin
View index.lua
local html =
[[
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/mode/xml/xml.js"></script>
@brandon15811
brandon15811 / query.sh
Last active Feb 5, 2021
PocketMine Server Query in Bash
View query.sh
#!/bin/bash
MAGIC='fefd'
SESSIONTYPE='09'
SESSION='01020304'
LONG="0"
while getopts ":l" opt; do
case $opt in
@brandon15811
brandon15811 / android-tcpdump.sh
Created Apr 16, 2014
Script for easy tcpdump to wireshark on android
View android-tcpdump.sh
#!/bin/bash -xe
nc_running()
{
NC_RUN=$(adb shell busybox ps -w | grep "NCRUN='1'" > /dev/null 2>&1; echo $?)
}
tcpdump_running()
{
TCP_RUN=$(adb shell busybox ps -w | grep -v "NCRUN='1'" | grep 'TCPRUN="1"' > /dev/null 2>&1; echo $?)
}
@brandon15811
brandon15811 / client.js
Last active Dec 5, 2018
Pipe based program control for Pocketmine
View client.js
var net = require('net');
var client = net.connect({path: '\\\\.\\pipe\\' + process.argv[2] + '-console'}, function()
{
client.write(process.argv[3] + '\n');
process.exit(0);
});