rapid7/metasploit-framework — pull request #3393 by zeroSteiner (2014-05-25 20:35:34+00:00)
Title: Add variables for meterpreter irb

This adds the ```session``` and ```framework``` variables for use in the meterpreter IRB interface. Post modules are supposed to reference the session object through the ```session``` variables but it's defined in IRB as ```client```. With this change it is easier to test snippets of code by copying and pasting without the need to set session to client.

Before patch:
```
msf4-git (S:0 J:0) exploit(handler) > exploit

[*] Started reverse handler on 192.168.90.1:4444
[*] Starting the payload handler...
[*] Sending stage (17349 bytes) to 192.168.90.178
[*] Meterpreter session 1 opened (192.168.90.1:4444 -> 192.168.90.178:1043) at 2014-05-25 16:31:53 -0400

meterpreter > irb
[*] Starting IRB shell
[*] The 'client' variable holds the meterpreter client

>> client
=> #
>> session
NameError: undefined local variable or method `session' for #
```

After patch:
```
msf4-git (S:0 J:0) exploit(handler) > exploit

[*] Started reverse handler on 192.168.90.1:4444
[*] Starting the payload handler...
[*] Sending stage (17349 bytes) to 192.168.90.178
[*] Meterpreter session 1 opened (192.168.90.1:4444 -> 192.168.90.178:1042) at 2014-05-25 16:27:34 -0400

meterpreter > irb
[*] Starting IRB shell
[*] The 'client' variable holds the meterpreter client

>> client
=> #
>> session
=> #
>> framework
=> #
>>
```

Testing
- [ ] Get a new meterpreter session
- [ ] From the IRB shell check that the new session and framework variables are available