level 1.
# -*- encoding: cp949 -*- import urllib2,re req = urllib2.Request('https://www.hackthis.co.uk/levels/coding/1') req.add_header('cookie','PHPSESSID=쿠키') word = re.findall('<textarea>(.*?)',urllib2.urlopen(req).read())[0].split(', ') word.sort() answer = ', '.join(word) req = urllib2.Request('https://www.hackthis.co.uk/levels/coding/1','answer='+answer) req.add_header('cookie','PHPSESSID=쿠키') print urllib2.urlopen(req).read()
level 2.
# -*- encoding: cp949 -*- import urllib2,re req = urllib2.Request('https://www.hackthis.co.uk/levels/coding/2') req.add_header('cookie','PHPSESSID=hoa3pnqd3ql3glfeia5q9t3715') s = re.findall('<textarea>(.*?)</textarea>',urllib2.urlopen(req).read())[0].split(',') answer = ''.join(map(lambda x:chr(94 - (int(x)-32) + 32) if x!=' ' else ' ',s)) print answer req = urllib2.Request('https://www.hackthis.co.uk/levels/coding/2','answer='+answer) req.add_header('cookie','PHPSESSID=hoa3pnqd3ql3glfeia5q9t3715') print urllib2.urlopen(req).read()
2번같은경우 어떻게 암호화된건지 해석하는게 더 어려웠던 것 같다.
'Python > 2.7 simple coding(+ c++)' 카테고리의 다른 글
canyouhack.it Programming Challenge 2 Sudoku! (0) | 2015.05.01 |
---|---|
hack this site Programming missions : Parse an XML file (0) | 2015.04.10 |
DareYourMind programming 1~2, 5, 9 (0) | 2015.01.22 |
hack this site Programming missions : String manipulation (0) | 2015.01.21 |
hack this site Programming missions : Reverse Ascii Shift (0) | 2015.01.20 |