rapid7/meterpreter

getting the output of an executed command that exits right away via a channel is inconsistent

bcook-r7 opened this issue · 1 comments

With Windows meterpreter, this command should show output like so:

meterpreter > execute -i -H -f cmd -a "/c hostname"
Process 3412 created.
Channel 22 created.
windows-8-vm
meterpreter >

But usually, it seems the channel closes before the output appears, probably due to the channel closing and the channel data not being processed in the same order every time. You're more likely to just see this:

meterpreter > execute -i -H -f cmd -a "/c hostname"
Process 1360 created.
Channel 24 created.
meterpreter >

Running a 'slower' command like ping works reasonably well, somewhat reaffirming this is a race.

Yes have noticed this, normally works second time around!