rbash shell escape
https://fireshellsecurity.team/restricted-linux-shell-escaping-techniques/
rbash shell esacping
Run env to see exported environment variables
Run ‘export -p’ to see the exported variables in the shell. This would tell which variables are read-only. Most likely the PATH ($PATH) and SHELL ($SHELL) variables are ‘-rx’, which means we can execute them, but not write to them. If they are writeable, we would be able to escape the restricted shell!
If the SHELL variable is writeable, you can simply set it to your shell of choice (i.e. sh, bash, ksh, etc…).
If the PATH is writeable, then you’ll be able to set it to any directory you want. I recommend setting it to one that has commands vulnerable to shell escapes.
Try basic Unix commands and see what’s allowed ls, pwd, cd, env, set, export, vi, cp, mv etc.Last updated