rapid7/metasploit-framework — pull request #19 by d1n (2011-11-15 22:25:04+00:00)
Title: Meterpreter System Level API extension modification for spawning a Linux command shell.

This little patch adds Linux command shell functionality when using the 'shell' command from within the command dispatcher for Meterpreter as opposed to using the 'execute -f /bin/bash -c' followed by channel -i 'channel_id' to interact with a cmd shell.

If the client.platform condition is a windows based operating system it spawns a cmd.exe shell, however, if the client.condition is anything else it spawns a Linux command shell. I've tested the patch on Windows XP x86 and Windows 7 x64, including Linux x86 and x86_64.

It seems to work just fine.