From 68bbde209a605a7e6c70298d65f9ef10080956e0 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Thu, 18 Jul 2024 13:30:46 -0400 Subject: [PATCH] aimedb: add warning for all-zero access code/idm --- core/aimedb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/aimedb.py b/core/aimedb.py index 944153b..6d5bd57 100644 --- a/core/aimedb.py +++ b/core/aimedb.py @@ -177,6 +177,7 @@ class AimedbServlette(): async def handle_lookup(self, data: bytes, resp_code: int) -> ADBBaseResponse: req = ADBLookupRequest(data) if req.access_code == "00000000000000000000": + self.logger.warn(f"All-zero access code from {req.head.keychip_id}") ret = ADBLookupResponse.from_req(req.head, -1) ret.head.status = ADBStatus.BAN_SYS return ret @@ -207,6 +208,7 @@ class AimedbServlette(): async def handle_lookup_ex(self, data: bytes, resp_code: int) -> ADBBaseResponse: req = ADBLookupRequest(data) if req.access_code == "00000000000000000000": + self.logger.warn(f"All-zero access code from {req.head.keychip_id}") ret = ADBLookupExResponse.from_req(req.head, -1) ret.head.status = ADBStatus.BAN_SYS return ret @@ -252,6 +254,7 @@ class AimedbServlette(): req = ADBFelicaLookupRequest(data) idm = req.idm.zfill(16) if idm == "0000000000000000": + self.logger.warn(f"All-zero IDm from {req.head.keychip_id}") ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000") ret.head.status = ADBStatus.BAN_SYS return ret @@ -280,6 +283,7 @@ class AimedbServlette(): idm = req.idm.zfill(16) if idm == "0000000000000000": + self.logger.warn(f"All-zero IDm from {req.head.keychip_id}") ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000") ret.head.status = ADBStatus.BAN_SYS return ret @@ -319,6 +323,7 @@ class AimedbServlette(): idm = req.idm.zfill(16) if idm == "0000000000000000": + self.logger.warn(f"All-zero IDm from {req.head.keychip_id}") ret = ADBFelicaLookupExResponse.from_req(req.head, -1, "00000000000000000000") ret.head.status = ADBStatus.BAN_SYS return ret @@ -377,6 +382,7 @@ class AimedbServlette(): user_id = -1 if req.access_code == "00000000000000000000": + self.logger.warn(f"All-zero access code from {req.head.keychip_id}") ret = ADBLookupResponse.from_req(req.head, -1) ret.head.status = ADBStatus.BAN_SYS return ret