var_dump(md5('QNKCDZO') == md5('s878926199a'));
// true
If I only use md5 to hash password,
then I can login with both 'QNKCDZO' and 's878926199a'.
var_dump(md5('QNKCDZO'));
// 0e830400451993494058024219903391
var_dump(md5('s878926199a'));
// 0e545993274517709034328855841020
PHP is weak typing.
When using '==', it treats the result as numerical strings.
'0e830400451993494058024219903391' would be 0,
and also '0e545993274517709034328855841020',
for they are both started with '0e'.
var_dump(md5('QNKCDZO') === md5('s878926199a'));
// false
hash_equals(md5('QNKCDZO'), md5('s878926199a'));
Use '===' and it will check types.
Or you can use 'hash_equals' function which is timing attack safe.
Change value of cookie, then login to another account.
F12 > Storage
SITCON 2018: 校園駭客-看你學號() return 你家住址;
You
妹子(?)
Known Numbers
Can be calculated
000~999 = Total 1000 combinations