Skip to content

Commit abf9b34

Browse files
committed
Make use of the filename template in the smb protocol
1 parent e18e69e commit abf9b34

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

nxc/modules/ntdsutil.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,7 @@ def add_ntds_hash(ntds_hash, host_id):
143143
add_ntds_hash.ntds_hashes = 0
144144
add_ntds_hash.added_to_db = 0
145145

146-
if not connection.output_filename:
147-
timestamp = time.strftime("%Y-%m-%d_%H-%M-%S")
148-
hostname = connection.hostname
149-
ip = connection.host
150-
filename = f"{hostname}_{ip}_{timestamp}.ntds"
151-
output_dir = os.path.join(NXC_PATH, "logs", "ntds")
152-
os.makedirs(output_dir, exist_ok=True)
153-
connection.output_filename = os.path.join(output_dir, filename).rstrip(".ntds")
146+
connection.output_filename = connection.output_file_template.format(output_folder="ntds")
154147

155148
NTDS = NTDSHashes(
156149
f"{self.dir_result}/Active Directory/ntds.dit",

0 commit comments

Comments
 (0)