From f5788e4bafe59079905539c496e60954f9c7d59d Mon Sep 17 00:00:00 2001 From: swee Date: Sat, 11 Jan 2025 00:57:36 -0800 Subject: [PATCH] Update modules/botnet_protect.py --- modules/botnet_protect.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/botnet_protect.py b/modules/botnet_protect.py index 863440b..da2c862 100644 --- a/modules/botnet_protect.py +++ b/modules/botnet_protect.py @@ -21,7 +21,7 @@ class IRCatModule: raise Exception("Botnet detected!") def onSocket(self, ip, socket, value, cachedNick=None, validated=False): if cachedNick != None: - if not (cachedNick + "|" + ip in self.memory and self.memory[cachedNick + "|" + ip] == 0): + if not (ip in self.memory and self.memory[ip] == 0): print(value) if "JOIN" in value: target = value.split(" ")[1] @@ -31,7 +31,9 @@ class IRCatModule: elif "PRIVMSG" in value: target = value.split(" ")[1] content = " ".join(value.split(" ")[2:])[1:] - if content in self.sus_strings and (cachedNick + "|" + ip in self.memory and self.memory[cachedNick + "|" + ip] == 1): - self.ban(ip) + if content in self.sus_strings and ( and ): + if ip in self.memory: + if self.memory[ip] == 1: + self.ban(ip) else: self.memory[ip] = 0 # 0: Trust the connection :3 \ No newline at end of file