mirror of https://github.com/dirtbags/moth.git
Make OpenWRT work, save nonce in addteam
This commit is contained in:
parent
3882487a11
commit
0656034e8b
|
@ -20,7 +20,13 @@ Instructions for setting up OpenWRT
|
||||||
After installing OpenWRT:
|
After installing OpenWRT:
|
||||||
|
|
||||||
* Change the root password
|
* 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
|
* Configure the LAN interface as 10.0.0.1/16 and
|
||||||
fd84:b410:3441::1/64
|
fd84:b410:3441::1/64
|
||||||
* Tell DHCP to begin at 257 after the base IP: this will assure
|
* 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
|
* Disable router solicitations on LAN
|
||||||
* Enable WPA2, with the password "correct horse battery staple"
|
* Enable WPA2, with the password "correct horse battery staple"
|
||||||
* Turn on router advertisements (under radvd) on LAN
|
* 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
|
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
|
contest. If you want to get fancy, you can scp the files in
|
||||||
|
|
|
@ -20,6 +20,9 @@ www=${CTF_BASE:-/var/www}
|
||||||
mkdir -p $base/teams/names
|
mkdir -p $base/teams/names
|
||||||
mkdir -p $base/teams/colors
|
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
|
# Assign a color. I spent weeks selecting a color pallette that
|
||||||
# wouldn't be hell on people with protanopia. Please don't change these
|
# wouldn't be hell on people with protanopia. Please don't change these
|
||||||
# colors.
|
# colors.
|
||||||
|
@ -45,7 +48,7 @@ esac
|
||||||
# Compute hash of team name; they'll use this for everything in the
|
# 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
|
# 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}/.
|
# 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 "$1" > $base/teams/names/$hash
|
||||||
echo "$color" > $base/teams/colors/$hash
|
echo "$color" > $base/teams/colors/$hash
|
||||||
|
|
Loading…
Reference in New Issue