From e721a5b805a4f3a55b0ff88bb617533e483a3058 Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:37:14 +0200 Subject: [PATCH] Improved output of GPPPasswords --- smbclientng/modules/GPPPasswords.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/smbclientng/modules/GPPPasswords.py b/smbclientng/modules/GPPPasswords.py index 190390d..400c1bd 100644 --- a/smbclientng/modules/GPPPasswords.py +++ b/smbclientng/modules/GPPPasswords.py @@ -230,12 +230,17 @@ def __find_callback(self, entry, fullpath, depth): if (not entry.is_directory()) and (entry.get_longname().lower().endswith('.xml')): data = self.parse_xmlfile_content(fullpath) if data is not None: - print("[+] %s" % fullpath) - for entry in data: - print(" | username: %s" % entry["attributes"]["username"]) - print(" | password: %s" % entry["attributes"]["password"]) - if len(data) > 1: - print("|") + if len(data) != 0: + print("[+] %s" % fullpath) + for entry in data: + if self.config.no_colors: + print(" | username: '%s'" % entry["attributes"]["username"]) + print(" | password: '%s'" % entry["attributes"]["password"]) + else: + print(" | \x1b[94musername\x1b[0m: '\x1b[93m%s\x1b[0m'" % entry["attributes"]["username"]) + print(" | \x1b[94mpassword\x1b[0m: '\x1b[93m%s\x1b[0m'" % entry["attributes"]["password"]) + if len(data) > 1: + print("|") return None def run(self, arguments):