KnightCTF 2024 Writeup

この大会は2024/1/21 0:00(JST)~2024/1/22 0:00(JST)に開催されました。
今回もチームで参戦。結果は700点で734チーム中153位でした。
自分で解けた問題をWriteupとして書いておきます。

Levi Ackerman (WEB)

http://66.228.53.87:5000/robots.txtにアクセスしたら、以下のように表示された。

Disallow : /l3v1_4ck3rm4n.html

http://66.228.53.87:5000/l3v1_4ck3rm4n.htmlにアクセスすると、フラグが表示された。

KCTF{1m_d01n6_17_b3c4u53_1_h4v3_70}

Kitty (WEB)

SQLインジェクションでログインする。

Username: " or 1=1 -- //
Password: a

HTMLソースを見ると、スクリプトに以下のように書いてある。

<script>
    function addPost(event) {
        event.preventDefault();
        const post_in = document.getElementById('post_input').value;
        
        if (post_in.startsWith('cat flag.txt')) {
            fetch('/execute', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                body: `post_input=${encodeURIComponent(post_in)}`
            })
            .then(response => response.text())
            .then(result => {
                const contentSection = document.querySelector('.content');
                const newPost = document.createElement('div');
                newPost.classList.add('post');
                newPost.innerHTML = `<h3>Flag Post</h3><p>${result}</p>`;
                contentSection.appendChild(newPost);
            });
        } else {
            const contentSection = document.querySelector('.content');
            const newPost = document.createElement('div');
            newPost.classList.add('post');
            newPost.innerHTML = `<h3>User Post</h3><p>${post_in}</p>`;
            contentSection.appendChild(newPost);
        }
    }
</script>

普通にcat flag.txtと入力すれば、フラグが表示されるようだ。

KCTF{Fram3S_n3vE9_L1e_4_toGEtH3R}

Vicker IP (Networking)

httpの通信が多い。192.168.1.7から192.168.1.8にいろんなパスをGETしている。

KCTF{192.168.1.8_192.168.1.7}

Flag Hunt (Steganography)

zipにはパスワードがかかっているので、クラックする。

$ fcrackzip -u -D -p dict/rockyou.txt chall.zip 


PASSWORD FOUND!!!!: pw == zippo123

このパスワードで解凍する。展開されたn0t3.txtにはこう書いてある。

The flag is here somewhere. Keep Searching..

Tip: Use lowercase only

wavファイルにはモールス信号が入っているので、デコードする。

morsecodetotherescue!!

img1.jpg~img1001.jpgがあるが、img725.jpgのみハッシュが異なる。steghideでパスフレーズに「morsecodetotherescue!!」を指定して、img725.jpgから秘匿情報を抽出する

$ steghide extract -sf img725.jpg 
Enter passphrase: 
wrote extracted data to "flag.txt".
$ cat flag.txt
KCTF{3mb3d_53cr37_4nd_z1pp17_4ll_up_ba6df32ce}
KCTF{3mb3d_53cr37_4nd_z1pp17_4ll_up_ba6df32ce}