URL: https://2019.peactf.com/problems

前回のcybricsに引き続き、風邪が長引いていたのと、アクセスができない時があったりして、簡単なやつをちょこっと解いて終了。

いちおう、やった記録として残しておきます。



Broken Keyboard


Challenge

Help! My keyboard only types numbers!

Ciphertext: 112 101 97 67 84 70 123 52 115 99 49 49 105 115 99 48 48 108 125


Solution

普通に1個1個変換したら面白くないので、ワンライナーで挑戦。

1
$ python -c 'print("".join([chr(int(x)) for x in "112 101 97 67 84 70 123 52 115 99 49 49 105 115 99 48 48 108 125".split()]))'


Flag: peaCTF{4sc11isc00l}





Breakfast


Challenge

Mmm I ate some nice bacon and eggs this morning. Find out what else I had for an easy flag. Don’t forget to capitalize CTF!

Ciphertext: 011100010000000000101001000101{00100001100011010100000000010100101010100010010001}


Solution

他の問題を解いていると、フラグのフォーマットが peaCTF{xxxx} なのがわかるので、011100010000000000101001000101の部分がpeaCTFだとして6等分すると、

01110   p
00100   e
00000   a
00010   C
10010   T
00101   F

なので、こんな感じだと予想。
00000   a
00001   b
00010   c
00011   d
00100   e
00101   f
00110   g
00111   h
01000   i
01001   j
01010   l (kはどこへ行った?)
01011   m
01100   n
01101   o
01110   p (これがpなのは確か)
01111   q
10000   r
10001   s
10010   t (これがTなのは確か)
10011   u
10100   v (結果、なぜかこれはvではなくて、wだった)


ところどころナゾだけど、{}の中身は、
00100   e
00110   g
00110   g
10100   w
00000   a
00101   f
00101   f
01010   l
00100   e
10001   s


Flag: peaCTF{eggwaffles}


#問題文の中で、baconの部分だけ太字になっているのがナゾ。なんかのヒントなの? スライスするとか言うことかな。。



(2019/09/15 追記)

復習してたら、これはBacon’s cipherっていうらしいですね。知らなくても解けたけど。





Hide and Seek


Challenge

Try to find to the flag file located somewhere in the folders located in: /problems/hide-and-seek_16_d386ec3561e6180b95a47434c62a78be


Solution

これはシェルサーバに入って解く問題。

$ find . -name *flag*
$ cat ./926c7fc91293cbdcbb5a99c561782682/80dee25b24cac38a8a7f7214c732974c/d9f58f5e381818ca33525a98ca33dfbe/f17007910d11d07404b23bb62d7a7ee1/9c991628ac6f756dd67cfa3b98c42cf6/47c8055d6bd5102bd363fc752227844a/1d4c5a6d7ce032905f80ccd47b1c08df/f4fd3d96096de5ed863de07324e1bf57/flag.txt


Flag: flag{peactf_linux_is_fun_f4ca42f3f34f4674d511eade889d74f7}





School


Challenge

My regular teacher was out sick so we had a substitute today.

Alphabet: ​WCGPSUHRAQYKFDLZOJNXMVEBTI
zswGXU{ljwdhsqmags}


Solution

単一換字式暗号 (monoalphabetic substitution ciphers)です。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings;
use utf8;

use open qw/:utf8/;

open(my $F, "<:utf8", 'School.txt') or die;
my $text;
while (my $l = <$F>)
{
    #$l =~ s/[\r\n]+/ /g;
    $text .= $l;
}
close($F);

$text =~ y/wcgpsuhraqykfdlzojnxmvebti/abcdefghijklmnopqrstuvwxyz/;
print $text;
print "\n---------\n";

得られた結果:peaGXU{orangejuice}

上記のPerlスクリプトは小文字だけ置き換えているので、GXUのところが書き換わってないだけです。


Flag: peaCTF{orangejuice}





Coffee Time


Challenge

Run this jar executable in a virtual machine and see what happens.

Attachments:

  • coffeetime.jar


Solution

実行しろというので、とりあえず実行。

$ java coffeetime.jar 
Error: Could not find or load main class coffeetime.jar
Caused by: java.lang.ClassNotFoundException: coffeetime.jar


よくわからんので、とりあえずコードでも見てみるかと思って、jadでデコンパイル。

そしたら、ソースコードの中にフラグがありました。なんじゃこりゃ。

System.out.println("peaCTF{nice_cup_of_coffee}");


Flag: peaCTF{nice_cup_of_coffee}





We are E.xtr


Challenge

特に記載なし(添付ファイルのみ)

Attachments:

  • E.xtr


Solution

$ file E.xtr 
E.xtr: data

$ xxd E.xtr | head -n 1
00000000: 8958 5452 0d0a 1a0a 0000 000d 4948 4452  .XTR........IHDR

PNGファイルのファイルヘッダを直す系の問題。

バイナリエディタで編集する。

$ xxd E.xtr | head -n 1
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452  .PNG........IHDR

$ file E.xtr 
E.xtr: PNG image data, 1280 x 720, 8-bit colormap, interlaced


Flag: peaCTF{read_banned_it}





The Wonderful Wizard


Challenge

特に記載なし(添付ファイルのみ)

Attachments:

  • TheWonderfulWizard.png


Solution

「青い空を見上げればいつもそこに白い猫」で赤色ビット0抽出すると、数字が出てくるので、それをHex Decodeするだけ。
TheWonderfulWizard_Neko.PNG

66 6c 61 67 7b 70 65 61 63 74 66
5f 77 68 65 72 65 5f 74 68 65 5f
77 69 6e 64 5f 62 6c 6f 77 73 7d


Flag: flag{peactf_where_the_wind_blows}