rapid7/metasploit-framework — pull request #2310 by zeroSteiner (2013-08-30 19:41:18+00:00)
Title: Fix three minor issues in the Python Meterpreter

This fixes three issues in the Python Meterpreter:

* Work around the second 'b' being appended when files are opened in binary mode on Windows (this was pointed out by @Meatballs1 and seems to be an issue originating from https://github.com/rapid7/metasploit-framework/blob/master/lib/rex/post/meterpreter/channels/pools/file.rb#L44)
* Set the socket timeout to the more reasonable value of 3.0 seconds to avoid meterpreter timing out
* Call os.setsid() when it's available, presumably on Unix/Linux systems to start a new session