Skip to content

Commit 91c339e

Browse files
authored
Merge pull request Pennyw0rth#603 from Pennyw0rth/fix_host
fix 0x_df issue with hosts file
2 parents ea77ad9 + 0f1c2f9 commit 91c339e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

nxc/protocols/smb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,9 @@ def print_host_info(self):
330330

331331
if self.args.generate_hosts_file:
332332
with open(self.args.generate_hosts_file, "a+") as host_file:
333-
host_file.write(f"{self.host} {self.hostname} {self.hostname}.{self.targetDomain} {self.targetDomain if isdc else ''}\n")
334-
self.logger.debug(f"{self.host} {self.hostname} {self.hostname}.{self.targetDomain} {self.targetDomain if isdc else ''}")
333+
dc_part = f" {self.targetDomain}" if isdc else ""
334+
host_file.write(f"{self.host} {self.hostname}.{self.targetDomain}{dc_part} {self.hostname}\n")
335+
self.logger.debug(f"{self.host} {self.hostname}.{self.targetDomain}{dc_part} {self.hostname}")
335336
elif self.args.generate_krb5_file and isdc:
336337
with open(self.args.generate_krb5_file, "w+") as host_file:
337338
data = f"""

0 commit comments

Comments
 (0)