oopsie upgrading shell kills reverse shell

I’m attempting to upgrade the shell in on Oopsie, but Ctrl Z kills my NC session. Is there an alternate way to pass ctrl+z?

Hi, Ctrl+z should not kill your session, just suspend it until you want. Then you need to run command “stty raw -echo” and “fg” to enable again your shell, but fully interactive this time (ctrl+z, ctr+c, tab, etc will be caught in the remote shell).

Here you have explained what I think you’re trying to do: Upgrading Simple Shells to Fully Interactive TTYs - ropnop blog

To make this trick work, your previous session need to be from a python pty module. If you follow all the steps in the previous link (set env vars and terminal size) you’ll have a fully interactive remote terminal, but if you don’t do all the steps it’s possible that doesn’t work well or behaves strange.

Thank you for that explanation. I understand it was killing the session.

I am probalby wrong here but I just entered “ctrl+z” and sent it down the line with NC rather than actually pressing CTRL+Z.

Anyway it worked… I was able to root the box after doing this.

It would be good to know exactly what this did and why it was necessary though.

I am having the same problem,

If i press Ctrl + Z together it closed my connection.

If I type it, I get a Command not found. Whats the fix?

Type your comment> @DemiScuzz said:

I am having the same problem,

If i press Ctrl + Z together it closed my connection.

If I type it, I get a Command not found. Whats the fix?

Your connection doesn’t close exactly. Ctrl+z will suspend the reverse shell. The following stty command occurs on your terminal and ‘fg’ brings the reverse shell back to the foreground.

Got ya.
Cheers.