Solution 06: Caret Insertion
Overview
The caret ^ is cmd.exe’s escape character. It is stripped during command parsing but remains in the raw command line string that the EDR reads.
Solution
:: Single caret insertion
cmd.exe /c who^ami
:: Multiple carets
cmd.exe /c w^h^o^a^m^i
:: Applied to other commands
cmd.exe /c net^ user
cmd.exe /c net^ ^user /domain
cmd.exe /c n^e^t u^s^e^r
Why It Works
- The EDR reads the command line from the PEB:
cmd.exe /c who^ami - It searches for
"whoami"in the command line - The string
"who^ami"does not contain the substring"whoami" - No match - no detection!
- Meanwhile, cmd.exe strips the carets and executes
whoaminormally
Alternative Approaches
:: Double quotes (empty strings)
cmd.exe /c who""ami
:: Using cmd variable substitution
cmd.exe /c set x=whoami && call %x%
MostShittyEDR