wargame / / 2019. 1. 27. 22:52

python challenge - level 2

http://www.pythonchallenge.com/pc/def/ocr.html



recognize the characters. maybe they are in the book, 
but MAYBE they are in the page source



문자를 인식한다. 아마도 그것들은 책에있다. 

그러나 아마 그것들은 페이지 소스에 안에 있을 수도 있다.



페이지 소스에 들어가보니


find rare characters in the mess below:

라는 주석과함께 미친듯한 문장들이 있음.. (생략...)

번역을 해보면 (찾아라 레어한 문자들을 이 혼란속에서)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
lst = list("""%%$@_$^__#)^)&!_+]!*@&^}@[@%]()%+$&[(_@%+%$*^@$^!+]!&_#)_*}{}}!}_]$[%}@[{_@#_^{*
@##&{#&{&)*%(]{{([*}@[@&]+!!*{)!}{%+{))])[!^})+)$]#{*+^((@^@}$[**$&^{$!@#$%)!@(&
{(+$#}}
(&_+][&_@)$&$&^[_$(++$^}]&^^*(+*!&#_$]*+@!]+{%^_*+!&}@$!#^{+_#([+@(((*+)[()__}(^
@)](+[$*_(]*$[[&@^(_*#(*&!^{+]_%)_)^[}@]#]%#@+^+[%{_*{!)}#$@#)_$!_(!*+#}%%}+$&$[
%&]!{{%*_!*}&)}$**_{*!#%[[#]!](^^$![#[[*}%(_#^^!%))!_^@)@**@}}(%%{#*%@(((]^%^![&
}!)$]&($)@](+(#{$)_%^%_^^#][{*[)%}+[##(##^{$}^]#&(&*{)%)&][&{]&#]}[[^^&[!#}${@_(
#@}&$[[%]_&$+)$!%{(}$^$}*""")
 
# 중략
 
lst.sort()
 
print(lst)
 
 
 
 
 
cs



ㅇㄹㄴ


난 걍 리스트로만들고 정렬시켰다.


그리고 어떤곳에 나열되어있는 문자열을 구했음. 그러니 '_' 과 '{' 사이에 사이좋게 정렬되어있었다.


'a', 'e', 'i', 'l', 'q', 't', 'u', 'y'


aeilqtuy


라고 생각했는데 안풀리는거 보니 정렬을 시키면 안되는건가보다 코드를 다시 짰다



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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}$^$}*"""
 
#중략 
 
strcmp = 'abcdefghijklmnopqrstuvwxyz'
answer = ''
 
for i in range(0len(string)):
    if string[i] in strcmp:
        answer += string[i]
print(answer)
 
 
cs





>> equality


'wargame' 카테고리의 다른 글

python challenge - level 4  (0) 2019.01.28
python challenge - level3  (0) 2019.01.27
python challenge - level 1  (0) 2019.01.27
vortex.labs.overthewire.org@vortex1  (0) 2016.06.01
vortex.labs.overthewire.org@vortex0  (0) 2016.06.01
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유