Skip to content

Instantly share code, notes, and snippets.

@mazrean
Last active January 5, 2021 10:29
Show Gist options
  • Save mazrean/203caf17d52cc791de2bcc11762c1c31 to your computer and use it in GitHub Desktop.
Save mazrean/203caf17d52cc791de2bcc11762c1c31 to your computer and use it in GitHub Desktop.

wanictf2020 pwn

SQL_challenge_1

index.phpを見ると '/\|が使えない。 1_scheme.sqlを見てテーブルの構造を確認する。 WHEREの条件がyears=yearsになれば全件表示される。 よって、クエリパラムをyear=yearsにすればよい。

別解:

  • year=(1)OR(1)でも任意のカラムでtrueになりOK

flag: FLAG{53cur3_5ql_a283b4dffe}

SQL_challenge_2

index.phpを見ると英数字以外の前に\が追加される。 ↑と同じ方法で通りそう。やってみたら通った。↑で別の解法が想定されていたっぽい。

flag: FLAG{5ql_ch4r_cf_ca87b27723}

devtools_1

dev toolのインスペクターなど、何らかの方法でhtmlを見るとコメントにflagがある。

flag: FLAG{you_can_read_html_using_devtools}

devtools_2

想定しているのはdev toolで金額を5000000000000000に書き換えるのだと思う。ただ、js中にflagがあるので、正直js見たほうが早い。

flag: FLAG{you_can_edit_html_using_devtools}

simple_memo

ディレクトリトラバーサルを使う。 ../がサニタイズされているが、サニタイズされた結果が目的の文字列になればよいので、fileを....//flag.txtとかにすれば./memos/../flag.txtになりOK。

flag: FLAG{y0u_c4n_get_hi5_5ecret_fi1e}

striped table

idが奇数のときにmemoのエスケープ処理がされていない。よって、idが奇数のmemoにscriptタグを仕込めばOK。

flag: FLAG{simple_cross_site_scripting}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment