File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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!" )
You can’t perform that action at this time.
0 commit comments