Skip to content

Instantly share code, notes, and snippets.

@glennzw
glennzw / flasher_n900.sh
Created April 13, 2014 11:33
Flash N900
#!/bin/bash
#[email protected]
# This script will flash your N900. It assumes you want to use the Maemo 5 Global release.
# Based on trying to understand http://wiki.maemo.org/Updating_the_tablet_firmware#N900
set -e
echo "[[ Glenn's Maemo Flasher: [email protected] / @glennzw for comments ]]"
type flasher-3.5 >/dev/null 2>&1 || { echo >&2 "I require flasher but it's not installed. Install from http://skeiron.org/tablets-dev/maemo_dev_env_downloads/" ;exit 1; }
if [ ! -f RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin ]; then
@glennzw
glennzw / install_BigBluButt.sh
Last active August 29, 2015 13:56
Install BigBlueButton
#!/bin/bash
# This script should be run on a Digital Ocean Ubuntu 10.4 64 bit droplet.
# Based on: http://code.google.com/p/bigbluebutton/wiki/InstallationUbuntu
# After running this script, see: http://code.google.com/p/bigbluebutton/wiki/BBBConf
# [email protected]
apt-get install -y language-pack-en
update-locale LANG=en_US.UTF-8
@glennzw
glennzw / new_mac.py
Last active August 29, 2015 13:56
Change your OSX MAC address to a random value. If you don't know why this is useful, you probably don't need it.
#!/bin/bash
# OSX MAC address changer
# glenn@sensepost // @glennzw
# This script will disaccociate from the current AP, randomly change your WiFi MAC, and then reassociate.
# N.B This code is specifically for OSX
iface=en1
ap=$(airport -I | grep SSID: | grep -v BSSID| sed 's/.*SSID://' | sed -e 's/^ *//g' -e 's/ *$//g')
@glennzw
glennzw / ntp_gps.txt
Created December 30, 2013 14:58
NTP + GPS
apt-get install ntp
apt-get install gpsd
apt-get install gpsd-clients
gpsmon
Add to /etc/ntpd.conf:
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.420 refid GPS
@glennzw
glennzw / set_dns.txt
Last active December 31, 2015 00:29
Set DNS server on OSX
#You can set individual adapter DNS servers via the GUI network manager, but I wanted
#to set a VMWare virtual interface to be my DNS server (vmnet8, via 'ifconfig'). This
# adapter is not listed. Therefore, we use the tool 'scutil':
root@osxBox# scutil
> open
> d.init
> d.add ServerAddresses * <ip_of_dns_server>
> set State:/Network/Service/PRIMARY_SERVICE_ID/DNS
> quit
@glennzw
glennzw / ss.py
Created December 2, 2013 06:18
Simple Scapy code to detect APs
from scapy.all import Dot11Beacon, Dot11Elt, sniff
aps={}
def proc_packet(p):
if p.haslayer(Dot11Beacon) and p[Dot11Elt].info != '':
bssid = p.addr2
ssid = p.info
if (bssid) not in aps:
print "New AP: '%s' (%s)" % (ssid, bssid)
aps[bssid] = ssid
@glennzw
glennzw / evil.py
Last active August 19, 2021 13:37
Simple Python library to manage wireless network connection.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# [email protected] / @glennzw
# Handle wireless networking from Python
# The name (evil.py) is a play on 'wicd'
from subprocess import Popen, call, PIPE
import errno
from types import *
import logging
import sys
@glennzw
glennzw / build-gnuradio.sh
Created September 2, 2013 14:22
build-gnu radio on Kali
#!/bin/bash
#
# Build script for UHD+GnuRadio on Fedora and Ubuntu
#
#
#
# Updates: https://github.com/guruofquality/grextras/wiki
# Updates: https://github.com/balint256/gr-baz.git
#
#
@glennzw
glennzw / crc_fcs.c
Last active December 21, 2015 21:08
How wireshark calculates the FCS CRC32
[[[[ packet-eth.c ]]]]
guint32 fcs = crc32_802_tvb(tvb, tvb_length(tvb) - 4);
[[[[ crc32-tvb.c ]]]]
guint32
crc32_802_tvb(tvbuff_t *tvb, guint len)
{
@glennzw
glennzw / fcs.txt
Last active June 4, 2019 14:09
FCS - Frame Check Sequence
I'm capturing 802.11 frames - probe requests to be exact. I'm noticing occasional garbled data, so would to incorporate the Frame Check Sequence (FCS) to ensure frame integrity. I'd expect the card to dump failed checksum frames, but maybe this doesn't happen in promisc mode. We can see the FCS in action with tshark like so:
# tshark -i mon0 -R 'wlan.fcs' -T fields -e wlan.fcs_good -e wlan.fcs
1 0x5c1eecd5
0 0x8d425ccf
1 0xb28bb592
1 0xd2cb1bf6
...where wlan.fcs is the calculated checksum, and wlan.fcs_good is the boolean of the result.