0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

picoCTF 2024 writeup Bookmarklet

Posted at

Bookmarklet (Web Exploitation)

Why search for the flag when I can make a bookmarklet to print it for me?
Browse here, and find the flag!

とりあえず、記載のリンクを開く。
image.png
何かコードが書いてある。bookmarkletらしい。
謎コードを以下に示す。

        javascript:(function() {
            var encryptedFlag = "àÒÆÞ¦È¬ë٣֖ÓÚåÛÑ¢Õӗ¨Í•ÕĦ–í";
            var key = "picoctf";
            var decryptedFlag = "";
            for (var i = 0; i < encryptedFlag.length; i++) {
                decryptedFlag += String.fromCharCode((encryptedFlag.charCodeAt(i) - key.charCodeAt(i % key.length) + 256) % 256);
            }
            alert(decryptedFlag);
        })();
    

このコードを実行するとフラグが得られそうである。
ブラウザで実行できるところの一つにコンソールがある。
コンソールにコードを貼り付ける。
image.png
実行する。
image.png

フラグが得られた。

picoCTF{p@g3_turn3r_18d2fa20}

Reference

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?