rapid7/metasploit-framework — pull request #3129 by todb-r7 (2014-03-20 17:23:41+00:00)
Title: Fix 2782 with 2961 and stop stack-tracing download_exec

In #2782, @Meatballs1 feared that this change would disrupt Linux shell sessions, and gave the example of breaking download_exec for Linux shells.

As far as I can tell, this is the /only/ example of breakage, so this PR fixes that by:

* Including #2961. Note, there don't seem to be any holdups over there.
* Updating download_exec for #2961's `get_env` command

Now, keep in mind that download_exec already seems kinda broken -- that's what https://dev.metasploit.com/redmine/issues/8777 is all about. I am unable to use it normally on an Ubuntu 10.04 target, due to a mismatch on the shell command tokens. See that bug for details.

So, verification is easy, and lifted from @Meatballs1's report on #2782:

## Verification

- [ ] Run the below on a SSH / Telnet shell session

````
use post/linux/manage/download_exec
set VERBOSE true
set SESSION 1
set URL http://google.com
run
````

- [ ] See the lack of exceptions.
- [ ] Landing this will also land #2961, so make sure that happens.

If there is more brokennes introduced by #2782 that I'm not detecting, then feel free to pile on this PR, however, a grep through with the below turned up no other cases of linux shells getting left out in the cold: ` grep -r "session.sys.config.getenv" modules/post/ `