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

Wrong filename on RDP screenshot (Mission extension) #649

Closed
jdouliez opened this issue Oct 12, 2022 · 2 comments
Closed

Wrong filename on RDP screenshot (Mission extension) #649

jdouliez opened this issue Oct 12, 2022 · 2 comments

Comments

@jdouliez
Copy link
Contributor

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
@jdouliez
Copy link
Contributor Author

jdouliez commented Oct 12, 2022

I've created the PR #650 to fix this little bug.

mpgn added a commit that referenced this issue Oct 13, 2022
fix(#649) : Fix Wrong filename on RDP screenshot issue
@mpgn
Copy link
Contributor

mpgn commented Oct 13, 2022

merged thx :)

@mpgn mpgn closed this as completed Oct 13, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants