Escape

Homebrew shells

List for *nix (Tool) List for windows

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 ideas List of parameter expansions

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

  • deepce, a vulnerability scanner.

  • grype, a vulnerability scanner.

  • WhaleScan, scans windows containers.

Electron

Tell me more

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

Perhaps the app even uses its own custom URI scheme?

git

git-shell tries to be restrictive server-side, but might not be.

Javascript

Sandboxes

Python

Tell me more

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

Source

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