The Metasploit Project hosts the world's largest database of quality assured exploits, including hundreds of remote exploits, auxiliary modules, and payloads. You can even review the Metasploit Framework source code of any module - or write your own.
Search for modules
Module Browser
BSDi Command Shell, Bind TCP Stager
Listen for a connection, Spawn a command shell (staged)