2018-01-01から1年間の記事一覧

35C3 Junior CTF: 1996

問題 問題文 It's 1996 all over again! nc 35.207.132.47 22227 Difficulty estimate: very easy 問題概要 x86_64 の ELF ファイルとそのソースコードおよびそのプログラムが動いている接続先が与えられる. 解答例 指針 buffer overflow による return addr…

AtCoder Beginner Contest 110: D - Factorizatiom

問題 問題文 https://atcoder.jp/contests/abc110/tasks/abc110_d 問題概要 正整数 N, M が与えられる. となるような正整数からなる長さ N の数列 a が何通りあるかを 109+7 で割った剰余の形で答えよ. 制約 解答例 指針 重複組合せ 解説 まず M がある素数 …

35C3 Junior CTF: flags

問題 問題文 Fun with flags: http://35.207.169.47 Flag is at /flag Difficulty estimate: Easy 問題概要 脆弱性のあるWebサービスの URL が与えられる. 解答例 指針 ディレクトリトラバーサル 解説 HTTP_ACCEPT_LANGUAGE の値に応じた国旗を表示するサー…

AtCoder Beginner Contest 111: D - Robot Arms

問題 問題文 https://atcoder.jp/contests/abc111/tasks/arc103_b 問題概要 N 個座標 (X_i, Y_i) が与えられる. 正整数 d_1, d_2, d_3, .. d_m を用意し, それぞれに対して (d_i, 0) (-d_i, 0) (0, d_i) (0, -d_i) のいずれかを加算することで, (X_i, Y_i) …

picoCTF 2018: shellcode

問題 問題文 This program executes any input you give it. Can you get a shell? You can find the program in /problems/shellcode_2_0caa0f1860741079dd0a66ccf032c5f4 on the shell server. Source. Hints Maybe try writing some shellcode? You also …

AtCoder Beginner Contest 112: D - Partition

問題 問題文 https://atcoder.jp/contests/abc112/tasks/abc112_d 問題概要 整数 N, M が与えられる. 各項の和が M となる 長さ N の数列 a のうち, a の最大公約数の最大値を求めよ. 解答例 指針 M の約数を考える 解説 の最大公約数を とすると, 数列 の各…

picoCTF 2018: quackme

問題 問題文 Can you deal with the Duck Web? Get us the flag from this program. You can also find the program in /problems/quackme_1_374d85dc071ada50a08b36597288bcfd. Hints: Objdump or something similar is probably a good place to start. 問…

AtCoder Beginner Contest 113: D - Number of Amidakuji

問題 問題文 https://atcoder.jp/contests/abc113/tasks/abc113_d 問題概要 あみだくじを作る. まず W 本の平行な縦線を引き, 次にそれらを繋ぐ横線を引いていく. それぞれの縦棒の長さは H + 1 であり, 横線の端点となれるのは上から 1, 2, 3 ... H の位置…

picoCTF 2018: leak-me

問題 問題文 Can you authenticate to this service and get the flag? Connect with nc 2018shell2.picoctf.com 23685. Source. Hints: Are all the system calls being used safely? Some people can have reallllllly long names you know.. 問題概要 脆…

AtCoder Beginner Contest 114: D - 756

問題 問題文 https://atcoder.jp/contests/abc114/tasks/abc114_d 問題概要 整数 が与えられる. の約数のうち, 約数がちょうど 75 個となる数はいくつあるか. 解答例 指針 N! を素因数分解する 解説 約数がちょうど 75個となる整数とは より p, q, r を異な…

picoCTF 2018: buffer overflow 1

問題 問題文 Okay now you're cooking! This time can you overflow the buffer and return to the flag function in this program? You can find it in /problems/buffer-overflow-1_1_8a16ff6a1b3cfb2e42c08d9090051a5d on the shell server. Source. Hint…

AtCoder Beginner Contest 115: D - Christmas

問題 問題文 https://beta.atcoder.jp/contests/abc115/tasks/abc115_d 問題概要 多次元バーガーを作る事を考える. 多次元バーガにはレベルがあり, レベル L バーガー (Lは 0 以上の整数) は以下のように定義される. L = 0 : パティ 1 枚のみで構成される. L…

OtterCTF: Gotta Go Deeper

問題 問題文 Rick and morty played with the configurations of the portal gun and accidentally got stuck in this picture. Help us get them out. GottaGoDeeper.png 問題概要 png ファイルが与えられる. 解答例 指針 binwalk + 青空白猫 解説 与えられ…

ABC054: C - One-stroke Path

問題 問題文 https://beta.atcoder.jp/contests/abc054/tasks/abc054_c 問題概要 頂点数: N , 辺の数: M の重みなし無向グラフが与えられる. ただし, このグラフは自己ループや二重辺を持たない. 頂点 1 を始点として, 全ての頂点を1度だけ通る経路は何通り…

picoCTF 2018: buffer overflow 0

問題 問題文 Let's start off simple, can you overflow the right buffer in this program to get the flag? You can also find it in /problems/buffer-overflow-0_2_aab3d2a22456675a9f9c29783b256a3d on the shell server. Source. Hints How can you tr…

AOJ 1625: Origami, or the art of folding paper

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1625&lang=jp 問題概要 幅 n, 高さ m の長方形の紙が与えられる. (n, m は32以下の正整数) 紙を t回折る操作をした後 p 回穴を開ける. (t, p は20 以下の正整数) t 組の d_i, c_i が…

picoCTF 2018: in out error

問題 問題文 Can you utlize stdin, stdout, and stderr to get the flag from this program? You can also find it in /problems/in-out-error_4_c51f68457d8543c835331292b7f332d2 on the shell server Hints Maybe you can split the stdout and stderr o…

AOJ1618: A Garden with Ponds

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1618&lang=jp 問題概要 面倒なので省略 解答例 指針 4重ループを回しすべての長方形について考える 解説 長方形の x の範囲 [lx, ry], y の範囲 [ly, ry] に関してループを回しすべて…

picoCTF 2017: Weird RSA

問題 問題文 We recovered some data. It was labeled as RSA, but what in the world are dq and dp Can you decrypt the ciphertext for us 問題概要 解答例 指針 中国人剰余定理 解説 与えられたファイルの中身を表示してみる. $ cat RSA.txt c: 95272795…

AOJ1617: Almost Identical Programs

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1617&lang=jp 問題概要 2つの文字列が与えられる. 2つが完全に等しければ, IDENTICAL と 2つのプログラム中の対応する文字列定数1つだけが異なるならば CLOSE と それ以外の場合,DIF…

EKOPARTY PRE-CTF 2015: Perfect security

問題 問題文 It is not maybe so perfect. Hints: Use the golden math! crypto200.zip ※問題ファイルは下記のものを利用できる。 https://github.com/ctfs/write-ups-2015/tree/master/ekoparty-pre-ctf-2015/crypto/perfect-security 問題概要 暗号処理を…

AOJ DPL1: A - Coin Changing Problem

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_A 問題概要 額面が 円の m 種類の硬貨を使って n 円を支払うときの使用する硬貨の最小枚数を求めよ。 なお各額面のコインは何度でも使用できるものとし, 与えられるコインの額…

SECCON2017 Online CTF: Ps and Qs

問題 問題文 Ps and Qs Decrypt it. update: we fixed the flag, please try to submit again. psqs1-0dd2921c9fbdb738e51639801f64164dd144d0771011a1dc3d55da6fbcb0fa02.zip (pass:seccon2017) 問題ファイルは下記のリンクのものを利用できる。 https://gi…

POJ1611: The Suspects

問題 問題文 http://poj.org/problem?id=1611 問題概要 n 人の学生とその学生からなる m 個のグループが与えられる。 全ての学生に 0 ~ n−1 の番号が振られており 0 番目の学生に SARS という病気の感染の疑いがある。感染の疑いのある学生と同じグループの…

34C3 Junior CTF: spi

問題 問題文 I used to be a hero. Now I can't even handle this: Mitschnitt Hints: We messed up, the flag starts with 34C4 not 34C3, sorry! 問題概要 音声ファイルが与えられる。 解答例 指針 やるだけ 解説 与えられた ogg ファイルを VLC で再生速…

ABC084: D - 2017-like Number

問題 問題文 https://abc084.contest.atcoder.jp/tasks/abc084_d 問題概要 N も (N+1) / 2 も素数であるという条件を満たす奇数 N を 2017に似た数 とする。 個のクエリが与えられ, 各クエリでは奇数 が与えられる。 区間 で 2017に似た数となる奇数の個数を…

34C3 Junior CTF: ARM2

問題 問題文 Can you reverse engineer this code and get the flag? This code is ARM Thumb 2 code which runs on an STM32F103CBT6. You should not need such a controller to solve this challenge. There are 5 stages in total which share all the s…

POJ3380: Bridges

問題 問題文 http://poj.org/problem?id=3380 問題概要 頂点数が n の重み付き無向グラフが与えられる。 各頂点は島を表しており, ある島から他の島までの経路は 1 通りしか存在しない。 各島には 1 つの町がある。 町には 1 から n まで番号がつけられてお…