http://www.pythonchallenge.com/pc/return/good.html 이전 레벨에서 구한 huge / file 로 접속하여 보면 그림이 나타난다. 그리고 소스를 보면 first와 second 값이 있다. 이 값들을 X,Y 좌표로 보고 선을 그려보면 아래와 같은 그림이 나타난다. #!c:\python26\python.exe import Image, ImageDraw first = [146,399,163,403,170,393,169,391,166,386,170,381,170,371,170,355,169,346,167,335,170,329,170,320,170,310,171,301,173,290,178,289,182,287,188,286,190,286,192,291,194,296,195,305,194,307,191,312,190,316,190,321,192,331,193,338,196,341,197,346,199,352,198,360,197,366,197,373,196,380,197,383,196,387,192,389,191,392,190,396,189,400,194,401,201,402,208,403,213,402,216,401,219,397,219,393,216,390,215,385,215,379,213,373,213,365,212,360,210,353,210,347,212,338,213,329,214,319,215,311,215,306,216,296,218,290,221,283,225,282,233,284,238,287,243,290,250,291,255,294,261,293,265,291,271,291,273,289,278,287,279,285,281,280,284,278,284,276,287,277,289,283,291,286,294,291,296,295,299,300,301,304,304,320,305,327,306,332,307,341,306,349,303,354,301,364,301,371,297,375,292,384,291,386,302,393,324,391,333,387,328,375,329,367,329,353,330,341,331,328,336,319,338,310,341,304,341,285,341,278,343,269,344,262,346,259,346,251,349,259,349,264,349,273,349,280,349,288,349,295,349,298,354,293,356,286,354,279,352,268,352,257,351,249,350,234,351,211,352,197,354,185,353,171,351,154,348,147,342,137,339,132,330,122,327,120,314,116,304,117,293,118,284,118,281,122,275,128,265,129,257,131,244,133,239,134,228,136,221,137,214,138,209,135,201,132,192,130,184,131,175,129,170,131,159,134,157,134,160,130,170,125,176,114,176,102,173,103,172,108,171,111,163,115,156,116,149,117,142,116,136,115,129,115,124,115,120,115,115,117,113,120,109,122,102,122,100,121,95,121,89,115,87,110,82,109,84,118,89,123,93,129,100,130,108,132,110,133,110,136,107,138,105,140,95,138,86,141,79,149,77,155,81,162,90,165,97,167,99,171,109,171,107,161,111,156,113,170,115,185,118,208,117,223,121,239,128,251,133,259,136,266,139,276,143,290,148,310,151,332,155,348,156,353,153,366,149,379,147,394,146,399] second = [156,141,165,135,169,131,176,130,187,134,191,140,191,146,186,150,179,155,175,157,168,157,163,157,159,157,158,164,159,175,159,181,157,191,154,197,153,205,153,210,152,212,147,215,146,218,143,220,132,220,125,217,119,209,116,196,115,185,114,172,114,167,112,161,109,165,107,170,99,171,97,167,89,164,81,162,77,155,81,148,87,140,96,138,105,141,110,136,111,126,113,129,118,117,128,114,137,115,146,114,155,115,158,121,157,128,156,134,157,136,156,136] im = Image.new('RGB', (512, 512), 'white') draw = ImageDraw.Draw(im) count = 0 for y in […]
http://www.pythonchallenge.com/pc/def/integrity.html 문제 페이지에서 접속하면 파리같이 생긴 곤충의 그림이 나오고 소스를 보면 어떤 인코딩 된듯한 문자열이 나온다. 이후에 알게 되었지만 사진속의 곤충은 벌이였고 beezip을 의도한 것으로 보인다. #!c:\python26\python.exe import bz2 un = 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BA\x06\xbe\x084' pw = 'BZh91AY&SY\x94$|\x0e\x00\x00\x00\x81\x00\x03$ \x00!\x9ah3M\x13<]\xc9\x14\xe1BBP\x91\xf08' print repr(bz2.decompress(un)) print repr(bz2.decompress(pw))
먼저 문제 페이지는 아래와 같다. http://www.pythonchallenge.com/pc/def/hockey.html 해당 페이지에 접속을 하면 “it’s in the air. look at the letters.” 라고 나온다. 공기중에서 볼 수 있는것? badcob님의 힌트를 받아 아래 페이지가 존재 한단것을 알 수 있었다. http://www.pythonchallenge.com/pc/def/oxygen.html (nomja님의 제보로 다시 한번 확인해보니 이전 문제에서 출력되는 hocky에서 이루어지는 글자가 oxygen이군!) 해당 페이지에는 이미지가 삽입되어 있었다. 이미지에서 회색 및 […]
문제 페이지 : http://www.pythonchallenge.com/pc/def/channel.html 먼저 주석을 보면 ZIP 이라는 단어가 있기에 다음 페이지에 접속하여 보니 ZIP 파일을 찾으라고 한다. http://www.pythonchallenge.com/pc/def/zip.html http://www.pythonchallenge.com/pc/def/channel.zip 파일이란게 있는 것을 확인했고 readme.txt 파일을 확인하여 보면 시작파일이 어떤 파일인지 확인할 수 있다. 각 파일을 읽어가며 따라가면 최종적으로 “Collect the comments.” 라는 메세지가 나온다. 한참을 고민한 결과 zip 파일 내부에 각 파일에 대해 […]
문제 페이지 : http://www.pythonchallenge.com/pc/def/peak.html 처음 문제를 보고 뭔가 한참 고민을 했더랬다 -_- pronounce it ? 도저히 이해가 안되어 포럼을 좀 본 결과 발음과 관련되어 있단걸 알게되었고 pickle이란걸 알게 되었다. #!c:\python26\python.exe import pickle, re pkl_file = open('banner.p', 'rb') data = pickle.load(pkl_file) tmp = '' for x in range(len(data)): for y in range(len(data[x])): if data[x][y][0].find(' ') == […]
http://www.overthewire.org/wargames/vortex/level2.shtml 먼저 코드를 보자. tar와 관련된 문제인거 같다. #include <stdlib.h> #include <stdio.h> #include <sys/types.h> int main(int argc, char **argv) { char *args[] = { "/bin/tar", "cf", "/tmp/ownership.$$.tar", argv[1], argv[2], argv[3] }; execv(args[0], args); } tar 명령어만 알고 있다면 쉽게 풀 수 있는 문제다. 인자로 패스워드를 주면 된다. 패스워드가 위치한 경로로 이동한 후 작업을 하면 된다. […]
문제 페이지 : http://www.pythonchallenge.com/pc/def/linkedlist.php #!C:\Python26\python.exe import httplib, re def gogo(number): conn = httplib.HTTPConnection('www.pythonchallenge.com') conn.request('GET', '/pc/def/linkedlist.php?nothing=' + str(number)) r1 = conn.getresponse() data = r1.read() print data if data.find('Yes. Divide by two and keep going.') == 0: return int(number) / 2 else: tmp = re.search('and the next nothing is [0-9]+', data).group() return re.search('[0-9]+', tmp).group() x = gogo(12345) […]