Most of the times very similar to upgrade interactive shell.
Usually just need to try python way of upgrading: python3 -c 'import pty; pty.spawn("/bin/bash")'
Check what is on PATH, echo $PATH. If the path is in your current folder, just ls foldername (no need to use /). Check GTFObin and see if you can shell with any of the file inside.
If not refer to this page: https://null-byte.wonderhowto.com/how-to/escape-restricted-shell-environments-linux-0341685/