From 256794389d57ec6dad5822233313dd635da1a46b Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 15 Mar 2020 11:57:20 +0100 Subject: [PATCH] Use latin-1 as encoding for iconv --- _gtfobins/iconv.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/_gtfobins/iconv.md b/_gtfobins/iconv.md index 9b83f7a..6bf2586 100644 --- a/_gtfobins/iconv.md +++ b/_gtfobins/iconv.md @@ -1,21 +1,20 @@ --- +description: The `8859_1` encoding is used as it accepts any single-byte sequence, thus it allows to read/write arbitrary files. Other encoding combinations may corrupt the result. functions: file-write: - - description: Write ASCII data to file. - code: | + - code: | LFILE=file_to_write - echo "DATA" | iconv -o "$LFILE" + echo "DATA" | iconv -f 8859_1 -t 8859_1 -o "$LFILE" file-read: - - description: Read data from file as UTF-8. - code: | + - code: | LFILE=file_to_read - iconv -f UTF8 "$LFILE" + iconv -f 8859_1 -t 8859_1 "$LFILE" suid: - code: | LFILE=file_to_read - ./iconv -f UTF8 "$LFILE" + ./iconv -f 8859_1 -t 8859_1 "$LFILE" sudo: - code: | LFILE=file_to_read - sudo iconv -f UTF8 "$LFILE" + ./iconv -f 8859_1 -t 8859_1 "$LFILE" ---