Web Application Challenge 7
+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!
+ + + +''' + +print ''' +diff --git a/puzzles/webapp/70/,binary.png b/puzzles/webapp/70/,binary.png new file mode 120000 index 0000000..36053bd --- /dev/null +++ b/puzzles/webapp/70/,binary.png @@ -0,0 +1 @@ +../10/,binary.png \ No newline at end of file diff --git a/puzzles/webapp/70/,ctf.css b/puzzles/webapp/70/,ctf.css new file mode 120000 index 0000000..19b2533 --- /dev/null +++ b/puzzles/webapp/70/,ctf.css @@ -0,0 +1 @@ +../10/,ctf.css \ No newline at end of file diff --git a/puzzles/webapp/70/7.cgi b/puzzles/webapp/70/7.cgi new file mode 100755 index 0000000..1bfdf64 --- /dev/null +++ b/puzzles/webapp/70/7.cgi @@ -0,0 +1,86 @@ +#!/usr/bin/python + +import os +import cgi +import cgitb +cgitb.enable(context=10) + +#if os.environ.has_key('QUERY_STRING'): +# os.environ['QUERY_STRING'] = '' + +fields = cgi.FieldStorage() + +import Cookie +c = Cookie.SimpleCookie(os.environ.get('HTTP_COOKIE', '')) + +content = { + 'joke1' : '
An infinite number of mathematicians walk into a bar. The first one orders a beer. The second orders half a beer. The third, a quarter of a beer. The bartender says You are all idiots! and pours two beers.
', + 'joke2' : '
Two atoms are talking. One of them says I think I lost an electron! and the other says Are you sure? The first replies Yeah, I am positive!
', +} + +if c.has_key('content_name') and c.has_key('content'): + k = c['content_name'].value + try: + c['content'] = content[k] + except KeyError: + c['content'] = 'key = s4nNlaMScV
' +else: + c['content_name'] = 'joke1'; + c['content'] = content['joke1'] + + +print 'Content-Type: text/html\n%s\n\n\n' % c +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!
+ + + +''' + +print ''' +