Current working directory not respected
I was working on a HTB box and after the initial foothold with user X I escalated to user Y, then I tried to upload a file but it kept the path that I was on from user X (not sure I managed to get the point across 😅)
- User X was in /home/X
- su Y
- cd /tmp
- detach and try to upload, it goes to /home/X instead of /tmp
A possible workaround is to allow to pass a second argument to upload/download to put the destination path. wdyt?
great tool btw!
This is a known issue and it is related somehow to https://github.com/brightio/penelope/discussions/73.
The shell and the agent are independent processes and I need to find a way to maintain the current working directory and the user privileges once the user changes shell process.
A possible workaround is to allow to pass a second argument to upload/download to put the destination path. wdyt?
Yes that would be a temporary workaround until find a way to synchronize the path automatically. I will add it to the roadmap.
Thanks!
The best workaround so far is changing directory to /tmp or /var/tmp before switching users. Or getting a new shell from the new user would solve the issue as well.