Skip to content

Instantly share code, notes, and snippets.

@golyshevd
Last active August 29, 2015 14:10
Show Gist options
  • Save golyshevd/4783b7d567941eb89861 to your computer and use it in GitHub Desktop.
Save golyshevd/4783b7d567941eb89861 to your computer and use it in GitHub Desktop.
Yet another node DOS
var http = require('http');
http.createServer(function (req, res) {
req.on('data', function (c) {
console.log('INCOMING DATA %j', c);
});
req.on('end', function () {
console.log('DONE RECEIVING DATA');
res.end();
});
}).listen(1337);
// Пробуем послать неправильный Content-Length
// curl -v "http://127.0.0.1:1337/" -d "foo" -H "Content-Length: 5"
// Сервер будет таймаутиться и в итоге ваш прокси ответит 504
// Ожидаю увидеть или BadRequest (400) или совсем игнор заголовка Content-Length,
// но чтобы все тело докачалось
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment