<?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 Raynard Waits on Medium]]></title>
        <description><![CDATA[Stories by Raynard Waits on Medium]]></description>
        <link>https://medium.com/@raynardwaits?source=rss-e5a2f89cd2e2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5FKYxXFuVpzeihLjZR7dsA@2x.jpeg</url>
            <title>Stories by Raynard Waits on Medium</title>
            <link>https://medium.com/@raynardwaits?source=rss-e5a2f89cd2e2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:42:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raynardwaits/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[The Hard Part of a Detection Rule Is What You Exclude]]></title>
            <link>https://medium.com/@raynardwaits/the-hard-part-of-a-detection-rule-is-what-you-exclude-0c9b759527d1?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c9b759527d1</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Fri, 14 Aug 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-08-14T00:01:02.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EyoF8C9usOh9b-1CK8BU1w.jpeg" /></figure><p>I wrote my second Sigma rule this weekend, targeting T1036.005, a binary named like a legitimate program but running from somewhere that program doesn’t live. The part that finds the bad thing took about thirty seconds to write. The part that gets rid of the good thing took an hour, and it is the only part that actually decided whether the rule works.</p><h3>The easy half</h3><pre>selection:<br>    Image|endswith: &#39;\mysqld.exe&#39;</pre><p>That is the whole detection. Any process whose path ends in \mysqld.exe. On a machine running MySQL, that also matches MySQL, so on its own it is a rule that alerts on your database server existing.</p><p>The exclusion is what turns it into a detection.</p><pre>filter:<br>    Image|startswith:<br>        - &#39;C:\Program Files\MySQL\&#39;<br>        - &#39;C:\Program Files (x86)\MySQL\&#39;<br>condition: selection and not filter</pre><h3>Why I stopped the path where I did</h3><p>My real install lives at C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe, and my first instinct was to exclude exactly that. Tighter is better, right?</p><p>Not here. That path contains a version number. When I upgrade to 8.4, the exclusion stops matching, and the rule starts firing on my own legitimate service. Worse, if I had built the filter the other direction, a version-anchored exclusion can stop excluding without anyone noticing.</p><p>That is the failure mode I care about most, because I have watched it happen with firewall block lists and conditional access exclusions. A control that needs manual maintenance eventually drifts away from reality, and the drift is invisible until something gets through.</p><p>So the filter stops at \MySQL\. It survives a version upgrade. And if it ever does break, it breaks loudly, by alerting on something legitimate, which is the kind of broken you find out about the same day.</p><p>I included the x86 path too. A 32 bit MySQL installs there by default. That is a real install, not an edge case.</p><h3>Validating it</h3><p>First I measured what I was actually excluding. Thirty days of process creation events, every path a mysqld has ever launched from on this box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iU4Bi0U7Z-oGbSzP_Wyo-Q.png" /></figure><p>Sixteen events, two paths. Thirteen from the real service, three from a renamed binary I dropped in a temp directory to trigger the rule. That is my false positive population, measured rather than assumed, and it is why I set the rule to medium instead of high.</p><p>Then the rule logic itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zd8vaDUICejx9mmNjxyjKQ.png" /></figure><p>Three events. It removed exactly the thirteen legitimate service starts and kept exactly the three I planted.</p><h3>Two things that nearly slipped through</h3><p>My first version of that query had no parentheses. NOT binds tighter than OR in SPL, so it read as &quot;my search minus path A, or alternatively anything matching path B.&quot; It returned the correct three events anyway, because nothing on this box lives in Program Files (x86). Right answer, wrong reason, and it would have stayed wrong until the day something landed there.</p><p>The second one is about my test artifact. I made the trigger by copying notepad.exe and renaming it, and Sysmon dutifully recorded OriginalFileName: NOTEPAD.EXE right next to an Image claiming to be mysqld.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eS2uXYmvNqFGOyp4HVlhOg.png" /></figure><p>That mismatch is a real masquerading signal, and it is a better one than a path check in some ways. It is also not what my rule detects, and real T1036.005 usually involves a purpose built binary that has no original name to contradict. So the mismatch is evidence of how I tested, not evidence the rule is stronger than it is.</p><p>That is a separate rule, for a separate technique, on a separate day.</p><p><em>Part of my hands-on SOC lab series. Real telemetry, real validation, real mistakes caught before publishing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c9b759527d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The File VirusTotal Has Never Seen]]></title>
            <link>https://medium.com/@raynardwaits/the-file-virustotal-has-never-seen-df791655de2e?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/df791655de2e</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wannacry]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-08-12T00:01:02.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1OIJ4Y2-gky4RDM7J-OP4Q.jpeg" /></figure><p>One file in my honeypot download queue came back from VirusTotal as a 404. Not zero detections. No record at all. Nobody on earth has ever submitted that hash. That turned out to be more useful than a clean scan, and it forced me to answer a question I had been quietly outsourcing to an external service.</p><p>Context if you are just arriving: this is the same download queue from the last few posts. Thirty-seven distinct files across fifty-seven delivery events, and roughly 86% of them are WannaCry. A nine-year-old worm is still the overwhelming majority of what an internet-facing honeypot catches.</p><h3>A 404 is not a clean result</h3><p>This is worth being precise about, because the two get conflated constantly.</p><p>A result of 0/70 means the file was submitted, scanned by seventy engines, and none of them fired. That is a finding. It might be a false negative, but the file has been looked at.</p><p>A 404 means VirusTotal has no record of the hash. It was never submitted, never scanned, never seen. My lookup script handles this explicitly: on a 404 it returns nothing but the hash and found: False. No size, no file type, no first-seen date, no submission count. There is no report because there is nothing to report on.</p><p>So the engines did not clear this file. They never got the chance.</p><p>bc0208fedae9c035f04f237a3dc8efaf arrived once, on May 17, 2026, from 102.91.72.135. SMB, port 445, no staging URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vrtQPYI8HaDMhEthsaiZqQ.png" /></figure><h3>When external intel has nothing, your own data still does</h3><p>This is the part I want to make the point of the post.</p><p>If VirusTotal is your only enrichment source, the investigation stops here. Unknown hash, no report, move on. I have watched myself do exactly that with low-priority items, and it is a bad habit, because a 404 is the one result where the external source is definitionally useless, and your own evidence is all that is left.</p><p>I captured this file. It is sitting on my own sensor. So I went and looked at what I had.</p><p><strong>Size.</strong> Pulled straight off the binary: 5.1MB. The WannaCry samples in this window cluster tightly around 5.0MB, and four other unlabeled samples in the same size band were previously identified as WannaCry EternalBlue components through Imphash and compile timestamps.</p><p><strong>Delivery.</strong> The download_url field is empty, and the protocol is smbd on port 445. No staging server, no web fetch. The payload was pushed inline over SMB, which is the same delivery shape as the rest of the WannaCry traffic in this queue and exactly what EternalBlue-style exploitation looks like when it lands.</p><p>Two independent characteristics, size band and delivery vector, both pointing the same direction. Neither came from a threat intel feed.</p><h3>Three registers, kept separate</h3><p>Being honest about what I actually know:</p><p><strong>Known.</strong> VirusTotal has no record of this hash. The captured file is 5.1MB. It was pushed inline over SMB on 445 with no staging URL.</p><p><strong>Inferred.</strong> Very likely a repacked WannaCry variant, based on size band, delivery vector, and queue context.</p><p><strong>Not verified.</strong> I have no Imphash, no compile timestamp, no CVE tag, no section layout. And VirusTotal cannot supply any of them, because it has no report to supply them from.</p><p>Collapsing those three into one confident sentence is how bad threat intel gets written. The inference is reasonable. It is still an inference.</p><h3>Why the unverified version is already a finding</h3><p>If this is a WannaCry repack, then attackers are recompiling and repacking commodity malware often enough that a nine-year-old worm can still produce a hash the world’s largest malware database has never encountered. The behavior is ancient and well understood. The file identity is brand new.</p><p>Hashes identify files. They do not identify threats. Change one byte and every hash-based control you own goes blind to a payload you have caught a hundred times before.</p><h3>What would actually confirm it</h3><p>The method exists, and I have used it. Static triage on the captured binary: file type, section count, entropy, Imphash, compilation timestamp, targeted string extraction. All read-only, no execution required, and a Windows PE cannot run natively on the ARM Linux sensor holding it anyway.</p><p>That is the next post. Either the metadata puts this file in the WannaCry lineage, and the inference becomes a verified identification, or it does not, and I have something genuinely unusual sitting in my queue.</p><p><em>Part of an ongoing series working a real honeypot download queue from triage through identification.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df791655de2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Got Fooled By My Own Data Six Times. So I Built a Checklist.]]></title>
            <link>https://medium.com/@raynardwaits/i-got-fooled-by-my-own-data-six-times-so-i-built-a-checklist-a33631d1044a?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a33631d1044a</guid>
            <category><![CDATA[security-analysts]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[security-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 00:01:03 GMT</pubDate>
            <atom:updated>2026-08-07T00:01:03.509Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qd1AbWVrNG_IaQow7Nhog.jpeg" /></figure><p>Last month I published a <a href="https://medium.com/@raynardwaits/six-ways-my-own-data-lied-to-me-05f8b56fd725">post</a> about six different ways my own honeypot data misled me. Wrong timestamps, wildcards that matched nothing, junk records inflating counts. It was an honest catalog of mistakes. It was also incomplete, because cataloging mistakes does nothing if you just make them again next week. So I turned those six failures into a verification routine I now run before any number goes into a report or a post. Here is the checklist, and the single principle underneath all of it.</p><h3>The principle: a field name is a claim, not a fact</h3><p>Every one of my six errors came from the same root cause. I trusted what a field was <em>called</em> instead of confirming what it <em>contained</em>. download_url sounded like it held URLs. @timestamp sounded like it held event time. md5_hash sounded like it held hashes. In each case, the name was a reasonable claim, and the data underneath told a different story.</p><p>Once you see that pattern, the fix is not “be more careful.” Being careful is not a control; it is a hope. The fix is a repeatable set of checks that catch the error before it reaches a conclusion.</p><h3>The checklist</h3><p>Here is what I now run against any field before I build a claim on it.</p><p><strong>1. Confirm the field means what its name says.</strong> Open the actual values, not the field name. Pull ten rows and read them. If I am about to filter on download_url, I look at what is actually in that column first. Empty strings hiding behind a real-sounding name is the trap that cost me the most.</p><p><strong>2. Prove a wildcard matches values, not existence.</strong> field: * matches any record where the field exists, including empty ones. When I want records with a real value, I query for something the value must contain. download_url: *http* requires the actual string, which an empty field cannot fake.</p><p><strong>3. Exclude known junk before counting.</strong> My pipeline produces placeholder records with http- prefixed identifiers instead of real hashes. A count that includes them is not a count of real events. If I filtered these out once, that filter has to be carried forward every time, because environment hygiene does not fix itself.</p><p><strong>4. Separate ingest time from event time.</strong> Two timestamp fields that normally sit milliseconds apart can drift by days the moment a pipeline stutters. Before I build a timeline, I confirm which clock wrote the field, and I use event time, not the time my system happened to receive it.</p><p><strong>5. Know which parts of the dataset are incomplete.</strong> A gap does not announce itself in your results. Before comparing counts, I check whether the window I am counting sits inside a known outage. Missing data looks exactly like low activity if you do not know it is missing.</p><p><strong>6. Check the distribution before calling a count a pattern.</strong> Seventy-nine events sounds like a trend until two source IPs account for eighty-one percent of them. Aggregates hide concentration. I always look at how a count is distributed before I describe it as a behavior.</p><h3>Why this is the real skill</h3><p>Anyone can run a query and get a number. The number will often be wrong in a way that looks completely reasonable, which is the dangerous kind of wrong. The difference between an analyst who gets fooled and one who doesn’t is not talent or caution. It is having a routine that assumes the data is lying until each field earns trust.</p><p>This checklist lives in my notes now, and it runs before anything I publish or report. The six mistakes were the tuition. The checklist is what I actually bought with it.</p><p>What check would you add to this list? I am still adding to mine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a33631d1044a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three Times Malware Lied About What It Was (And How I Caught It Anyway)]]></title>
            <link>https://medium.com/@raynardwaits/three-times-malware-lied-about-what-it-was-and-how-i-caught-it-anyway-b34112c0edc8?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b34112c0edc8</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-08-05T00:01:02.381Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOqIYOs4bLo80bls9CF_HQ.jpeg" /></figure><p>A cryptominer named after the Linux kernel. An attack whose real payload server never showed up in the logs everyone checks first. A pair of samples that half of VirusTotal flagged as malicious but none could name. Across a year of honeypot captures and detection work, the same trick kept surfacing: malware rarely hides. It impersonates, misdirects, or refuses to be labeled. It exploits an identity you already trust, or the absence of one, so your eyes slide right past it.</p><p>The cleanest version of this has a name in the MITRE ATT&amp;CK framework, T1036, Masquerading, where malware borrows a trusted identity to blend in. But the broader move shows up everywhere: attack the identity of the threat, not just the payload. Here is what three separate investigations taught me about catching things that lie about what they are, and why a signature is usually the wrong tool for the job.</p><h3>Lie #1: “I’m a kernel process”</h3><p>While tracing a honeypot attack chain back to the Outlaw botnet, I found the cryptominer payload running as kswapd0. On a real Linux box, kswapd0 is a legitimate kernel process that manages swap memory. It sits in the process list next to genuine system processes, and nobody questions it. That is exactly why the attacker chose the name.</p><p>A junior analyst scanning top for something suspicious walks right past kswapd0, because the name says &quot;I belong here.&quot; This is masquerading in its purest form, T1036.004. The defense is not to trust the name in the process list. It is to ask whether a kernel swap process has any business pegging the CPU, which is the one thing a miner cannot hide.</p><h3>Lie #2: “The attacker you see is the whole attack”</h3><p>The second case hid at the network layer. An attacker hit my honeypot’s MySQL service and ran a UDF attack, using CREATE FUNCTION downloader to turn the database into a file-fetching tool, then pulled a LockBit payload and dropped the function to clean up after itself. The obvious move in response is to grab the attacker&#39;s IP and block it.</p><p>That IP is a decoy for where the real threat lives. When I traced the download command, the payload came from a completely different server, a quiet file host that never once connected to my honeypot. Searching my connection logs for it returned zero hits. If I had responded to this and only looked at who connected, I would have blocked a scanning bot and missed the actual malware infrastructure entirely. The delivery server masqueraded as nothing at all by simply never showing up in the logs everyone checks first. You only find it by correlating the MySQL query logs against the connection logs, which is the whole point.</p><h3>Lie #3: “You can’t say what I am”</h3><p>The third case was subtler, because these samples did not evade detection at all. Two files pulled from my honeypot lit up VirusTotal with 55 and 57 detections. Everyone agreed they were malicious. Nobody could say what they were. No family name, no classification, just “malicious” and a shrug.</p><p>That missing label is its own kind of masquerade. A sample with no name resists the pivot every analyst wants to make: what is this, what does it do, what campaign is it part of. So I stopped waiting for a label and went to the metadata. A CVE tag pointed at the EternalBlue SMB vulnerability. A shared Imphash linked both files to the same codebase. A compile timestamp placed them one day before WannaCry’s 2017 outbreak. The samples were the DLL payload component of the EternalBlue chain, a piece fewer signature rules bother to label. The metadata named what the classification engine would not.</p><h3>The pattern underneath all three</h3><p>Signatures and labels answer “have we seen this exact thing before, and what did we call it?” Each of these attacks was built to make that question unhelpful. A trusted process name, a decoy source IP, or a missing family label all break the pivot in the same move: they attack the identity of the threat, not the payload itself.</p><p>Behavior, correlation, and metadata do not care what a threat calls itself, where it pretends to come from, or whether anyone has named it. A kernel process that pegs the CPU, a download URL that points somewhere no connection log shows, an unnamed DLL whose Imphash matches a known family: the surface identity is the lie, and the technical fingerprint gives it away.</p><h3>The takeaway for analysts</h3><p>When you investigate, do not stop at the obvious identity, whether it is a reassuring process name, the IP that happened to connect, or a missing label. Anchor to the things an attacker cannot cheaply fake: behavior, imports, compile artifacts, the correlation between two log sources, the role a process is actually playing. Surface identities are free to fake and free to omit. Fingerprints are expensive, because the malware still has to do its job.</p><p>Next I am taking this at the source and building a dedicated masquerade detection rule around non-standard execution paths. If a process claims to be a system binary but runs from the wrong place, that mismatch is the whole game.</p><p>What is the best masquerade you have caught in the wild? I would love to hear it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b34112c0edc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Detection for a Database Server That Phones Home]]></title>
            <link>https://medium.com/@raynardwaits/building-a-detection-for-a-database-server-that-phones-home-b21e0f54ceca?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b21e0f54ceca</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[cybersecurity-defense]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 00:01:03 GMT</pubDate>
            <atom:updated>2026-07-31T00:01:03.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bl0L9BHryXwMqGKrLfv6yg.jpeg" /></figure><p>I wrote my first detection rule this weekend. The most useful thing I learned wasn’t how to write it. It was why my first version didn’t fire, even though the behavior I was hunting for was happening right in front of me.</p><p>A quick note before I start: I built this alongside an AI assistant. I drove the reasoning and every design decision, and made the validation calls myself. The AI sped up the parts that would otherwise have been an afternoon of documentation and syntax lookups.</p><h3>The behavior worth detecting</h3><p>A database server is an inbound service. Clients connect to it. It sits there and answers. What it should almost never do is reach outward and connect to something else on the internet.</p><p>So when a MySQL server process opens an outbound connection, that is worth a look. It is exactly what you see when an attacker abuses a database to stage the next step, pulling down a payload through a user-defined function or a similar trick. I had investigated a real capture like this in my honeypot, where a MySQL exploit fetched a remote file.</p><p>Here is the important part. I did not build the rule around the attacker’s IP, the file hash, or the download URL. Those are cheap to change. The attacker rotates them between campaigns without effort. The durable thing is the behavior itself: a database process making an outbound connection. That is what the rule keys on.</p><h3>Then it didn’t fire</h3><p>I stood up MySQL on a Windows test box with Sysmon feeding Splunk, and I triggered the outbound connection. Sysmon logs network connections as Event ID 3, so I searched for it.</p><p>Nothing.</p><p>The connection was absolutely happening. I confirmed it three different ways at the operating system level. But Sysmon showed no Event ID 3 for it. I worked through the suspects one at a time. Was the sensor config filtering it out? I swapped to a config that logs everything. Still nothing. Was it the process name, the rule load, the trigger itself? Ruled each out.</p><p>The answer turned out to be a property of Sysmon most people never run into. Sysmon Event ID 3 logs established connections. My test connections were failing at the handshake, getting refused or timing out, so they never reached the established state and never generated an event. The moment I pointed the trigger at something that actually accepted the connection, the event appeared instantly.</p><p>That is a real and useful gap to understand. Your detection can only see what your sensor records, and a failed outbound attempt may leave no trace in this event.</p><h3>The rule</h3><p>Once the telemetry was proven, the rule itself was simple and honest:</p><pre>title: MySQL Server Process Making Outbound Network Connection<br>id: 9c3cec23-d96b-4538-9c8e-8b0f0b8b3cbb<br>status: experimental<br>description: Detects the MySQL server process (mysqld.exe) initiating an outbound network connection. A database service is architecturally an inbound service; unexpected outbound connections can indicate exploitation such as UDF abuse or a malicious payload fetch.<br>references:<br>  - https://asec.ahnlab.com/en/88514/<br>author: Raynard Waits<br>date: 2026-07-25<br>logsource:<br>  product: windows<br>  category: network_connection<br>detection:<br>  selection:<br>    Image|endswith: &#39;\mysqld.exe&#39;<br>    Initiated: &#39;true&#39;<br>  condition: selection<br>falsepositives:<br>  - Legitimate MySQL replication to a known replica or source host<br>  - Update or version checks, monitoring or backup agents, external API calls<br>  - Certificate or CRL validation<br>level: medium</pre><p>The Initiated: &#39;true&#39; condition scopes it to outbound only. My data actually contained one inbound connection to the database over loopback, and that one field cleanly excludes it. I matched on the filename ending rather than a full path so the rule survives different install locations.</p><p>I am being deliberate about what this proves. My testing confirmed the rule fires on the target behavior. It has not yet been run against a real mix of legitimate database traffic, so tuning the false positives is the next job, not a solved one.</p><h3>What it can’t see, and how you’d cover it</h3><p>The honest limitation is the same thing that tripped me up. This rule will miss a failed outbound attempt, because Sysmon does not log connections that never establish. If you want to catch the attempts too, you correlate with firewall or IDS logs for blocked connections and NetFlow for resets. No single sensor sees everything, and knowing where one ends and the next begins is half the job.</p><p>If you have written detections against Sysmon, I would like to hear how you handle the established-connection gap in your own environment.</p><p><em>The behavior in this post came from a real capture in my honeypot: a MySQL exploit that staged a remote payload. Indicators from that capture, for anyone tracking the same activity:</em></p><ul><li><em>MD5: </em><em>cc7ded4437b441a27dba2ad4ae59c3e7</em></li><li><em>Source IP: </em><em>114.234.173.164</em></li><li><em>Staging URL: </em><em>hxxp://star[.]zcnet[.]net:7766/Server[.]exe</em></li><li><em>Related campaign: AhnLab ASEC, </em><a href="https://asec.ahnlab.com/en/88514/"><em>https://asec.ahnlab.com/en/88514/</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b21e0f54ceca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From the Field: The Forward Nobody Sent]]></title>
            <link>https://medium.com/@raynardwaits/from-the-field-the-forward-nobody-sent-2c315dfdc6a5?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c315dfdc6a5</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cybersecurity-defense]]></category>
            <category><![CDATA[email-security]]></category>
            <category><![CDATA[security-analysts]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-07-29T00:01:02.566Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UenjOASJKm_kOQHPg1-V_g.jpeg" /></figure><p>A user reported that an email they never forwarded had been forwarded anyway. An hour later, I had an answer, and it wasn’t a compromise. Here’s the order I checked things in, and why the order mattered more than the finding.</p><h3>Two Problems, One Ticket</h3><p>The ticket came in marked urgent with two separate concerns.</p><p>First: a coworker had replied to an email that our user, call them User A, had supposedly forwarded to them. User A never forwarded it. They had also seen some spam come through recently and were putting the two things together.</p><p>Second: users weren’t receiving the digest emails from our spam filtering platform prompting them to review held messages.</p><p>The second one resolved in about five minutes. I logged into the platform and checked the affected mailbox. There were no messages held for review. The system only generates a notification when something is actually quarantined. No held messages, no notification. Working as designed, not a failure.</p><p>That left the forward.</p><h3>Starting With the Worst Case</h3><p>I emailed user A asking for the message in question. What came back was a screenshot. Not ideal, but there was enough in it to work from, and this felt like a situation where moving mattered more than waiting for perfect evidence.</p><p>The screenshot showed the coworker, user B, replying to a message that had originated from an external sender and arrived in user A’s mailbox.</p><p>Message trace was the first stop. The email hit user A’s inbox and was forwarded to user B almost immediately. No spoofing, no header anomalies, no third party in the path. A clean, straightforward forward.</p><p>That’s the point where this stopped looking like a mail flow question and started looking like it might be an account question. If someone else was in user A’s mailbox, that was the highest-severity possibility on the table, and everything else could wait.</p><p>I pulled 30 days of sign-in logs and reviewed them for geographic anomalies. Every sign-in came from the region where the user actually works. Nothing unusual, nothing to escalate.</p><p>Compromise was looking unlikely, but the forward still had no explanation.</p><h3>Narrowing Down</h3><p>If nobody logged in as user A, the next possibility was that somebody didn’t need to. Delegate access with send-as permissions would let another account send from user A’s mailbox in a way that looks, to a casual observer, exactly like user A sent it.</p><p>I checked the mailbox for delegation. Nothing assigned to anyone.</p><p>Not compromise. Not impersonation. That leaves configuration.</p><h3>The Rule</h3><p>Inbox rules were the next check, including hidden ones:</p><pre>Get-InboxRule -Mailbox user@domain.com -IncludeHidden</pre><p>Four rules came back. One looked worth a closer read:</p><pre>Get-InboxRule -Mailbox user@domain.com | Format-List Name, Enabled, Description</pre><p>There it was. A rule that automatically forwarded any message from one specific external sender to user B. No deletion, no moves to obscure folders, no hiding of the sent items. Just a forward.</p><p>That’s the entire explanation. The mail arrived, the rule fired, user B received it and replied, and user A saw a response to something they had no memory of sending.</p><h3>The Part I Couldn’t Close</h3><p>The obvious next question is who created it. I went looking:</p><pre>Search-UnifiedAuditLog -StartDate ([datetime]&quot;2026-04-25&quot;) -EndDate ([datetime]&quot;2026-07-24&quot;) -Operations &quot;New-InboxRule&quot;,&quot;Set-InboxRule&quot; -ResultSize 5000</pre><p>Nothing came back.</p><p>An empty result is only meaningful if you know your search works. So I verified the tenant had unified audit logging enabled, confirmed mailbox-level auditing was on for that mailbox, and ran a control search over a period where I knew events existed. That one returned results. The pipeline was fine.</p><p>So the empty result was real. No rule creation or modification event existed inside the 90-day retention window. The rule predates it.</p><p>I asked user A directly. They said they didn’t know about the rule. That could mean several things, and I’m not going to pretend it means any one of them.</p><p>We closed it as benign. Clean sign-in history, no delegation, a rule doing one narrow and non-destructive thing, no other suspicious rules on the mailbox, and no evidence of recent modification. The rule was left in place. Origin unresolved.</p><h3>The Takeaway</h3><p>The finding here is unremarkable. The sequence isn’t.</p><p>Account compromise, then impersonation, then configuration. That order isn’t arbitrary. It runs highest potential impact first, so that if the worst case is true you find out in the first fifteen minutes instead of the last. Checking inbox rules first would have produced the same answer faster and taught me nothing about whether the account was safe.</p><p>The other half is knowing when to stop. There was more thread to pull here. There always is. But every available indicator pointed the same direction, and continuing to dig on a benign finding is time not spent on the queue.</p><p>Not every investigation ends with a clean answer. Some of them end with enough of an answer.</p><p><em>Part of my From the Field series, documenting real investigations from real tickets.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c315dfdc6a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rarest Way a File Reached My Honeypot: SMB Exploit, HTTP Staging]]></title>
            <link>https://medium.com/@raynardwaits/the-rarest-way-a-file-reached-my-honeypot-smb-exploit-http-staging-b5f47e5f0236?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5f47e5f0236</guid>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[homelab]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-07-24T00:01:02.036Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z1jcJoI_HNGju0nfUO80mQ.jpeg" /></figure><p>Most malware that hits my honeypot arrives one of two ways: pushed straight through the exploit, or pulled from a staging server afterward. One recovered sample did something that turns out to be genuinely rare in my captures. It came in through an SMB exploit but staged its payload over HTTP. Only 12 of 236 deliveries did that, and this is one of them.</p><p>The file itself is a nine-year-old worm. The interesting part is how it got here.</p><h3>The Sample</h3><p>The MD5 is 574cf0062911c8c4eca2156187b8207d. VirusTotal puts it at 64/68, community score -194, and the family consensus is Conficker/Kido/Downadup. It is a Win32 DLL, 168,032 bytes, built with VC++ 6.0. Nothing exotic. This is commodity malware that has been circulating since 2008 and still scans the internet looking for open SMB.</p><p>It reached me as one of 20 malware downloads recovered after a Filebeat shipping outage knocked my pipeline offline for twelve days in June. I wrote about that recovery in this previous <a href="https://medium.com/@raynardwaits/recovering-lost-malware-and-fixing-a-watchdog-that-watched-the-wrong-thing-98ccb28209bf">post</a>. This sample was the one URL-staged file in the batch, which is why it was worth a closer look.</p><p>Delivery was SMB exploitation on port 445, but the payload was not pushed inline. It was pulled over HTTP from 62.197.79.231:9885/cvbi, the same host that ran the exploit. Two visits, June 17 at 23:20 and June 18 at 03:04, six events total from that IP across all of June, port 445 only. A focused single-purpose bot that showed up, dropped its file, and never came back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aeXOfJYuv6Z81tDZ-_Bh4A.png" /></figure><h3>The Question</h3><p>Finding one SMB-staged delivery made me want to know how common staging actually is. So I pulled every real download the honeypot has live-shipped in the past year and broke it down.</p><p>There are 236 real deliveries. 79 of them carry an HTTP staging URL, which is about a third. My first instinct was that staging was rare. A third is not rare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-6kWFAf5ByN9wEVISgzwEQ.png" /></figure><p>But look closer at that third. One hash accounts for 68% of the staged deliveries. Two source IPs account for 81%. Those two IPs are persistent MySQL bots hammering the same payload over and over. The staging population looks diverse until you notice almost all of it is two actors pushing one file. Strip them out and staging nearly disappears.</p><h3>Where This Sample Actually Sits</h3><p>Here is the part that made the whole thing click. I broke the 79 staged deliveries down by port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_4PPblna5g2kWFH0VQ75Q.png" /></figure><p>67 of the 79 came over MySQL on port 3306. Only 12 came over SMB on port 445. Staging is overwhelmingly a MySQL behavior. SMB deliveries almost always push the payload inline, straight through the exploit, with no separate pull.</p><p>So this Conficker sample is not just in the staged minority. It is in the SMB slice of a mostly-MySQL behavior. 12 of 236 total deliveries did what it did, roughly 5%. The rarity is not the file. It is the combination of an SMB exploit and an HTTP pull, and the data is what proves it is uncommon rather than me asserting it.</p><h3>The Takeaway</h3><p>One sample is an anecdote. The population is the context that turns the anecdote into a finding. If I had stopped at “here is a Conficker sample,” I would have missed that its delivery method sits in the rarest 5% of everything I have caught. The lesson here? A single interesting artifact is worth checking against the whole dataset, because rarity only means something once you know the baseline.</p><p>One honest note on scope. These counts cover live-shipped deliveries as of July 21 and do not include the June backfill index, so treat them as a current snapshot rather than an all-time census. The numbers drift as new deliveries land.</p><p>Next question worth asking: why do SMB exploits mostly deliver inline while MySQL bots stage over HTTP? That is a difference in method, and method is harder to change than an IP.</p><h3>IOCs</h3><ul><li>MD5: 574cf0062911c8c4eca2156187b8207d</li><li>Source IP: 62.197.79.231</li><li>Staging URL: hxxp://62[.]197[.]79[.]231:9885/cvbi</li></ul><p><em>Part of my hands-on Honeypot Investigations series. Real infrastructure, real failures, real lessons.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5f47e5f0236" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Six Ways My Own Data Lied To Me]]></title>
            <link>https://medium.com/@raynardwaits/six-ways-my-own-data-lied-to-me-05f8b56fd725?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/05f8b56fd725</guid>
            <category><![CDATA[security-engineer]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 00:40:30 GMT</pubDate>
            <atom:updated>2026-07-22T00:40:30.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbOtXMy8sJQp31Em7ru55A.jpeg" /></figure><p>I have a rule I wrote down months ago while working my first honeypot download queue: verify a field before you trust a filter on it. Last night I broke that rule five separate times in a single investigation, and every one of them produced an answer that looked completely reasonable and was completely wrong.</p><p>None of them were exotic. They were ordinary fields behaving in ordinary ways that did not match what I assumed. Here is each one, what it looked like, and what it actually was.</p><h3>1. The Hash That Looked Like the Wrong File</h3><p>I searched VirusTotal for an MD5, and the result page showed a 64-character SHA-256 in the URL bar and the header. Different length, different value, so at first glance, different file.</p><p>It was the same file. VirusTotal canonicalizes every lookup to SHA-256 for display. The MD5 is right there in the Details tab under Basic properties, and it matched exactly.</p><p><strong>Lesson:</strong> when a tool normalizes an identifier, the display value is not the value you submitted. Confirm the identity inside the report, not from the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xmDaBkn2yWoDju_eI9gbw.png" /></figure><h3>2. The Timeline That Was Off By Nine Days</h3><p>My download events showed June 23. My connection events showed June 27. Four days apart, which meant the connections could not have delivered the file. I briefly concluded the real delivery data was lost during a shipping outage earlier that month.</p><p>Wrong field. @timestamp is when Filebeat shipped the record. timestamp is when Dionaea observed the event. Normally those are seconds apart, and the difference never matters. After a twelve-day outage, they were nine days apart. The real event times paired the connections and downloads within milliseconds of each other.</p><p><strong>Lesson:</strong> ingest time is not event time. The moment your pipeline stutters, that distinction becomes the difference between a correct timeline and a fabricated one.</p><h3>3. The Comparison Contaminated By a Gap</h3><p>I started comparing connection counts across deliveries, looking for a behavioral fingerprint. Then I remembered where those events sat on the calendar: inside the outage window, where roughly 354,000 connection events were never recovered.</p><p>I could not tell the difference between “this actor made two connections” and “this actor made five and three are missing.” The comparison was unusable before I ran it.</p><p><strong>Lesson:</strong> know which parts of your dataset are incomplete before you draw conclusions from counts. A gap does not announce itself in the results.</p><h3>4. The Wildcard That Matched Nothing</h3><p>To find deliveries with a staging URL, I queried download_url: *. It returned 224 hits.</p><p>Every visible row showed the field as empty. The wildcard was matching empty strings, so I was counting records where the field merely existed. Querying for download_url: *http* instead, requiring an actual URL substring, dropped it to 79.</p><p><strong>Lesson:</strong> “field exists” and “field has a meaningful value” are different questions. Wildcards answer the first one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UntGVxsP6AXGbRgj8_o4dQ.png" /></figure><h3>5. The Junk Records Inflating Everything</h3><p>The same query set was also counting placeholder records with hashes like http-IvSdr3 instead of real MD5 values, artifacts from my own export pipeline. They carried no source IP and no port. Excluding them cut the total delivery count from 342 to 235.</p><p>I had documented this exact problem months earlier and filtered for it back then. I just did not carry the filter forward.</p><p><strong>Lesson:</strong> environment hygiene issues do not fix themselves, and a filter you applied once is not applied forever.</p><h3>6. The Population That Was Really Two Machines</h3><p>79 deliveries with staging URLs sounded like a trend. Then I looked at the distribution: two source IPs accounted for 81 percent of them, and a single file hash accounted for 68 percent.</p><p>That is not a trend. That is two persistent bots repeating themselves, and treating it as a population statistic would have been badly misleading.</p><p><strong>Lesson:</strong> always check the distribution before describing a count as a pattern. Aggregates hide concentration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ggAnHb14Tpk99v5_FwShZg.png" /></figure><h3>What This Actually Costs</h3><p>Each of these took a few minutes to verify and would have taken far longer to unwind after publishing. Some came from my own assumptions, some from notes I had written weeks earlier, some from tooling output. The source did not matter. The check did.</p><p>The rule I wrote down months ago was right. I just proved that knowing a rule and applying it consistently are separate skills.</p><p><em>Part of my hands-on Honeypot Investigations series. Real infrastructure, real failures, real lessons.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05f8b56fd725" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When a Low Detection Score Means the Opposite of Safe]]></title>
            <link>https://medium.com/@raynardwaits/when-a-low-detection-score-means-the-opposite-of-safe-d2742a1cb6a8?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2742a1cb6a8</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-home-lab]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[soc-analyst-training]]></category>
            <category><![CDATA[honeypot]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Fri, 17 Jul 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-07-17T00:01:02.203Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*71q_0jvnmdnD_MSiu6t-yg.jpeg" /></figure><p>After triage, identification split the queue cleanly in two. About 86% was WannaCry, a nine-year-old worm that VirusTotal named on sight. Then there was one file that stood apart: the biggest in the window and the least detected. It turned out to be a self-extracting archive from a documented campaign, and the reason most engines could not classify it was commodity packaging, not sophistication. If you triage by detection ratio, this is the post that will make you stop and ask what that number is actually measuring.</p><h3>The easy 86 percent</h3><p>Naming the bulk of the queue was fast. The most-delivered file came back 62 of 73, WannaCry. High prevalence, clean family name, solved problem. My triage hypothesis from <a href="https://medium.com/@raynardwaits/working-a-honeypot-download-queue-triage-before-identification-5903ecb44828">Part 1</a> held: the loud, repetitive files were commodity. That is the good kind of boring.</p><h3>The file that would not fit</h3><p>One sample refused to cooperate. It was 32.9 MB, roughly seven times larger than anything else in the queue. Its label was generic, and it scored 42 of 75, the lowest detection ratio in the entire window when everything else sat in the 60s. The interesting part was not the size. It was the cluster. A generic label plus the lowest ratio means this is the one file automation looked at and gave up on.</p><h3>Follow the delivery, not the file</h3><p>So I stopped studying the file and looked at how it arrived. Three download events, one source IP, all inside a 57-second burst. Not over SMB like the WannaCry flood, but over port 3306, MySQL. The honeypot did not receive the file directly. The attacker used a MySQL exploit to make it reach out and pull the payload from an external server. Different door, different actor.</p><p>That staging URL was already documented. AhnLab’s ASEC had published it as infrastructure for a campaign that brute-forces internet-exposed MySQL and drops abused remote-management tooling. I had a named campaign before I had touched a single byte of the binary.</p><h3>Confirming it without a debugger</h3><p>I did not detonate anything. A few safe, read-only checks settled it. The file’s entropy measured 7.999 out of 8, meaning it is almost entirely compressed data, not program code. Its internal strings identified it as a WinRAR self-extracting archive, configured to unpack into a temp folder and run an installer script. The real payload sits compressed inside that archive.</p><p>That is the whole answer to the detection-ratio mystery. The scanners can only see the wrapper. The malicious payload is sealed in a compressed blob they cannot read, so they fire a vague heuristic and move on.</p><h3>Why the number lied</h3><p>This is why a low detection ratio is not a safety score. 42 of 75 on a wrapped dropper is more concerning than 68 of 75 on a named worm, because the low number means the packaging is working.</p><p>It also hands something concrete to whoever writes detections next. The domain and staging URL are indicators to block outright. The behavior is a candidate for a rule: a MySQL process spawning an outbound HTTP pull of an executable that then extracts to temp and launches a script. I did not write that rule. But knowing what a good one would key on is half the value of the investigation.</p><p>I stopped short of extracting the payload, and that is a deliberate call, not a loose end. An analyst enriches, attributes, and escalates. It does not reverse-engineer every sample it meets. This file is named, scoped, and documented, which is exactly where triage ends and deep analysis would begin.</p><p>Next time a sample comes back with a low detection ratio, do not exhale. Ask what the scanners are actually looking at, and whether the number is telling you the file is safe or just that it is wrapped.</p><p><em>Indicators (shared as threat intel):</em></p><ul><li><em>MD5: cc7ded4437b441a27dba2ad4ae59c3e7</em></li><li><em>Source IP: 114.234.173.164</em></li><li><em>Staging URL: hxxp://star[.]zcnet[.]net:7766/Server[.]exe</em></li><li><em>Reference: AhnLab ASEC, “Case of Attacks Targeting MySQL Servers to Install RAT Malware”</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2742a1cb6a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Had AI Write My Malware Lookup Script. Then I Read It.]]></title>
            <link>https://medium.com/@raynardwaits/i-had-ai-write-my-malware-lookup-script-then-i-read-it-cce6c40c017f?source=rss-e5a2f89cd2e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/cce6c40c017f</guid>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <dc:creator><![CDATA[Raynard Waits]]></dc:creator>
            <pubDate>Wed, 15 Jul 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-07-15T00:01:02.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYvPCbU7Tw4giUOE3OUBbQ.jpeg" /></figure><p>I used AI to write tooling. I am upfront about that. What I do not do is run code I cannot account for, and that difference matters a lot more than most people think. So before this script touched my honeypot data again, I sat down and read it line by line. Here is what I found, and here is the method I used to find it.</p><p>In <a href="https://medium.com/@raynardwaits/working-a-honeypot-download-queue-triage-before-identification-5903ecb44828">Part 1</a>, I worked a honeypot download queue down from nearly a million events to a short list of unique files. The next step was identifying them, which meant sending hashes to VirusTotal. The tool for that was a Python script I had AI write for me.</p><h3>The Standard Came First</h3><p>Let me be clear about the order of events, because the honest version is better than the tidy one.</p><p>I did not run this script blind and then feel bad about it later. When we built it, I said upfront that running something I could not explain was not acceptable. We agreed to run it once to finish the post I was working on, then come back and break it down properly. That is a bounded exception with a plan to close it, which is a real thing analysts do when there is a deadline. This post is me closing it.</p><p>Why does this matter? Because in a job, running an unread script against company data with company API keys is your problem. “The AI wrote it” is not a defense you want to give your incident lead. If I cannot open a file and explain what it does, I have no business pointing it at anything I am responsible for.</p><p>I am not a Python developer, and I am not going to pretend otherwise. That is not the skill here. The skill is reading code before you run it.</p><h3>Read It Backwards</h3><p>Here is the first thing that surprised me. Python scripts do not run top to bottom the way you read them. The file defines a bunch of tools first, and then at the very bottom it actually starts.</p><p>So I started at the bottom:</p><pre>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>That is the entry point. It says “if a human ran this file on purpose, go do the thing called main.” Everything above it is supporting cast. Find that line, see what it calls, go read that first.</p><h3>The Import Line Is Your Security Checkpoint</h3><p>Then I went to the top:</p><pre>import json, os, sys, time, urllib.request, urllib.error</pre><p>This one line tells you the ceiling on what the script can do. Everything here ships with Python itself. Nothing downloaded, nothing third party, nothing anyone could have tampered with.</p><p>More importantly, look at what is missing. No subprocess. No os.system. No socket. Those are the imports that let a script run shell commands or open raw network connections. They are not here, which means this script cannot do those things no matter what the rest of the code says.</p><p>Scan for capability, not just for where the code came from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eg5sHlAiY6lUbHXBUGFheA.png" /></figure><h3>What Does It Touch, And Where Does My Key Come From</h3><p>The constants gave me the full inventory: two files it reads, one file it writes, all in expected places. It never writes into my malware binaries folder and never reaches outside my home directory.</p><p>Speaking of that binaries folder, here is the finding I cared about most. The script calls os.listdir and os.path.getsize on it. That reads filenames and sizes. It never calls open() on those files. It never reads their contents, and it never executes them. That folder is full of live WannaCry, so this is exactly what I wanted to confirm, and now I can say it with certainty instead of hoping.</p><p>Then the API key:</p><pre>api_key = os.environ.get(&quot;VT_API_KEY&quot;, &quot;&quot;)</pre><p>The key is not in the file. It comes from the environment at runtime. That means I could email this script, post it publicly, commit it anywhere, and my key does not leak. If I had opened this and found a key hardcoded in the source, that would have been a serious problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQZ-GuJ68ibVt9Wwc_La_Q.png" /></figure><h3>Where Is My Data Going</h3><p>One more line worth staring at:</p><pre>req = urllib.request.Request(f&quot;https://www.virustotal.com/api/v3/files/{md5}&quot;)</pre><p>Hardcoded. HTTPS. Not built from a variable, not pulled from a config file someone else could edit. The only things leaving my network are a hash and my key. No file contents, no logs, no system info. If that URL had pointed somewhere I did not recognize, that is where I stop.</p><h3>The Flaw I Found</h3><p>The script caches results so it does not re-query hashes it has already seen. Great for rate limits. But that cache never expires, and it has no timestamps.</p><p>So if a hash came back clean six months ago, the script will keep telling me it is clean forever, even if VirusTotal has since flagged it 60 out of 70. It hands you a stale answer and gives you no hint that it is stale.</p><p>That is not a security bug. It is a correctness bug, and knowing the difference matters. The script is not doing anything dangerous. It is just quietly capable of being wrong.</p><p>My fix: re-run anything older than a month. In a production environment without free tier rate limits, I would be more aggressive than that. Anything over a week. Threat intel moves fast, and the only reason to wait longer is cost, not correctness.</p><h3>Would I Run It?</h3><p>Yes. Standard library only, no shell execution. Three file paths, all expected. Key from the environment. Malware touched by name only, never opened. One hardcoded HTTPS endpoint carrying nothing but a hash. The one caveat is cache staleness, and I know how to handle it.</p><p>That is a verdict I can defend, and I got there by reading, not by trusting.</p><p>Next up: I clear the cache, run it fresh, and find out what is actually in that queue.</p><p><em>This is Part 2 of my honeypot download triage series. Part 1 covers working the queue down from a million events. All analysis is performed on log data in an isolated lab environment.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cce6c40c017f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>