Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new lmkdir command to be able to create directory on local machine from meterpreter #18386

Merged
merged 9 commits into from Oct 30, 2023

Conversation

e-lliot
Copy link
Contributor

@e-lliot e-lliot commented Sep 20, 2023

Added lmkdir command to create new directory on local machine.

  • Start msfconsole
  • use windows/x64/meterpreter/reverse_tcp
  • run
  • lmkdir test
  • Verify lmkdir successfully create a new directory on local machine
  • Verify if lmkdir fails it displays an error message
  • Document lmkdir creates a new directory on local machine while in meterpreter

Added lmkdir command to create new directory on local machine
…fs.rb

Co-authored-by: dwelch-r7 <Dean_Welch@rapid7.com>
@bwatters-r7
Copy link
Contributor

I don't see the implementation of

It'd be good to also have it loop over the list of args and create each directory to align with the existing command too

While that's not really a blocker- the choice of what is included in a PR is ultimately yours- it might be a good idea to say why.

@e-lliot
Copy link
Contributor Author

e-lliot commented Oct 4, 2023

Since I can't implement this feature maybe we can let this PR as is and let someone who want to implement it open another PR.

@bwatters-r7
Copy link
Contributor

@e-lliot, that's perfectly fine!

@bwatters-r7 bwatters-r7 self-assigned this Oct 5, 2023
…fs.rb


Sets the path variable via a loop so that it fixes the path assignment and lets the user give a series of directories

Co-authored-by: Brendan <bwatters@rapid7.com>
@e-lliot
Copy link
Contributor Author

e-lliot commented Oct 10, 2023

@bwatters-r7 it might be ready to merge (after testing of course).

Copy link
Contributor

@dwelch-r7 dwelch-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of formatting changes, not a blocker though

e-lliot and others added 4 commits October 13, 2023 12:15
…fs.rb


formatting

Co-authored-by: dwelch-r7 <Dean_Welch@rapid7.com>
…fs.rb


formatting

Co-authored-by: dwelch-r7 <Dean_Welch@rapid7.com>
…fs.rb


formatting

Co-authored-by: dwelch-r7 <Dean_Welch@rapid7.com>
…fs.rb


formatting

Co-authored-by: dwelch-r7 <Dean_Welch@rapid7.com>
@bwatters-r7
Copy link
Contributor

[*] Started reverse TCP handler on 10.5.135.201:4585 
[*] Sending stage (200774 bytes) to 10.5.132.167
[*] Meterpreter session 1 opened (10.5.135.201:4585 -> 10.5.132.167:49723) at 2023-10-30 14:21:58 -0500

msf6 payload(windows/x64/meterpreter/reverse_tcp) > sessions -i -1
[*] Starting interaction with 1...

meterpreter > sysinfo
Computer        : DESKTOP-D1E425Q
OS              : Windows 10 (10.0 Build 17134).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x64/windows
meterpreter > lmkdir
Usage: lmkdir </path/to/directory>
meterpreter > lmkdir test1 test2
Directory 'test1' created successfully.
Directory 'test2' created successfully.
meterpreter > 

@bwatters-r7 bwatters-r7 merged commit ac6aa53 into rapid7:master Oct 30, 2023
34 checks passed
@bwatters-r7 bwatters-r7 added the rn-enhancement release notes enhancement label Oct 30, 2023
@bwatters-r7
Copy link
Contributor

bwatters-r7 commented Oct 30, 2023

Release Notes

This PR adds the lmkdir command to Meterpreter, which creates a directory on the local host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants