<?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[Stories by Fsantos on Medium]]></title>
        <description><![CDATA[Stories by Fsantos on Medium]]></description>
        <link>https://medium.com/@fsantos094tmc?source=rss-4d3c77c33662------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L5hWFuheFdXOyWq97BxJMg.png</url>
            <title>Stories by Fsantos on Medium</title>
            <link>https://medium.com/@fsantos094tmc?source=rss-4d3c77c33662------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:35:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fsantos094tmc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From 13,745 Rows of Noise to One Executive Dashboard]]></title>
            <link>https://medium.com/@fsantos094tmc/from-13-745-rows-of-noise-to-one-executive-dashboard-450c80a087fd?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/450c80a087fd</guid>
            <category><![CDATA[power-bi-cybersecurity]]></category>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 16:36:34 GMT</pubDate>
            <atom:updated>2026-11-24T11:21:37.190Z</atom:updated>
            <content:encoded><![CDATA[<h4>Building a Vulnerability Intelligence Platform</h4><p><strong><em>How I transformed raw Tenable scan, Crowdstrike and DAST scan data into a strategic risk portal for 15 properties — and Why CVSS scores alone will get your security team ignored — and what to do instead.</em></strong></p><p>Thank you joining me on this blog entry!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-H6awWav30krugb9Z73Rg.png" /><figcaption>1. Fabric Medallion architecture data pipeline</figcaption></figure><p>If you hand an executive a 13,000-row CSV file and tell them the company has a vulnerability problem, you haven’t told them anything. You’ve just moved the problem from the security tool to their inbox.</p><p>I spent the last several months building a system that solves exactly this.</p><p>What started as a data dump from a Tenable vulnerability scanner became a full business intelligence platform <strong>— an enrichment pipeline, a composite risk scoring engine, and a Power BI executive dashboard that lets security leadership at a 15-property portfolio answer three questions in under 30 seconds<em>:</em></strong></p><p><strong><em>Which locations are most at risk? Which systems are in compliance scope? Who is past their remediation deadline?</em></strong></p><h3>The insight that changes vulnerability and remediation efforts</h3><p>Tenable is an excellent scanner. It finds real vulnerabilities. The problem isn’t the tool — it’s what happens after.</p><p>A typical scan export looks roughly like this: a flat CSV with thousands of rows, one per finding, with columns like <strong>severity_id</strong>, <strong>plugin_name</strong>, <strong>cvss3_base_score</strong>, and <strong>asset_ipv4</strong>.</p><p>Without context, everything looks equally urgent. When everything is important … nothing gets fixed.</p><p>CVSS scores how bad a vulnerability is in isolation. It doesn’t know importance of its function to the business logic or workflow.</p><p>It is ignorant whether that server sits inside your payment gateway scope, if it is externally accessible from outside the organization, or if it is three layers deep of segmentation behind a back-office closet.</p><p>For effective remediation efforts, a vulnerability report needs to know the critically of the asset itself to the function of the business daily operations.</p><p>The real question is:</p><p><strong><em>If this gets exploited, how bad is the outcome for the organization?</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JoPgZYx00DkW_ZW2XQZquA.png" /><figcaption>Overview of pipeline from ingestion to dashboard</figcaption></figure><h3>Layer 0 — Data Ingestion Layer</h3><p>Before any of the enrichment work, the raw findings have to come out of three separate security tools and land somewhere consistent. I built this with three Postman API collections — one each for Tenable, CrowdStrike, and StackHawk —the API calls could now be scheduled for weekly refresh reports. Each tool hands back data differently.</p><p>Tenable queues up a big export and you check back until it’s ready, CrowdStrike hands results back a page at a time until there’s nothing left to page through, and StackHawk is simpler, since it’s just scanning a handful of web applications in this case. All collections use pre-request and post -requests scripts via GET method to extract the data fields from the schema we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKLSU9kvSs7VN-IdCz7Q2Q.png" /><figcaption>Data Ingestion of the three enterprise tools via Postman API collection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8NOIw7uEBASq8G416pvkA.png" /><figcaption>API Collection run for Crowdstrike</figcaption></figure><p>Every collection ends the same way— it drops its results off via a relay server programmed to write the results out as a standardized CSV, so the rest of the pipeline never has to know or care which of the three tools a given row came from.</p><h3>Layer 1 — Parsing a semi-structured asset inventory &amp; IP-to-site enrichment via binary search</h3><p>The VMS (Vulnerability Management System) asset inventory Excel file is the backbone of everything. It maps subnets to hotel. Tags can also be made in Tenable to label where the assets belong, however we did not have this luxury at the time.</p><p>With this excel file, we have visibility and labelling of properties, network zones, and criticality information across 27 sites: 16 hotels, 3 corporate offices, 3 cloud environments.</p><p>This basic excel file data looks something like this conceptually — a site name in one cell, then a dozen zone/CIDR rows below it with no site identifier of their own.</p><p>This is the carry-forward pattern, and it&#39;s extremely common in real-world enterprise operational documentation. Here&#39;s how I handled it..</p><pre>raw = pd.read_excel(<br>      EXCEL_PATH,<br>      sheet_name=&#39;Scope&#39;,<br>      header=None,<br>      skiprows=6,<br>      nrows=291,<br>      usecols=[1, 3, 4]<br>  )<br>  raw.columns = [&#39;col_b&#39;, &#39;col_d&#39;, &#39;col_e&#39;]<br><br>  # Forward-fill site names from first row of each block<br>  raw[&#39;site_name&#39;] = raw[&#39;col_b&#39;].where(<br>      raw[&#39;col_b&#39;].notna() &amp; ~raw[&#39;col_b&#39;].str.startswith(&#39;scanner&#39;, na=False)<br>  ).ffill()</pre><p><strong><em>The result: a clean lookup table of named subnets, each tagged with a hotel property and zone name — ready for IP matching.</em></strong></p><p>Now for each of 13,745 findings, I needed to find which subnet — and therefore which property and zone — an IP belonged to. A naive nested loop works but doesn’t scale. I converted each subnet to an integer range and used binary search instead:</p><pre>import bisect, ipaddress<br><br>  # Pre-compute integer representations of networks and broadcast addresses<br>  df_subnets[&#39;network_int&#39;] = df_subnets[&#39;cidr&#39;].apply(<br>      lambda c: int(ipaddress.ip_network(c, strict=False).network_address)<br>  )<br>  df_subnets[&#39;broadcast_int&#39;] = df_subnets[&#39;cidr&#39;].apply(<br>      lambda c: int(ipaddress.ip_network(c, strict=False).broadcast_address)<br>  )<br>  df_subnets = df_subnets.sort_values(&#39;network_int&#39;).reset_index(drop=True)<br>  nets = df_subnets[&#39;network_int&#39;].tolist()<br><br>  def match_ip(ip):<br>      try:<br>          i = int(ipaddress.ip_address(str(ip).strip()))<br>      except ValueError:<br>          return None<br>      idx = bisect.bisect_right(nets, i) - 1<br>      if idx &gt;= 0 and i &lt;= df_subnets.iloc[idx][&#39;broadcast_int&#39;]:<br>          return df_subnets.iloc[idx]<br>      return None</pre><p>For each IP, I convert it to an integer, binary-search for the largest network start that’s still ≤ the IP, and confirm the IP is within that network’s broadcast range. This runs in 0 (log n) per lookup — fast enough to enrich the entire dataset in under a second.</p><p>Every Tenable finding now has a <strong>site_name</strong>, a <strong>zone_name</strong>, and the raw zone text that feeds into tier classification.</p><h3>Layer 3 — Regex for Asset Critically Tier Classification &amp; Composite Risk Score</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWmEUlw8Wdl8Vj3zGYEzSQ.png" /><figcaption>4 Tier Assest Classification for Business</figcaption></figure><p>With zone names in hand, I needed to classify every asset into a criticality tier. This is where business logic gets encoded as. I defined four tiers based on what each zone type means for hotel operations.</p><pre>  import re<br><br>  def get_tier(zone: str) -&gt; int:<br>      z = str(zone).lower()<br>      if re.search(r&#39;cde|payment|creditcard|card.?reader&#39;, z):<br>          return 1<br>      if re.search(r&#39;server|active.?directory|vmware|firewall|dmz|admin&#39;, z):<br>          return 2<br>      if re.search(r&#39;office|mgmt|management|pc|workstation|native|guessed&#39;, z):<br>          return 3<br>      return 4</pre><p>This function looks at a network zone’s name classifies how critical it is by checking for keywords — payment-related terms score a 1 (most critical), server/infrastructure terms score a 2, office/workstation terms score a 3, and anything that doesn’t match any of those falls through as a 4 (least critical). Tier score weights: <strong>T1=10, T2=7, T3=4, T4=1</strong> — a Tier 1 asset is treated as ten times more critical than a Tier 4 device.</p><blockquote>Composite Risk Scoring Formula</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HmfBEoaJSD8WS6wRVFxc4Q.png" /></figure><pre>import re<br>import pandas as pd<br><br># --- Step 1: classify each row&#39;s network zone into a criticality tier ---<br>def get_tier(zone: str) -&gt; int:<br>    z = str(zone).lower()<br>    if re.search(r&#39;cde|payment|creditcard|card.?reader&#39;, z):<br>        return 1<br>    if re.search(r&#39;server|active.?directory|vmware|firewall|dmz|admin&#39;, z):<br>        return 2<br>    if re.search(r&#39;office|mgmt|management|pc|workstation|native|guessed&#39;, z):<br>        return 3<br>    return 4<br><br>df[&#39;tier&#39;] = df[&#39;zone_name&#39;].apply(get_tier)<br><br># --- Step 2: flag findings that have a know<br>df[&#39;has_cve&#39;] = df[&#39;cve&#39;].notna() &amp; (df[&#39;cve&#39;].astype(str).str.strip() != &#39;&#39;)<br><br># --- Step 3: composite risk score ---<br>TIER_SCORES = {1: 10, 2: 7, 3: 4, 4: 1}<br>CVSS_FALLBACK = {4: 9.5, 3: 7.95, 2: 5.45, 1: 2.0}<br><br>df[&#39;tier_score&#39;] = df[&#39;tier&#39;].map(TIER_SCORES)<br><br>df[&#39;cvss_score&#39;] = df[&#39;cvss3_base_score&#39;].combine_first(df[&#39;cvss_base_score&#39;])<br>df[&#39;cvss_score&#39;] = df[&#39;cvss_score&#39;].fillna(dLBACK))<br><br>df[&#39;internet_facing&#39;] = df[&#39;zone_name&#39;].str.<br>    r&#39;dmz|firewall|waf|public|internet|web.?server|edge|perimeter&#39;,<br>    regex=True, na=False<br>).astype(float)<br><br>df[&#39;composite_risk&#39;] = (<br>    (df[&#39;cvss_score&#39;] / 10) * 0.40<br>    + (df[&#39;tier_score&#39;] / 10) * 0.35<br>    + df[&#39;has_cve&#39;].astype(float) * 0.15<br>    + df[&#39;internet_facing&#39;] * 0.10<br>)</pre><p>Each row starts as a network zone name and a raw CVSS score, and gets run through a short chain of lookups. First, the zone name is matched against keyword patterns to assign a criticality tier — payment-related zones score highest, servers next, office equipment lower, everything else lowest — and that tier is converted to a 0–10 weight.</p><p>Separately, the pipeline picks the best CVSS score available for that finding (v3 if present, v2 as backup, and a fixed midpoint if neither exists), and checks two more things: whether the finding has a known CVE attached, and whether its zone name suggests it’s reachable from the internet.</p><p>Those four signals — vulnerability severity, asset criticality, CVE presence, and internet exposure — are then combined into one weighted average, with severity and asset criticality carrying the most weight. The result is a single 0–10 risk score per finding that reflects not just how bad a vulnerability is, but how much it actually matters given what it’s running on.</p><h4>Layer 4 — Service Level Agreement and Compliance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*GPjcBk8-FeHCBohZ6uzedQ.png" /></figure><pre>import pandas as pd<br><br># --- Step 1: parse the raw &quot;first_found&quot; timestamp from the scanner export ---<br>df[&#39;first_found_parsed&#39;] = pd.to_datetime(df[&#39;first_found&#39;], errors=&#39;coerce&#39;)<br><br># --- Step 2: SLA window (in days) per severity level ---<br>SLA_DAYS = {4: 7, 3: 30, 2: 90, 1: 180}<br><br># --- Step 3: age each finding and compare against its SLA window ---<br>df[&#39;days_open&#39;] = (<br>    pd.Timestamp.today().normalize() - df[&#39;first_found_parsed&#39;]<br>).dt.days<br><br>df[&#39;sla_days&#39;]     = df[&#39;severity_id&#39;].map(SLA_DAYS)<br>df[&#39;sla_overdue&#39;]  = df[&#39;days_open&#39;] &gt; df[&#39;sla_days&#39;]<br>df[&#39;days_overdue&#39;] = (df[&#39;days_open&#39;] - df[&#39;sla_days&#39;]).clip(lower=0)</pre><p>Each finding’s age is calculated by subtracting the date it was first discovered from today’s date, giving a simple day count.</p><p>That count is then compared against the SLA window for its severity — looked up from the same dictionary used for the table above — to flag whether it’s overdue, and by how many days (clip(lower=0) just keeps that number from going negative for findings that are still within their window).</p><blockquote>This creates the accountability for our team.</blockquote><blockquote>No email saying, “we have 669 criticals” — but “we have 669 criticals, and 95% of them are past the 7-day window by an average of X days.”</blockquote><blockquote>That’s a sentence a CISO can act on.</blockquote><h4>The Power BI Dashboard</h4><p>The enriched dataset feeds directly into Power BI via a Python Script data source. No intermediate file. Query refresh re-runs the pipeline against the latest CSV drop. The dashboard has two pages, each serving a different audience.</p><pre>tenable_transform.py — Power BI &quot;Python script&quot; data source<br># Power BI runs this script on every query refresh and loads whichever<br># pandas DataFrame is named `df` as a table. No CSV export, no intermediate file.<br><br># ... enrichment, tier classification, composite risk, SLA (Layers 1-5) ...<br><br>keep = [<br>    &#39;plugin_name&#39;, &#39;severity_label&#39;, &#39;cvss_score&#39;, &#39;composite_risk&#39;, &#39;risk_label&#39;,<br>    &#39;site_name&#39;, &#39;zone_name&#39;, &#39;criticality_tier&#39;, &#39;is_pci_scope&#39;, &#39;internet_facing&#39;,<br>    &#39;asset_ip&#39;, &#39;asset_hostname&#39;, &#39;days_open&#39;, &#39;sla_overdue&#39;, &#39;days_overdue&#39;,<br>]<br>df = df[[c for c in keep if c in df.columns]].copy()<br><br>2. Page 1 — Executive Summary (real visual definitions, trimmed):<br><br>exec_visuals = [<br>    visual(&#39;card&#39;, ..., [agg_sel(&#39;composite_risk&#39;, 1)], title=&#39;Avg Risk Score (0-10)&#39;),<br>    visual(&#39;card&#39;, ..., [agg_sel(&#39;plugin_id&#39;, 5)], title=&#39;Open PCI-Scope Findings&#39;,<br>           filters=[_in_filter(&#39;is_pci_scope&#39;, [True]),<br>                    _in_filter(&#39;severity_label&#39;, [&#39;Critical&#39;, &#39;High&#39;])]),<br>    visual(&#39;card&#39;, ..., title=&#39;Total Open Findings&#39;),<br><br>    visual(&#39;clusteredBarChart&#39;, ..., [col_sel(&#39;site_name&#39;), agg_sel(&#39;composite_risk&#39;, 0)],<br>           title=&#39;Property Risk Ranking&#39;, order_by=order_desc_agg(&#39;composite_risk&#39;, 0)),<br><br>    visual(&#39;donutChart&#39;, ..., [col_sel(&#39;sla_overdue&#39;), agg_sel(&#39;plugin_id&#39;, 5)],<br>           title=&#39;SLA Status — Critical &amp; High&#39;,<br>           filters=[_in_filter(&#39;severity_label&#39;, [&#39;Critical&#39;, &#39;High&#39;])]),<br>]<br><br>3. Page 2 — Security Operations (real, trimmed):<br><br>ops_visuals = [<br>    visual(&#39;clusteredBarChart&#39;, ..., [col_sel(&#39;site_name&#39;), agg_sel(&#39;days_overdue&#39;, 3)],<br>           title=&#39;Max Days Overdue by Property&#39;, filters=[_gt_filter(&#39;days_overdue&#39;, 0)]),<br><br>    visual(&#39;matrix&#39;, ..., [col_sel(&#39;criticality_tier&#39;), col_sel(&#39;site_name&#39;), agg_sel(&#39;composite_risk&#39;, 0)],<br>           title=&#39;Risk Matrix — Tier × Property&#39;),<br><br>    visual(&#39;tableEx&#39;, ...,<br>           [col_sel(&#39;site_name&#39;), col_sel(&#39;asset_ip&#39;), col_sel(&#39;plugin_name&#39;),<br>            col_sel(&#39;severity_label&#39;), col_sel(&#39;days_open&#39;), col_sel(&#39;cvss_score&#39;),<br>            col_sel(&#39;composite_risk&#39;)],<br>           title=&#39;Oldest Open Findings — Critical &amp; High&#39;,<br>           filters=[_in_filter(&#39;severity_label&#39;, [&#39;Critical&#39;, &#39;High&#39;])],<br>           order_by=order_desc_col(&#39;days_open&#39;)),<br>]</pre><blockquote><strong>Page 1 — Executive Summary</strong></blockquote><p>This page is designed for a director who has 90 seconds before a board call. At a glance:</p><p>- Total open findings by severity, broken out as KPI cards</p><p>- Critical findings vs. SLA compliance — the 95% overdue stat lives here as a gauge visual</p><p>- Risk heat map — properties on one axis, criticality tiers on the other, composite risk score as color intensity</p><p>- Top 5 highest-risk properties ranked by composite score, not raw count</p><p>The goal is to answer: Where is the portfolio most exposed, and are we keeping up?</p><blockquote><strong>Page 2 — Security Operations</strong></blockquote><p>This page is for the security analyst who owns the remediation queue. Filters by property, tier, and severity. Visuals include:</p><p>- Per-asset vulnerability counts with SLA status</p><p>- CVE inventory — which CVEs are present, how many hosts, when first seen</p><p>- Overdue critical findings sorted by days past SLA</p><p>- Tier 1 and Tier 2 assets with open criticals, IP addresses, hostnames, plugin names</p><p>The operations page answers: <strong>What exactly do I patch next, and on which machine?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fgv4Wzj4iYFyr1AB1_yAgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UP6QV327VypF0zt3m480yg.png" /></figure><blockquote><strong>The property view — from portfolio to a single site</strong></blockquote><p>Clicking a property in the ranking chart drops you into a per-site page that answers a narrower question: not “how’s the portfolio doing” but “what’s actually wrong at this hotel.” It shows a KPI strip (critical count, high count, overdue findings, SLA compliance), a tier breakdown and severity chart at a glance, and then a sortable, resizable findings table — IP, hostname, CVE, CVSS, days open, days overdue, tier — capped at the top 500 by risk so the page stays responsive even on a property with a heavy backlog.</p><h4>How a semantic model could scale this project</h4><p>The blog’s pipeline — one flat pandas dataframe feeding a static .pbix — works cleanly at the scale it was built for, but it has a ceiling. Every refresh means re-running the enrichment and risk-scoring logic over the entire dataset from scratch, and there’s no way to give different viewers different secured slices of the same file — everyone who opens it sees everything. That’s fine for one person building one dashboard off a periodic export; it stops being fine once the data volume and the number of simultaneous viewers both grow past what a single shared file can reasonably hold.</p><p>A semantic model solves this by replacing the flat table with a star schema — one central fact table surrounded by dimension tables for things like asset, severity, and department — connected by declared relationships instead of code. Each relationship is a pre-wired join: click a department in a slicer, and that filter automatically propagates through the relationship graph to scope every chart and measure built on the fact table, with no query written by hand. The same mechanism doubles as an access boundary — tying a viewer’s login to a row in the department dimension via a relationship means each person’s filter is enforced automatically, so many people can query the same live data concurrently and each still only sees what they’re authorized to see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mbe-pTgy3QaTwJXgyEcCnQ.png" /><figcaption>Enterprise Level extension — Semantic Model</figcaption></figure><p>None of this makes the vulnerabilities go away — it just makes it possible to see which ones actually matter, and to whom. That distinction is the whole job: a scanner produces data, but a security program runs on decisions, and decisions need context a raw finding never carries on its own.</p><p>Every layer in this build — the enrichment, the scoring formula, the SLA clock, even which chart lives on which page — exists to answer one question a raw scanner export never could: not how bad is this, but how much should we care? That’s the real deliverable. Not the dashboard, not the pipeline, but the translation between a number a machine produced and a decision a person can actually stand behind.</p><blockquote>I’m a cybersecurity engineer who builds data systems at the intersection of security operations and business intelligence.</blockquote><p>Thank you for taking the time to read this blog entry!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=450c80a087fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sysmon config & threat hunting w/ Splunk SIEM]]></title>
            <link>https://medium.com/@fsantos094tmc/sysmon-config-threat-hunting-w-splunk-siem-fc650b2a658f?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc650b2a658f</guid>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sysmon]]></category>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 02:13:54 GMT</pubDate>
            <atom:updated>2024-06-14T02:20:23.245Z</atom:updated>
            <content:encoded><![CDATA[<p>LinkedIn: <a href="https://www.linkedin.com/in/fabio-henrique-santos-5964361b4/">(3) Fabio Henrique Santos | LinkedIn</a></p><p>I n threat-hunting scenarios, the baseline simulated activity of an environment can be leveraged to identify abnormal process behavior and to determine the scope of an incident.</p><p>Sysmon provides granular visibility into various aspects of system activity, including process creation, network connections, file modifications, and registry changes.</p><p>Configuring Sysmon and deriving a baseline on trusted host systems is an important step in incident response readiness. With this, SOC team members can identify potential security gaps, vulnerabilities, or misconfigurations.</p><p>Thank you for joining me for this blog entry! We will be going through some Sysmon configuration concepts and a threat-hunting scenario using Splunk.</p><h4>Creating an XML Sysmon Configuration file</h4><p>Defining proper filtering and exclusion rules in XML configuration can increase performance and save storage while providing greater entropy amongst triggered events in Sysmon to help reduce false positive alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vVKsyq-WXEubLzK1B0jpvw.png" /><figcaption>Schema for Sysmon Configuration</figcaption></figure><p>Depending on the environment in which Sysmon is deployed, additional configurations should be done to address specific groups, users, and applications being run during business workflow.</p><p>Some sources on GitHub can be used to enhance coverage of MITRE ATT&amp;CK techniques and exclude known behaviors with Sysmon:</p><ul><li><a href="https://github.com/SwiftOnSecurity/sysmon-config">https://github.com/SwiftOnSecurity/sysmon-config</a></li><li><a href="https://github.com/olafhartong/sysmon-modular">https://github.com/olafhartong/sysmon-modular</a></li></ul><p>For this blog entry, we will be creating a compound Sysmon rule which will consist of an XML configuration file with:</p><ul><li>Exclusion for ‘<em>svchost.exe</em>’ normal processes</li><li>Monitoring inclusion rules from threat intelligence for lsass.exe process access and GrantedAccess permission levels</li><li>Exclusion for trusted host machine normal process creation behaviour.</li></ul><p>This will be done with the help of the PowerShell Module ‘psgumshoe’ <a href="https://github.com/PSGumshoe/PSGumshoe">https://github.com/PSGumshoe/PSGumshoe</a> which has a ‘Convert-to Sysmonrule’ cmdlet which we can then use with Visual Studio code to create our own Sysmon configuration XML file.</p><ul><li>After installing Sysmon from Sysinternals, open Administrator PowerShell window use command — <strong><em>sysmon -c </em></strong>to view configuration then<strong><em> — sysmon -s | more </em></strong>to view schema for XML</li><li>Install ‘Sysmon’ extension by Dark Operator in Visual Studio Code and create file named “lsass_svchost_processbaseline.xml”</li><li>Search templates from references on GitHub</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gaEi9O0jFNxfEBeV0ooSg.png" /><figcaption>XML configuration file for Sysmon with lsass access and svchost process creation</figcaption></figure><p>Now by using the PSgumshoe module in Powershell we can run:</p><ul><li>Get-SysmonProcessCreateEvent | select user,parentcommandline, commandline -Unique | ConvertTo-SysmonRule</li></ul><p>This pipeline will generate a rule based on the current activity of the host machine in relation to Event ID 1 – Process Creation.</p><p>In the XML file we will exclude these to not trigger Sysmon unnecessarily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpBMl3yE_Jj0lLBs0p7b3g.png" /><figcaption>Building baseline of process creation on host machine</figcaption></figure><ul><li>Copy rule to clipboard and paste into “<em>lsass_svchost_processbaseline.xml</em>” in Visual Studio and save into appropriate directory.</li><li>Configure Sysmon with newly created XML file —<strong><em> sysmon -c ‘lsass_svchost_processbaseline.xml’</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIftOZii2hHOJCrfCJuLWA.png" /><figcaption>Sysmon configuration complete</figcaption></figure><p>This is one use case of a tailored Sysmon configuration file. The objective of this blog is to illustrate the limitations and capabilities of Sysmon and how it can be fine-tuned.</p><p>Using MITRE ATT&amp;CK Navigator along with a comprehensive understanding of your particular environment, these concepts can be used by blue-teamers to gain better coverage of their systems.</p><h4>Threat Hunting Scenario w/ Splunk SIEM tool</h4><blockquote>Hypothesis:</blockquote><p><strong><em>A Microsoft application has loaded an unsigned library from the Appdata folder</em></strong></p><ul><li>Add Data to Splunk</li><li>Generate query based on Sysmon EventIDs and the extracted fields relevant to the hypothesis</li></ul><p>For this threat-hunting scenario we will assume that our system has been compromised via malicious use of Office 365 and that it is the <strong>parent process</strong> of an unsigned library.</p><p>Our first query will search for processes created by Office 365 Word. It should look something like this, in the source file — <em>source= “5295-win82-sysmon.json”</em></p><pre>Event.EventData.ParentImage = *winword.exe &quot;Event.System.EventID.$&quot;=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tN1kgPRRP4OEClVPYioPUw.png" /><figcaption>Figure 1: Winword.exe Process Creation- Suspicious ier.dll</figcaption></figure><p>Here we can see that the Word has created a process <strong>rundll32.exe — 10624 </strong>image and executed it on a <strong>writable path </strong>which raises suspicion.</p><p><strong>Indicator of Compromise</strong>:</p><p>c:\\users\\jerry.knapp\\<strong>appdata</strong>\\roaming\\microsoft\\templates\\<strong>ier.dll,HEEPUBQQNOG”,</strong></p><p>With this information, we can craft a follow-up query to filter for the image loaded, i.e., Sysmon Event ID 7.</p><pre>Event.EventData.ImageLoaded = *ier.dll &quot;Event.System.EventID.$&quot;=7</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*JlNizaJyU7otlfrWh8HPQg.png" /><figcaption>Figure 2: Loaded image details</figcaption></figure><p>This will be the point from which we begin to understand the scope of the incident as we ask questions relating to the <strong><em>past, present, &amp; future </em></strong>of the event timeline.</p><blockquote><strong>1. PAST — What are the processes leading up to this event?</strong></blockquote><p>From what we can see in Figure 1, the parent process of the loaded <strong>ier.dll</strong> image is <strong>winword.exe — 11296</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*swCaoF0_m5RVqtD8qTl86A.png" /><figcaption>Figure 3 Parent Processes</figcaption></figure><p>In the extracted fields section, a parent process of winword.exe is shown. By clicking on this, Splunk will display the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9vB2YcB7SslydFU4xpa1A.png" /><figcaption>Figure 4. PID 9672 explorer.exe</figcaption></figure><h4><strong>Discovery &amp; Implication:</strong></h4><p>When comparing the ‘<strong>CommandLine</strong>’ in Figure 5 and the ‘<strong>ParentCommandLine</strong>’ in Figure 1, it is evident that the user Jerry Knapp while on Internet Explorer (<strong>Process ID 9672</strong>) clicked on something that opened winword.exe (<strong>Process ID 11296)</strong>. This inherently downloaded a malicious document <strong>0714_6656030531.doc</strong> that is responsible for the unsigned image <strong>ier.dll (Process 9768)</strong> being loaded by <strong>rundll32.exe (Process 10624)</strong>.</p><p>The figure below illustrates some other activities by this winword.exe process ID 11296. These include Event ID 11 for file creation, 13 for registry set value, and 23 for file deletion which can be subject to further investigation.</p><pre>source=&quot;5295-win82-sysmon.json&quot; &quot;Event.EventData.ProcessId&quot;= 11296 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3pccps2Bu_BcTxPE53G2w.png" /><figcaption>Figure 5:More activities related to past events of IOC</figcaption></figure><pre>&quot;Event.EventData.ProcessId&quot;= 11296 &quot;Event.System.EventID.$&quot;=13</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhxqCg5nWC2o3GHwgqi2ew.png" /><figcaption>Figure 6: Registry Set Value</figcaption></figure><p>In this event we see that an Event ID 13 set the binary data of the downloaded <strong>0714_6656030531.doc </strong>to a registry value in HKEY_Current_User…<strong>\Trusted Documents\ </strong>before the image had been loaded into memory.</p><blockquote><strong>2. PRESENT/FUTURE — What activities include the same processes &amp; user? What are the network connections related to this event?</strong></blockquote><p>Let’s run a query to see what else we can find in relation to the event found in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6Iyj8Se6IoXUcHdT6mv7A.png" /><figcaption>Figure 7: Event ID 3</figcaption></figure><p>In this Figure, the field section shows activities related to Event ID 3 — Network Connection. We can see that several IPs can be further investigated. We can try Event ID 22.</p><pre>&quot;Event.EventData.ProcessId&quot;=9768 or &quot;IPAddress&quot; &quot;Event.System.EventID.$&quot;=22</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*L3NjGGalcubCeom3awy4aw.png" /><figcaption>Figure 8: DNS Request</figcaption></figure><ul><li>4a5ikol.ru — 8.211.241.0</li><li>wortlybeentax.com — 194.147.78.155</li><li>api.ipify.org — 50.16.216.118</li></ul><p>By searching through the events for each IP, some domain names were found that are possible indicators of a C2 infrastructure.</p><p><strong>Discovery &amp; Implication</strong></p><p>From this point, we can assume that the C2 infrastructure is exfiltrating data, attempting to enumerate the company domain to move laterally and escalate to higher administrative privileges.</p><p>With this in mind, I took a different approach in my next query by using Event ID 10 — Process Access and structuring the Splunk search using TargetProcessID as a field name.</p><pre>&quot;Event.EventData.TargetProcessId&quot;=9768 &quot;Event.System.EventID.$&quot;=10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSB1EgUxjM71bxEDOMMqFQ.png" /><figcaption>Figure 9: Credential Dumping</figcaption></figure><p>The Windows Error Reporting service executable (werfault.exe) is responsible for handling errors and crashes in Windows applications and services. Attackers can exploit werfault.exe to dump credentials by forcing it to interact with the LSASS process, which stores various types of security information, including user credentials.</p><p>Once a process has crashed Windows Error Reporting will create a memory dump file. In this scenario, werfault.exe handled a forced crash of LSASS so that the attacker was able to discreetly access sensitive information.</p><p><strong>Conclusion:</strong></p><p>Threat hunting with Sysmon (System Monitor) is important for enhancing an organization’s security posture. Properly configured Sysmon can enhance visibility, improve threat detection, and optimize performance.</p><p>By focusing on relevant events, reducing noise, and tailoring the configuration to the specific environment, organizations can leverage Sysmon to its full potential, making it a powerful tool in the cybersecurity arsenal.</p><p>The source file <em>“5295-win82-sysmon.json” </em>used in this hunt has 163,390 events with many more examples of adversary techniques but to keep this blog a reasonable length I have only shown a few examples.</p><p>Thank you to those who took the time to read this blog entry…more on the way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc650b2a658f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contopee— Basic Static Analysis & Behavioral Analysis]]></title>
            <link>https://medium.com/@fsantos094tmc/contopee-basic-static-analysis-behavioral-analysis-c85d9de91def?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/c85d9de91def</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[information-technology]]></category>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Thu, 29 Feb 2024 16:39:51 GMT</pubDate>
            <atom:updated>2024-05-14T13:48:59.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*2RfasYyehLAWf0Yc4aIyVQ.png" /><figcaption>North Korean APT Group</figcaption></figure><p>The North Korean threat actor group known as Lazarus developed malware that conducted the first attack by a nation-state on a private company.</p><p>In 2016, they stole $81 million from a Bangladesh bank. This malware is described as a proxy-aware backdoor that communicates using a custom-encrypted binary protocol.</p><p><strong>Before we begin…</strong></p><p>As we approach a malware sample, it is important to consider the following objectives:</p><ul><li><em>What are the capabilities of this malware? How much control does it give to the attacker?</em></li><li><em>How is it communicating to C&amp;C?</em></li><li><em>How does it maintain persistence?</em></li><li><em>What are the indicators of compromise?</em></li><li><em>What are the types of encryption used in malware?</em></li><li><em>Can we decrypt the pcap? Can we extract the commands and the exfiltrated data?</em></li><li><em>Can it spread through the network?</em></li></ul><p>Through the analysis process, we will do our best to report our findings concerning these questions.</p><p><strong>Let’s jump into a VM and begin the analysis…</strong></p><p><strong>STAGE 1: Identify functions of the malware via API in strings and native Windows Libraries</strong></p><ul><li>Using the PEiD tool in the VM, drag the file in to view if it is packed or unpacked.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*mnkwyK0oO6aVKIATa8mM0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*43AgyKkVjmDgM0SMHVYzxQ.png" /><figcaption>Figure 1: PEiD tool</figcaption></figure><p>This static analysis tool can scan the PE (Portable Executable) file for signatures.</p><p>In our example Figure 1, PEiD was able to identify the language of the malware, which is C ++, and the name of the Entry Point sections.</p><p>If for instance the file was packed, it would have typically shown UPX in the EP section names. Other common packers are PECompact, and Aspack.</p><p>From viewing the section names we can begin to understand some of the functionality of the malware. These sections represent parts of the binary.</p><ul><li>.text — contains instructions that the CPU executes are located</li><li>.rdata (read-only data) — is where constant strings and other static data that are needed for the executable to run.</li><li>.data — this section can provide insights into variables, buffers, or other data structures used in the malicious code.</li><li>.rsrc (resource section)- this indicates that this malware is using resources that may store additional payloads, configuration data, or hidden functionalities.</li></ul><p><strong>Now let’s drop the file into the Windows command line and draw out the strings…</strong></p><ul><li>Use command — <em>strings (File_Path) &gt; contopee.txt</em> to save the strings in a text file for examination.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xxvv6-n5GZtYnS-Aapyz-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T2Ai7LY9FZfDjSFNB622Kg.png" /><figcaption>Figure 2: Extracting Strings</figcaption></figure><p>By searching through the list we can discover some API function names, file paths, and configuration info related to the malware.</p><p><strong>Let’s cross-check this with the PEstudio analysis tool…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxiiaJ0kuAZ9fDRN4Xv2Mg.png" /><figcaption>Figure 3: PEStudio</figcaption></figure><p>This tool provides a variety of features to inspect the Portable Executable in more detail. Let’s search through them, and compare it with the information we found in Figure 2.</p><p><strong>At this point of our analysis we can draw on some conclusions about the functionality of the malware…</strong></p><p><strong>Registry modification </strong><em>— RegSetValueEx, RegCreateKey, RegDeleteKey:</em></p><p>According to Microsoft Windows documentation, these APIs set the data and type of a specified value under a registry key, creates a registry key and deletes a subkey and its value from the specified platform-specific view of the registry.</p><p>This information along with the strings found in Figure 2 including:</p><ul><li>SOFTWARE\Microsoft\Windows NT\CurrentVersion</li></ul><p>The malware may be <strong>maintaining persistence and/or defense evasion </strong>with these calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*EzNTxb9NTMYn5-mu6jhBxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*QZAVrUo9--xsC0o2mWVHFQ.png" /><figcaption>Figure 4: PEStudio Strings Address in Memory</figcaption></figure><p>Also with the PEStudio tool, we can view the offset which refers to the distance in bytes from a reference point to a specific location loaded in memory. The offset provides the <strong>RVA (Relative Virtual Address) </strong>position of where these functions will be called within the PE file.</p><p><strong>Another series of suspicious API calls in the malware…</strong></p><p><strong>Process Discovery and Execution</strong><em> — GetCurrentProcessId, CreateProcessAsUser, TerminateProcess, Process32Next, Process32First, OpenProcess, CreateToolhelp32Snapshot, CreateProcess.</em></p><p>Researching these calls in the Microsoft documentation reveals to us that the malware is opening a process and creating a thread within the primary process. This is possible evidence of process injection.</p><p><strong>Let’s take a look at what Native Windows libraries the malware is importing using the the CFF Explorer tool…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*noy1Pry1eojG3r0RUaraIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*F7PaNAkh20J8jjamW-qS-g.png" /><figcaption>Figure 5: CFF Explorer</figcaption></figure><p>On the left, we selected the ‘<em>Optional header</em>’ of the PE file, which contains additional information on the executable, such as AddressOfEntryPoint.</p><p>When we select ‘Import Directory’ on the right image above, we can see the modules that have been imported along with the number of functions being used from each library. Here is a closer look…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*Af7KI8vAXP7Eoj198vCIDQ.png" /><figcaption>Figure 6: Windows functions used in malware</figcaption></figure><p>Out of the 5 imported Windows libraries used, an interesting series of commands is discovered in the ‘ADVAPI32.dll’.</p><p>This module provides a variety of functionalities related to advanced Windows API services, including security, authentication, and registry operations. Other services include Access Control Lists (ACLS), User Account Management, and Cryptographic Services.</p><p><strong>From researching the functions used from the ADVAPI32.dll —</strong> <em>DuplicateTokenEx, SetTokenInformation, AdjustTokenPrivileges, CreateProcessAsUserW, LookupPrivilegeValueW</em></p><p>We can resolve that the malware is using an <strong>Access Token Manipulation</strong> identified in the MITRE ATT&amp;CK framework as technique T1134 either to get the privilege to create a thread in a process or for defense evasion.</p><p><strong>STAGE 2</strong>: <strong>Understand how the malware behaves in a controlled environment</strong></p><ul><li>Open Process Monitor and filter using Process Name with ‘contopoee.exe’</li><li>Execute Contopee via command line and view events</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*JnYzY9PKBdSr3Cdhw5JlUw.png" /><figcaption>Figure 6: Procmon results for Contopee.exe</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFxE-KrQUebQRzDlrq9p8A.png" /><figcaption>Figure 7: Process Tree</figcaption></figure><ul><li>Additionally, you can press Ctrl + T to view the process tree</li></ul><p>After scrolling through the tool results, we can see that the registry key discovered earlier.. <em>‘SOFTWARE\Microsoft\Windows NT\CurrentVersion</em>’ has been accessed. This time we can take a closer look at the values the malware was setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j51uEegO9Ve9LS2ddrUxGA.png" /><figcaption>Figure 8: Registry Key Value Entry</figcaption></figure><p><strong><em>HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Image File Execution Options\Contopee.exe</em></strong> — In this registry entry, the malware has set a specific execution option for Contopee.exe. This correlates with the MITRE ATT&amp;CK framework technique T1546.012 ‘Event Triggered Execution: Image File Execution Options Injection’ for persistence and privilege escalation.</p><p><strong><em>HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\GRE_Initialize\DIsableMetaFiles — </em></strong>This registry value indicates that the malware was possibly trying to take advantage of the Microsoft graphics component. According to Microsoft Documentation Security Bulletin MS15–035, this series of events may exploit a vulnerability that could allow for remote code execution.</p><blockquote><strong>WHAT’S NEXT?..</strong></blockquote><p>Perform Static Code Analysis and Reverse Engineering to better understand the functionalities of the malware. This will be a new blog entry so stay tuned.</p><p>Thank you for visiting my blog page!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c85d9de91def" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Capstone Project — Finding Vulnerabilities on a Remote System using Metasploit]]></title>
            <link>https://medium.com/@fsantos094tmc/capstone-project-finding-vulnerabilities-on-a-remote-system-using-metasploit-ce2c120792a8?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce2c120792a8</guid>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 17:09:27 GMT</pubDate>
            <atom:updated>2023-12-05T17:09:27.894Z</atom:updated>
            <content:encoded><![CDATA[<h3>Capstone Project — Finding Vulnerabilities on a Remote System using Metasploit</h3><p>LinkedIn: <a href="https://www.linkedin.com/in/fabio-henrique-santos-5964361b4/">(3) Fabio Henrique Santos | LinkedIn</a></p><p>With this tool, penetration testing teams can use precomposed or custom-made code that can be ran against a network to probe for vulnerabilities. Once the information on the services running on the target system is collected, it can then be used to address systemic weaknesses through exploitation methods.</p><p>For this practical, I have chosen to use Ubuntu 22.04 VM and have gone through the steps necessary to have the Metasploit framework installed and ready to run, as shown below:</p><ol><li>Install prerequisite packages, including curl, postgresql, and postgresql-contrib. Run the following command to install these packages <strong>— <em>$ sudo apt install curl postgresql postgresql-contrib</em></strong></li><li>Run the following command to download and save the Metasploit installer script as —<strong> <em>msfinstall: $ curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploitframework-wrappers/msfupdate.erb &gt; msfinstall</em></strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*bBARchepP1W3YI4MIk_Oiw.png" /><figcaption>Figure 1: Metasploit framework installed</figcaption></figure><p>3. Assign the “read” and execute access for everyone on the installer script —<strong><em>$ chmod 755 msfinstall</em></strong></p><p>4. Now, run the “msfinstall” installer script for the installation of the Metasploit Framework —<strong><em> $ sudo ./msfinstall</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*ec_IVZmjryrgASZzk4Ieow.png" /><figcaption>Figure 2: Ready to use against remote system</figcaption></figure><p>Now from here, I have set up a Windows 10 Virtual Machine which has a bridged network connection allowing for my physical machine to be connected to the virtual computers on the same network. The Windows 10 computer will be the target system for the Ubuntu 22.04.</p><p>After using ipconfig in the Windows machine the target IPv4 address has been determined. We will then run Nmap on the Ubuntu system with the target IP Address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*2B_7aPlI9GQBj6BEP6K9ig.png" /><figcaption>Figure 3: Target system information</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*0_Taafx6emN2eRKUSv__Zw.png" /><figcaption>Figure 4: Nmap scan of IPv4 of Windows Client</figcaption></figure><p>From this information, we can see that are services running which can be further investigated to discover more details about the specific ports being used.</p><p>By adding — <strong>sV</strong> to the command above, a more detailed version is displayed in the terminal.</p><p>Before we launch the Metasploit framework, it would be useful to discuss what an SMB protocol is and how it relates to the basic functions and services of the ports displayed above.</p><h4>Server Message Block</h4><p>SMB is an application layer protocol that allows for file, printer, device sharing, and inter-process communication (IPC) between applications on a network through a client-server architecture.</p><p>In other words, a network’s computers (SMB clients) can connect to SMB servers to access shared files and directories or perform tasks like printing over the network. SMB has always been a network file-sharing protocol. As such, SMB requires network ports on a computer or server to enable communication with other systems. SMB uses either IP port 139 or 445.</p><p>Quite some SMB-related vulnerabilities were discovered over the years and these vulnerabilities caused serious security issues around the world.</p><p>After changing the settings on the Windows 10 client (which invoked a restart) the target system is now 192.168.0.186. We must find out if it is susceptible to SMB attacks.</p><h4>Using Metasploit:</h4><p>After launching Metasploit we can then search deeper for SMB scanner exploitation tools. The <strong>smb_ms17_010 </strong>will be the exploit to confirm if the target 192.168.0.186 is susceptible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*RSXI_QbH5zStNnIcfTBORQ.png" /><figcaption>Figure 5: SMB grep search</figcaption></figure><p>Using the Metasploit framework we should choose an exploit that the target system is most likely vulnerable to. This has been identified by the use of the following command in the Linux terminal window..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*OauEIpPcfk8sGEuK-hMsSg.png" /><figcaption>Figure 6: SMB scan</figcaption></figure><p>With this gathering of information, it was determined that launching an SMB exploit on this machine would increase the chances of later gaining a command and control position over the victim.</p><p>Next, we use ‘grep exploit search smb’ on the command line to select from several exploits available.</p><p>In this case, exploit/windows/smb/ms17_010_psexec has been chosen. From then it is necessary to submit the payload that will be launched against the Windows 10 client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*yxhoYsu_Ce3MtjCXzWTMZw.png" /><figcaption>Figure 7: Payload selected against Windows</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*LUD0tViJhAKAqWTLahk8ng.png" /><figcaption>Figure 8: Remote Access</figcaption></figure><p>After entering the commands displayed above, remote control over the opposing system has been achieved.</p><p>The malicious payload used above was Meterpreter. This is an attack payload that provides an interactive shell to the attacker from which to explore the target machine and execute code. It is performed by using DLL injection.</p><p>As a result, Meterpreter resides entirely in memory and writes nothing to disk. No new processes are created as Meterpreter injects itself into the compromised process, from which it can migrate to other running processes.</p><h4>About SNORT</h4><p>Snort is an open-source network intrusion detection/prevention system. The purpose of this tool is to defend against exploitation attempts such as the one illustrated earlier.</p><p>This system when executed is capable of monitoring real-time traffic via packets.</p><p>It can perform protocol analysis, content searching/matching, and can be used to detect a variety of attacks and even probes, buffer overflows, stealth port scans, CGI attacks, SMB probes, OS fingerprinting attempts, and much more.</p><p>This first screenshot shows the installation process of Snort, where it has to be downloaded from a web browser and then into the Local Disk C drive. A simple change of directory from the command line can bring us to the Snort system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*itr0EOiAWf9uYA9lT2iSFA.png" /><figcaption>Figure 9: Initializing SNORT Intrusion Prevention System on Windows 10 Client</figcaption></figure><p>From here we type in the command ‘cd bin’ and then ‘snort.exe’ to officially launch the system. When successful the information should display the following details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*LI1hWqx7XYJUVV5h_NcdLA.png" /><figcaption>Figure 10: Snort</figcaption></figure><p>Furthermore, Snort could be utilized as a packet sniffer like a tcpdump or Wireshark. It is also capable of being used as a network file-logging device.</p><p>From this point, the administrator can set up rules and policies to better regulate the system and defend against potential threats.</p><p>To summarize, the purpose of this blog was to give the reader a basic understanding of pen-testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce2c120792a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Investigation into Real-life Attack Scenario Part Two:]]></title>
            <link>https://medium.com/@fsantos094tmc/a-brief-investigation-into-real-life-attack-scenario-part-two-8ce1a9c2d1de?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce1a9c2d1de</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[dfir-conference]]></category>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 14:18:44 GMT</pubDate>
            <atom:updated>2024-03-21T17:41:08.580Z</atom:updated>
            <content:encoded><![CDATA[<p>Triage with Kape collection and Memory Forensics using Volatility3</p><p><a href="https://www.linkedin.com/in/fabio-henrique-santos-5964361b4/">Fabio Henrique Santos | LinkedIn</a></p><p>In this blog entry, we will be continuing the attack investigation from part one, <a href="https://thedfirreport.com/">The DFIR Report — Real Intrusions by Real Attackers, The Truth Behind the Intrusion</a>.</p><h4>Current Scenario:</h4><p>During the first part of the investigation, we were able to identify a local machine that had been communicating with unknown domains. It is suspected that this is a possible C&amp;C by which to command the ransomware.</p><p>Through packet analysis, it has been made clear that there is malicious traffic traveling throughout the network. The local machine in question is 10.100.100.69.</p><p>At this point. it would be useful to discover who workstation 10.100.100.69 is, and the IP address of the Domain Controller.</p><ul><li>using the same pcap from earlier, type <strong><em>— kerberos</em></strong> as a filter…</li></ul><p>Through this filter, we can deduce that all LDAP requests are going to the Domain Controller as it is the machine in the network that will authenticate all local workstations before they access company resources.</p><p>In the image below we can see that there are LDAP requests to DC 10.100.100.20 from infected machine 10.100.100.69 which has been revealed to be user ‘Harvey. Swanson’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FA1uQOULmFGwQxyFJoBBPQ.png" /><figcaption>Figure 0.1 — Identifying infected hosts</figcaption></figure><p>After following some of the TCP streams in this filter, it is evident that the communication between the Harvey Swanson workstation and the DC resembles that of the malware identified earlier in Figure 1.5.</p><p><strong>3. Targeting DC local machine for Remote Triage by using gKape and EZ tools to identify the origin of infection</strong></p><p>Now that we have successfully identified the infected machines, we will go on to perform a triage of the mounted image file of the Domain Controller 10.100.100.20 ( 2021–06–14T114825_dc1.vhdx).</p><p>A triage will collect and parse forensic artifacts that correlate to the ongoing investigation.</p><ul><li>To mount disk image, open Powershell and run command — Mount-DiskImage -ImagePath “insert_file_path”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U6IJsWWO9eY1TADIC3BOeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRx8SF6Ubr5wqTKaAV6ibg.png" /><figcaption>Figure 3.0</figcaption></figure><ul><li>Now that image is mounted, open gKape and select the Target source and destination.</li></ul><h4>Choose Target/Module options:</h4><p>The target source is going to be the new (D:) drive that has appeared on our PC. The target destination will be a short file path where the result of our collection will end up.</p><ul><li>For the target destination, a short file path is recommended, for instance, “C:\kape\triage_collection”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*ni4tl-WCkRYnlgLmQ5gsUw.png" /><figcaption>Figure 3.1 Targets ready to execute</figcaption></figure><ul><li>Select target configuration to allow for ‘MiniTimelineCollection’ , SANS Triage &amp; more. Use in command line(optional) — <strong>.<em>\kape.exe — tsource D: — tdest C:\kape\triage_collection — tflush — target !BasicCollection,!SANS_Triage,MiniTimelineCollection — gui</em></strong></li><li>Target options are selected — Click Execute</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZhyTVYJ06pWfNN8maENYrA.png" /></figure><p>Now the result of this will cause new files to appear in our (C:) Drive via the file path provided in the Target destination we selected earlier.</p><h4>Selecting Timeline Modules:</h4><p>Since the Target configuration has been done, it is time for Module options. Modules are programs that process the collected artifacts and extract information.</p><ul><li>Use the Target destination folder as the Module source and create a new file path for the Module destination i.e., “C:\kape\timelines”.</li><li>Select the Module configuration. In this case, we will be selecting the Mini_Timeline and the MFTECmd option included in the command line —<strong><em> .\kape.exe — msource C:\kape\triage_collection — mdest C:\kape\timelines — mflush — module MFTECmd_$MFT,Mini_Timeline,Mini_Timeline_Slice_by_Daterange — gui</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nYDB4ABTbv9_nIODKlplw.png" /><figcaption>Figure 3.2 Module configuration selected</figcaption></figure><p>With these modules selected, we will be able to formulate a sequenced timeline of the events associated with the Domain Controller. The result of this will be a series of new files that will appear in our, ‘C:\kape\timelines’, folder.</p><ul><li>Click Execute on gKape</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*XHBCRH47ZVbCKvwArgb-FQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*HY9Z5nxOF2IP0L7dmegRUQ.png" /><figcaption>Figure 3.2 gKape file results</figcaption></figure><p>Let’s now use the file ‘20230617110013_MFTECmd_$MFT_Output (3).csv’ in the Eric Zimmerman tool, Timeline Explorer. (You could also open this file in a SIEM ..i.e, Splunk)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vvZUDoIrNo30ZNFIZUXrtQ.png" /><figcaption>Figure 3.3 Suspicious executable file found</figcaption></figure><p><strong>Discovery &amp; Implication:</strong></p><p>Temporary files contain data that’s necessary for a program or application to run however malware is often attached to or embedded in legitimate processes.</p><p>Typing ‘temp’ into the search bar of the Timeline Explorer was done to locate a ‘fQumh.exe’ unknown executable file coming from the Parent Path .\Windows\Temp. This could very likely be the origin of the infection in the Domain Controller</p><p>In this scenario, the Temp folder has been used by an attacker as a staging point once the malware has been able to escalate privileges and install.</p><p>This calls for further investigation into the infected machine to determine processes in the memory that are being used to spread ransomware.</p><p><strong>4. Memory Forensics on Domain Controller to investigate abnormal processes</strong></p><p>Since we now have a basic understanding of the attack method, we will use the memory dump file of the DC (DC1–20210614–113939.dmp) on Volitility3.</p><ul><li>Open command line, and change the directory to the volatility3 folder and run <strong><em>— pip install -r .\requirements.txt </em></strong>… for volatility to be operational on your machine.</li><li>Next, we will use the command — <strong><em>python vol.py -f “/path/to/file” windows.info …</em></strong>to gather basic information about the target system that could assist us in the investigation<strong><em>.</em></strong></li><li>Then run the command above again but this time add a pipeline to save this information into a text file for later reference using .. — <strong><em>&gt; DC1.mem.info</em></strong></li><li>Our full command in this case is <strong><em>— python vol.py -f “C:\Users\fsant\Documents\maltrak_training\4641\Memory\DC1–20210614–113939.dmp” windows.info &gt; DC1.mem.info</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*zRRBJD78KKjEa_VOUiVQnA.png" /><figcaption>Figure 4.0 Information on Target System saved to Notepad</figcaption></figure><h4>Objective:</h4><p>At this point in our investigation, we are looking for suspicious applications that are running, any memory injection, or loaded DLL that may lead to further conclusions.</p><p>To do this, we will view the processes of the targeted system and search for any abnormal behaviour.</p><p>Using the <strong>pstree</strong> plugin will cause Volatility to present the hierarchy of the parent-child relationships between all the processes being ran on the Domain Controller.</p><ul><li>Our command looks like —<strong><em> python vol.py -f “C:\Users\fsant\Documents\maltrak_training\4641\Memory\DC1–20210614–113939.dmp” windows.pstree | more</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WmB0H7aeawfrJpVUquMXA.png" /><figcaption>Figure 4.1 Suspicious Parent-Child Process Relationships</figcaption></figure><h4>Identifying embedded executables through a Process Dump:</h4><p>Let us now dive deeper into this process to identify if our assumptions lead to a false positive or true positive conclusion</p><ul><li>To dump the process into a file outside the current directory use <strong><em>— o ../</em></strong> the command will look like: <strong><em>— python vol.py -f “C:\Users\fsant\Documents\maltrak_training\4641\Memory\DC1–20210614–113939.dmp” -o ../ windows.dumpfiles — — pid 376</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqhtG-1Rr-iiQkwYTD8A6Q.png" /><figcaption>Figure 4.2 Result of procdump on Rundll32.exe w/ PID 376</figcaption></figure><ul><li>Open one of these files to search its contents…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDEmcyxQhQ1hn-OYOcgM1g.png" /><figcaption>Figure 4.3 Executable File</figcaption></figure><p>Microsoft Windows uses the PE file format for executables. The most common PE identifiers are the presence of the characters “MZ” at the beginning of the file, and the string “This program cannot be run in DOS mode” as shown in Figure 4.3.</p><p>The portable executable files dumped from the process could lead to further discoveries of the attack method. An attacker may obfuscate code so it is not detectable via normal analysis such as VirusTotal.</p><p>To continue searching for malware hidden within these processes we could perform static and/or dynamic code analysis. Also, Yara rules could be used to scan all the files on the system for malicious content.</p><p>A possible next step in this investigation would be to search for strings within the file that could be related to the malware.</p><h4><strong>Going deeper with Volatility 3:</strong></h4><p>Additionally, we can search for the command-line of the processes in the machine for more information.</p><p>This time around I took the memory dump from the Windows workstation and used the following command: <strong><em>— python3 ./vol.py -f “C:\Users\fsant\Documents\maltrak_training\4641\Memory\WIN81–20210614–115233.dmp” windows.cmdline</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XxC_yp98QrB_ilfbAHaWfw.png" /><figcaption>Figure 4.4 Suspicious Executable in Temp folder, Wuauclt.exe &amp; hidden Powershell command-line</figcaption></figure><p><strong>Discover &amp; Implication:</strong></p><p>After investigating these processes and their relationships, it was discovered that there is a relatively suspicious sequence of services present. The parent process rundll32.exe (PID 376) is opening several wuauaclt.exe processes in Figure 4.1.</p><p>Rundll32 enables the execution of dynamic link libraries (DLL). The adversary may leverage this library as a means of credential theft and execution bypass.</p><p>The Windows Update Client (wuauclt.exe) can also be used by attackers to execute malicious code on systems by loading it from an arbitrary specially crafted DLL.</p><p>In this case , Figure 4.4 shows a peculiar unknown file running in the Temp folder(PID 7580, 10076).</p><ul><li>“C:\Users\HARVEY~1.SWA\AppData\Local\Temp\<strong>tdrE934.exe</strong>”</li></ul><p>This proceeds PID 9500, 5980 &amp; 5976 as an indicator of compromise. The workstation is downloading something from <strong><em>‘onlineworkercz.com’ </em></strong>domain which was discovered in the first part of our investigation using Wireshark.</p><h4>Conclusion:</h4><p>Up to this point in the investigation, we have been able to identify some indicators of compromise in this company domain.</p><p>The purpose of this blog was to demonstrate some aspects of how an investigation is performed on a compromised network.</p><p>These investigations tend to continue until the segmentation or remediation of the network-infected area is completed. Also, much of this information can be used in a court of law. With that being said, the end goal is to reverse and restore any damage caused to the company.</p><p>Thank you to all those who read through both parts of this brief investigation of a real-life attack scenario…</p><p><strong><em>References:</em></strong></p><ul><li><a href="https://ericzimmerman.github.io/KapeDocs/#!Pages%5C5.-gkape.md">KAPE documentation (ericzimmerman.github.io)</a></li><li><a href="https://logixconsulting.com/2020/09/28/did-you-know-why-malware-uses-the-temp-folder/#:~:text=A%20program%20and%20application%20may,victims%20of%20malware%20attacks%20overlook.">Did You Know? Why Malware Uses the Temp Folder — Logix Consulting Managed IT Support Services Seattle</a></li><li><a href="https://blog.onfvp.com/post/volatility-cheatsheet/">Volatility 3 CheatSheet — onfvpBlog [Ashley Pearson]</a></li><li><a href="https://hazmalware.wordpress.com/2009/09/01/how-to-identify-embedded-executables/">How To Identify Embedded Executables | hazmalware (wordpress.com)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce1a9c2d1de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Investigation into Real-life Attack Scenario Part One:]]></title>
            <link>https://medium.com/@fsantos094tmc/a-brief-investigation-and-forensic-report-on-real-life-attack-scenario-616ae878e3d8?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/616ae878e3d8</guid>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 22:47:31 GMT</pubDate>
            <atom:updated>2023-12-05T14:27:36.569Z</atom:updated>
            <content:encoded><![CDATA[<p>Using cybersecurity analytical tools to discover indicators of compromise within a domain network</p><p>After acquiring foundational knowledge regarding threat investigative frameworks, I am writing this blog series to showcase the use of some analytical tools. The files of this documented attack can be found in <a href="https://thedfirreport.com/">The DFIR Report — Real Intrusions by Real Attackers, The Truth Behind the Intrusion</a>.</p><h4><strong>Scenario:</strong></h4><p>Within the source files provided to me by my instructors is an intrusion that came from an Excel document and quickly spread to domain-wide ransomware. These files contain all network traffic, memory dumps, and Sysmon logs of the endpoints within the domain.</p><p>To begin the investigation, I will start with the .pcap files which contain the captured network traffic of the incident.</p><p>The Wireshark tool is profiled to my preference to display information in the way which I believe is most relevant…</p><ol><li><strong>Filtering for http communication and exporting SMB files with Wireshark</strong></li></ol><ul><li>I ran the following basic filter for http —<strong> <em>(http.request or tls.handshake.type == 1) and !(udp.port eq 1900)</em></strong></li><li>Going to (Statistics/HTTP/Requests)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VOBupqrLQ2Q_VpJhMYo4A.png" /><figcaption>Figure 1.0</figcaption></figure><p>Possible unknown HTTP GET request file — <em>jquery- 3.3.1.min.js</em></p><ul><li>Filter to view the behaviour of local machine after being in contact with 88.80.147.101 —<strong><em> ip.addr==10.100.100.22</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l35tEy_j8fVZQHZ3RsXcYA.png" /><figcaption>Figure 1.1</figcaption></figure><h4>Analysis of Network Communication:</h4><p>After observing the .pcap from this filter we can gather that there has been communication from a local machine to unknown domains:</p><p>‘onlineworkercz.com’ 149.248.52.187</p><p>‘gmbfrom.com’ 88.80.147.101</p><ul><li>From there, I go to (Statistics/Conversations/IPv4) using the same filter</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*P5aw_52rjuWQlNRjsD6T3w.png" /><figcaption>Figure 1.2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*sFH0oVo4SRswQcb2S46omg.png" /><figcaption>Figure 1.3</figcaption></figure><p>The traffic from the local machine we are viewing has plenty of packets communicating with the unknown domains</p><p>Local machine 10.100.100.22 has a large portion of packets communicating with one of the company’s local machines, 10.100.100.69, as we can see from the top of Figure 1.2</p><p>Let’s filter out the communication between these two local machines</p><ul><li>Right-click over conversation (Apply as Filter &gt; Selected &gt; A to B) Figure 1.3</li><li>Or use filter — <strong><em>ip.addr==10.100.100.22 &amp;&amp; ip.addr==10.100.100.69</em></strong></li></ul><p>We can quickly see that it is, mostly TCP and SMB protocols. Let’s try to take a deeper look into these packets..</p><ul><li>Follow packet stream Right-click over packet (Follow &gt; TCP stream)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9VPviA_1PG9XBP60TUl9w.png" /><figcaption>Figure 1.4</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPRF295NKwfNT8FeB5TtNQ.png" /><figcaption>Figure 1.5</figcaption></figure><p>The packet information displays a short message indicating that the communication between these two local machines has been compromised.</p><p>Let’s confirm this but exporting the objects found within HTTP and SMB protocols so that we can later obtain the file hashes and run a static analysis.</p><ul><li>Go to File &gt; Export Object &gt; HTTP.. to save the file <em>jquery- 3.3.1.min.js</em></li><li>Go to File &gt; Export Object &gt; SMB.. to save the files below</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*o7SQ9puPEgVhHXbEqolhSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ZkaIJoLu-xBC1rtWJ7WQYA.png" /><figcaption>Figure 1.6</figcaption></figure><ul><li>Saves files into the ‘exported_object’ folder for further investigation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-FbnqVL4wpc5A3Tyk71YA.png" /><figcaption>Figure 1.7</figcaption></figure><h4>Discovery &amp; Implication:</h4><p>Considering the information we have gathered from this packet capture analysis, we can conclude that the domain has been infected through the initial contact of local machine 10.100.100.22 with the two unknown domains.</p><p>The TCP communication between 10.100.100.22 and 10.100.100.69 is evidence that 10.100.100.22 is carrying out instructions from C2 as the traffic between them contains a message from the attacker in Figure 1.5.</p><p>2. <strong>Collect file hash and verify malicious content with EZ tools and VirusTotal</strong></p><p>At this stage, I will go on to take the saved files from Figure 1.7 to run them through a basic static analysis tool known as VirusTotal.</p><p>Before I do do that, I first obtained the SHA-256 hash of the file contents with an Eric Zimmerman forensic tool known as ‘Hasher’ <a href="https://www.sans.org/tools/ez-tools/">https://www.sans.org/tools/ez-tools/</a></p><ul><li>After downloading the tool, I simply dropped the files saved in the ‘exported-objects’ folder into Hasher</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3V_gIAmmO_5rFgCk4l3l1w.png" /><figcaption>Figure 2.0</figcaption></figure><p>The files will now be taken into VirusTotal so that we can confirm the hash output with a secondary source. We will also be able to scan for malicious content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yfBLqhXj5ZT7rTvJnfF1PQ.png" /><figcaption>Figure 2.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTFhvoNTWgY40Q4Qs-a20g.png" /><figcaption>Figure 2.2</figcaption></figure><p>Using VirusTotal we were able to identify what these files were and how they contributed to the attack. Take a look at Figure 2.1 and Figure 2.2.</p><p>These two files contain executables that instruct the victim machine to communicate with C2 via Cobalt Strike and to spread ransomware.</p><p>Here we have confirmed the malicious content of these files proving that this may be one source of the infection.</p><p>In the next blog entry, we will continue to investigate this same attack from different angles. I will use other tools such as gKape to perform a triage and Volatility3 to look into the memory dumps of the infected machines.</p><p><em>References:</em></p><ul><li><a href="https://thedfirreport.com/2021/08/01/bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike/">BazarCall to Conti Ransomware via Trickbot and Cobalt Strike (thedfirreport.com)</a></li></ul><p><em>LinkedIn:</em> <a href="https://www.linkedin.com/in/fabio-henrique-santos-5964361b4/">Fabio Henrique Santos | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=616ae878e3d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sigma Rules: Creating Detections for SIEM Systems]]></title>
            <link>https://medium.com/@fsantos094tmc/sigma-rules-creating-detections-for-siem-systems-68f1ee5204d9?source=rss-4d3c77c33662------2</link>
            <guid isPermaLink="false">https://medium.com/p/68f1ee5204d9</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[cyber-attack-prevention]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Fsantos]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 21:08:26 GMT</pubDate>
            <atom:updated>2024-05-14T11:17:24.784Z</atom:updated>
            <content:encoded><![CDATA[<h4>A rudimentary understanding of threat investigation tools for Cybersecurity</h4><p>In the opening modules of the <a href="https://www.maltrak.com/">MalTrak | Home</a> master’s program, the adversarial techniques used by malicious actors have been defined. The theoretical concepts relating to initial access, privilege escalation, persistence, and lateral movement have also been brought to our attention. When diving deeper into investigating such threats, it is evident that an IT professional must understand how these techniques manifest themselves within the SIEM (Security Information and Event Management) system.</p><p>To demonstrate as a practical exercise, we were prompted by instructors to launch a simulation attack using AWS instances in a lab environment. The objective in this case was to use the DC instance to force the blue team instance to generate Sysmon log entries as if it were in a real-world situation. Along with the activity that is logged during typical company workflow, there more than likely are signs of inauspicious or even malicious behavior among these log entries. Using this information, we can essentially create detections that will alert a system if indicators of a potential adversarial attack have been identified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*DGsJDD-XUcldW6dHnBVUNw.png" /><figcaption>Generic template for the creation of Sigma rules</figcaption></figure><p>Sigma for SOC analysts, is an open-signature syntax that is YAML language based. The rules describe relevant log events in a standardized fashion so as to be applicable across many SIEM platforms and also easily shareable amongst researchers and analysts. Sigma rules is essentially a filter for logs whereas a sequence of events that may lead to a compromised system are brought to the attention of security analysts. The instructions and templates for Sigma rules and its repository can be found at <a href="https://github.com/SigmaHQ">Sigma · GitHub</a>.</p><p>To illustrate, I have created a few Sigma detection rules derived from the templates available on GitHub. Using <a href="https://attack.mitre.org/">MITRE ATT&amp;CK®</a> as a reference I selected a few adversarial techniques that commonly threaten businesses today. The DC instance in this lab environment contains a tool called ‘Atomic Red Team’. This is a library of tests that can be executed based on <a href="https://attack.mitre.org/">MITRE ATT&amp;CK t</a>echniques. This tool was used to launch a simulation attack on the blue team instance which contains a SIEM for analysis.</p><p>To date, 25 SIEMS (and derivatives) are supported by SIGMA rules, and include:</p><ul><li><a href="https://www.splunk.com/">Splunk</a></li><li><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html">ElasticSearch Query DSL</a></li><li><a href="https://www.elastic.co/de/products/kibana">Kibana</a></li><li><a href="https://www.elastic.co/guide/en/x-pack/current/xpack-alerting.html">Elastic X-Pack Watcher</a></li><li><a href="https://www.logpoint.com/">Logpoint</a></li><li><a href="https://www.microsoft.com/en-us/microsoft-365/windows/microsoft-defender-atp">Microsoft Defender Advanced Threat Protection (MDATP)</a></li><li><a href="https://azure.microsoft.com/en-us/services/azure-sentinel/">Azure Sentinel / Azure Log Analytics</a></li><li><a href="https://software.microfocus.com/en-us/products/siem-security-information-event-management/overview">ArcSight</a></li><li><a href="https://docs.microsoft.com/en-us/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-6">PowerShell</a></li><li><a href="https://www.gnu.org/software/grep/manual/grep.html">Grep</a></li></ul><p>According to resources, driver-based attacks which at times may be referred to as BYOVD attacks, are valuable exploiting methods for malicious actors. Targeting a vulnerable driver in a Windows system could potentially bypass the Driver Signature Enforcement (DSE) of the kernel. The ‘registry add lsass driver.yaml’ rule I created is the corresponding detection rule for a similar attack method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EEGhdUmIMRY-hWSkByI1pA.png" /><figcaption>Original Sigma rule example 1.0</figcaption></figure><p>In order to initiate access into a company domain many actors would look to launch spearphishing campaigns involving emails with attached documents that contain macro-code. The social engineering aspect in this case would be to compel the recipient to click on an attachment which in turn executes malicious code. This type of scenario can be detected through the following filter I made called ‘macro-enabled phishing attachment.yaml’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_wymdy7kfOMnPK8k1rwEg.png" /><figcaption>Original Sigma rule example 2.0</figcaption></figure><p>There are many options for the attachment such as Microsoft Office documents, executables, PDFs, or archived files. Upon opening the attachment, the adversary’s payload exploits a vulnerability in the user’s system. With the continued use of an AWS instance, we can go on to launch more simulation attacks and derive different variations of Sigma rules based on the information we gather from the logs</p><p>This demonstrates how Sigma rules are created for the purpose of detecting log events that could threaten a network’s security. This filtering aids in investigation and threat-hunting procedures. Further development of these detection rules makes for more accurate log searches and fewer false positives. After some time of community testing, a newly created Sigma rule can go from ‘experimental’ status to ‘stable’ status. I will be looking to dive deeper into this topic and will update this blog with more information in the near future. For now, this has been an introduction to understanding the purpose and use of SIEM detection rules.</p><ul><li><a href="https://www.linkedin.com/in/fabio-henrique-santos-5964361b4/">Fabio Henrique Santos | LinkedIn</a></li></ul><p><em>References:</em></p><ul><li><a href="https://attack.mitre.org/">https://attack.mitre.org/</a></li><li><a href="https://research.splunk.com/endpoint/57fb8656-141e-4d8a-9f51-62cff4ecb82a/">Windows Autostart Execution LSASS Driver Registry Modification — Splunk Security Content</a></li><li><a href="https://www.rapid7.com/blog/post/2021/12/13/driver-based-attacks-past-and-present/">Driver-Based Attacks: Past and Present | Rapid7 Blog</a></li><li><a href="https://www.urbannetwork.co.uk/macro-based-malware-bad-attachment/#:~:text=The%20majority%20of%20the%20macro,remittance%20and%20invoices%20for%20services.">[CyberSecurity Blog Series] How to spot Macro-based Malware attachment — urban (urbannetwork.co.uk)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68f1ee5204d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>