Hack4S3cur1ty

[Seccon Beginners 2018][MISC] てけいさんえくすとりーむず 본문

CTFs/2018

[Seccon Beginners 2018][MISC] てけいさんえくすとりーむず

h4ck4s3cur1ty 2018. 5. 28. 23:48

대충 번역기 돌려보면 뭔소린지 모르겠다.


nc 접속해보면 사칙연산 100스테이지 깨는거같아서 코드를 짰다.




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from socket import *
 
HOST = 'tekeisan-ekusutoriim.chall.beginners.seccon.jp'
PORT = 8690
 
= socket(AF_INET, SOCK_STREAM)
s.connect((HOST,PORT))
 
def read_until(check):
   buffer = ''
   while check not in buffer:
      buffer += s.recv(1)
   return buffer
 
read_until('---------------------------------------------------------------')
read_until('---------------------------------------------------------------\n')
 
for i in range(1,101):
    read_until('(Stage.' + str(i) + ')\n')
    data = s.recv(1024).strip().replace('=''')
    print data
    print eval(data)
    s.send(str(eval(data)) + '\n')
 
print s.recv(1024)
cs


Comments