rapid7/metasploit-framework — pull request #730 by sempervictus (2012-08-26 08:09:40+00:00)
Title: Get a TTY from a *nix shell session

This module gets a TTY for *nix shell sessions which can in turn
be used to feed credentials to sudo and other processes requiring
a TTY. Initially a python tty.spawn is attempted as this leaves
no trace on disk and should be far more widely deployed than
expect. The second method writes an expect script to disk with
instructions to delete itself on execution and spawns a TTY shell.

See http://pentestmonkey.net/blog/post-exploitation-without-a-tty.