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?

【Alpaca Hack : write up】I wanna be the Admin

Posted at

I wanna be the Admin

でもguestから始めよう!

0.使うツールについて

ここでは「Burp Suite Community Edition」を使用しますが、インストールのやり方などの説明は致しません、その代わりにこの記事を参考にインストールしましょう。:thumbsup_tone1:

Burp Suiteの使い方

1.問題のサイトの挙動確認

loginの挙動

・まずburp suiteで問題のサイトにアクセスし、guestでログインしてみる。
image.png
image.png

・burpを見てみるとusernameとpasswordが丸見えでやり取りされていて、サイト上ではinvalid credentialsとエラー画面が出ている。
image.png

registerの挙動

・次にサイトにあるRegisterをやってみると、burpにはloginの時のusernameとpasswordに加えてnicknameが追加でやり取りされている。そしてサイトにはHello aaa(aaa)と書かれていてroleがguestとなっている。
image.png
image.png
image.png

2.解法・解答

問題のファイルのindex.jsを見てみると、

users.set(user_data.username, {
  role: "guest",
  ...user_data,
});

とあり、user_data(POSTされた全パラメータ)をそのまま展開していることが見てわかる。

つまり、Register時に「role=admin」を送信すれば上書きできるので、Burpで「&role=admin」を追加してサイトを更新すると、
image.png
image.png
となって、サイトにFlagがでてくる。

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?