Skip to content

Commit ca932eb

Browse files
committed
fix error is dc
1 parent 01b83d4 commit ca932eb

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

nxc/protocols/smb.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -684,23 +684,16 @@ def check_dc_ports(self, timeout=1):
684684
return open_ports >= 3
685685

686686
def is_host_dc(self):
687-
from impacket.dcerpc.v5 import transport, nrpc
687+
from impacket.dcerpc.v5 import nrpc, epm
688688

689689
self.logger.debug("Performing authentication attempts...")
690690

691691
# First check if port 135 is open
692692
if self._is_port_open(135):
693693
self.logger.debug("Port 135 is open, attempting MSRPC connection...")
694694
try:
695-
rpctransport = transport.DCERPCTransportFactory(f"ncacn_ip_tcp:{self.host}[135]")
696-
rpctransport.set_connect_timeout(2)
697-
698-
dce = rpctransport.get_dce_rpc()
699-
dce.connect()
700-
dce.bind(nrpc.MSRPC_UUID_NRPC)
701-
695+
epm.hept_map(self.host, nrpc.MSRPC_UUID_NRPC, protocol="ncacn_ip_tcp")
702696
self.isdc = True
703-
dce.disconnect()
704697
return True
705698
except DCERPCException:
706699
self.logger.debug("Error while connecting to host: DCERPCException, which means this is probably not a DC!")

0 commit comments

Comments
 (0)