@@ -233,14 +233,13 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
233233
234234 if doKerberos :
235235 rpctransport .set_kerberos (doKerberos , kdcHost = dcHost )
236- # if target:
237236
238237 rpctransport .setRemoteHost (target )
239238 dce = rpctransport .get_dce_rpc ()
240239 if doKerberos :
241240 dce .set_auth_type (RPC_C_AUTHN_GSS_NEGOTIATE )
242241 dce .set_auth_level (RPC_C_AUTHN_LEVEL_PKT_PRIVACY )
243- self .context .log .debug ("Connecting to {}" . format (binding_params [pipe ][" stringBinding" ]) )
242+ self .context .log .debug (f "Connecting to { format (binding_params [pipe ][' stringBinding' ]) } " )
244243 try :
245244 dce .connect ()
246245 except Exception as e :
@@ -358,7 +357,7 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
358357 dce = rpctransport .get_dce_rpc ()
359358 if doKerberos :
360359 dce .set_auth_type (RPC_C_AUTHN_GSS_NEGOTIATE )
361- self .context .log .debug ("Connecting to {}" . format (binding_params [pipe ][" stringBinding" ]) )
360+ self .context .log .debug (f "Connecting to { format (binding_params [pipe ][' stringBinding' ]) } " )
362361 try :
363362 dce .connect ()
364363 except Exception as e :
@@ -373,11 +372,10 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
373372 return dce
374373
375374 def exploit (self , dce , listener , always_continue , pipe ):
376-
377375 self .context .log .debug ("Sending NetrDfsAddStdRootForced!" )
378376 try :
379377 request = NetrDfsAddStdRootForced ()
380- """ NET_API_STATUS NetrDfsAddStdRootForced(
378+ """ NET_API_STATUS NetrDfsAddStdRootForced(
381379 [in, string] WCHAR* ServerName,
382380 [in, string] WCHAR* RootShare,
383381 [in, string] WCHAR* Comment,
@@ -587,7 +585,7 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
587585 if doKerberos :
588586 dce .set_auth_type (RPC_C_AUTHN_GSS_NEGOTIATE )
589587 dce .set_auth_level (RPC_C_AUTHN_LEVEL_PKT_PRIVACY )
590- self .context .log .debug ("Connecting to {}" . format (binding_params [pipe ][" stringBinding" ]) )
588+ self .context .log .debug (f "Connecting to { format (binding_params [pipe ][' stringBinding' ]) } " )
591589 try :
592590 dce .connect ()
593591 except Exception as e :
@@ -602,7 +600,6 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
602600 return dce
603601
604602 def exploit (self , dce , listener , always_continue , pipe ):
605-
606603 self .context .log .debug ("Sending EfsRpcAddUsersToFile!" )
607604 try :
608605 request = EfsRpcAddUsersToFile ()
@@ -822,7 +819,7 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
822819 if doKerberos :
823820 dce .set_auth_type (RPC_C_AUTHN_GSS_NEGOTIATE )
824821 dce .set_auth_level (RPC_C_AUTHN_LEVEL_PKT_PRIVACY )
825- self .context .log .debug ("Connecting to {}" . format (binding_params [pipe ][" stringBinding" ]) )
822+ self .context .log .debug (f "Connecting to { format (binding_params [pipe ][' stringBinding' ]) } " )
826823 try :
827824 dce .connect ()
828825 except Exception as e :
@@ -837,7 +834,6 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
837834 return dce
838835
839836 def exploit (self , dce , listener , target , always_continue , pipe ):
840-
841837 try :
842838 resp = rprn .hRpcOpenPrinter (dce , "\\ \\ %s\x00 " % target )
843839 except Exception as e :
@@ -937,7 +933,7 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
937933 if doKerberos :
938934 dce .set_auth_type (RPC_C_AUTHN_GSS_NEGOTIATE )
939935 dce .set_auth_level (RPC_C_AUTHN_LEVEL_PKT_PRIVACY )
940- self .context .log .debug ("Connecting to {}" . format (binding_params [pipe ][" stringBinding" ]) )
936+ self .context .log .debug (f "Connecting to { format (binding_params [pipe ][' stringBinding' ]) } " )
941937 try :
942938 dce .connect ()
943939 except Exception as e :
@@ -952,7 +948,6 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
952948 return dce
953949
954950 def exploit (self , dce , listener , always_continue , pipe ):
955-
956951 self .context .log .debug ("Sending ElfrOpenBELW!" )
957952 try :
958953 request = even .ElfrOpenBELW ()
0 commit comments