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

Align Meterpreter sessions command with msfconsole sessions command #18811

Closed
adfoster-r7 opened this issue Feb 9, 2024 · 5 comments · Fixed by #18885
Closed

Align Meterpreter sessions command with msfconsole sessions command #18811

adfoster-r7 opened this issue Feb 9, 2024 · 5 comments · Fixed by #18885
Labels
suggestion-feature New feature suggestions

Comments

@adfoster-r7
Copy link
Contributor

Summary

Meterpreter offers a sessions command that does not support the -i flag, causing sessions -i -1 to not work. We should align these commands to work in the same way.

Motivation

Consistency

@adfoster-r7 adfoster-r7 added the suggestion-feature New feature suggestions label Feb 9, 2024
@errorxyz
Copy link
Contributor

errorxyz commented Feb 9, 2024

This issue also applies to command shells

msf6 exploit(multi/handler) > sessions 

Active sessions
===============

  Id  Name  Type                   Information            Connection
  --  ----  ----                   -----------            ----------
  1         meterpreter x64/linux  errorxyz @ linome.xyz  127.0.0.1:4444 -> 127.0.0.1:55900 (127.0.0.1)
  2         shell x64/linux                               127.0.0.1:4444 -> 127.0.0.1:45406 (127.0.0.1)

msf6 exploit(multi/handler) > sessions -i 2
[*] Starting interaction with 2...

sessions

[*] Wrong number of arguments expected: 1, received: 0
Usage: sessions <id>

Interact with a different session Id.
This command only accepts one positive numeric argument.
This works the same as calling this from the MSF shell: sessions -i <session id>


Another place I found this string link
Do we only need the -i option or other options such as kill, list, etc?

@adfoster-r7
Copy link
Contributor Author

Thanks for taking a look 👍

I think the only thing is the sessions command for now

@errorxyz
Copy link
Contributor

errorxyz commented Feb 9, 2024

I don't think you understood my question correctly, I've asked if we also need the kill, list, etc options under the sessions command other that the interact option

@adfoster-r7
Copy link
Contributor Author

adfoster-r7 commented Feb 9, 2024

I'd be happy with just sessions -i -1 working; but if there's a way to keep the have all the same functionality consistent without copy/pasting that would be great too

@errorxyz
Copy link
Contributor

Hi I haven't forgotten about this, I'm a bit busy this week, I'll send a fix for this next week if that's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion-feature New feature suggestions
Projects
None yet
2 participants