2018-12-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度だけ通る経路は何通り…