<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[security analytics - Medium]]></title>
        <description><![CDATA[all things related to security and analytics, including my own work and the latest in threat detections - Medium]]></description>
        <link>https://medium.com/security-analytics?source=rss----3a6451fe38b6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>security analytics - Medium</title>
            <link>https://medium.com/security-analytics?source=rss----3a6451fe38b6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:54:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/security-analytics" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cyber Analytics Use Case: Streaming Beacon Detection with Spark]]></title>
            <link>https://medium.com/security-analytics/cyber-analytics-use-case-streaming-beacon-detection-with-spark-199435a45ac8?source=rss----3a6451fe38b6---4</link>
            <guid isPermaLink="false">https://medium.com/p/199435a45ac8</guid>
            <category><![CDATA[cyber]]></category>
            <category><![CDATA[spark-streaming]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Jonathan Ticknor]]></dc:creator>
            <pubDate>Thu, 01 Apr 2021 13:19:22 GMT</pubDate>
            <atom:updated>2021-04-01T13:16:26.226Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GQkmlGDH8-KALtr693gXLw.jpeg" /></figure><p>I hope to convey two messages with this post: 1) A use case for cyber analytics that isn’t DGA or phishing, and 2) A few tricks that you can use with Spark’s Structured Streaming to enhance your analytic performance. I chose beaconing because it’s an easy concept to understand and the intuition to build the analytic can be misleading if you don’t understand how the data is generated or what artifacts may be present. It’s become clear over the course of my career that data scientists without sufficient domain expertise are often leaving quite a bit on the table. I’m going to cover the basics of why you would use Spark Streaming and what behavior I’m trying to detect with this analytic. If you want to get straight to the code and use case, go ahead and jump to Section 2.</p><h3><strong>Section 1: Spark Streaming and Beacon Basics</strong></h3><h4><em>Spark Streaming</em></h4><p>For any of those who have worked in the field of big data or data science, Spark has been a critical component of your workflow at some point in your career. Although many use cases utilize the batch processing capabilities of Spark, it’s the streaming components that can provide immense value for any cyber security data workflow. Spark offers two capabilities for those interested in stream processing: 1) Spark Streaming (DStreams) and 2) Structured Streaming. For those familiar with the traditional RDD batch processing capability, Spark Streaming is simply an extension of this methodology. Internally, the stream of data is represented as a sequence of RDDs and is processed as such. In order to aggregate data for processing across multiple time frames, Spark Streaming offers window functions which effectively combines the RDDs within the desired time window for processing all at once.</p><p>This framework is incredibly powerful, but what if I have a use case with a very large time window (or unknown)? And what if I’m processing really large volumes of log data, like in an enterprise security use case? The answer is that you better bring a lot of servers to the party. There is another way to do this though, and it utilizes the Spark SQL engine; it’s called Structured Streaming. The input data stream is effectively an unbounded table which appends new data upon arrival. That data is then processed and generates a results table which can be written to console, pushed to another source, etc. The power of Structured Streaming is the fact that it processes the newly received data to update the results table incrementally and discards the source data. We can leverage this capability in some neat ways to help keep the memory, and compute, requirements down compared to standard Spark Streaming, thus saving us money and time in processing logs. In Section 2 I will highlight the areas where we can get the most bang for our buck in this use case.</p><h4>Beaconing</h4><p>Any team that is trying to build security analytics has most likely tried to build a beacon detector to find command and control communication. Lazy malware authors, or those that don’t care/think they will get caught, will often program a beacon to their infrastructure from the compromised host in some periodic fashion (e.g. every 5 minutes look for new command). This task gets more complicated when the author cares about staying hidden (there are ways to do this, but that’s for another post). If we consider some kind of network log (NetFlow, Firewall, Proxy, etc.) as the data source, we should look at the frequency of connections between an internal IP address and an external IP address. We can make this more complicated and add in ports, protocols, amount of data, etc. but let’s keep it simple for now. What we want to see is some repetitive nature between two hosts. Any beacon detector will find hundreds to thousands of benign software beacons in an enterprise network, so we will ultimately need to create smart filters for a production deployment. Now that we know what a beacon is and how we can utilize Spark for stream processing, let’s build a simple streaming beacon detector to find communications in real time.</p><h3>Section 2: Building a Beacon Detector</h3><p>The first step in building a beacon detector is to decide what technique we are going to use. For this simple example, I’m going to use an entropy calculation, specifically a normalized entropy which returns a value between 0 and 1 (where a value of 0 indicates no entropy). Ultimately I will subtract that value from one so that connections with a score of one would indicate a perfectly periodic connection. The data that will be fed into the entropy calculation are time values between discrete communications of hosts in the log data. Now that I know what technique and data I’m going to use, let’s get into some code (find the full code <a href="https://gist.github.com/jonticknor/dc8bbfe1420d052265ed652842d52529">here</a>).</p><p>Let’s go ahead and do our standard imports for Spark Structured Streaming as well as some of the specific functions we are going to need. The udf capability will be very important because that’s where we will write our analytic and apply it to the data table. Would this really be an analytic without importing numpy?</p><pre>from pyspark.sql import SparkSession<br>from pyspark.sql.functions import collect_list<br>from pyspark.sql.functions import split<br>from pyspark.sql.functions import udf<br>from pyspark.sql.types import FloatType</pre><pre>import numpy as np</pre><p>Now I need to define a few parameters that will be relevant to the periodicity detection algorithm.</p><pre># Padding allows for consideration of log time stamp issues,<br># network delay, etc.<br>padding = 1.0</pre><pre># Minimum data points to consider activity periodic<br>min_dp = 5</pre><pre># Minimum score to be deemed periodic<br>p_criteria = 0.9</pre><p>The first parameter is absolutely critical for the development of a useful beacon detector across data types. The padding allows us to smooth out some of the noise in our interstitial time values for a few reasons: 1) issues with log time stamp reporting (e.g. rounding), 2) some network delay which causes a small perturbation, or 3) other unknown noise producers. In my experience, leaving this value at 1, which means the analytic uses the timestamps as is, leads to a loss in result fidelity. It is quite rare that you create a bucket which makes something look periodic which is not. The min_dp parameter lets me decide how many data points I want to consider before I call something periodic. The value of 5 is more of a rule of thumb I have noticed, but the larger the value, the more certain we can be. Finally, p_criteria is an adjustable parameter to provide a cutoff for those results worthy of investigation. Depending on the size of the network, this parameter can be moved up and down to support triage capabilities (higher value means more strict, less results).</p><p>Now the fun part, the periodicity algorithm itself. This analytic is rather simple, but let’s take a look at some key pieces.</p><pre># Periodicity detection<br>def periodicity(df):<br>  if len(df) &lt;= min_dp:<br>    return 0.0<br>  time_df = sorted([int(val) for val in df])<br>  time_diff = [round((time_df[i] - time_df[i-1]) / padding) *      padding for i in range(1,len(time_df))]<br>  values, counts = np.unique(time_diff, return_counts=True)<br>  probs = counts/len(time_diff)<br>  en = sum([-prob * np.log(prob) for prob in probs]) /  np.log(len(time_diff)) <br>  entropy = 1.0 - en <br>  return float(entropy)</pre><p>First I want to filter out connections that don’t meet our data threshold criteria and then sort the timestamps. Next, using the padding value I created above, I want to create an array of the interstitial times from the original timestamps in the logs. Next, I use the numpy <em>unique</em> function to gather the counts of each interstitial time we have, e.g. [2, 2, 2, 4] -&gt; [(2,3), (4,1)]. Next I apply the entropy function and divide by the length of the array to get the normalized entropy value. Finally, I subtract that value from one to get the final periodicity score, where those connections with a value closer to one are more periodic.</p><p>The next function will be used to filter the data before I run it through the periodicity detector. The filter value used here could be modified for your application, but my experience is that 25 connections is more than sufficient to make a determination on periodicity.</p><pre># Only retain last 25 timestamps<br>def filter_tstamp(df):<br>  if len(df) &gt; 25:<br>    return df[-25:]<br>  else:<br>    return df</pre><p>This udf function is incredibly important because it allows me to reduce the amount of data I am carrying over time, allowing me to prevent memory issues and reduce the complexity of the calculation. For example, some hosts communicate multiple times per second, which makes the array enormous and bogs down computation. The ability to use this udf to control the size of the results table provides a huge win compared to DStreams, one that I saw very quickly in testing and production deployments.</p><p>Next, I set up some basic udf functions to call later on the table of raw data.</p><pre>tstamp_udf = udf(filter_tstamp)<br>periodic_udf = udf(periodicity, FloatType())</pre><p>Next I put in some boiler plate code to create the SparkSession and give my app a name. That is followed by the method in which I am retrieving the data, in this case from a socket connection on the localhost, port 9999.</p><pre>spark = SparkSession \<br> .builder \<br> .appName(&quot;StructuredPeriodicity&quot;) \<br> .getOrCreate()</pre><pre>lines = spark \<br> .readStream \<br> .format(&quot;socket&quot;) \<br> .option(&quot;host&quot;, &quot;localhost&quot;) \<br> .option(&quot;port&quot;, 9999) \<br> .load()</pre><p>Next I need to take the raw data feed, in this case the fake log I am generating, and split it into its component parts. The data I am feeding in is comma separated (i.e. source_ip, destination_ip, timestamp).</p><pre># Split the line into values<br>split_col = split(lines.value, &quot;,&quot;)</pre><p>Now it’s time to create the table. Using the spark <em>split_col</em> function, I create new columns in the table and give them useful names (e.g. destination_ip). Finally, I drop the value column, which is simply the raw log itself. You could keep this value, but since I want to do aggregations and I already retained all of the component parts, it makes sense to discard the field.</p><pre>n_log = lines.withColumn(&quot;source_ip&quot;, split_col.getItem(0)) \<br> .withColumn(&quot;destination_ip&quot;, split_col.getItem(1)) \<br> .withColumn(&quot;timestamp&quot;, split_col.getItem(2)) \<br> .drop(&quot;value&quot;)</pre><p>Here is where all the work is really being done. Now that I have a nice table of new raw data, it’s time to do something useful with it. The first step is a simple <em>groupBy</em> command to create a (source_ip, destination_ip) tuple and aggregate all of the corresponding timestamps. Next, I want to apply the udf I created earlier which filters out anything other than the last 25 data points. Finally, I apply my periodicity analytic via <em>periodic_udf</em> and I have scores for each of the unique connections in the environment. I have avoided many of the filtering steps you would likely apply in a real environment (e.g. eliminate internal-internal connections, ignore well known sites, filter out specific ports, etc.).</p><pre># Generate arrays of interstitial times<br>p_log = n_log.groupBy(&quot;source_ip&quot;,&quot;destination_ip&quot;) \<br> .agg(collect_list(&quot;timestamp&quot;).alias(&quot;timestamp&quot;)) \<br> .select(&quot;source_ip&quot;, &quot;destination_ip&quot;, &quot;timestamp&quot;, tstamp_udf(&quot;timestamp&quot;).alias(&quot;timestamp_new&quot;)) \<br> .select(&quot;source_ip&quot;, &quot;destination_ip&quot;, &quot;timestamp&quot;, periodic_udf(&quot;timestamp_new&quot;).alias(&quot;entropy&quot;))</pre><pre># Filter results<br># p_log = p_log.select(&quot;source_ip&quot;, &quot;destination_ip&quot;, &quot;timestamp&quot;, &quot;entropy&quot;).where(&quot;entropy &gt; 0.9&quot;)</pre><p>Finally, let’s run this thing. For this use case I have chosen the <em>complete</em> output mode, which means that the entire results table will be written to console. In a real deployment you may only want to send new alerts to a data sink, which helps reduce output data volume/redundancy. I haven’t included the <em>p_criteria</em> filter for this example because I’m generating fake data and want to see my full results.</p><pre># Start running the query<br>query = p_log \<br> .writeStream \<br> .outputMode(&quot;complete&quot;) \<br> .format(&quot;console&quot;) \<br> .start()</pre><pre>query.awaitTermination()</pre><p>And there you have it, a simple 77 line program to detect periodicity in comma separated log data. Of course this program gets more complicated if we are connecting to Kafka or raw syslog and need to send the data to any number of possible sinks. But this simple algorithm has proven time and again to detect malicious beacons in both small and large networks, in a streaming fashion, with a limited computational overhead. There are other more complex ways to think about beacons that are beyond the scope of this article, but this should help you get started down the road to thinking about how you would solve this problem and deploy a solution.</p><p>Gist: <a href="https://gist.github.com/jonticknor/dc8bbfe1420d052265ed652842d52529">https://gist.github.com/jonticknor/dc8bbfe1420d052265ed652842d52529</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=199435a45ac8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-analytics/cyber-analytics-use-case-streaming-beacon-detection-with-spark-199435a45ac8">Cyber Analytics Use Case: Streaming Beacon Detection with Spark</a> was originally published in <a href="https://medium.com/security-analytics">security analytics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ElasticPhish: Using CertStream and the Elastic Stack for Phishing Intelligence]]></title>
            <link>https://medium.com/security-analytics/elasticphish-using-certstream-and-the-elastic-stack-for-phishing-intelligence-b03b86ad5cfe?source=rss----3a6451fe38b6---4</link>
            <guid isPermaLink="false">https://medium.com/p/b03b86ad5cfe</guid>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[kibana]]></category>
            <dc:creator><![CDATA[Jonathan Ticknor]]></dc:creator>
            <pubDate>Wed, 29 Jul 2020 13:25:20 GMT</pubDate>
            <atom:updated>2019-04-30T19:54:58.878Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous post, <a href="https://medium.com/security-analytics/a-phishing-guide-lessons-learned-on-the-journey-to-detecting-phishing-domains-816ec21e5f7a"><em>A Phishing Guide: Lessons Learned on the Journey to Detecting Phishing Domains</em></a><em>, </em>I laid out my experience building phishing detection algorithms and the associated challenges. In this post, I want to dig deeper into a specific use case where open source technology can be a force multiplier for any security team. I provide all the requisite information to get started on <a href="https://github.com/jonticknor/ElasticPhish">GitHub</a> if you want to get straight to it, but I will take a deeper dive here to explain the project and the impetus for it.</p><p>As we all know, security breaches are becoming all too common from political parties to major health insurers and large technology companies. Industry research suggests that somewhere around 90% of breaches begin with some form of phishing. As I noted in my previous article, phishing encompasses a very broad set of tactics, techniques, and procedures (TTPs). This creates a need for a broad set of solutions to protect the enterprise in an environment that is increasingly less centralized with the explosion of cloud, IoT, and personal devices. Any single point solution, whether it be email or web gateway, will only see a snapshot of the attack surface. And any one organization will only see the attacks which have been directed at them, whether purposeful or opportunistic.</p><p>So how do organizations protect themselves when no single product will detect or block every attack? I am arguing for a crowd sourced effort at threat intelligence sharing and detection. You may say, “but there are already platforms for intelligence sharing” and you would be correct. I’m arguing for something a little more nuanced: the commoditization of data sources and detection capabilities. We have reached a stage where dozens of vendors are building redundant detection capabilities and differentiation is incredibly difficult. What if those detection algorithms were not only used to share findings (URL, MD5, malicious IP, etc.), but were in a shared repository where they could be run over data in every organization? Not only would this allow us to keep the best of breed and make that available to any security team, intelligence sharing would also benefit as equal capability could mean equal visibility, agnostic to vendor. This may be a dream, but I don’t see the benefit of having smart security experts building tools in silos rather than collaborating and growing the discipline faster.</p><p>Let’s now get to the point of this article: how might we take open source technology and improve our threat intelligence feed. I have laid out a simple proof of concept solution that can jump start any security team and hopefully spark creativity to build on it. Here is a breakdown of the ElasticPhish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3FV5JKH51bKTOnNAA3csdg.png" /><figcaption>ElasticPhish Architecture: CertStream, Python, Elastic (Elastic logos are trademarks of Elasticsearch BV)</figcaption></figure><h3>Data Feed</h3><p>The first step in building any threat intelligence pipeline is the data feed. For the specific application of phishing domain detection, I have chosen CertStream. <a href="https://certstream.calidog.io/">Certstream</a> is a tool that provides real-time updates of the Certificate Transparency Log network. Through simple APIs, you can interact with certificates as they are being issued. CertStream monitors a number of Certificate Authorities and I would recommend reading the documentation to better understand the capability and how to use it. We will be using the Python API for this use case.</p><p>One important note: There is a url for a CertStream server hosted by CaliDog included in most examples. I would recommend using this ONLY for testing purposes to make sure your code runs properly. Once you plan to deploy for real detection, your best option is running your own CertStream server. It is quite simple and provides a more robust data pipeline for real-time intelligence feeds.</p><h3>Analytic</h3><p>The simplicity of the CertStream API allows for robust analytic capabilities to consume live certificate data and provide real-time intelligence feeds. In this proof of concept, I have included a simple heuristic model that has proven to be a rather effective solution for surfacing phishing domains (detects ~1000 new domains per day). The analytic scores domains based on the presence of several factors including well known keywords, brand spoofing, and tld usage. The brands and keywords found in the <em>scoring.yml</em> file were derived from large scale analysis of open source intelligence feeds like PhishTank, OpenPhish, VirusTotal, and Twitter. I developed a script (not included) that ingests each of these data sources and extracts words and brand names.</p><p>In order to reduce false positives in obvious situations, the <a href="http://s3-us-west-1.amazonaws.com/umbrella-static/index.html">Umbrella 1M</a> list is used to filter domains before they are scored. If you use this tool, or some incarnation, in production I would recommend also using a WHOIS filter to further reduce false positives as well as add valuable data enrichment. However, these services are quite expensive and numerous so I have not built one into this prototype.</p><p>It’s important to note that the analytic writes the data to a file for consumption by Filebeat to highlight the breadth of the Elastic stack. This output could be modified to support a host file format similar to hpHosts or piped directly to a Proxy/NGFW/DNS for real time blocking. Your imagination is the limit.</p><h3>Elastic Stack</h3><p>To store and visualize the results of the analytic, I have chosen the <a href="https://www.elastic.co/">Elastic</a> stack (Beats, Logstash, Elasticsearch, Kibana). I have chosen Elastic for a number of reasons, but most importantly because of the ease of setup and built in visualization capabilities via Kibana. Although it’s a bit of overkill, I have chosen to use Filebeat and Logstash in this application to showcase all aspects of the technology. I could have easily enriched the data in Python and used the Elasticsearch API for direct data loading, but the focus of this project is on available capabilities to enhance workflow.</p><p>As the domains are processed by the analytic, those exceeding the specified threshold are logged to a file. Filebeat reads from this file and ships the data directly to Logstash through the Beats connector. Logstash is tasked with enriching the data by performing an <em>nslookup</em> and then using the MaxMind functionality available in Logstash to gather geolocation information about the IP. This information not only helps visualize where the domains are being hosted but also allows aggregations to be performed to discover enclaves where large scale phishing operations may be taking place.</p><p>The enriched data is then shipped into Elasticsearch where it is indexed and available for search in near real-time. Kibana is used to not only perform the searches but also to build dashboards for real-time situational awareness around emerging phishing threats.</p><h3>Conclusion</h3><p>My goal with this project was to show how two really cool open source technologies, CertStream and Elastic, can be used to enhance any security operations team today. This simple approach can help you block phishing campaigns before they are ever deployed. But as I said in the introduction, there is no one size fits all solution. This project is really my call to the community to open the doors and begin sharing detection algorithms to protect the entire community. We’ve all worked on the same problems, but in silos. Detection capabilities are no longer a differentiator, so we must work together to commoditize them. Malicious URL detection using Certificate Transparency Logs may be a great place to start. Leave me a response or a note with ideas you may have. Thanks for reading, and I look forward to your ideas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b03b86ad5cfe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-analytics/elasticphish-using-certstream-and-the-elastic-stack-for-phishing-intelligence-b03b86ad5cfe">ElasticPhish: Using CertStream and the Elastic Stack for Phishing Intelligence</a> was originally published in <a href="https://medium.com/security-analytics">security analytics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantifying the MITRE ATT&CK Round 2 Evaluation]]></title>
            <link>https://medium.com/security-analytics/quantifying-the-mitre-att-ck-round-2-evaluation-fa9c39765a26?source=rss----3a6451fe38b6---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa9c39765a26</guid>
            <category><![CDATA[endpoint-protection]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <dc:creator><![CDATA[Jonathan Ticknor]]></dc:creator>
            <pubDate>Wed, 29 Jul 2020 13:25:05 GMT</pubDate>
            <atom:updated>2020-04-23T20:35:55.307Z</atom:updated>
            <content:encoded><![CDATA[<p>MITRE released the results for Round 2 of their EDR evaluation scenario, this time emulating APT29. As you might have seen, nearly every vendor associated with the evaluation has issued a press release pronouncing their clear effectiveness and decisive victory over the competition. I want to avoid the marketing fluff and jump right into the data. What follows is an explanation of how I quantified the results, with layers of nuance that I hope will help customers find the right fit for their situation. Rather than provide a one-size fits all scoring methodology, I broke down results with clear lines of separation between human derived detection and machine only. If you’re trying to better understand the market or looking to make a choice for a new EPP tool, what follows should be especially relevant to you. I’ve provided the Github link to code and scoring files at the bottom. As always, I appreciate feedback that can help improve the methodology.</p><p>The views expressed in this analysis are mine alone and do not represent those of my employer, which partners with many of the vendors who participated in the MITRE evaluation.</p><h3>Evaluation Basics</h3><p>Let’s take a quick look at the evaluation description before we jump into the results (please read the full evaluation information <a href="https://attackevals.mitre.org/APT29/">here</a>). For Round 2 of the evaluation, MITRE focused specifically on APT29 emulation. For those not familiar, this group is attributed to the Russian government and was believed to be behind the DNC attack during the 2016 election cycle. To assess detection capabilities of 21 EPP vendors, MITRE has broken down the results using two key indicators: detection types and detection modifiers. I think it’s appropriate to outline these types and modifiers because they have changed since the first round of evaluations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*OHmqAPozdtw4rwqqQvOj_A.png" /><figcaption>Vendors that participated in Round 2 evaluation</figcaption></figure><p>Detection type is broken into 6 categories: Technique, Tactic, General, MSSP, Telemetry, and None. The categorical distinctions are based on quality of the result, e.g. a specific alert notifying the analyst of exactly what happened and how it happened vs. raw telemetry that requires manual hunting. I defer to the MITRE <a href="https://attackevals.mitre.org/APT29/detection-categories.html">page</a> which provides a more in-depth explanation of these categories.</p><p>Additionally, modifiers were included to provide context around the detection (i.e. was it an alert, delayed due to processing, a result of human investigation, etc.). MITRE provides 5 modifiers: Alert, Correlated, Delayed, Host Interrogation, Residual Artifact, and Configuration Change (I exclude innovation, it’s not clear to me what it really means yet).</p><h3>Scoring Methodology</h3><p>As the press releases poured in, with quotes like “the most detections of any vendor” and “the highest fidelity results”, I found myself more inclined to publish a scoring framework that could provide some necessary context to customers who don’t follow these evaluations closely. It is bit misleading when detection could mean anything from generic telemetry that requires manual hunting to alerts with specific information presented directly to an analyst in the UI. My first thought, before trying to put numbers on paper, was to break the scoring down into a few distinct categories:</p><blockquote>1. Immature SOC: organization with limited security staff, often only have IT staff. No manual hunting and rely heavily on the tool to provide alerts. No MSSP.</blockquote><blockquote>2. Mature SOC: organization with multiple levels of SOC analysts, hunting capability (via tools or scripting), other security tools feeding SIEM, ability to investigate and remediate.</blockquote><blockquote>3. MSSP: relevant to any maturity level, an attempt to quantify the value add of an MSSP to the base product (usually a non-trivial fee).</blockquote><p>Breaking down results into these distinct categories is the most important part of this evaluation. The results of full blown MSSP and manual hunting aren’t particularly relevant to customers who can’t afford those resources, and could ultimately steer them towards an incorrect product fit. Now that we have three scoring regimes, how do we quantify the detections themselves while taking into account modifiers?</p><p>The settled on a 0–4 scale scoring scheme based on detection type, with a modifier weighting (between 0 and 1). The more verbose the detection, the higher the initial score. Weighting is influenced by the speed with which the result gets to the analyst (e.g. immediate alert vs. delayed by cloud processing). Each of the 3 regimes above carried a different scoring key (see Github link below for full details).</p><p>The final score for each vendor is computed by multiplying the detection score and the modifier weight for each of the 140 substeps and adding them together. Instances where there are more than one modifier, the modifier with the lowest weight is used (e.g. an ALERT that is DELAYED due to processing receives the DELAYED weight). At this point there is no consideration for multiple detections of a substep, although I believe this may indicate a higher probability of positive result in a different test (just a hunch, no quantitative justification at the moment).</p><h3>Results</h3><h4>Immature SOC</h4><p>This result can best be described as the EPP tool alone, without the support of real human analysis. In this instance, Telemetry is worth zero points since human intervention to detect adversarial behavior is realistically not occurring. Additionally, the manual modifiers are given a value of zero to reflect the lack of human intervention. I think these results are very important for small organizations who don’t plan on purchasing managed hunt or MSSP services and have limited cycles to browse EDR logs. The top vendors in this category reflect those who had the most Technique and Tactic detections which are critical for organizations that need out of the box triage automation.</p><p><strong><em>Scoring:</em></strong></p><blockquote>Detection: {Technique: 4, Tactic: 4, General: 2, Telemetry: 0, None: 0}</blockquote><blockquote>Modifier: {Alert: 1.0, No Modifier: 1.0, Correlated: 0.75, Delayed (Processing): 0.5, all others: 0}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*xLGSByNy7uV_bLxiy-VGKg.png" /><figcaption>Results for immature SOC scoring framework (score reflected below logo)</figcaption></figure><h4>Mature SOC</h4><p>This result reflects instances where a more mature security posture is in place, e.g. multi-tiered SOC analysts, IR team, log scale log aggregation, etc. Since human analysis is an advantage for these organizations, points are awarded for Telemetry detections. Additionally, modifiers that reflect human intervention (i.e. Delayed-Manual, Host Interrogation, and Residual Artifact) are now given a non-zero value to reflect their availability. I have purposefully left out the MSSP results as they are not necessarily indicative of an internal SOC capability. It’s interesting to note that there are a few vendors who make rather significant jumps once Telemetry, Host Interrogation, and Residual Artifact results are added (e.g. Carbon Black, SecureWorks). If you have a SOC or hunt team, these results better reflect what a human-machine tandem could hope to detect.</p><p><strong><em>Scoring:</em></strong></p><blockquote>Detection: {Technique: 4, Tactic: 4, General: 2, Telemetry: 1, None: 0}</blockquote><blockquote>Modifier: {Alert: 1.0, No Modifier: 1.0, Correlated: 0.75, Delayed (Processing): 0.5, Delayed (Manual): 0.75, Host Interrogation: 0.75, Residual Artifact: 0.25, all others: 0}</blockquote><blockquote>* Host Interrogation and Residual Artifact are attached to the detection type None, so a default detection score of 3 is used.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*LMg9jVl7OVnAO8IvYFgEwg.png" /><figcaption>Results for mature SOC scoring framework (score reflected below logo)</figcaption></figure><h4>MSSP</h4><p>For those considering whether to purchase an MSSP or managed hunt license, these results should help provide some justification. The scoring configuration matches the mature SOC with the exception of the MSSP detection type receiving a score of 4. The most interesting results in this category were significant score jumps by SentinelOne (MSSP was able to detect nearly all of the previous Telemetry finds) and Microsoft (55 MSSP finds, high Telemetry conversion rate). If you are considering an MSSP purchase, looking at the conversion rate of Telemetry detections to MSSP detections gives you a plausible method for evaluating human capability. I’m not suggesting you can make significant differentiation decisions between 35 and 50 MSSP detections, but 50 vs. 5 is quite telling.</p><p><strong><em>Scoring:</em></strong></p><blockquote>Detection: {Technique: 4, Tactic: 4, MSSP: 4, General: 2, Telemetry: 1, None: 0}</blockquote><blockquote>Modifier: {Alert: 1.0, No Modifier: 1.0, Correlated: 0.75, Delayed (Processing): 0.5, Delayed (Manual): 0.75, Host Interrogation: 0.75, Residual Artifact: 0.25, all others: 0}</blockquote><blockquote>* Host Interrogation and Residual Artifact are attached to the detection type None, so a default detection score of 3 is used.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*eGtU7rR7TRmNLTfkIhslQg.png" /><figcaption>Results for MSSP scoring framework (score reflected below logo)</figcaption></figure><h3>Final Thoughts</h3><p>The level of participation in this evaluation suggests that the market is moving away from secretive testing and dubious detection metrics to a more open and transparent process for evaluation. I think each of the vendors should be applauded for taking the time to participate and be scrutinized. I want to be very clear, the results of this single test don’t make or break a solution and the vendor orders above are not an end all be all for making a decision. This (and the first evaluation) are simply data points to better inform purchasing decisions. Efficacy, integration, UI capability, ease of deployment, and price are all important factors that can’t be considered independently.</p><p>I do find it interesting that there are a handful of vendors that appear to rise to the top regardless of deployment scenario (product only, MSSP, advanced SOC). I will point out that in the MSSP category, the difference between rank 9 and 13 is only 50 points, but the difference between the top vendors and the median is quite notable. If you dig into the data, it’s clear that the MSSP offerings from these vendors were quite adept at using their telemetry to create findings, suggesting strong hunt teams. I hope for the next round of evaluations that some of the managed hunt providers (Red Canary, Root9B, etc.) can find a way in with their own/favorite EPP agent to better quantify what the managed hunt market is capable of.</p><p>I’ve taken a very specific scoring approach to this evaluation and thus will have gaps in my interpretation and complexity of evaluation. For instance, two major factors that I would like to support are (1) multiple detections on a single substep (may indicate more robust solution), (2) attack stage of the substep (early detection vs. detection after full scale compromise). However, I think this framework helps simplify a mountain of data that only the most hardened of us will dig through. My hope is that those trying to decide on an endpoint, MSSP solution, or security stack have a way to inform their decision a little more beyond pure marketing. Vendors can slice the data any way they like to sell a tool, my hope is to make the playing field a little more level.</p><h3>Links</h3><p>MITRE ATT&amp;CK Evaluation: <a href="https://attackevals.mitre.org/APT29/">https://attackevals.mitre.org/APT29/</a></p><p>Github Code Link: <a href="https://github.com/jonticknor/maes">https://github.com/jonticknor/maes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa9c39765a26" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-analytics/quantifying-the-mitre-att-ck-round-2-evaluation-fa9c39765a26">Quantifying the MITRE ATT&amp;CK Round 2 Evaluation</a> was originally published in <a href="https://medium.com/security-analytics">security analytics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cyber and AI: Separating Fact from Fiction at Peak Hype]]></title>
            <link>https://medium.com/security-analytics/cyber-and-ai-separating-fact-from-fiction-at-peak-hype-deb228767484?source=rss----3a6451fe38b6---4</link>
            <guid isPermaLink="false">https://medium.com/p/deb228767484</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Jonathan Ticknor]]></dc:creator>
            <pubDate>Fri, 01 Feb 2019 15:42:19 GMT</pubDate>
            <atom:updated>2019-02-08T13:58:06.530Z</atom:updated>
            <content:encoded><![CDATA[<p>By now, we have all seen an article claiming artificial intelligence (AI) is the solution to all of our detection problems or an unstoppable automated hacking force. AI has become the buzzword that every security company must include in their marketing material to keep up. So how do you separate strong technology from marketing hype? In this article I’m going to lay out common applications of machine learning (ML) in security and the questions you should ask every vendor to cut through the marketing hype and understand if their technology will be useful to you. I’ll start with a definition of AI to ground the rest of the post, followed by a brief analysis of techniques and what you can do to better vet vendor engagements. I could fill a book with an in-depth analysis, so I will focus on hitting the key points.</p><h3><strong>Defining AI</strong></h3><p>The most common request I receive from customers is a definition of AI. After analyzing hundreds of definitions from researchers, practitioners, and our own internal definitions, my team came up with a simple definition we feel helps customers:</p><blockquote><strong>Artificial intelligence</strong> is the design of agents that perceive their environment and act to meet an objective, often without being explicitly programmed to do so.</blockquote><p>Although this definition is admittedly broad in technological scope, it’s the second part which is critical to understand in a security context. Early AI implementations relied on handcrafted knowledge that was programmed into the agent. This approach is brittle in two ways, 1) There is no learning or handling of uncertainty and 2) The approach is not scalable as the agent must learn to react to an ever changing environment to be useful, requiring recurring human updates. This is a great proxy for the emergence of ML capabilities in security as practitioners realized that building ever growing rule and signature lists was an unsustainable approach to defending against an intelligent adversary. We can certainly squabble over semantics, but let’s go with this definition for the purpose of this article.</p><p>As our definition states explicitly, learning will be a key ingredient of the technology. There are three forms of learning that have become essential components for security ML vendors: unsupervised learning, supervised learning, and reinforcement learning. I will save a deep dive on each technique for another post, but a quick outline should inform the reader enough to dig deeper:</p><blockquote><strong>Unsupervised learning:</strong> an approach used to model the underlying structure or distribution of the data without the benefit of labels (e.g. clustering users into similar groups)</blockquote><blockquote><strong>Supervised learning:</strong> using labeled data to build a model which can classify or make predictions based on characteristics of new, unseen data points (e.g. classify malicious urls based on a labeled data set of known malicious and benign urls)</blockquote><blockquote><strong>Reinforcement learning:</strong> goal-oriented algorithms which learn how to achieve a complex objective or maximize some notion of a cumulative reward (e.g. attempt to maximize the cumulative score in a game)</blockquote><p>Now that we have a definition and a broad notion of the techniques we can deploy, let’s take a deeper dive into the market.</p><h3><strong>Areas of Application</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zsap3Co5p9ZUSsTfmJgUiA.png" /></figure><p>The growth of distributed computing platforms and easy to use deep learning packages seems to have generated a surge in ML based security products. In general, there are three major use cases for analytics in cybersecurity: endpoint, network, and security operations center (SOC) automation. Each of these categories contain two or more subcategories, some examples shown in the above diagram. Let’s take a dive into each of these disciplines to better understand use-cases and possible (and sometimes common) pitfalls.</p><h4><strong><em>Endpoint Detection</em></strong></h4><p>Endpoint detection saw some of the earliest growth in the use of ML in security, highlighted by unicorns like Cylance and Crowdstrike. However, the same techniques have been deployed by other upstarts including Endgame, FireEye, Palo Alto, Sentinel One, and Sophos as well as the more established anti-virus (AV) tools from Symantec, McAfee, Trend Micro, Kaspersky, Bitdefender, and Microsoft. The growth of “next-gen” AV in part has been a function of the problem it is trying to solve. With the rise of open source intelligence repositories like VirusTotal and VirusShare, the ability to get vast quantities of labeled data has never been easier. This allows companies without a large user base (e.g. startups) to download examples of malicious documents from which a model can be built. As is the case for all supervised ML applications, large quantities of labeled data that accurately represents the population is critical to the learning process of the algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*DA7utEk4WjpeFDSgE41krw.png" /><figcaption>Example post by Nick Carr of FireEye</figcaption></figure><p>You may have noticed I added the phrase “accurately represents the population” in describing the procurement of data. This is a critical fact that in many ways limits the capabilities of these solutions. Although there is a wealth of data available, the challenge for endpoint solutions is building a robust model that performs well in the face of an intelligent and ever changing adversary. This places pressure on the vendor to accurately represent these behavioral changes in their training set, and thus the model. Examples of malicious files bypassing AV solutions are frequently posted on popular social media sites like Twitter by top notch security researchers (see example). And then there was the “Hello World” controversy when a user submitted the simple Hello World training example for new coders and noticed many vendors flagging the file as malicious [1]. This caused some to suggest that these tools aren’t in fact understanding the underlying behavior of the file, but memorizing some facts about the training set (e.g. small files are always bad). The vendor explanations are worth a read for anyone interested in ML based endpoint detection tools.</p><p>If you follow many of these files over time you will often see an increase in vendors detecting the file as malicious. What this may suggest is 1) the vendors are retraining the model with the new samples (always good) or 2) there are new signatures for the file added to the product (always good). This is not to suggest that these products are not useful, they are, but rather to highlight the challenge in making predictions in a feature space not well represented in the training data. There is a fantastic article ([2]) that highlights two common issues in malware prediction that lead to inflated accuracy reports that I believe is likely an issue with some commercial offerings and not just academic efforts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRKRJr01lBw8DOJlvjNzFQ.png" /><figcaption>Examples of Leading Endpoint Security Tools</figcaption></figure><p>Finally, let me discuss the method most credited for creating these next-gen products, deep learning. Deep learning is a powerful form of ML that has been used in a range of disciplines, from beating Go champions to helping self driving cars. Like other ML models, deep learning requires a vector representation of the underlying data as input. In general, these features are hand engineered by subject matter experts to reflect important aspects of the underlying observed process. Another technique, embedding, which represents discrete variables as continuous vectors, has emerged as a means of allowing these models to “learn” relationships among the raw data variables. This allows, for instance, a user to feed the model the raw byte representation of an executable to predict if it is a malicious file. The thesis being that this powerful technique will allow the model to generalize on behaviors without the bias created by subject matter experts (i.e. engineering features based on malware they have seen in their career). However, a number of experts in this field believe that the learned features using embedding tend to perform more poorly than hand engineered features. We don’t have time to go deep on this topic, but I would point you to the work of Scott Coull at FireEye whose team has done amazing work around understanding what these deep learning models are actually learning and how that relates to well understood features of malicious files (see links below [3–4]). As powerful as these capabilities are, there are still plenty of avenues to explore to improve the technology.</p><h4>Network Detection</h4><p>Unlike endpoint detection, detecting adversarial behavior via network data requires a multi-faceted algorithmic approach. When I use the term network detection, I’m talking about firewall, proxy, DNS, etc. as data sources. The objective is to detect behaviors associated with an adversaries presence on the network (e.g. phishing email, malware beacon, lateral movement). A wave of startups have entered this space since ~2013 promising smarter alerts and a better security and event management (SIEM) system. Companies often brand themselves as SIEM replacement, UEBA, UBA, MDR, and less often MSSP. Whereas endpoint detection has well defined problem statements and high value labeled data sets, network detection is more nebulous and has led to some of the more egregious misuses of the terms AI and ML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fAAJ2B4cq4uDW8IyNr2sFw.png" /><figcaption>Examples of Advanced Detection Vendors</figcaption></figure><p>Because network detection encompasses so many unique behaviors, the range of applied techniques varies significantly by provider. However, there is one common thread among many in the network detection market: unsupervised learning. As I described earlier, unsupervised learning is an approach that seeks to model the underlying structure of the data in the absence of labels. The most commonly used (and abused) phrase to describe unsupervised learning in security is that it can “find the unknown unknowns” (any Rumsfeld fans?). What is generally meant by that statement is that the model can learn “normal” from the data without being explicitly told what normal is using historical information (often labeled data, like with supervised learning). Thus, a statistical anomaly will appear which represents a behavior previously unknown to the customer.</p><p>Without vanquishing unsupervised learning as a viable strategy, let me explain some of the difficulties and why the approach is challenging in a security context. Feature generation, as described previously, is itself a critical aspect of unsupervised learning. First, the features themselves will impart bias on what can be found in the data by selecting a subset of information from which to group users, devices, etc. For example, if I chose to consider the IPs and ports that a device connects to, I’m already taking a very narrow view of the data and limiting the behaviors I can detect (e.g. without data transfer, it will be impossible to detect data exfiltration). Additionally, each of the anomalous entities will lack a proper description of why the behavior/user is strange, often just providing information like cluster characteristics or anomaly score. Finally, anomalous does not equal malicious. This is one of the most difficult concepts to impart on data scientists new to the field. Those with experience know that lots of anomalous behavior occurs on a network, purposefully or not, that is completely benign.</p><p>So why am I making these points? First, the results when considered in aggregate tend to have high false positive rates. Since the intention is to model the underlying structure of the data, there is limited room to filter noise like we can with endpoint detection or more targeted behavioral detection. Additionally, the inability to specify the reason for the anomaly often leads to frustration from SOC analysts during investigation. With the deluge of alerts SOC personal face from existing devices, adding lower information, time heavy manual investigation alerts to the queue is incredibly expensive. This combination leads to lack of trust in the solution and ultimately turning off the alerts altogether.</p><p>So how do you build a robust network detection pipeline that reduces false positives, decreases total alerts, and provides reasoning/justification for the alert? I have always advocated for an approach I call targeted analytics. This approach focuses on building analytics for specific behaviors (e.g. malicious urls, beaconing, network enumeration, etc.) rather than trying to find generic anomalous entities. By focusing on individual behaviors, analytics can be built using subject matter expertise to inform feature generation and data source usage. This helps not only improve the detection capability, but also allows for robust noise filtering that helps to reduce alert generation (e.g. filtering beacons based on ISP).</p><p>The goal is not to replace devices like firewalls, proxies, and IDS/IPS but rather to utilize that data to provide a comprehensive view of malicious behavior that may be missed by these traditional solutions. Although this approach requires more subject matter expertise and the ability to outline critical behaviors in the attack sequence, the increased fidelity of results pays significant dividends for the user. I will create a distinct post addressing this philosophy and how organizations can use it to supercharge their SOC in the future.</p><h4>SOC Automation</h4><p>The final notable area of ML support in security is at the SOC level. As I hinted at above, SIEM was the original promise to aggregate all relevant network and security logs to more quickly assess and stop malicious activity. If you’ve made it this far, you already know that SIEM has failed to deliver on the automation promise. As the number of devices on the network and the sophistication of actors increases, the inability to quickly triage the most important threats has become a paramount task to address in modern SOCs. This problem has opened the door to security startups promising an AI solution to automate away the human SOC as we know it. How realistic are these claims? Let’s take a deeper dive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oi671o326G0hsopCEBI73w.png" /><figcaption>Examples of SIEM and SOC Automation Tools</figcaption></figure><p>Most SOC automation platforms pitch the idea of automated aggregation of alerts to display only the most critical events facing the organization. So how exactly would an AI solution solve this problem? For this use case the alerts themselves are the raw data, not the telemetry from the network. Thus, feature engineering revolves around relationships among alerts in both time and substance. This seems like an obvious application for supervised learning where the SOC could label aggregated alerts entering the system to build a robust training set.</p><p>Here in lies the first major hurdle for AI SOC automation. Let’s assume we used the Mitre ATT&amp;CK Matrix categories as features, of which there are greater than 200. We need enough data to effectively model the possible feature space (combinations of these behaviors), which is growing exponentially with the addition of each new feature (analytics folks know this as the curse of dimensionality [5]). It’s not only incredible time consuming to accurately label data in security, but even more difficult to get many examples of behavioral combinations. One solution is to simulate behaviors of known adversaries in a cyber range and inject that data into an existing data pool. It may be obvious to some readers that this creates an artificial behavioral distribution which does not reflect the attack environment, but that’s for another post. Suffice it to say, to properly build an ML solution we need to observe the actual distribution of attack techniques.</p><p>A second issue we quickly run into is deciphering between malicious/benign and low/critical severity examples of identical behavioral patterns. A real world example of this occurred at a large organization my team worked with that had Carbon Black telemetry. We saw process spawning of rundll32.exe using the the **advpack.dll “LaunchINFSection”** function followed by net.exe user commands and other persistence mechanisms which matched the behavioral signature of an advanced adversary targeting the same industry just a month before (if interested, check out [6]). After further investigation by our team and the customer, we tracked it down to a Windows upgrade and a separate rollout of a new specialized company software tool. Because the exact command line information was not available in the alert, it was impossible to make an accurate assessment of the severity of this event.</p><p>The point here is that working at the alert level is one step above the raw data where you lose important information necessary for the decision making process. A natural reaction I often see is, “well I will just add that information to the features of my model.” You are now introducing a non-numeric and effectively unbounded feature space to a classification model (this is not good). As we make the feature space more complex, the amount of data required to accurately define the underlying process grows as well (curse of dimensionality strikes again).</p><p>So you may say, “AI SOC automation doesn’t currently exist.” I haven’t vetted every tool on the market, but this is likely not a bad bet. This is a bit tongue and cheek, but the reality is that a one size fits all solution to get rid of your human SOC doesn’t exist. I would argue that ML is unnecessary for SOC automation at this stage. Given the ineffectiveness of most detection tools, the data available to any SIEM has significant gaps and false alarms. Smart algorithms for reducing the noise and highlight interesting patterns from existing devices have proven very effective (e.g. Red Canary). More robust detection capabilities to replace legacy tools helps bring higher fidelity data into the SIEM. Being able to classify commodity threats, which encompass most of the alerts SOC analysts deal with, helps to automate the triage process without ML.</p><p>I’m not suggesting that we should not endeavor to build this technology, just that it isn’t ready yet. A heuristic engine built with subject matter expertise and knowledge can help classify most threats to the network, freeing up time for analysts to manually inspect more nuanced, never before seen behavior combinations. It is unlikely that an AI solution will be able to handle these rare edge cases anyways, so the argument is really about how best to automate low level and repetitive tasks from the queue. Advanced threats will never represent an appreciable amount of the training data for a model as their tactics constantly shift, so the goal should never be to <strong>automatically</strong> classify these threat actors.</p><h3>What to Ask</h3><p>So now that I’ve discussed the applications, their capabilities, and disadvantages, how do you navigate the market? Your first step is to assess your security footprint, SOC maturity, and risk profile (obviously budget as well). Although some vendors may suggest that they are the only product you need, the reality is that every tool checks only some of your security boxes. It should be obvious at this point that there is no such thing as a perfect product, even an ML solution touting 99% detection.</p><p>In general, if you are a small organization with no real intellectual property, your major threats will be opportunistic (users opening malicious attachments, visiting bad websites) and thus requires strong endpoint protection with a low cost SIEM solution for compliance. Larger organizations, critical infrastructure, and companies with intellectual property concerns (e.g. semiconductor manufacturer, banks, utilities, oil &amp; gas) will require strong endpoint protection and robust advanced network detection capabilities. I’ve been in engagements with Fortune 500 companies where we detected hundreds of malicious communications passing through their existing tools. As I said before, no solution is perfect and a defense in depth strategy is necessary. Obviously there are nuances to all of this as supply chain attacks become a lucrative approach for more advanced adversaries to use small companies as a means to breach larger organizations. The key is to understand that no product is a magic bullet and buying every product is an overreaction to fear based sales tactics. Understand what your gaps are and ask yourself if the vendor will help fill that gap.</p><p>So what questions should you ask a potential vendor? It depends on the category, but here a few that will help you dig deeper. If they are uncomfortable or unwilling to answer these questions, you should really reconsider the engagement.</p><p><strong><em>Endpoint Protection</em></strong></p><blockquote>1) What data have you used to train your ML model?<br>2) How do you handle model decay? How often is my solution updated to take advantage of retraining?<br>3) Are signatures also built into the platform to block well known tactics/files?<br>4) Do you participate in 3rd party testing? If so, what were the false positive and false negative rates for new malware?<br>5) Is the solution analyzing the file pre or post execution?</blockquote><p><strong>Network Detection</strong></p><blockquote>1) Explain what you mean by AI?<br>2) Do you use unsupervised learning? supervised learning? reinforcement learning?<br>3) Can you show me examples of behaviors detected by your analytics?<br>4) What type of algorithms are you using and what behaviors do those techniques detect?<br>5) How do you balance alert fatigue caused by false positives vs the potential for false negatives?</blockquote><p><strong>SOC Automation</strong></p><blockquote>1) How is the system using AI to automate SOC processes?<br>2) How did you gather the requisite data to build a robust model?<br>3) Does the process require humans in the loop?<br>4) Can the system adjust to my specific needs (behaviors I care about)?<br>5) How does the system distinguish between severity among a specific behavior group (e.g. PUP/Adware spawning suspicious process vs. zero-day spawning suspicious process)?</blockquote><p>This is not an exhaustive list of questions, but a great place to get started. Security is complicated and vendors should be willing to discuss their capabilities in depth without giving away intellectual property. I would recommend having a trial period to put the solution to the test. Bake-offs are a great opportunity for all involved to show off what they can do. Use-case documents are also a great way to understand a product, but be sure the vendor can describe specifically what they have detected and how they detected it with proper IOCs (IP addresses, domains, file hashes, etc.). Ultimately it’s about balancing budget and risk reduction. If the pitch sounds too good to be true, it likely is.</p><p>I hope that this post has been informative and will help you in your next vendor engagement. As always, look for partners who exhibit transparency, honesty, and humility. It’s a tough discipline and none of us are perfect, but together we can build on existing knowledge and better defend networks. I look forward to pivoting to a more technical article next time, so stay tuned.</p><p>[1] <a href="https://www.csoonline.com/article/3216765/security/heres-why-the-scanners-on-virustotal-flagged-hello-world-as-harmful.html">https://www.csoonline.com/article/3216765/security/heres-why-the-scanners-on-virustotal-flagged-hello-world-as-harmful.html</a></p><p>[2] <a href="https://arxiv.org/pdf/1807.07838.pdf">https://arxiv.org/pdf/1807.07838.pdf</a></p><p>[3] <a href="https://www.fireeye.com/blog/threat-research/2018/12/what-are-deep-neural-networks-learning-about-malware.html">https://www.fireeye.com/blog/threat-research/2018/12/what-are-deep-neural-networks-learning-about-malware.html</a></p><p>[4] <a href="https://www.camlis.org/scott-coull/">https://www.camlis.org/scott-coull/</a></p><p>[5]<a href="https://www.kdnuggets.com/2017/04/must-know-curse-dimensionality.html">https://www.kdnuggets.com/2017/04/must-know-curse-dimensionality.html</a></p><p>[6] <a href="https://securelist.com/muddywater/88059/">https://securelist.com/muddywater/88059/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=deb228767484" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-analytics/cyber-and-ai-separating-fact-from-fiction-at-peak-hype-deb228767484">Cyber and AI: Separating Fact from Fiction at Peak Hype</a> was originally published in <a href="https://medium.com/security-analytics">security analytics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Phishing Guide: Lessons Learned on the Journey to Detecting Phishing Domains]]></title>
            <link>https://medium.com/security-analytics/a-phishing-guide-lessons-learned-on-the-journey-to-detecting-phishing-domains-816ec21e5f7a?source=rss----3a6451fe38b6---4</link>
            <guid isPermaLink="false">https://medium.com/p/816ec21e5f7a</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Jonathan Ticknor]]></dc:creator>
            <pubDate>Thu, 24 Jan 2019 18:10:57 GMT</pubDate>
            <atom:updated>2019-11-20T19:32:15.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to the first post of a series that will chronicle my personal experiences building detection capabilities for some of the largest organizations in the world. When addressing detection capabilities, phishing is often the first subject that comes to mind and is an essential tactic used by proficient adversaries. Hence, the series will start here with <em>A Phishing Guide: Lessons Learned on the Journey to Detecting Phishing Domains</em>.</p><p>Here I will highlight my philosophies and document many of the common pitfalls to which the industry has succumb to. Opacity and lack of in-depth knowledge of phishing techniques has led to the general mistrust of advanced analytic vendors and practitioners in today’s market. This article will review phishing’s historically successful approaches and clarify the importance and techniques of building detection models to defend against these malevolent methods. I hope that the following insights are useful for those looking to build a robust detection platform and helpful to those working to figure out what the new “Advanced AI” vendors actually do (often this is actually not AI) and are trying to accomplish in the future.</p><p>The first thing I want to do is define what I mean by phishing detection. Phishing has broad connotations in cyber security, including malicious email, attachment, and domain detection among others. For this post, I want to focus on malicious domain detection because it’s an important component for any corporate security team and can be built using readily available data. Anyone with WebProxy or DNS can begin to detect malicious traffic in their own environment, and with a little extra effort and ingenuity, can use open source data to build their own domain threat intelligence feed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUEj67BZ5IqwPIdOff0Qog.png" /><figcaption>An example of a Microsoft One Drive phishing page</figcaption></figure><p>A savvy reader is probably aware of the many academic articles, vendor use cases, and Github repositories claiming to detect &gt;95% of malicious domains with incredible false positive rates (often below 0.1%). By no means am I the expert on phishing detection, nor do I have all of the answers on how to implement a detection strategy. But my experience in the field, particularly related to phishing, tells me to first critically assess any solution that purports “too good to be true” detection metrics. There are two critical questions that must be asked when assessing any solution: 1) What data was used to build the model? and 2) What data was used to test the model? This may seem trivial, but mistakes at this stage lead to unreasonable expectations upon deployment, and ultimately customer/user disappointment. I don’t believe biased data sets are used on purpose, but are often the result of limited domain knowledge or lack of access to robust data. Let’s first jump into a taxonomy of phishing techniques, and then we can better understand how bias can be introduced through improper data collection.</p><p>There are 7 common approaches that I am going to introduce below to get started. For the expert reader, I am aware there are more but highlighting the most common techniques will help the broadest audience.</p><blockquote>1. <strong>Domain generation algorithms (DGAs)</strong>: A technique used by malware authors in which an algorithm is used to constantly change the command and control (C2) domain to avoid blocking mechanisms. This technique has fallen out of favor as even the most rudimentary security tools often provide DGA detection.</blockquote><blockquote>2. <strong>Well known brands</strong>: A popular approach to phishing domain generation that is exceptional at tricking users into believing they are accessing a legitimate site owned by Apple, Google, Bank of America, etc. In the age of smartphones with small url bars on the screen, the use of brand names has been wildly successful at stealing social media, personal mail, and financial credentials.</blockquote><blockquote>3. <strong>Well known keywords</strong>: A popular approach used in spam and the classic “You have a virus, call 1–888-” tech support scams. By using keywords like virus, detected, and login the adversary creates fear in the user that the machine has in fact been compromised.</blockquote><blockquote>4. <strong>Homoglyph attacks</strong>: A powerful technique used by adversaries to trick users into clicking by making very minor changes to a popular domain that trick the user into “seeing” the proper domain. This technique has become more difficult to deploy as large corporate security teams register many of the most successful homoglyphs via protection providers like MarkMonitor.</blockquote><blockquote>5. <strong>Punycode</strong>: An old trick that has become more of an emerging threat. Again, an approach that uses the appearance of the domain to trick users.</blockquote><blockquote>6. <strong>Legitimate hijacked pages</strong>: Among the more difficult techniques to detect, particularly for models that use enrichment from WHOIS data to filter false positives. In this approach, an adversary compromises a legitimate website and hosts malicious subdomains or folder structures leading to malicious pages. It is common to see this approach paired with one of the techniques above (particularly brand and keyword spoofing).</blockquote><blockquote>7. <strong>Standard domain</strong>: The most difficult technique to detect and one often employed by more advanced actors. The domain generally has no discernible lexical features that make it unique. To prevent detection via WHOIS data (registration time, owner, registration country, etc.), the domain is registered in advance of the attack.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4zzg08gPatcsgj4NfN1wA.png" /><figcaption>Examples of phishing techniques</figcaption></figure><p>Now that I have defined a taxonomy of common techniques, I can start to consider possible solutions. The first challenge is acquiring a sufficient amount of useful data to build a detection model. I need a substantial set of confirmed phishing domains as well as an equally sizable set of known benign domains. If your first instinct is to get the Alexa or Umbrella 1 million lists, fight the urge. Although these lists can be particularly useful in filtering false positives, they are not strong datasets for building a robust detection model.</p><p>First, I want examples of legitimate traffic to domains with multiple subdomains (which you won’t get from the Alexa 1M). Second, I want a representative dataset for lexical analysis. If the model thinks that character transitions related to word concatenation in domains is rare among our benign set, there will be an issue. Although uncommon in the top 1M datasets, this behavior occurs frequently in domains people visit on a daily basis (think auto dealers, hospitals, local shopping). Finally, I want a broad geographic diversity in domains, particularly if I am building the model for an international company (e.g. flagging every Brazilian or Polish site that has unique lexical characteristics won’t work). I’m not going to give away all my techniques, but there are ways to get these robust benign datasets for free, e.g. Common Crawl, customer historical data.</p><p>For malicious domains, there are a number of resources I can use to build a robust dataset. Some of the more common ones include PhishTank, hpHosts, FireHOL, and VirusTotal (requires a license to gather many domains). Once I gather these lists, it is critical that a filter is applied to remove duplication (particularly at the second level domain). I have seen many training datasets used with significant duplication of malicious infrastructure which led to artificially high detection rates reported (500 examples of *.baddomain[.]com in the training and test sets). It is also important that I try to gather as many possible examples of the seven techniques listed above to understand how my model will perform against a variety of adversaries.</p><p>Now that I have collected enough data, it is time to build a model. But let’s hold on for a second and think about the seven techniques I highlighted above. The first technique, DGAs, is a trivial task to solve as I mentioned earlier. We can either hand engineer features and use a random forest model or use a deep learning model with character embeddings to detect this behavior. Techniques 2 &amp; 3 rely on tricking users, and although e.g. they are often abnormally long, use .com in the middle of the domain, and include dashes, there are many examples that don’t use these obvious indicators. It should be obvious that the character embedding DNN we used for DGAs may struggle detecting these techniques(spoiler alert, it will). Technique 4 goes a step further and attempts to look just like a legitimate domain. You may say, “but wait, if the user switches an l for a 1 in google[.]com or adds an extra letter that will be lexically strange.” However, if you analyze enough traffic you will realize there are plenty of legitimate domains that use strange lexical features just like that. This will lead to false positive issues using ML models to detect this technique. Techniques 5 &amp; 7 go a step further, becoming nearly impossible to detect using lexical based models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*3vUxO-hJxk0irPJueRkYIQ.png" /><figcaption>Example WHOIS record used for enrichment</figcaption></figure><p>We can go a step further and begin to add enrichment to our domains. For instance, we can add registration date, hosting IP, hosting ISP, and hosting country to our lexical features. Although at first glance this seems like an obvious solution to the lexical feature problem, I need to address how expensive it is to gather these features. At a typical Fortune 500 customer, the number of never before seen unique domains often exceeds 500,000 in a given day. A typical service like whoisxml offers 2 million WHOIS lookups per month for ~$1,800. That license alone can be cost prohibitive for some organizations (highly recommend these services though, they save on a lot of headaches). On top of that, as new privacy laws are enacted we are seeing less registration information available, reducing the efficacy of the enrichment. I generally recommend smart filtering before enrichment to help reduce the number of domains analyzed despite the risk of increasing the false negative rate.</p><p>This is not to say that ML, and in particular deep learning, with or without enrichment do not have their place in security analytics or malicious domain detection. ML is a really awesome hammer, but not every problem is a nail. In the case of phishing domain detection, I am arguing for a multi-analytic solution to protecting the environment (which is what my team currently deploys). Anyone who has worked with SOC analysts understands the impact false positives have on their workflow. We have to remember that each analytic we build is just one alert among hundred or thousands of unique alerts the SOC will see on a given day. It is essential that we do the heavy lifting before it get’s to them, increasing the chances that our alerts will be used. I won’t spell out exactly what my team has implemented, but here are a few cool ways other companies/individuals are trying to solve this challenge:</p><blockquote><strong>DGAs</strong>: random forest model on hand engineered features, deep learning models</blockquote><blockquote><strong>Well known brands/keywords</strong>: heuristic models, keyword detectors (see Cisco Umbrella)</blockquote><blockquote><strong>Homoglyph attacks</strong>: dnstwist (<a href="https://github.com/elceef/dnstwist">https://github.com/elceef/dnstwist</a>)</blockquote><blockquote><strong>Punycode</strong>: <a href="https://www.endgame.com/blog/technical-blog/detecting-phishing-computer-vision-part-1-blazar">https://www.endgame.com/blog/technical-blog/detecting-phishing-computer-vision-part-1-blazar</a></blockquote><blockquote><strong>Hijacked domains</strong>: heuristic models, domain length, etc.</blockquote><blockquote><strong>Standard domain</strong>: WHOIS data, hosting information (major challenge)</blockquote><p>As you can see, we need a broad range of approaches to tackle the ingenuity of phishing attacks. I think it’s critical to ask a vendor how they are detecting these types of domains, what they are doing to reduce false positives, and how they plan to adapt to adversary tactics. This is a very challenging problem, particularly as adversaries adjust their behavior with the knowledge of our detection techniques.</p><p>I hope you all found this read to be educational or, in the least, a bit entertaining. My next post will focus on AI/ML for security in the more general sense, sifting through the hype and providing an understanding of the current state of the market. Future posts will include in-depth technical analysis (some with code) as well as more general state of the discipline analyses. Stay Tuned!</p><p>Any feedback is more than welcome. Thank you for your time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=816ec21e5f7a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-analytics/a-phishing-guide-lessons-learned-on-the-journey-to-detecting-phishing-domains-816ec21e5f7a">A Phishing Guide: Lessons Learned on the Journey to Detecting Phishing Domains</a> was originally published in <a href="https://medium.com/security-analytics">security analytics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>