rapid7 / meterpreter

THIS REPO IS OBSOLETE. USE https://github.com/rapid7/metasploit-payloads INSTEAD
Other
326 stars 144 forks source link

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

Open bcook-r7 opened 9 years ago

bcook-r7 commented 9 years ago

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.

Meatballs1 commented 9 years ago

Yes have noticed this, normally works second time around!