0

I have a question. So I was doing ctf and there was this if statement. I have no idea how to get past it.
if(isset($_POST['var']) && md5($_POST['var']) == NULL)
All I'm asking for is a little hint, thanks.

Patrikkk
  • 3
  • 1
  • 1
    I don't think `md5()` ever returns NULL. – Barmar Mar 07 '21 at 22:48
  • 1
    Type juggling also won't make them equal. Integer 0 is == NULL, but `md5()` returns a string. Only an empty string is == NULL, but `md5()` returns a 32-character string. – Barmar Mar 07 '21 at 22:52

1 Answers1

2

OK, here's a hint.

PHP's md5() function expects its argument to be a string.

Can you think of some way of forcing this statement to deal with a different data type?

r3mainer
  • 23,981
  • 3
  • 51
  • 88
  • 1
    It worked! I have changed the post data from var to var[] so now it is an array. Also added var[]=1 so now it's set. Thanks. – Patrikkk Mar 08 '21 at 08:26