Skip to content

Instantly share code, notes, and snippets.

@boxysean
boxysean / router-hackz-002.md
Created December 10, 2012 15:03
Router Hackz: Wireshark

A report back from Tuesday's hack sesh:

  • We started off by installing Wireshark on our computers. Sae and Sarah run OS X 10.8 (Mountain Lion) which does not come with X11, so they needed to install XQuartz before launching Wireshark. (Sae, there you go, that's how you do it buddy.) We then dived in and played around with the basic features. (X11 is a cross-platform windowing system like Aqua and Cocoa are windowing systems for OS X. Lots of open source projects use it for their GUIs because it allows to code one solution for many platforms. The trade-off is the applications don't have the Apple/Windows look-and-feel that we all expect.)

  • Using Wireshark is a bit like a scavenger hunt. There's a lot of information flowing on our local networks, the fun part is trying to figure out what is interesting. Robbie and Peter, connected to the standard NYU wireless network, started to capture packets with dynamic webpages streaming election updates. They saw a lot of web traffic racing in and out of their own comp

@boxysean
boxysean / router-hackz-001.md
Created December 10, 2012 15:04
Router Hackz: OpenWrt

A little report back from tonight's hack sesh:

  • Peter and Jonathan tried to hack into Peter's Netgear (I think it was a WNR1000) to flash OpenWrt. They weren't able to get the machine to respond to the flashing process, the Broadcom processor on that device doesn't appear to be so popular and there isn't much online community support for this product.

  • Karl brought 3 old WRT54Gs and discovered one of them was already running OpenWrt! Awesome, a really old build from 2006. We thought about upgrading the firmware but it was password protected really well -- the admin password prompt even worked when doing a factory reset on the sucker.

  • Johann, Sae, and Robbie played around with the OpenWrt interface and discovered how to blink the LEDs on the main page, how to SSH into the router, and thought about possible applications of an OpenWrt router. Johann and I were setting up a captive portal on the device to have it so every website accessed was redirected to the router's HTTP webserver.

Good stuff! We'll me

import cv
import sys
import os
image = cv.LoadImage(sys.argv[1])
storage = cv.CreateMemStorage()
haar=cv.Load('haarcascade_frontalface_default.xml')
detected = cv.HaarDetectObjects(image, haar, storage, 1.1, 2, cv.CV_HAAR_DO_CANNY_PRUNING, (20,20))
@boxysean
boxysean / unreachable-qrst
Created March 7, 2013 19:41
Running batman-adv on OpenWrt Attitude Adjustment 12.09-rc1, ad-hoc mode on NanoStation M2s. They "associate" according to OpenWrt LuCI and see each other according to "batctl o", but unable to ping by using the batctl layer 2 ping.
root@brooklynnet-never:~# batctl o
[B.A.T.M.A.N. adv 2012.3.0, MainIF/MAC: wlan0/00:27:22:4c:94:77 (bat0)]
Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ...
e2:46:9a:34:1f:77 0.260s (255) e2:46:9a:34:1f:77 [ br-lan]: dc:9f:db:03:89:b1 (225) e2:46:9a:34:1f:77 (255)
dc:9f:db:02:89:b1 0.690s (255) dc:9f:db:03:89:b1 [ br-lan]: dc:9f:db:03:89:b1 (255)
c6:3d:c7:a8:2c:1d 0.300s (197) dc:9f:db:02:89:b2 [ wlan0]: dc:9f:db:02:89:b2 (197)
dc:9f:db:03:89:b1 0.660s (255) dc:9f:db:03:89:b1 [ br-lan]: e2:46:9a:34:1f:77 (225) dc:9f:db:03:89:b1 (255)
dc:9f:db:02:89:b2 0.200s (224) dc:9f:db:02:89:b2 [ wlan0]: dc:9f:db:02:89:b2 (224)
root@brooklynnet-never:~# batctl p dc:9f:db:03:89:b2
PING dc:9f:db:03:89:b2 (dc:9f:db:03:89:b2) 20(48) bytes of data
@boxysean
boxysean / gist:5111299
Created March 7, 2013 20:03
The layer 2 batman mesh is working, but I can't seem to get a bridge from eth0 to wlan0 to go. WHAT I WANT: To create a route on this device to 10.0.0.0/8 over the bat0 or mesh bridge interface, in order to see my 10.0.3.0/24 that is over the wlan0 ad-hoc network and connected. Not sure how to do that. Followed the quick start guide. <http://www…
root@brooklynnet-never:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
ifconfig wlan0 mtu 1528
batctl if add wlan0
ifconfig br-lan mtu 1528
batctl if add br-lan
@boxysean
boxysean / gist:5132531
Created March 11, 2013 07:27
getting closer to a batman mesh, but need some advice to push it through

I'm testing out a setup in my lab but am having trouble configuring it correctly! I've tried a lot of variations of the setup, read the documentation, and went through the mailing list to see what I'm doing wrong, but can't figure it out.

I followed the sophisticated setup and added ethernet links to it, possibly in a wrong way. I read somewhere that ethernet interfaces must be added to batman as bridges. (Side note: this causes my dmesg output to complain about too small of MTU for the ethernet interfaces but I can't seem to raise the bridge MTU to 1528 like it suggests.)

Network diagram:

       wlan0 AP      br-mesh1 --- eth0
             \      /                 \
              <veng>                   <roa>

\ \

@boxysean
boxysean / gist:5413206
Last active December 16, 2015 09:29
My printing code final idea pad

I'm going to make materials to publicize my thesis project, Outernet.

Outernet is a local wifi network that connects communities in Long Island City, Greenpoint, and Bushwick without using the Internet. People connected to Outernet will be able to participate in the classifieds, forums, and chat.

I want to let people know where they can connect to the network, and make posters to advertise the network.

Design ideas:

hosts = localhost
auth_bind = yes
auth_bind_userdn = cn=%n, ou=people, dc=outerwebs, dc=nodomain
ldap_version = 3
base = ou=people, dc=outerwebs, dc=nodomain
scope = subtree
user_filter = (cn=%n)
@boxysean
boxysean / named.conf.local
Last active June 11, 2020 15:49
bind for outernet
zone "outernet" {
type master;
file "/etc/bind/zones/outernet.db";
};
zone "56.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.56.168.192.in-addr.arpa";
};
@boxysean
boxysean / Outernet-install-script.txt
Created May 1, 2013 00:26
Let it be known, this is how you set up a GuruPlug to run the Outernet stack
install git, git-core
setup ssh keys with github
install sys-rc-conf
disable lighttpd and stop service
install apache2
remove apache2-mpm-prefork and install apache2-mpm-worker
apt-get upgrade
mark mysql-client-5.0 as upgradable... and then let them all upgrade