mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 11:14:23 +00:00
V5.2.7
This commit is contained in:
@@ -144,6 +144,10 @@ class Connection:
|
|||||||
self.Base.logs.error(f"OSError __connect_to_irc: {oe} - {data}")
|
self.Base.logs.error(f"OSError __connect_to_irc: {oe} - {data}")
|
||||||
self.signal = False
|
self.signal = False
|
||||||
|
|
||||||
|
self.IrcSocket.shutdown(socket.SHUT_WR)
|
||||||
|
self.IrcSocket.shutdown(socket.SHUT_RD)
|
||||||
|
self.Base.logs.info(f"<<{self.currentCloneObject.nickname}>> Clone Disconnected ...")
|
||||||
|
|
||||||
except AssertionError as ae:
|
except AssertionError as ae:
|
||||||
self.Base.logs.error(f'Assertion error : {ae}')
|
self.Base.logs.error(f'Assertion error : {ae}')
|
||||||
except ValueError as ve:
|
except ValueError as ve:
|
||||||
@@ -154,11 +158,6 @@ class Connection:
|
|||||||
self.Base.logs.critical(f"{atte}")
|
self.Base.logs.critical(f"{atte}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.Base.logs.error(f"Exception: {e}")
|
self.Base.logs.error(f"Exception: {e}")
|
||||||
finally:
|
|
||||||
self.IrcSocket.shutdown(socket.SHUT_WR)
|
|
||||||
self.IrcSocket.shutdown(socket.SHUT_RD)
|
|
||||||
self.Base.logs.info(f"<<{self.currentCloneObject.nickname}>> Clone Disconnected ...")
|
|
||||||
# self.IrcSocket.close()
|
|
||||||
|
|
||||||
def parser(self, cmd:list[bytes]):
|
def parser(self, cmd:list[bytes]):
|
||||||
try:
|
try:
|
||||||
@@ -177,6 +176,7 @@ class Connection:
|
|||||||
error_value = str(response[1]).replace(':','')
|
error_value = str(response[1]).replace(':','')
|
||||||
if error_value == 'Closing':
|
if error_value == 'Closing':
|
||||||
self.Base.logs.info(f"<<{self.currentCloneObject.nickname}>> {response} ...")
|
self.Base.logs.info(f"<<{self.currentCloneObject.nickname}>> {response} ...")
|
||||||
|
self.currentCloneObject.connected = False
|
||||||
# self.signal = False
|
# self.signal = False
|
||||||
|
|
||||||
match response[1]:
|
match response[1]:
|
||||||
|
|||||||
@@ -1017,7 +1017,7 @@ class Irc:
|
|||||||
current_command = cmd[0]
|
current_command = cmd[0]
|
||||||
uid_to_deauth = self.User.get_uid(fromuser)
|
uid_to_deauth = self.User.get_uid(fromuser)
|
||||||
self.delete_db_admin(uid_to_deauth)
|
self.delete_db_admin(uid_to_deauth)
|
||||||
self.send2socket(f":{dnickname} PRIVMSG {dchanlog} :[ {self.Config.CONFIG_COLOR['rouge']}{current_command}{self.Config.CONFIG_COLOR['noire']} ] - {self.User.get_nickname(fromuser)} est désormais déconnecter de {dnickname}")
|
self.send2socket(f":{dnickname} PRIVMSG {dchanlog} :[ {self.Config.CONFIG_COLOR['rouge']}{str(current_command).upper()} ]{self.Config.CONFIG_COLOR['noire']} - {self.User.get_nickname(fromuser)} est désormais déconnecter de {dnickname}")
|
||||||
|
|
||||||
case 'auth':
|
case 'auth':
|
||||||
# ['auth', 'adator', 'password']
|
# ['auth', 'adator', 'password']
|
||||||
@@ -1039,10 +1039,10 @@ class Irc:
|
|||||||
if not user_from_db is None:
|
if not user_from_db is None:
|
||||||
uid_user = self.User.get_uid(user_to_log)
|
uid_user = self.User.get_uid(user_to_log)
|
||||||
self.insert_db_admin(uid_user, user_from_db[1])
|
self.insert_db_admin(uid_user, user_from_db[1])
|
||||||
self.send2socket(f":{dnickname} PRIVMSG {dchanlog} :[ {self.Config.CONFIG_COLOR['verte']}{current_command}{self.Config.CONFIG_COLOR['noire']} ] - {self.User.get_nickname(fromuser)} est désormais connecté a {dnickname}")
|
self.send2socket(f":{dnickname} PRIVMSG {dchanlog} :[ {self.Config.CONFIG_COLOR['verte']}{str(current_command).upper()} ]{self.Config.CONFIG_COLOR['noire']} - {self.User.get_nickname(fromuser)} est désormais connecté a {dnickname}")
|
||||||
self.send2socket(f":{self.Config.SERVICE_NICKNAME} NOTICE {fromuser} :Connexion a {dnickname} réussie!")
|
self.send2socket(f":{self.Config.SERVICE_NICKNAME} NOTICE {fromuser} :Connexion a {dnickname} réussie!")
|
||||||
else:
|
else:
|
||||||
self.send2socket(f":{dnickname} PRIVMSG {dchanlog} :[ {self.Config.CONFIG_COLOR['rouge']}{current_command}{self.Config.CONFIG_COLOR['noire']} ] - {self.User.get_nickname(fromuser)} a tapé un mauvais mot de pass")
|
self.send2socket(f":{dnickname} PRIVMSG {dchanlog} :[ {self.Config.CONFIG_COLOR['rouge']}{str(current_command).upper()} ]{self.Config.CONFIG_COLOR['noire']} - {self.User.get_nickname(fromuser)} a tapé un mauvais mot de pass")
|
||||||
self.send2socket(f":{self.Config.SERVICE_NICKNAME} NOTICE {fromuser} :Mot de passe incorrecte")
|
self.send2socket(f":{self.Config.SERVICE_NICKNAME} NOTICE {fromuser} :Mot de passe incorrecte")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -151,14 +151,14 @@ class Config:
|
|||||||
configuration:dict[str, Union[str, int, list, dict]] = json.load(configuration_data)
|
configuration:dict[str, Union[str, int, list, dict]] = json.load(configuration_data)
|
||||||
|
|
||||||
config_dict = {"CONFIG_COLOR" : {
|
config_dict = {"CONFIG_COLOR" : {
|
||||||
"blanche": "\\u0003\\u0030",
|
"blanche": "\x0300",
|
||||||
"noire": "\\u0003\\u0031",
|
"noire": "\x0301",
|
||||||
"bleue": "\\u0003\\u0020",
|
"bleue": "\x0302",
|
||||||
"verte": "\\u0003\\u0033",
|
"verte": "\x0303",
|
||||||
"rouge": "\\u0003\\u0034",
|
"rouge": "\x0304",
|
||||||
"jaune": "\\u0003\\u0036",
|
"jaune": "\x0306",
|
||||||
"gras": "\\u0002",
|
"gras": "\x02",
|
||||||
"nogc": "\\u0002\\u0003"
|
"nogc": "\x02\x03"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,25 @@ class Clone():
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def thread_clone_clean_up(self, wait: float):
|
||||||
|
|
||||||
|
activated = True
|
||||||
|
|
||||||
|
while activated:
|
||||||
|
clone_to_kill: list[str] = []
|
||||||
|
|
||||||
|
for clone in self.Clone.UID_CLONE_DB:
|
||||||
|
if not clone.connected and clone.alive:
|
||||||
|
clone_to_kill.append(clone.nickname)
|
||||||
|
clone.alive = False
|
||||||
|
|
||||||
|
for clone_nickname in clone_to_kill:
|
||||||
|
if self.Clone.delete(clone_nickname):
|
||||||
|
self.Logs.debug(f'<<{clone_nickname}>> object has been deleted')
|
||||||
|
|
||||||
|
del clone_to_kill
|
||||||
|
time.sleep(wait)
|
||||||
|
|
||||||
def thread_change_hostname(self):
|
def thread_change_hostname(self):
|
||||||
|
|
||||||
fake = faker.Faker('en_GB')
|
fake = faker.Faker('en_GB')
|
||||||
@@ -142,6 +161,9 @@ class Clone():
|
|||||||
found = True
|
found = True
|
||||||
clone.vhost = rand_ip
|
clone.vhost = rand_ip
|
||||||
break
|
break
|
||||||
|
if not clone in self.Clone.UID_CLONE_DB:
|
||||||
|
found = True
|
||||||
|
break
|
||||||
|
|
||||||
def thread_create_clones(self, nickname: str, username: str, realname: str, channels: list, server_port: int, ssl: bool) -> None:
|
def thread_create_clones(self, nickname: str, username: str, realname: str, channels: list, server_port: int, ssl: bool) -> None:
|
||||||
|
|
||||||
@@ -262,6 +284,8 @@ class Clone():
|
|||||||
|
|
||||||
self.Irc.send2socket(f':{dnickname} NOTICE {fromuser} :{str(number_of_clones)} clones joined the network')
|
self.Irc.send2socket(f':{dnickname} NOTICE {fromuser} :{str(number_of_clones)} clones joined the network')
|
||||||
|
|
||||||
|
self.Base.create_thread(self.thread_clone_clean_up, (5, ), run_once=True)
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.Logs.error(f'{err}')
|
self.Logs.error(f'{err}')
|
||||||
self.Irc.send2socket(f':{dnickname} NOTICE {fromuser} :/msg {dnickname} clone connect [number of clone you want to connect]')
|
self.Irc.send2socket(f':{dnickname} NOTICE {fromuser} :/msg {dnickname} clone connect [number of clone you want to connect]')
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "5.2.6"
|
"version": "5.2.7"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user