diff --git a/.test.env b/.test.env index 820f8ea..bcf1613 100644 --- a/.test.env +++ b/.test.env @@ -70,6 +70,7 @@ ROLE_ACADEMY_CBBH=7168215511011276950 ROLE_ACADEMY_CPTS=1795774641027354363 ROLE_ACADEMY_CDSA=1157697238949167235 ROLE_ACADEMY_CWEE=1257697240949167235 +ROLE_ACADEMY_CAPE=1318971191586979861 ROLE_UNICTF2022=6148613121047893215 diff --git a/src/core/config.py b/src/core/config.py index 5fa8baf..ae78092 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -86,6 +86,7 @@ class AcademyCertificates(BaseSettings): CERTIFIED_PENETRATION_TESTING_SPECIALIST = 3 CERTIFIED_DEFENSIVE_SECURITY_ANALYST = 4 CERTIFIED_WEB_EXPLOITATION_EXPERT = 5 + CERTIFIED_ACTIVEDIRECTORY_PENTESTING_EXPERT = 6 class Roles(BaseSettings): @@ -133,6 +134,7 @@ class Roles(BaseSettings): ACADEMY_CPTS: int ACADEMY_CDSA: int ACADEMY_CWEE: int + ACADEMY_CAPE: int # Joinable roles UNICTF2022: int BIZCTF2022: int @@ -225,6 +227,7 @@ def get_academy_cert_role(self, certificate: int) -> int: self.academy_certificates.CERTIFIED_PENETRATION_TESTING_SPECIALIST: self.roles.ACADEMY_CPTS, self.academy_certificates.CERTIFIED_DEFENSIVE_SECURITY_ANALYST: self.roles.ACADEMY_CDSA, self.academy_certificates.CERTIFIED_WEB_EXPLOITATION_EXPERT: self.roles.ACADEMY_CWEE, + self.academy_certificates.CERTIFIED_ACTIVEDIRECTORY_PENTESTING_EXPERT: self.roles.ACADEMY_CAPE }.get(certificate) def get_post_or_rank(self, what: str) -> Optional[int]: @@ -259,6 +262,7 @@ def get_cert(self, what: str): "CBBH": self.roles.ACADEMY_CBBH, "CDSA": self.roles.ACADEMY_CDSA, "CWEE": self.roles.ACADEMY_CWEE, + "CAPE": self.roles.ACADEMY_CAPE }.get(what) class Config: diff --git a/src/helpers/verification.py b/src/helpers/verification.py index 307a22b..ddb4be9 100644 --- a/src/helpers/verification.py +++ b/src/helpers/verification.py @@ -74,7 +74,9 @@ async def _check_for_ban(uid: str) -> Optional[Dict]: return ban_details + async def process_certification(certid: str, name: str): + """Process certifications.""" cert_api_url = f"{settings.API_V4_URL}/certificate/lookup" params = {'id': certid, 'name': name} async with aiohttp.ClientSession() as session: @@ -98,6 +100,8 @@ async def process_certification(certid: str, name: str): cert = "CDSA" elif certRawName == "HTB Certified Web Exploitation Expert": cert = "CWEE" + elif certRawName == "HTB Certified Active Directory Pentesting Expert": + cert = "CAPE" else: cert = False return cert