Sum (Hello World Platform)
Points: 20
Category: Programming Like Marathons
Description:

English:


This problem is an example on how to connect to our server to read inputs and send the outputs for the programming challenges. Given a set of numbers greater than zero, followed by zero and a line break, compute the sum of these numbers. The solution for this problem is available at: https://static.pwn2win.party/solvers-example-platform.tar.gz.  All you need to do in order to obtain the flag is to execute the implementation you see more fit!


openssl s_client -connect programming.pwn2win.party:9000

ダウンロードしたファイルを解凍すると、C++、Java、Pythonで書かれたソースファイルが出来ます。
  • solve_sum.cpp
  • solve_sum.java
  • solve_sum.py
Python-2.7.9の実行環境でPythonプログラムを実行するだけで、下記のとおりフラグが表示されました。
$ /usr/local/lib/python2.7.9/bin/python solve_sum.py
received: 6 3 4 6 5 2 6 6 2 0
sent: 40
received: 8 5 2 3 1 1 9 5 9 2 0
sent: 45
received: 7 1 5 4 2 9 9 0
sent: 37
received: 6 8 4 7 3 9 5 7 9 6 6 1 8 2 2 0
sent: 83
received: 5 5 8 3 8 3 9 7 1 7 1 1 2 2 5 9 5 7 0
sent: 88
received: 5 9 9 1 3 7 3 5 4 4 2 4 6 6 6 1 0
sent: 75
received: 2 7 9 1 2 8 5 6 5 9 6 5 5 8 9 9 2 7 4 0
sent: 109
received: 7 9 7 2 2 2 9 0
sent: 38
received: 5 7 1 3 9 6 2 6 3 3 7 1 4 4 2 1 0
sent: 64
received: 5 2 2 3 2 8 1 8 0
sent: 31
received: 9 7 5 5 1 3 8 1 7 6 1 7 0
sent: 60
received: 6 7 2 9 6 8 1 0
sent: 39
received: 1 1 6 2 3 7 0
sent: 20
received: 4 7 2 5 1 5 3 4 7 7 0
sent: 45
received: 3 3 5 6 5 3 3 6 4 2 6 4 4 1 0
sent: 55
received: 1 4 7 7 7 1 5 4 5 3 0
sent: 44
received: 2 3 5 6 7 1 6 4 9 2 1 0
sent: 46
received: 8 3 6 3 2 5 6 9 6 9 2 2 3 3 9 3 4 1 4 0
sent: 88
received: 2 5 4 3 9 1 1 7 8 6 0
sent: 46
received: 9 1 6 8 2 5 5 4 8 1 0
sent: 49
received: CTF-BR{Congrats!_you_know_how_to_sum!}
フラグは、
CTF-BR{Congrats!_you_know_how_to_sum!}
です。

Pythonプロフェッショナルプログラミング 第2版
株式会社ビープラウド
秀和システム
2015-05-21