rapid7/metasploit-framework — pull request #4157 by zeroSteiner (2014-11-09 02:07:10+00:00)
Title: Add getsid to the python meterpreter

This implements ```stdapi_sys_config_getsid``` in the Python Meterpreter. It also changes the implementation of ```stdapi_sys_config_getuid``` to more closely replicate what the Windows meterpreter does. Most notably the domain is now present in the returned value.

Tested on:
- Windows XP SP3 x86 2.7
- Windows 7 SP1 x86 2.7
- Windows 7 SP1 x64 2.7
- Windows 7 SP1 x64 3.4

This PR requires #4150 to be landed first

- [ ] Test the new implementation of getuid on Windows
- [ ] Test the new getsid command on Windows
- [ ] Verify getuid still works on non-Windows systems

Example output:
```
[*] [2014.11.08-21:06:54] Sending stage (18528 bytes) to 192.168.90.178
[*] Meterpreter session 21 opened (192.168.90.1:4444 -> 192.168.90.178:1034) at 2014-11-08 21:06:54 -0500

msf-git (S:2 J:1) payload(reverse_tcp) > sessions -i -1
[*] Starting interaction with 21...

meterpreter > getuid
Server username: NOOB-07797B4D0D\Administrator
meterpreter > getsid
Server SID: S-1-5-21-1801674531-1004336348-1417001333-500
meterpreter > sysinfo
Computer : noob-07797b4d0d
OS : Windows XP 5.1.2600
Architecture : x86
Meterpreter : python/python
meterpreter >
```