2
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 32 Simple Auth 50pt

2
Posted at

問題

image.png

解いてみた

前回の問題31と同じくソースを見て脆弱な部分を見つけてflagを得る問題。
https://qiita.com/CTFman/items/b8408239f1782920b46e

ソースを見てみます。

image.png

flagを入力するとflagが表示されるようです。
flagは入力できないので、このif文に何かヒントがありそうです。

strcasecmpについて調べてみます。
仕様についてはこちらで。
strcasecmp - PHP

脆弱性とかそういうキーワードで調べると、引数のStringの型チェックが厳密に行われていないらしく、配列を渡すと返り値で0がくるらしい。

nameに[]をつけると配列をPOSTすることができるので、ChromeのF12でソースを編集してみます。

image.png

そして送信ボタンを押す。

image.png

できました。

image.png

2
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
2
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?