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.
Asked
Active
Viewed 634 times
0

Patrikkk
- 3
- 1
-
1I don't think `md5()` ever returns NULL. – Barmar Mar 07 '21 at 22:48
-
1Type 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 Answers
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
-
1It 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