I was reading a write up and noticed a person using this command:
stty raw -echo ; fg

I have read the man page but am still a little confused as to what this command does 100%. I noticed when hitting ^z during a nc session and typing in this command that it gave me more functionality with the shell.

Can someone just explain to me what the command does entirely? What part of the command takes me back to my nc session?

Breaking the command down into two parts:

stty raw -echo

redirects all your input to the reverse shell. It takes in your “raw” input without your current shell being “in the way”; while


takes you back to the reverse shell.

I highly recommend watching this video though, since I don’t think I’m explaining it as well as he does - What Happens In a "Shell Upgrade"? - YouTube

Thanks for the info. I’ll have to give that video a watch. I just hate using commands that I have found in write ups but lack the understanding of how they fully work.