Skip to content

Instantly share code, notes, and snippets.

View brannondorsey's full-sized avatar
📡
Makin' the net work

Brannon Dorsey brannondorsey

📡
Makin' the net work
View GitHub Profile
@brannondorsey
brannondorsey / upnp-tomfoolery.md
Created April 20, 2018 03:58
UPnP Tomfoolery

UPnP Tomfoolery

Turns out, UPnP is terrible when it comes to security. The entire protocol exists to have devices easily find and connect to one another without any authentication at all. This is all good fun to poke around with. Here are a few tools and notes I've found along the way.

UPnP devices can be found by listening to UDP packets on port 1900. To actively discover these services on your network, send an HTTP M-SEARCH request to the default UDP mulicast address: 239.255.255.250.

There are some great Linux tools that make interfacing with all of these stuff a synch:

sudo apt update
@brannondorsey
brannondorsey / boid.js
Created June 3, 2015 15:02
Butterfly Habitat in Three.js
// by Joshua Koo @BlurSpline !!! http://www.joshuakoo.com/
// http://www.lab4games.net/zz85/blog/2013/12/30/webgl-gpgpu-and-flocking-part-1/
var Boid = function() {
var vector = new THREE.Vector3(),
_acceleration, _width = 500, _height = 500, _depth = 200, _goal, _neighborhoodRadius = 100,
_maxSpeed = 4, _maxSteerForce = 0.1, _avoidWalls = false;
this.position = new THREE.Vector3();
@brannondorsey
brannondorsey / README.md
Last active May 11, 2023 08:35
Ubuntu internet sharing and LAN over Ethernet between two+ machines

Its easy to setup a LAN between two Ubuntu machines connected over ethernet. If one of those machines, which we will call the server, is also connected to the internet via another device (like a wireless card) it will automagically share its internet connection as well. Begin by connecting the client and server machines via ethernet.

On the server machine, click the network icon on the top right and select "Edit Connections > Wired connection 1 > Edit > IPv4 Settings" and change "Method" to "Shared to other computers". Then open the network icon menu again and click "Wired connection 1" to ensure that the connection has been established. Running ifconfig in the terminal should show that the wired interface has an ip address.

On the client machine, click the network icon on the top right and select "Wired connection 1". All done. Run ifconfig on this machine as well to see the ip address you've been assigned.

@brannondorsey
brannondorsey / of_gitignore.txt
Created May 5, 2016 05:48
OpenFrameworks Project .gitignore
###########################
# ignore generated binaries
# but not the data folder
###########################
*/bin/*
!*/bin/data/
#########
# general
@brannondorsey
brannondorsey / chattervox_install_macos.md
Last active February 22, 2023 21:02
Chattervox Install Instructions

Chattervox on MacOS

Install Direwolf

The official Direwolf User Manual uses MacPorts to manage installation and dependencies. I don't particularly like MacPorts, so here are some instructions for installing Direwolf via Homebrew.

# Install Direwolf via Homebrew
brew install tdsmith/ham/direwolf
@brannondorsey
brannondorsey / sample.js
Created October 4, 2018 19:43
Discrete probability distribution sampling in JavaScript
// MIT License
//
// (c) 2018 Brannon Dorsey <brannon@brannondorsey.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
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@brannondorsey
brannondorsey / recon_methods.sh
Last active December 4, 2022 22:54
Red teaming reconnaissance and information gathering techniques
# define your target
export TARGET = brannon.online
# perform a whois lookup
whois $TARGET
# do a dns lookup
nslookup $TARGET
# here we find that 34.201.87.194 is the
# true IP address of the $TARGET
@brannondorsey
brannondorsey / README.md
Last active November 8, 2022 08:48
Mean Squared Error

A comparison of the Mean Squared Error algorithm in C, Python, and JavaScript.

C

gcc mse.c -O3 -o mse -lm
time ./mse
348.172699
@brannondorsey
brannondorsey / one_liners.md
Last active July 8, 2022 05:07
One Liners

Count the number of unique characters in a file

# https://unix.stackexchange.com/questions/5010/how-can-i-count-the-number-of-different-characters-in-a-file
# works for linux. There is a variation for MacOS in the link ^
sed 's/\(.\)/\1\n/g' text.txt | sort | uniq -c # sort -nr # uncomment this to sort the list by frequency

Replace a string in all instances of files in a directory

@brannondorsey
brannondorsey / chat_bots_in_videogames.md
Created March 6, 2014 07:05
Chat Bots and NLP in Videogames