L
L
LoonTiG2016-04-23 10:07:30
PHP
LoonTiG, 2016-04-23 10:07:30

How to get access?

There is this code

<?php
  include('flag.php');
  if(strcmp($_POST['password'], $password) == 0) {
    echo $flag;
  }
?>

<form method="post">
  <input type="password" name="password" placeholder="Enter password">
  <input type="submit" value="Enter">
</form>

How can I get $flag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2016-04-23
@xmax

So $flag is not set anywhere. I think it swears at you that the variable is not defined?
PS: And I hope the password is stored in encrypted form in some place?
Then before comparing it is necessary to encrypt the entered password in the form for comparison.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question