From 36daf80cf7911629443e4076800a72c2e06435e1 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 7 Oct 2009 08:19:06 -0600 Subject: [PATCH] Add keys for posters, ctfd now generates flagger tokens --- ctfd.py | 18 +++++++++++++----- kevin/kevin.py | 4 ++-- puzzles/posters/10/key | 2 +- puzzles/posters/15/key | 2 +- puzzles/posters/5/key | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ctfd.py b/ctfd.py index bced2d5..99071b5 100755 --- a/ctfd.py +++ b/ctfd.py @@ -1,13 +1,13 @@ #! /usr/bin/env python3 import asyncore -import pointsd -import game -import flagd -import histogram -import config import os import sys +import optparse +from ctf import pointsd +from ctf import flagd +from ctf import histogram +from ctf import config do_reap = False @@ -27,6 +27,14 @@ def sigchld(signum, frame): do_reap = True def main(): + p = optparse.OptionParser() + p.add_option('-p', '--genpass', dest='cat', default=None, + help='Generate a flagger password for the given category') + opts, args = p.parse_args() + if opts.cat: + print('%s:::%s' % (opts.cat, flagd.hexdigest(opts.cat.encode('utf-8')))) + return + pointsrv = pointsd.start() flagsrv = flagd.start() diff --git a/kevin/kevin.py b/kevin/kevin.py index d0ba26b..1f122cc 100755 --- a/kevin/kevin.py +++ b/kevin/kevin.py @@ -60,8 +60,8 @@ class Kevin(irc.Bot): def cmd_PRIVMSG(self, sender, forum, addl): text = addl[0] if text.startswith('!'): - parts = text[1:].lower().split(' ', 1) - cmd = parts[0] + parts = text[1:].split(' ', 1) + cmd = parts[0].lower() if len(parts) > 1: args = parts[1] else: diff --git a/puzzles/posters/10/key b/puzzles/posters/10/key index 8b13789..071491e 100644 --- a/puzzles/posters/10/key +++ b/puzzles/posters/10/key @@ -1 +1 @@ - +You're well on your way :) diff --git a/puzzles/posters/15/key b/puzzles/posters/15/key index 8b13789..1941358 100644 --- a/puzzles/posters/15/key +++ b/puzzles/posters/15/key @@ -1 +1 @@ - +-462766 diff --git a/puzzles/posters/5/key b/puzzles/posters/5/key index 8b13789..9b8d504 100644 --- a/puzzles/posters/5/key +++ b/puzzles/posters/5/key @@ -1 +1 @@ - +3acd767f2717b84076cdcd18e882f01d