From 6a9c2448a646d1168883ab1dc883eed84473a52a Mon Sep 17 00:00:00 2001 From: swee Date: Sat, 11 Jan 2025 00:50:26 -0800 Subject: [PATCH] Update modules/botnet_protect.py --- modules/botnet_protect.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/botnet_protect.py b/modules/botnet_protect.py index 3416637..976a6e4 100644 --- a/modules/botnet_protect.py +++ b/modules/botnet_protect.py @@ -21,16 +21,17 @@ class IRCatModule: raise Exception("Botnet detected!") def onSocket(self, ip, socket, value, cachedNick=None, validated=False): if validated: - if cachedNick + "|" + ip in self.memory and self.memory[cachedNick + "|" + ip] != True: + if cachedNick + "|" + ip in self.memory and self.memory[cachedNick + "|" + ip] != 0: if "JOIN" in value: target = value.split(" ")[1] - self.memory[cachedNick + "|" + ip][target] = 1 # 1: Just joined the channel, continue observing. + self.memory[ip] = 1 # 1: Just joined the channel, continue observing. if target == "#IRCATSUCKS": self.ban(ip) elif "PRIVMSG" in value: target = value.split(" ")[1] content = " ".join(value.split(" ")[2:])[1:] - if content in sus_strings and self.memory[cachedNick + "|" + ip][target] == 1: + print([content]) + if content in sus_strings and self.memory[ip] == 1: self.ban(ip) else: - self.memory[cachedNick + "|" + ip] = True # Trust the connection :3 \ No newline at end of file + self.memory[ip] = 0 # 0: Trust the connection :3 \ No newline at end of file