This commit is contained in:
parent
418fdf8daa
commit
cf793a99e3
1 changed files with 8 additions and 6 deletions
|
@ -2,10 +2,11 @@ import threading
|
||||||
__ircat_type__ = "allsocket"
|
__ircat_type__ = "allsocket"
|
||||||
__ircat_requires__ = ["ban-provider"]
|
__ircat_requires__ = ["ban-provider"]
|
||||||
__ircat_giveme__ = ["sql"] # Only command and allsocket have these.
|
__ircat_giveme__ = ["sql"] # Only command and allsocket have these.
|
||||||
__ircat_fakechannels__ = {"#IRCATSUCKS": "WHATEVER YOU DO, DO NOT JOIN IF YOU ARE HUMAN"}
|
__ircat_fakechannels__ = {"#IRCATSUCKS": "🅱️0tn3t pr0t3ct10n, do not join."}
|
||||||
class IRCatModule:
|
class IRCatModule:
|
||||||
sus_strings = [
|
sus_strings = [
|
||||||
" .''." # Latest Supernets spambot!
|
" .''.", # 2025 new year
|
||||||
|
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀" # "The United States of America" LATEST
|
||||||
]
|
]
|
||||||
memory = {} # {nick: {channel: trustlevel}} one can also be {nick: True} if it is whitelisted for the session.
|
memory = {} # {nick: {channel: trustlevel}} one can also be {nick: True} if it is whitelisted for the session.
|
||||||
useSQLengine = False
|
useSQLengine = False
|
||||||
|
@ -15,12 +16,13 @@ class IRCatModule:
|
||||||
self.useSQLengine = True
|
self.useSQLengine = True
|
||||||
self.SQLengine = sql
|
self.SQLengine = sql
|
||||||
def ban(self, ip):
|
def ban(self, ip):
|
||||||
del self.memory[ip]
|
del self.memory[ip] # Forget this all happened
|
||||||
|
# Add the ban
|
||||||
if self.useSQLengine:
|
if self.useSQLengine:
|
||||||
cur = self.SQLengine.conn.cursor()
|
self.SQLengine.addban(ip, "Botnet detected!") # Use the SQL provider if {'ban-provider': 'sql'}
|
||||||
else:
|
else:
|
||||||
open(self.ban_provider, "a").write(f"\n{ip} Botnet detected!")
|
open(self.ban_provider, "a").write(f"\n{ip} Botnet detected!") # Else, write on the banfile.
|
||||||
raise Exception("Botnet detected!")
|
raise Exception("Botnet detected!") # Kill the connection
|
||||||
def onSocket(self, ip, socket, value, cachedNick=None, validated=False):
|
def onSocket(self, ip, socket, value, cachedNick=None, validated=False):
|
||||||
if cachedNick != None:
|
if cachedNick != None:
|
||||||
print(value)
|
print(value)
|
||||||
|
|
Loading…
Add table
Reference in a new issue