Skip to content

Commit 5294722

Browse files
OJBrent Cook
authored andcommitted
Prevent socket-like behaviours during migrate on pivoted sessions
1 parent dfba42e commit 5294722

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/rex/post/meterpreter/client_core.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def create_named_pipe_pivot(opts)
9595
}
9696
}
9797

98-
# Create the migrate stager
9998
stager = c.new()
10099

101100
stage_opts[:transport_config] = [stager.transport_config_reverse_named_pipe(stage_opts)]
@@ -651,7 +650,7 @@ def migrate(target_pid, writable_dir = nil, opts = {})
651650
# Sleep for 5 seconds to allow the full handoff, this prevents
652651
# the original process from stealing our loadlib requests
653652
::IO.select(nil, nil, nil, 5.0)
654-
else
653+
elsif client.pivot_session.nil?
655654
# Prevent new commands from being sent while we finish migrating
656655
client.comm_mutex.synchronize do
657656
# Disable the socket request monitor

0 commit comments

Comments
 (0)