mirror of https://github.com/dirtbags/moth.git
Fail startup of points if packages are not online yet
This commit is contained in:
parent
04c37d19f1
commit
d14c77f070
|
@ -19,3 +19,4 @@ cat <<EOD
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
EOD
|
EOD
|
||||||
|
exit 1
|
||||||
|
|
|
@ -17,5 +17,5 @@ for d in /packages/*; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
cd /var/www
|
cd $CTF_BASE/www
|
||||||
exec tcpsvd -u ctf ${IP%/*} 80 $CTF_BASE/packages/mcp/bin/eris -c.
|
exec tcpsvd -u ctf ${IP%/*} 80 $CTF_BASE/packages/mcp/bin/eris -c.
|
||||||
|
|
|
@ -104,21 +104,29 @@ EOD
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
match=$(awk -v ans="$answer" '(substr($0, length($1)+2) == ans) { print substr(FILENAME, 6, length(FILENAME)-17) " " $1; }' $CTF_BASE/packages/*/answers.txt)
|
clear
|
||||||
if [ -z "$match" ]; then
|
matches=0
|
||||||
echo 'That is not a correct answer. Type "[1mhelp[0m" for help.'
|
for fn in /opt/*/answers.txt; do
|
||||||
continue
|
cat=$(basename ${fn%/answers.txt})
|
||||||
fi
|
while read points ans; do
|
||||||
|
if [ "$ans" = "$answer" ]; then
|
||||||
cat=${match% *}
|
if log $hash | grep -wq "$cat $points"; then
|
||||||
points=${match#* }
|
|
||||||
fn=$BASE/$hash/$cat.$points
|
|
||||||
if log $hash | grep -Fxq "$cat $points"; then
|
|
||||||
echo "You've already received points for this answer."
|
echo "You've already received points for this answer."
|
||||||
elif $CTF_BASE/packages/p2/bin/pointscli $hash $cat $points p2console; then
|
elif /opt/p2/bin/pointscli $hash $cat $points p2console; then
|
||||||
echo "You get [1m$points[0m more points in the [1m$cat[0m category."
|
echo "You get [1m$points[0m more points in the [1m$cat[0m category."
|
||||||
|
matches=$(expr $matches + 1)
|
||||||
else
|
else
|
||||||
echo "[1mError recording points. Tell the officials![0m"
|
echo "[1mError recording points. Tell the officials![0m"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
done < $fn
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$matches" -eq 0 ]; then
|
||||||
|
echo 'That is not a correct answer. Type "help" for help.'
|
||||||
|
fi
|
||||||
|
if [ "$matches" -gt 1 ]; then
|
||||||
|
echo "Holy shit! Double word score!"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -61,28 +61,13 @@ function foot() {
|
||||||
|
|
||||||
|
|
||||||
print " </div>"
|
print " </div>"
|
||||||
print " <pre style=\"position: fixed; bottom: 0; right: 20em; "
|
print " <pre style=\"position: fixed; bottom: 0; left: 20%; font-size: 250%;"
|
||||||
print " opacity: 0.8;\">"
|
print " opacity: 0.8; background-color: black\">"
|
||||||
print " What is it?"
|
print "Project 2<br>"
|
||||||
print " It is a hacker/forensic/puzzle game... are you up for a challenge"
|
print "<p>A CTF for people with limited time/patience/self-confidence.</p>"
|
||||||
print ""
|
print "<p>Plug in ethernet at this table, download puzzles, go think.</p>"
|
||||||
print " How do I play?"
|
print "<p>http://10.0.0.2/</p>"
|
||||||
print " Sit at the terminal and make yourself a team."
|
print "<p>Use the terminal to claim points when you've figured something out.</p>"
|
||||||
print " Follow instructions from there (involves visiting a website)"
|
|
||||||
print ""
|
|
||||||
print " FAQ:"
|
|
||||||
print " Q - What is the picture being projected?"
|
|
||||||
print " A - It is the scoreboard and the image is for you to figure out"
|
|
||||||
print " "
|
|
||||||
print " Q - Are there any hints?"
|
|
||||||
print " A - NO"
|
|
||||||
print " "
|
|
||||||
print " Q - Can I connect remotely and play?"
|
|
||||||
print " A - Sure, connect to our Access Point \"Verizon MiFi A6AD Secure\""
|
|
||||||
print " "
|
|
||||||
print " Q - How do I track my points?"
|
|
||||||
print " A - See first FAQ. The points are based off of how many"
|
|
||||||
print " puzzles you've solved in each category"
|
|
||||||
print " </pre>"
|
print " </pre>"
|
||||||
print " </body>"
|
print " </body>"
|
||||||
print "</body></html>"
|
print "</body></html>"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
10.0.0.2/24
|
10.0.1.2/24
|
||||||
|
|
|
@ -4,9 +4,5 @@ exec 2>&1
|
||||||
|
|
||||||
ip link set dev eth0 up
|
ip link set dev eth0 up
|
||||||
|
|
||||||
if grep 'debug' /proc/cmdline; then
|
|
||||||
ip addr add dev eth0 10.0.0.110/24
|
ip addr add dev eth0 10.0.0.110/24
|
||||||
exec sleep 8d
|
exec sleep 8d
|
||||||
else
|
|
||||||
exec udhcpc -f eth0
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in New Issue