Exiting the final session crashes intermediate session in named_pipe pivoted sessions

Open
#16,655 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby

Research direction

Reproduce the failure with the reverse_named_pipe payload by interacting with session 4 using sessions -i 4 and exiting after sysinfo. Compare the shutdown of the pivoted session with the intermediate session described in pull request #16653. Done means exiting the final session no longer closes the session it went through, while the final session still closes normally.

Written by the indexing model from the issue text.

Description

bug not-stale

While landing https://github.com/rapid7/metasploit-framework/pull/16653 I noticed that closing the pivoted session brings down the session that the pivoted session went through:

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

meterpreter > sysinfo
Computer        : WIN10X64-1703
OS              : Windows 10 (10.0 Build 15063).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x64/windows
meterpreter > exit
[*] Shutting down Meterpreter...

[*] 10.5.136.102 - Meterpreter session 4 closed.  Reason: User exit
msf6 payload(windows/x64/meterpreter/reverse_named_pipe) > [*] 10.5.132.101 - Meterpreter session 3 closed.  Reason: Died

Dominant language
Ruby
Stars
39k
Forks
15k
Avg merge
5d 6h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rapid7/metasploit-framework

All issues in rapid7/metasploit-framework

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.