Skip to content

Commit 92206c8

Browse files
committed
fix output check
1 parent aa17bbc commit 92206c8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

nxc/protocols/rdp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ async def execute_shell(self, payload, get_output, shell_type):
427427
await asyncio.sleep(self.args.cmd_delay)
428428

429429
timeout_counter = 0
430-
while not clipboard_ready and timeout_counter < 100: # 10 second timeout
430+
while not clipboard_ready and timeout_counter < 200: # 10 second timeout
431431
try:
432432
data = await asyncio.wait_for(self.conn.ext_out_queue.get(), timeout=0.1)
433433
if hasattr(data, "type") and data.type.name == "CLIPBOARD_READY":
@@ -446,6 +446,10 @@ async def execute_shell(self, payload, get_output, shell_type):
446446
self.logger.fail("Warning: Clipboard may not be fully initialized, no output can be retrieved")
447447
return ""
448448

449+
if not clipboard_ready and get_output:
450+
self.logger.fail("Clipboard cannot be initialized, no output can be retrieved")
451+
return ""
452+
449453
# Wait for desktop to be available
450454
await asyncio.sleep(self.args.cmd_delay)
451455

0 commit comments

Comments
 (0)