WebページのURLが与えられた。
ページのソースを表示すると、最後のあたりで main.js が読み込まれていた。
このファイルを見ると、plantFlag という関数があった。
そこで、この関数を改造した以下のコードを
An URL of a web page was given.
Viewing the source of the page, I found main.js loaded near the end.
Reading the file, I found a function plantFlag.
I modified this function and pasted the code to the console in
すると、textContent はflagの文字がシャッフルされたような文字列となり、
spanタグの innerHTML を見ると各文字に flag-char-0、flag-char-1 のような連番のクラスがつけられていた。
最初のページのソースに戻って観察すると、main.css が読み込まれており、
これらのクラスに order が指定されていることを発見した。
そこで、それぞれの文字が order で指定された位置に配置されると推測し、この処理を行う以下のプログラムを作成した。
As a result, the textContent became a string that looks like a shuffled flag,
and classes with sequential numbers like flag-char-0 and flag-char-1 were assigned to each characters in the innerHTML of the span tag.
Looking at the source of the first page again, I found that main.css is loaded, and that order is specified for each classes like flag-char-0 there.
Finding this, I guessed that each characters will be placed to the positions specified by order and wrote this program to do this:
このプログラムを main.css を入力として実行すると、flagが得られた。
I executed this program using main.css as the input. The flag was emitted as a result.