Bind shells are programs that bind to a port and listen for connections and serves shells. Whenever a connection is received, it runs a shell, such as Bash, and passes off the standard input, output, and error handles to the remote connection. It can listen forever and serve shells to multiple incoming connections.
Bind shells are useful when you want to add persistent access to a machine. You can run the bind shell and then disconnect or inject the bind shell into memory through a remote code execution vulnerability.
The biggest problem with bind shells is that firewalls and the NAT routing can prevent direct remote access to the computer. Incoming connections are usually blocked or routed in a way that prevent connecting to the bind shell. For this reason, reverse bind shells are often used. The next section covers reverse bind shells.
When compiling this...