77from impacket .uuid import uuidtup_to_bin
88
99
10+ def get_dynamic_endpoint (interface : bytes , target : str , timeout : int = 5 ) -> str :
11+ string_binding = rf"ncacn_ip_tcp:{ target } [135]"
12+ rpctransport = transport .DCERPCTransportFactory (string_binding )
13+ rpctransport .set_connect_timeout (timeout )
14+ dce = rpctransport .get_dce_rpc ()
15+ dce .connect ()
16+ endpoint = epm .hept_map (target , interface , protocol = "ncacn_ip_tcp" , dce = dce )
17+ return endpoint
18+
1019class NXCModule :
1120 name = "coerce_plus"
1221 description = "Module to check if the Target is vulnerable to any coerce vulns. Set LISTENER IP for coercion."
@@ -528,6 +537,13 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
528537 },
529538 }
530539
540+ # activates EFS
541+ # https://specterops.io/blog/2025/08/19/will-webclient-start/
542+ try :
543+ get_dynamic_endpoint (uuidtup_to_bin (("df1941c5-fe89-4e79-bf10-463657acf44d" , "0.0" )), target , timeout = 1 )
544+ except :
545+ pass
546+
531547 rpctransport = transport .DCERPCTransportFactory (binding_params [pipe ]["stringBinding" ])
532548 rpctransport .set_dport (445 )
533549
@@ -755,27 +771,6 @@ class PrinterBugTrigger:
755771 def __init__ (self , context ):
756772 self .context = context
757773
758- def get_dynamic_endpoint (self , interface : bytes , target : str , timeout : int = 5 ) -> str :
759- string_binding = rf"ncacn_ip_tcp:{ target } [135]"
760- rpctransport = transport .DCERPCTransportFactory (string_binding )
761- rpctransport .set_connect_timeout (timeout )
762- dce = rpctransport .get_dce_rpc ()
763- self .context .log .debug (f"Trying to resolve dynamic endpoint { uuid .bin_to_string (interface )!r} " )
764- try :
765- dce .connect ()
766- except Exception as e :
767- self .context .log .warning (f"Failed to connect to endpoint mapper: { e } " )
768- raise e
769- try :
770- endpoint = epm .hept_map (target , interface , protocol = "ncacn_ip_tcp" , dce = dce )
771- self .context .log .debug (
772- f"Resolved dynamic endpoint { uuid .bin_to_string (interface )!r} to { endpoint !r} "
773- )
774- return endpoint
775- except Exception as e :
776- self .context .log .debug (f"Failed to resolve dynamic endpoint { uuid .bin_to_string (interface )!r} " )
777- raise e
778-
779774 def connect (self , username , password , domain , lmhash , nthash , aesKey , target , doKerberos , dcHost , pipe ):
780775 binding_params = {
781776 "spoolss" : {
@@ -784,7 +779,7 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
784779 "port" : 445
785780 },
786781 "[dcerpc]" : {
787- "stringBinding" : self . get_dynamic_endpoint (uuidtup_to_bin (("12345678-1234-abcd-ef00-0123456789ab" , "1.0" )), target ),
782+ "stringBinding" : get_dynamic_endpoint (uuidtup_to_bin (("12345678-1234-abcd-ef00-0123456789ab" , "1.0" )), target ),
788783 "MSRPC_UUID_RPRN" : ("12345678-1234-abcd-ef00-0123456789ab" , "1.0" ),
789784 "port" : None
790785 }
0 commit comments