Skip to content

Commit c09304e

Browse files
committed
Autoformat
1 parent 008c490 commit c09304e

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

nxc/protocols/smb.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def enum_host_info(self):
273273
self.conn.logoff()
274274
except Exception as e:
275275
self.logger.debug(f"Error logging off system: {e}")
276-
276+
277277
# DCOM connection with kerberos needed
278278
self.remoteName = self.host if not self.kerberos else f"{self.hostname}.{self.domain}"
279279

@@ -707,11 +707,11 @@ def execute(self, payload=None, get_output=False, methods=None):
707707
except UnicodeDecodeError:
708708
self.logger.debug("Decoding error detected, consider running chcp.com at the target, map the result with https://docs.python.org/3/library/codecs.html#standard-encodings")
709709
output = output.decode("cp437")
710-
710+
711711
self.logger.debug(f"Raw Output: {output}")
712712
output = "\n".join([ll.rstrip() for ll in output.splitlines() if ll.strip()])
713713
self.logger.debug(f"Cleaned Output: {output}")
714-
714+
715715
if "This script contains malicious content" in output:
716716
self.logger.fail("Command execution blocked by AMSI")
717717
return None
@@ -732,24 +732,24 @@ def ps_execute(self, payload=None, get_output=False, methods=None, force_ps32=Fa
732732
if not payload:
733733
self.logger.error("No command to execute specified!")
734734
return None
735-
735+
736736
response = []
737737
obfs = obfs if obfs else self.args.obfs
738738
encode = encode if encode else not self.args.no_encode
739739
force_ps32 = force_ps32 if force_ps32 else self.args.force_ps32
740740
get_output = True if not self.args.no_output else get_output
741-
741+
742742
self.logger.debug(f"Starting ps_execute(): {payload=} {get_output=} {methods=} {force_ps32=} {obfs=} {encode=}")
743743
amsi_bypass = self.args.amsi_bypass[0] if self.args.amsi_bypass else None
744744
self.logger.debug(f"AMSI Bypass: {amsi_bypass}")
745-
745+
746746
if os.path.isfile(payload):
747747
self.logger.debug(f"File payload set: {payload}")
748748
with open(payload) as commands:
749749
response = [self.execute(create_ps_command(c.strip(), force_ps32=force_ps32, obfs=obfs, custom_amsi=amsi_bypass, encode=encode), get_output, methods) for c in commands]
750750
else:
751751
response = [self.execute(create_ps_command(payload, force_ps32=force_ps32, obfs=obfs, custom_amsi=amsi_bypass, encode=encode), get_output, methods)]
752-
752+
753753
self.logger.debug(f"ps_execute response: {response}")
754754
return response
755755

@@ -833,7 +833,7 @@ def shares(self):
833833
continue
834834
self.logger.highlight(f"{name:<15} {','.join(perms):<15} {remark}")
835835
return permissions
836-
836+
837837
def interfaces(self):
838838
"""
839839
Retrieve the list of network interfaces info (Name, IP Address, Subnet Mask, Default Gateway) from remote Windows registry'
@@ -1370,7 +1370,7 @@ def put_file_single(self, src, dst):
13701370
self.logger.success(f"Created file {src} on \\\\{self.args.share}\\{dst}")
13711371
except Exception as e:
13721372
self.logger.fail(f"Error writing file to share {self.args.share}: {e}")
1373-
1373+
13741374
def put_file(self):
13751375
for src, dest in self.args.put_file:
13761376
self.put_file_single(src, dest)
@@ -1393,7 +1393,6 @@ def get_file(self):
13931393
for src, dest in self.args.get_file:
13941394
self.get_file_single(src, dest)
13951395

1396-
13971396
def enable_remoteops(self):
13981397
try:
13991398
self.remote_ops = RemoteOperations(self.conn, self.kerberos, self.kdcHost)
@@ -1476,7 +1475,7 @@ def sccm(self):
14761475
except Exception as e:
14771476
self.logger.debug(f"Could not upgrade connection: {e}")
14781477
return
1479-
1478+
14801479
try:
14811480
self.logger.display("Collecting Machine masterkeys, grab a coffee and be patient...")
14821481
masterkeys_triage = MasterkeysTriage(
@@ -1491,7 +1490,7 @@ def sccm(self):
14911490
if len(masterkeys) == 0:
14921491
self.logger.fail("No masterkeys looted")
14931492
return
1494-
1493+
14951494
self.logger.success(f"Got {highlight(len(masterkeys))} decrypted masterkeys. Looting SCCM Credentials through {self.args.sccm}")
14961495
try:
14971496
# Collect Chrome Based Browser stored secrets
@@ -1681,7 +1680,6 @@ def dpapi(self):
16811680
"Google Refresh Token",
16821681
)
16831682

1684-
16851683
if dump_cookies and cookies:
16861684
self.logger.display("Start Dumping Cookies")
16871685
for cookie in cookies:
@@ -1869,4 +1867,4 @@ def add_ntds_hash(ntds_hash, host_id):
18691867
NTDS.finish()
18701868

18711869
def mark_guest(self):
1872-
return highlight(f"{highlight('(Guest)')}" if self.is_guest else "")
1870+
return highlight(f"{highlight('(Guest)')}" if self.is_guest else "")

0 commit comments

Comments
 (0)