I used to have a cat who loved ice cream. I think I may have given her some as a kitten, and from then on, anytime that she saw someone eating ice cream she would do her best to try and steal some from them. And even if she didn’t really seem to enjoy a particular flavor, she still seemed driven to try and steal that person’s ice cream.
Like my cat stealing ice cream, bad guys are constantly trying to target organizations and their data for nefarious purposes. And compared to the numerous flavors of ice cream that my cat exfiltrated, there are a number of different flavors of data exfiltration.
And just recently, a new flavor of data exfiltration has been seen in the freezer aisle.
Mnemonic Labs recently released a very cool proof of concept blog showing how the TLS SNI extension can be used to exfiltrate data. This is very similar to data exfiltration using some of the other fancier flavors. Mnemonic’s work has shown that the SNI exfiltration method is successful in bypassing many security controls, which led me down a Splunk detection exercise.
Before diving in, here’s a bit of information around Mnemonic’s proof of concept code from their blog:
SNIcat comprises of two separate but interdependent components:
In order to see the SNI information, I’m using Zeek to capture wire data. I’m then ingesting the Zeek data into Splunk, and through the use of the Splunk Decrypt App I’m able to decode the Base32 encoded SNI data (SNICat is using Base32 encoding for its exfiltration).
Here’s a quick walkthrough of what I did and the Splunk searches involved. For more information on the Mnemonic code, please refer to their blog post above.
The following search picks up the various SNICat commands being passed in the SNI field being captured via Zeek’s SSL decoder, and then ingested into Splunk. I’ve included an image showing the events captured as the SNICat C2 server runs through its various functions.
index=main sourcetype="bro:ssl:json" | rex field=server_name "(?<snicat>(LIST|LS|SIZE|LD|CB|CD|EX|ALIVE|EXIT|WHERE|finito)-[A-Za-z0-9]{16}\.)" | stats count by snicat
index=main sourcetype="bro:ssl:json" | search server_name=* | rex field=server_name "(?P<base32_encoded_sni>^[A-Z2-7]+=*)" | eval b32len=len(base32_encoded_sni) | where b32len>10 | decrypt field=base32_encoded_sni b32() emit('base32_decoded_command') | table base32_decoded_command base32_encoded_sni
Here it is again, zoomed in for your viewing pleasure:
I will be adding the SNICat detection to Splunk’s Enterprise Security Content Update for use with Splunk Enterprise Security shortly, but for the time being, feel free to use the searches above.
Happy Splunking!
The world’s leading organizations rely on Splunk, a Cisco company, to continuously strengthen digital resilience with our unified security and observability platform, powered by industry-leading AI.
Our customers trust Splunk’s award-winning security and observability solutions to secure and improve the reliability of their complex digital environments, at any scale.