Bash

  • Missing ls or dir commands

    If you cannot run ls, dir, find nor grep to list files you can use

    echo *
    echo /any/path/*
  • restricted bash (rbash) - GitHub Gist

    rbash is a shell with restriction features. Misconfigured rbash can be bypassed.

    # List available commands
    compgen -c
    
    # Run bash without profiles (when rbash is initialized in .bashrc)
    bash --noprofile
    
    # Read files
    mapfile -t  < /etc/passwd
    printf "$s\n" "${anything[@]}"
  • shell from provided commands - Website

    Some commands/binaries allows to pop a shell. Use GTFOBins to find them. Here are the most common ones:

    CommandDescription
    less!/bin/sh
    vim:!/bin/sh