Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@brandon15811
brandon15811 / Program.cs
Created May 27, 2023 17:22
Install Winget without Powershell
using System.Collections;
using System.Net;
using System.IO.Compression;
using Windows.Management.Deployment;
namespace MSIXInstaller
{
class Program
{
static void Main(string[] args)
@brandon15811
brandon15811 / massadmin.py
Created August 1, 2012 02:47
Script for mass changing settings on a github organization
#!/usr/bin/python
import requests
import json
import sys
def color(val):
if val == True:
return '\033[92m' + str(val) + '\033[0m'
elif val == False:
return '\033[91m' + str(val) + '\033[0m'
@brandon15811
brandon15811 / query.sh
Last active February 5, 2021 09:07
PocketMine Server Query in Bash
#!/bin/bash
MAGIC='fefd'
SESSIONTYPE='09'
SESSION='01020304'
LONG="0"
while getopts ":l" opt; do
case $opt in
@brandon15811
brandon15811 / dns_server.sh
Created December 13, 2014 03:26
Very basic DNS server written in bash
#!/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
@brandon15811
brandon15811 / android-tcpdump.sh
Created April 16, 2014 03:55
Script for easy tcpdump to wireshark on android
#!/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 / dumper.py
Created February 1, 2013 18:34
libminecraftpe.so dumper
#!/usr/bin/python
import subprocess
import sys
functions = subprocess.check_output(['./arm-eabi-nm', '-DCnS', 'libminecraftpe.so']).splitlines()
for functions_line in functions:
if "MobFactory::CreateMob" in functions_line:#if "Packet::write" in functions_line:
functions_line_split = functions_line.split(' ')
stop_address = hex(int(functions_line_split[0], 16) + int(functions_line_split[1], 16))
function = subprocess.check_output(['./arm-eabi-objdump',
@brandon15811
brandon15811 / client.js
Last active December 5, 2018 14:55
Pipe based program control for Pocketmine
var net = require('net');
var client = net.connect({path: '\\\\.\\pipe\\' + process.argv[2] + '-console'}, function()
{
client.write(process.argv[3] + '\n');
process.exit(0);
});
@brandon15811
brandon15811 / ns-inet.sh
Last active November 18, 2016 04:56 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
#!/usr/bin/env bash
set -x
NS="openvpn"
VETH="vethopenvpn"
VPEER="vpeeropenvpn"
#NS="ns1"
#VETH="veth1"
#VPEER="vpeer1"
@brandon15811
brandon15811 / dump.py
Last active August 12, 2016 09:50 — forked from Intyre/bytes.js
MCPE 0.15 Packet dumper
"""
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:
#!/usr/bin/python
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello from Mandrill, Python style!"