Web Application Challenge 1
+Through some manipulation or interpretation of this CGI script + and the HTML page(s) that it generates, a 10 character key can be + found.
+Find the key!
+diff --git a/puzzles/webapp/1/1.cgi b/puzzles/webapp/1/1.cgi new file mode 100755 index 0000000..c2a405d --- /dev/null +++ b/puzzles/webapp/1/1.cgi @@ -0,0 +1,32 @@ +#!/usr/bin/python + +import cgi +import cgitb + +print 'Content-Type: text/html' +print '' + +print ''' + +
+Through some manipulation or interpretation of this CGI script + and the HTML page(s) that it generates, a 10 character key can be + found.
+Find the key!
+Through some manipulation or interpretation of this CGI script + and the HTML page(s) that it generates, a 10 character key can be + found.
+Find the key!
+Question: How many geeks does it take to break a CGI?
+''' + +# key = uq4G4dXrpx +if (fields.has_key('num')): + print ''' +You entered %d.
+ ''' % int(fields['num'].value) + +print ''' + +Through some manipulation or interpretation of this CGI script + and the HTML page(s) that it generates, a 10 character key can be + found.
+Find the key!
+ + +''' + +PRODUCT_NAME = "Monkey of some kind" + +def purchase_success(quantity): + print ''' +Congratulations, your order for %d "%s" has been placed.
+ ''' % (quantity, PRODUCT_NAME) + +# key = BRrHdtdADI +if fields.has_key('quantity') and fields.has_key('product') and fields['product'].value == PRODUCT_NAME: + product = fields['product'].value + quantity = int(fields['quantity'].value) + + purchase_success(quantity) +else: + print ''' + +Use the order form below to place an order.
+ + + ''' % (PRODUCT_NAME, PRODUCT_NAME) + +print ''' + +Through some manipulation or interpretation of this CGI script + and the HTML page(s) that it generates, a 10 character key can be + found.
+Find the key!
+ + +''' + +PRODUCT_NAME = "Unidentifiable garbage" + +def purchase_success(quantity): + print ''' +Congratulations, your order for %d "%s" has been placed.
+ ''' % (quantity, PRODUCT_NAME) + +# key = 765JBo4B54 +if fields.has_key('quantity') and fields.has_key('product') and fields['product'].value == PRODUCT_NAME: + product = fields['product'].value + quantity = int(fields['quantity'].value) + + purchase_success(quantity) +else: + print ''' + +Use the order form below to place an order.
+ + + ''' % (PRODUCT_NAME, PRODUCT_NAME) + +print ''' + +