Level1 문제는 다음과 같다.
Telnet to blowfish.smashthestack.org port 6666 to recieve an encrypted passwd. Decrypt it and log in to level2. 😉
접속을 하니 다음과 같이 암호화 된 문자열이 출력되었다.
해당 암호는 시저암호로 암호화 되어 있다. (Caesar cipher : http://en.wikipedia.org/wiki/Caesar_cipher) 해독하는 코드를 python으로 작성하여 보면 다음과 같다.
#!/usr/bin/python
s = 'GungJnfRnfl'
ret = ''
for x in range(26):
for y in range(len(s)):
if s[y] == ' ':
ret += ' '
continue
tmp = ord(s[y]) + x
if( ord(s[y]) <= ord('Z') and tmp > ord('Z') ):
tmp -= 26
elif( ord(s[y]) <= ord('z') and tmp > ord('z') ):
tmp -= 26
ret += chr(tmp)
print ret
ret = ''
<실행결과>
C:\Users\ByJJoon\Desktop>level1.py
GungJnfRnfl
HvohKogSogm
IwpiLphTphn
JxqjMqiUqio
KyrkNrjVrjp
LzslOskWskq
MatmPtlXtlr
NbunQumYums
OcvoRvnZvnt
PdwpSwoAwou
QexqTxpBxpv
RfyrUyqCyqw
SgzsVzrDzrx
ThatWasEasy
UibuXbtFbtz
VjcvYcuacua
WkdwZdvbdvb
XlexAewcewc
YmfyBfxdfxd
ZngzCgyegye
AohaDhzfhzf
BpibEiagiag
CqjcFjbhjbh
Drkdakcikci
Eslebldjldj
Ftmfcmekmek