diff --git a/main.js b/main.js index 0d28acc..4731f1b 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ const net = require("net") -const {spawn,exec} = require("child_process"); +const {exec} = require("child_process"); const portlist = [21,1433,7777] const host = "0.0.0.0"; var ipSet = new Set() @@ -26,7 +26,7 @@ portlist.forEach(i => { // This interval looks through the ipSet every 30 seconds and if there are an inside, it will ban them and remove them from the Set setInterval(()=>{ ipSet.forEach(i => { - exec(`echo -A INPUT -s ${i} -j DROP`, (error, stdout, stderr) => { + exec(`iptables -A INPUT -s ${i} -j DROP`, (error, stdout, stderr) => { if (error) { console.log(`error: ${error.message}`); return;