$ cat Vertical: Illegal Pharma
Partnerka affiliate economics, the WordPress pharma hack, hacklink markets and the payment chokepoint, with detection and defense.
Illegal pharma is the most thoroughly studied black-hat vertical in existence, because academic security teams spent a decade taking it apart end to end. The result is something no other vertical has: leaked affiliate ledgers, named programs, and precise economics. This chapter documents how illegal online pharmacies captured organic traffic, why the model worked, how it was demonetized, and how the compromised-host tactics that still run today are detected and defended against. Per the archive's Tier C boundary, it explains the full mechanism and the defenses without providing a working exploit or malware artifact.
1 · Definition
The vertical covers unlicensed and gray-market online pharmacies: sites selling prescription drugs without a valid prescription, cross-border knockoffs of brand medications, and in some programs actual controlled substances. Their defining SEO problem is that their own domains are disposable and penalized on sight, so the entire organic strategy is built on borrowing or hijacking authority that belongs to someone else. confirmed[2]
2 · Why it worked: the partnerka model
Illegal pharma at scale never ran as lone operators. It ran on partnerka networks... affiliate programs that owned the storefronts, shopping carts, payment processing, supplier fulfillment and payouts, while a distributed set of affiliates did nothing but generate traffic. The affiliate never touched a pill or a payment; the program never touched the traffic. This division of labor is the whole reason it scaled. confirmed[1]
The canonical programs, all exposed through leaks and law-enforcement action, were GlavMed and SpamIt (run by Igor Gusev; GlavMed the SEO-and-web arm, SpamIt the closed email-spam arm) and RX-Promotion (notable for pushing actual controlled substances). A nine-gigabyte database leaked from the operation and was analyzed first by SophosLabs and then by academics, which is why the numbers below are so solid. confirmed[3]
3 · Architecture
DISTRIBUTED AFFILIATES CENTRAL PROGRAM BACK END
-------------------- ---------------- --------
traffic generation ── send ──▶ storefront + cart ── order ──▶ acquiring bank
(SEO / spam / templates, tracking, (scarce; studied)
hijacked hosts) 40% payout to affil. │
▲ │ ▼
│ ▼ supplier / post
└──────── 30-40% commission ◀── revenue to the buyer
The affiliate side is the volume engine; the program plus its banking is the value core. Which half you attack determines whether disruption works, and that turned out to be the single most important finding in the field (section 14).
4 · Historical evolution
| Era | What happened |
|---|---|
| Mid-2000s | "Canadian Pharmacy" branded storefronts proliferate; email spam is the dominant channel, SEO the scaling channel. |
| 2007–2010 | GlavMed/SpamIt process 1.5M+ orders from 800K+ customers; measured revenue in the tens of millions. confirmed[3] |
| Sep 2010 | Russian authorities open a criminal investigation into Gusev; SpamIt announces closure and global spam volumes drop. confirmed[3] |
| 2011–2012 | Academic teams publish the value-chain and leaked-ledger analyses that reframe enforcement worldwide. confirmed[1][2] |
| 2020s | Storefront spam is demonetized; surviving activity leans on compromised-host injection and hacklink markets, overlapping with SEO poisoning. practitioner |
5 · The measured economics (why it kept going)
The PharmaLeaks analysis of the leaked ledgers is the most reliable set of numbers in all of black-hat SEO. confirmed[2]
| Metric | Finding |
|---|---|
| Combined settled revenue (~4 yrs, 3 programs) | > $185M (GlavMed ~$81M, SpamIt ~$92M, RX-Promotion ~$12M) |
| Unique customers | ~1.2M combined; market not saturating (~3,500 new/week each for the big two) |
| Repeat-order rate | 27% (GlavMed), 38% (SpamIt) — product was largely delivered as promised |
| Affiliate commission | 30–40%; top-heavy: ~10% of affiliates earned 75–90% of revenue |
| Net margin | 10–20% after commissions, supplier cost, processing, refunds |
| Product mix | ED drugs dominate (73–79%); RX-Promotion's controlled substances were ~10% of orders but ~26% of revenue |
The uncomfortable finding: repeat rates that high mean this was not a pure scam. That is precisely what made it durable and hard to disrupt from the demand side.
6 · The search-side tactic: the pharma hack
Because their own domains are disposable, pharma operators historically ranked by injecting content into already-authoritative sites they compromised. This is the archetypal commerce-driven SEO poisoning, and it is documented here at the mechanism-and-detection level, not as a deployable recipe. The observable pattern (what a defender or auditor sees): practitioner
- Entry through an out-of-date CMS, a vulnerable plugin or theme, or stolen credentials.
- Obfuscated backdoor files dropped in low-traffic directories, plus encoded rows written into the site's options/settings table under innocuous names.
- Conditional cloaking: the injected code inspects the request's user-agent and serves keyword pages and link blocks only to search-engine crawlers. A human visiting in a browser sees the normal site; the spam appears only in search results and in "crawl as Google."
- Persistence: deleting the payload files is useless because include statements in a legitimate template file regenerate them on the next page load. This "delete protection" is why owners re-infect repeatedly.
The payoff: the victim domain's earned authority ranks the injected pharma pages, and the click is redirected to the affiliate money site. The victim absorbs the penalty risk; the operator keeps the revenue.
7 · The industrialized version: hacklink markets
The modern form is hacklink: rather than hacking sites yourself, you rent injected links on already-compromised domains through a control panel, turning the old GlavMed site-hacking arm into a self-serve service. Netcraft documents listings starting around $1 per link (higher for .gov/.edu authority), and identifies the three primary buyers as online gambling, pharma and adult, with some operators claiming access to 15,000+ compromised sites. practitioner[4] The 15,000 figure is an operator claim. estimate
8 · Demonstration (Tier C: incident analysis + defensive lab)
Hypothetical scenario. A regional clinic's WordPress site suddenly ranks, in Google only, for "canadian pharmacy" and drug-name queries. In a browser the site looks untouched. The owner deletes two suspicious files; they return within a day. This is the textbook signature: crawler-only visibility plus self-regeneration.
What the archive actually runs. Rather than reproduce the injection, the defensive demonstration compares a crawler-view fixture against a user-view fixture and flags the divergence, alongside file-integrity and unexpected-page signals. That is exactly what Lab 3 (crawler/browser response comparison) and Lab 6 (synthetic poisoning indicators) demonstrate on invented inputs. No live payload, malware or exploit is included, by design.
______________________
/ Rx PHARMA HACK \ served only to the crawler.
| ~~~~~~~~~~~~~~~~~~ | invisible in the browser.
| [ CLOAKED 201x ] | reincluded when the
| host: not yours | backdoor was finally found.
\______________________/
| |
__|____|__ here lies a borrowed ranking.
9 · Expected output & results
For the operator: fast rankings on the host's borrowed authority, a short lifespan before the host is cleaned or penalized, and near-zero attribution because the money site is one redirect away. For the host: a manual action or ranking collapse for content they never knowingly published, and repeated re-infection until the backdoor itself is removed. interpretation
10 · Documented real-world cases
- GlavMed / SpamIt takedown (2010–2011). Leak-sourced, law-enforcement-confirmed. See the case record.
- RX-Promotion controlled-substance sales. Ledger-documented demand for oxycodone and similar. See the case record.
- The hacklink market. Netcraft's documentation of injection-as-a-service. See the case record.
- GootLoader / Oyster SEO poisoning. The same mechanics, malware payoff. See GootLoader and the 2025 campaign.
11 · Common mistakes & footprints
Operationally, what gets pharma injection caught: reused backdoor filenames and obfuscation patterns that scanners fingerprint; a sudden spike in a site's indexed-page count; sloppy cloaking that leaks the spam to logged-in reviewers or to "fetch as Google"; and reuse of the same redirect money-domain across many hosts, which links compromises together. practitioner
12 · What experts get wrong
13 · Detection methods
Detect the cloak, not the browser view: use site: queries for drug terms, and Search Console URL inspection ("view crawled page") to see what the crawler is served. Monitor indexed-page counts for spikes. Watch for the regeneration signature (files returning after deletion), unexpected rows in the options/settings table, and obfuscated code in upload/include directories. Clean server-side, since many payloads specifically evade in-dashboard security plugins. See Detection & Defense. practitioner
14 · Defense & the demonetization lesson
The field-defining finding from Click Trajectories: the traffic side is nearly impossible to disrupt (domains cost under $1 in bulk, hosting is effectively infinite), but the payment side is a chokepoint... roughly three acquiring banks handled about 95% of spam-advertised sales, and merchant accounts take weeks to acquire and cannot be swapped like domains. Pressure on issuing-bank settlement demonetized far more of the industry than a decade of domain takedowns. confirmed[1] For a host, defense is standard incident response plus the detection above; for the ecosystem, follow the money.
15 · Risk & legal status
This vertical is distinct from most of the archive in that the underlying activity is frequently criminal, not merely a policy violation: unlicensed sale of prescription drugs, sale of controlled substances, and (for the injection tactics) unauthorized access to computer systems under laws such as the CFAA. Documenting mechanism and defense is legitimate research; the operational conduct is prosecutable. This is the clearest example in the guide of the Tier C boundary. interpretation
16 · Expert analysis & current effectiveness
As a storefront-spam business, the classic model is largely dead: demonetization worked. As a technique family, the pharma hack is very much alive, repurposed into general crimeware (malware, phishing) through the same compromised-host + cloaking + redirect pattern. The lesson that transfers to every other vertical: the reusable engine is long-tail targeting on a borrowed or hijacked host, with arrival-based cloaking. interpretation
17 · Field guide: what a defender should do first
If you audit a client in health or pharma and suspect this: preserve evidence before cleaning, inspect the crawler-served version, enumerate persistence hooks before deleting payloads, and rotate all credentials. Treat SEO poisoning as an attack on legitimate healthcare brands, not only as how illegal pharmacies rank... your own clients are targets. practitioner
18 · References
- Click Trajectories: End-to-End Analysis of the Spam Value Chain. Levchenko et al., IEEE S&P, 2011. primary
- PharmaLeaks: Understanding the Business of Online Pharmaceutical Affiliate Programs. McCoy et al., USENIX Security, 2012. primary
- SpamIt, GlavMed Pharmacy Networks Exposed. Krebs on Security, 2011. journalism
- The Hacklink Market: How Fraudsters Use SEO Poisoning. Netcraft. practitioner