node-postgres是node中连接pg数据库的客户端,其中出现过一个代码执行漏洞,非常典型,可以拿出来讲一讲。 0x02 漏洞触发点 安装node-postgres的7.1.0版本:npm install pg@7.1.0。 break // the evaluated javascript unless they are escaped // see https://github.com/brianc/node-postgres all // occurences of apostrophes, not just the first one. // See https://github.com/brianc/node-postgres 但是node-postgres是支持多句执行的,显然我们可以直接闭合第一个SQL语句,在第二个SQL语句中编写POC代码: ?
QQ截图20170521193014.jpg 2.Nodejs连接PostgreSQL数据库 (1)使用pg包 https://github.com/brianc/node-postgres (2)
* FROM hello', (err, res) => { console.log(res.rows[0].message) client.end() }) 此应用程序使用pgNPM模块(node-postgres 在node-postgres文档中阅读有关环境变量的更多信息。
mysql、node-postgres: 在不需要完整的 ORM 时使用,它们使用原始的 SQL 查询数据库(这些是驱动程序) node-mongodb-native: 在不需要完整的 ORM
nodejs的注入导致的命令执行漏洞,漏洞利用链非常精巧,首先我们需要了解一个漏洞,整个漏洞@Phith0n师傅发了很详细的分析 https://paper.seebug.org/438/ 简单描述漏洞来说,在node-postgres
nodejs的注入导致的命令执行漏洞,漏洞利用链非常精巧,首先我们需要了解一个漏洞,整个漏洞@Phith0n师傅发了很详细的分析 https://paper.seebug.org/438/ 简单描述漏洞来说,在node-postgres