Identifier / Programs / Linux and Unix
dosbox
MS-DOS emulator to run legacy DOS applications and games. tldr-pages
GTFOBins file-read, file-write 3 documented commands
How dosbox is abused
file-read
file-write
Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for dosbox.
3 documented commands
file-read unprivileged, with sudo, as SUID
The file content will be displayed in the DOSBox graphical window.
dosbox -c 'mount c /' -c 'type c:\path\to\input'Identifyfile-read unprivileged, with sudo, as SUID
The file is copied to a readable location.
dosbox -c 'mount c /' -c 'copy c:\path\to\input c:\path\to\output' -c exit
cat /path/to/OUTPUTIdentifyfile-write unprivileged, with sudo, as SUID
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.
dosbox -c 'mount c /' -c "echo DATA >c:\path\to\output" -c exitIdentifyNone of the 3 commands the identifier reads trips a Sigma process-creation rule. These commands are, with GTFOBins’ notes, from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for dosbox. The identifier reads the line of each that runs dosbox.
Everyday use
Start DOSBox with default settings
dosboxIdentifyRun a DOS executable located at a specific path
dosbox path/to/executable.exeIdentifyMount a folder as C: and run an executable
dosbox path/to/executable.exe -c "MOUNT C path/to/folder"IdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.