Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Wrong filename on RDP screenshot (Mission extension) #649

@jdouliez

Description

@jdouliez

Describe the bug
Using the RDP module and the --screenshot option, the logged filename on the tool output and the real filename on the filesystem are different. The local file misses the '.png' extension.

Code

`
async def screen(self):
await self.connect_rdp(self.url)
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('~/.cme/screenshots/{}_{}_{}'.format(self.hostname, self.host, datetime.now().strftime("%Y-%m-%d_%H%M%S")))
        buffer.save(filename,'png')
        self.logger.highlight("Screenshot saved {}".format(filename + ".png"))

`

Above, the ".png" suffix is appended into the log.
Shouldn't it also be saved at the saved file level?

To Reproduce
Steps to reproduce the behavior:

  1. Run the command "cme rdp -u $USER -p $PASSWORD -d $DOMAIN $IP --screenshot"
  2. The stdout logs "Screenshot saved /root/.cme/screenshots/[REDACTED]123738.png".
  3. The file /root/.cme/screenshots/[REDACTED]123738.png does not exist.
  4. The file /root/.cme/screenshots/[REDACTED]123738 does exist.

Expected behavior
The stdout logs "Screenshot saved /root/.cme/screenshots/[REDACTED]123738.png".
The screenshot image can be found at /root/.cme/screenshots/[REDACTED]123738.png

Crackmapexec info

  • OS: Docker
  • Version of CME : 5.3.0
  • Installed from apt or using latest release ? Please try with latest release before openning an issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions