Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 920

Pharming

Reviewed byCybersecurity entrepreneur & security researcher

What is Pharming?

PharmingAn attack that silently redirects users from a legitimate site to a malicious one by tampering with DNS, hosts files, or local routing — without requiring the victim to click a link.


Pharming subverts name resolution or routing so that users who correctly type a domain still land on an attacker-controlled clone. Unlike phishing it needs no lure click: techniques include poisoning DNS caches, compromising recursive resolvers, editing the local hosts file via malware, or changing a router's DNS settings. On the fraudulent site, credentials, payment data, and even MFA codes are harvested as if entered on the real one.

The best-documented case is the DNSChanger trojan run by Estonia's Rove Digital. Spread as a fake video codec, it rewrote victims' DNS to rogue servers and, at its peak, infected over four million machines across 100+ countries. The FBI's Operation Ghost Click (November 2011) seized the ~100-server infrastructure and charged seven suspects; court-ordered replacement resolvers kept victims online until July 2012. In 2018 Netlab 360 exposed GhostDNS, which brute-forced DNS on 100,000+ routers — about 87% in Brazil — to phish customers of Banco do Brasil and others. Symantec researchers earlier demonstrated "drive-by pharming," using CSRF against a router's default password to flip its DNS from a web page. Defences include DNSSEC, encrypted DNS (DoH/DoT), endpoint protection against hosts-file tampering, hardened router credentials, and strict TLS certificate checking.

flowchart LR
  U[User types bank.example.com] --> R{Resolution path tampered?}
  R -->|hosts file edited| M[Malware on endpoint]
  R -->|router DNS changed| G[Rogue resolver e.g. GhostDNS]
  R -->|cache poisoned| C[Compromised DNS cache]
  M --> X[Attacker IP returned]
  G --> X
  C --> X
  X --> P[Look-alike phishing site]
  P --> H[Credentials / payment / MFA harvested]

● Examples

  1. 01

    Malware modifies the Windows hosts file so that bank.example.com resolves to an attacker server with a look-alike login page.

  2. 02

    Compromised home router replaces the ISP's DNS with rogue resolvers that hijack banking traffic for the entire household.

● Frequently asked questions

What is Pharming?

An attack that silently redirects users from a legitimate site to a malicious one by tampering with DNS, hosts files, or local routing — without requiring the victim to click a link. It belongs to the Attacks & Threats category of cybersecurity.

What does Pharming mean?

An attack that silently redirects users from a legitimate site to a malicious one by tampering with DNS, hosts files, or local routing — without requiring the victim to click a link.

How do you defend against Pharming?

Defences for Pharming typically combine technical controls and operational practices, as detailed in the full definition above.

● Related terms