Make OpenWRT work, save nonce in addteam

This commit is contained in:
Neale Pickett 2012-05-18 22:03:53 -06:00
parent 291cbe93f1
commit a85a9d5479
2 changed files with 12 additions and 3 deletions

View File

@ -20,7 +20,13 @@ Instructions for setting up OpenWRT
After installing OpenWRT:
* Change the root password
* Install the kmod-ipv6, radvd, and luci-app-radvd packages
* Install the following packages:
ip6tables
kmod-ip6tables
kmod-ipv6
libip6tc
luci-app-radvd
radvd
* Configure the LAN interface as 10.0.0.1/16 and
fd84:b410:3441::1/64
* Tell DHCP to begin at 257 after the base IP: this will assure
@ -28,7 +34,7 @@ After installing OpenWRT:
* Disable router solicitations on LAN
* Enable WPA2, with the password "correct horse battery staple"
* Turn on router advertisements (under radvd) on LAN
* Enable prefix fd84:b410:3441::1/54 under radvd
* Enable prefix fd84:b410:3441::1/64 under radvd
This should be sufficient to bring up the router for running the
contest. If you want to get fancy, you can scp the files in

View File

@ -20,6 +20,9 @@ www=${CTF_BASE:-/var/www}
mkdir -p $base/teams/names
mkdir -p $base/teams/colors
[ -f $base/teams/nonce ] || dd if=/dev/urandom count=1 | md5sum | cut -b 1-8 > $base/teams/nonce
nonce=$(cat $base/teams/nonce)
# Assign a color. I spent weeks selecting a color pallette that
# wouldn't be hell on people with protanopia. Please don't change these
# colors.
@ -45,7 +48,7 @@ esac
# Compute hash of team name; they'll use this for everything in the
# contest instead of their team name, which makes stuff much easier on
# me since all team hashes are in the set /[0-9a-f]{8}/.
hash=$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | cut -b 1-8)
hash=$(printf "%s:%s" $nonce "$1" | md5sum | cut -b 1-8)
echo "$1" > $base/teams/names/$hash
echo "$color" > $base/teams/colors/$hash