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?

More than 5 years have passed since last update.

ksnctf 3 Crawling Chaos

Posted at

ksnctf 3 Crawling Chaos

  • 問題

  • リンク先にはこれだけ
    image.png

  • ソースコードを表示する
    image.png

  • jquery.min.jsについて色々検索してjqueryについて知る

    • うーにゃーの部分はjqueryによるコードっぽい
    • 抜き出してIDEONEで実行などしてみるがよく分からず
  • console.log()

    • javascriptでデバッグするのに有用らしい
    • 中身や結果を表示してくれる
  • console.log()結果

    • ƒ Function() { [native code] }の中身を""で文字列としてプリントしてくれてるっぽい

image.png

$(function(){$("form").submit(function(){
    var t=$('input[type="text"]').val();
    var p = Array(70,152,195,284,475,612,791,896,810,850,737,1332,1469,1120,1470,832,1785,2196,1520,1480,1449);
    var f = false;
    if(p.length==t.length){
        f=true;
        for(var i=0;i<p.length;i++)
            if(t.charCodeAt(i)*(i+1)!=p[i])
                f=false;
    if(f)alert("(」・ω・)」うー!(/・ω・)/にゃー!");}
    if(!f)alert("No");return false;
    }
    );
    }
    );
  • 解読
    • fがtrueになり続ければよい
    • 配列pのi番目を(i+1)で割った数値の文字コードを持つ文字を合わせたものを求めればよさそう
    • c++で書き直して実行。フラグゲット
int main(){
    int array[21] = {70,152,195,284,475,612,791,896,810,850,737,1332,1469,1120,1470,832,1785,2196,1520,1480,1449};
    
    REP(i, 21) {
        cout << (char)(array[i] / (i+1));
    }
    cout << endl;
    
    return 0;
}
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?