diff --git a/nxc/protocols/rdp.py b/nxc/protocols/rdp.py index 4f0277976..9a8a5a469 100644 --- a/nxc/protocols/rdp.py +++ b/nxc/protocols/rdp.py @@ -22,6 +22,8 @@ from asyauth.common.constants import asyauthSecret from asysocks.unicomm.common.target import UniTarget, UniProto +from nxc.paths import NXC_PATH + class rdp(connection): def __init__(self, args, db, host): @@ -166,6 +168,7 @@ def create_conn_obj(self): return True def check_nla(self): + self.logger.debug(f"Checking NLA for {self.host}") for proto in self.protoflags_nla: try: self.iosettings.supported_protocols = proto @@ -381,13 +384,14 @@ async def nla_screen(self): self.conn = RDPConnection(iosettings=self.iosettings, target=self.target, credentials=self.auth) await self.connect_rdp() - except Exception: + except Exception as e: + self.logger.debug(f"Failed to connect for nla_screenshot with {proto} {e}") return await asyncio.sleep(int(self.args.screentime)) if self.conn is not None and self.conn.desktop_buffer_has_data is True: buffer = self.conn.get_desktop_buffer(VIDEO_FORMAT.PIL) - filename = os.path.expanduser(f"~/.nxc/screenshots/{self.hostname}_{self.host}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}.png") + filename = os.path.expanduser(f"{NXC_PATH}/screenshots/{self.hostname}_{self.host}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}.png") buffer.save(filename, "png") self.logger.highlight(f"NLA Screenshot saved {filename}") return