easyauth

30 ×

Can you gain admin access to this site?

http://easyauth-afee0e67.ctf.bsidessf.net



easyauth.phpを確認すると、cookieのusernameがadministratorであればフラグが表示されることが分かります。
  $cookie = $_COOKIE['auth'];

  $pairs = explode('&', $cookie);
  $args = array();
  foreach($pairs as $pair) {
    if(!strpos($pair, '='))
      continue;

    list($name, $value) = explode('=', $pair, 2);
    $args[$name] = $value;
  }
  $username = $args['username'];

  print "<h1>Welcome back, $username!</h1>\n";
  if($username == 'administrator') {
    print "<p>Congratulations, you're the administrator! Here's your reward:</p>\n";
    print "<p>" . FLAG . "</p>\n";
それでは、問題で与えられたURLにアクセスします。

1

guest/guestでログインします。

2

ここでcookieの値を確認します。下記のとおりusernameがguestと成っています。
username=guest&date=2017-02-13T15:33:15+0000&
username=guestの部分をusername=administratorに書き換えて、Click hereのリンクをクリックします。下図のとおりフラグが表示されました。

3

フラグは、
FLAG:0076ecde2daae415d7e5ccc7db909e7e
です。