From 3a06a15b70aa5a435f6157ec07b7e23db3ef7161 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Mon, 22 Aug 2022 08:30:19 +0200 Subject: [PATCH] Fix issue on interact.sh `pull_logs` function: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` [•] Payloads sent to all URLs. Waiting for DNS OOB callbacks. [•] Waiting... main() File "/app/log4j-scan.py", line 401, in main records = dns_callback.pull_logs() File "/app/log4j-scan.py", line 257, in pull_logs for i in data_list: TypeError: 'NoneType' object is not iterable ``` --- log4j-scan.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/log4j-scan.py b/log4j-scan.py index a968253..f68b23f 100755 --- a/log4j-scan.py +++ b/log4j-scan.py @@ -254,9 +254,10 @@ def pull_logs(self): url = f"https://{self.server}/poll?id={self.correlation_id}&secret={self.secret}" res = self.session.get(url, headers=self.headers, timeout=30).json() aes_key, data_list = res['aes_key'], res['data'] - for i in data_list: - decrypt_data = self.__decrypt_data(aes_key, i) - result.append(self.__parse_log(decrypt_data)) + if data_list is not None: + for i in data_list: + decrypt_data = self.__decrypt_data(aes_key, i) + result.append(self.__parse_log(decrypt_data)) return result def __decrypt_data(self, aes_key, data):