Escape

Homebrew shells

List for *nixarrow-up-right (Toolarrow-up-right) List for windowsarrow-up-right

If the challenge is a homemade shell with some artificial limitations, gtfobins and LOLBAS list myriad ways to escape. These aren't vulnerabilities, per se, but intended functionality of applications that are commonly installed.

Bash

Good ideasarrow-up-right List of parameter expansionsarrow-up-right

Forbidden strings

${NOSUCHVAR:-fla}${NOSUCHVAR:-g.txt}    # expands to flag.txt

Stars aren't the only wildcard

fla?.txt
fl{a,A}g.txt
fl[a-z]g.txt

Docker

Electron

Tell me morearrow-up-right

view-source:arrow-up-right isn't necessarily blocked like file:// is.

Perhaps the app even uses its own custom URI schemearrow-up-right?

git

git-shellarrow-up-right tries to be restrictive server-side, but might not be.

Javascript

Sandboxesarrow-up-right

Python

Tell me morearrow-up-right

Python has so many ways to introspect, reflect, reload, import, execute unintended code.

Here's a pretty simple one:

Forbidden strings

If there's some sort of word blocklist, try unicode:

Python runs it just fine.

Pickle

Sourcearrow-up-right

Any callable in the target's namespace can be called with (almost) arbitrary parameters by pickling a class which implements __reduce__. Return the callable and a tuple of arguments. See above for a technique to chain as well.

Last updated