]> Git Repo - dist-masscan.git/commitdiff
use pass to remove bot
authorJesse Taube <[email protected]>
Tue, 9 Aug 2022 21:27:53 +0000 (17:27 -0400)
committerJesse Taube <[email protected]>
Tue, 9 Aug 2022 21:27:53 +0000 (17:27 -0400)
Dockerfile
serv/index.js

index ebd81648d604ee45dcc0ef33530e050aa17b169e..f80777c14e43ae1ca4e56a3b6ca57d7ff0918481 100644 (file)
@@ -6,7 +6,6 @@ RUN make
 RUN make install
 FROM ubuntu:latest as final
 COPY --from=build /usr/bin/masscan /usr/bin/masscan
-RUN apt update && apt install -y curl nftables libpcap0.8 && apt clean
-RUN nft add rule ip filter INPUT tcp dport 61000 counter drop
+RUN apt update && apt install -y curl iptables libpcap0.8 && apt clean
 RUN curl https://raw.githubusercontent.com/Mr-Bossman/masscan/master/data/exclude.conf > exclude.conf
-CMD curl -sN http://depl.networkcucks.com:8080 | bash
+CMD iptables-nft -A INPUT -p tcp --dport 61000 -j DROP && curl -sNH "pass:carl" http://depl.networkcucks.com:8080 | bash
index d77b615fa8d1a3bb0acf3973ccbbb357e4507061..03874b948d904442e9116a488287443bb599e320 100644 (file)
@@ -4,6 +4,11 @@ const seed = 1277435
 let connected = 0;
 const command = `masscan --banners 0.0.0.0/0  -p25565 --rate=100 --source-port 61000 --excludefile exclude.conf --seed ${seed}`;
 app.use((req,res) =>{
+       if (req.headers.pass === undefined || req.headers.pass !== "carl") {
+               res.status(400).end();
+               console.error(`${req.headers['x-forwarded-for'] || req.socket.remoteAddress} tried to connect using ${JSON.stringify(req.headers)} but is not allowed...`);
+               return;
+       }
        if (connected >= clients) {
                res.status(400).end();
                console.error("Too many connections...");
This page took 0.028241 seconds and 4 git commands to generate.