Skip to content

Commit c255655

Browse files
authored
Merge pull request #109 from T1erno/fix-smb-session-port
Use session port for SMB exec methods
2 parents 78c0c59 + 2e1303e commit c255655

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lsassy/exec/smb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def exec(self, command):
8888
stringbinding = r"ncacn_np:%s[\pipe\svcctl]" % self.session.address
8989
lsassy_logger.debug("StringBinding %s" % stringbinding)
9090
self._rpctransport = transport.DCERPCTransportFactory(stringbinding)
91-
self._rpctransport.set_dport(445)
91+
self._rpctransport.set_dport(self.session.port)
9292
self._rpctransport.setRemoteHost(self.session.address)
9393
if hasattr(self._rpctransport, "set_credentials"):
9494
# This method exists only for selected protocol sequences.

lsassy/exec/smb_stealth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def exec(self, command):
121121
stringbinding = r"ncacn_np:%s[\pipe\svcctl]" % self.session.address
122122
lsassy_logger.debug("StringBinding %s" % stringbinding)
123123
self._rpctransport = transport.DCERPCTransportFactory(stringbinding)
124-
self._rpctransport.set_dport(445)
124+
self._rpctransport.set_dport(self.session.port)
125125
self._rpctransport.setRemoteHost(self.session.address)
126126
if hasattr(self._rpctransport, "set_credentials"):
127127
# This method exists only for selected protocol sequences.

0 commit comments

Comments
 (0)