AbstractAs the world becomes further and further connected, the risk of cyber-attacks increases. Cyber criminals are creating malware at a record rate previously unseen before. They are also creating more ingenious methods of code execution to help increase their criminal activities, both in size and sophistication. This paper will detail a new method of using the Windows command “DOSKEY” for code execution. It will also present methods of detecting and mitigating such attacks. DOSKEY is a DOS utility within Microsoft Windows which adds additional features to command line processors. It was introduced in the summer of 1991 and has been present in every variation of Windows since. Usage (Microsoft, 2017) doskey [/reinstall] [/listsize=<Size>] [/macros:[all | <ExeName>] [/history] [/insert | /overstrike] [/exename=<ExeName>] [/macrofile=<FileName>] [<MacroName>=[<Text>]] Parameter Description /reinstall Installs a new copy of DOSKEY.exe and clears the command history buffer. /listsize=<Size> Specifies the maximum number of commands in the history buffer. /macros Displays a list of all DOSKEY macros. You can use the redirection symbol (>) with /macros to redirect the list to a file. You can abbreviate /macros to /m. /macros:all Displays DOSKEY macros for all executables. /macros:<ExeName> Displays DOSKEY macros for the executable specified by ExeName. /history Displays all commands that are stored in memory. You can use the redirection symbol (>) with /history to redirect the list to a file. You can abbreviate /history as /h. [/insert /overstrike] /exename=<ExeName> Specifies the program (that is, executable) in which the doskey macro runs. /macrofile=<FileName> Specifies a file that contains the macros that you want to install. <MacroName>=[] Creates a macro that carries out the commands specified by Text. MacroName specifies the name you want to assign to the macro. Text specifies the commands you want to record. If Text is left blank, MacroName is cleared of any assigned commands. /? Displays help at the command prompt. The main use of DOSKEY was the creation of aliases (MACRO defintions). It was widely used by those who primarily worked on Linux systems but had difficulty adjusting to the limited commands of cmd.exe. However since the inception of powershell, its use and importance has decreased. The figure below shows one use. It demonstrates the assigning of “ls” to “dir”. |