What Is Pharming? How This Invisible Attack Works and How to Defend Against It

Of all the phishing-adjacent attacks, pharming is perhaps the most unsettling — because it can victimize you even when you do everything right. You type your bank’s web address correctly. You don’t click any suspicious links. You see no warning signs. And yet you end up on a fraudulent website that captures your credentials. That’s pharming.

Pharming bypasses the primary advice given to phishing victims — “don’t click suspicious links” — by eliminating the link entirely and redirecting your traffic at the network level before it even reaches your browser.

What Is Pharming?

Pharming is a cyberattack in which the victim is redirected from a legitimate website to a fraudulent one without any action on the victim’s part — specifically without clicking a malicious link. The attacker achieves this by corrupting the system that translates human-readable website addresses (like “mybank.com”) into the numerical IP addresses that computers use to actually locate servers on the internet.

This translation system is called DNS — the Domain Name System. It is, in essence, the phone book of the internet. Pharming attacks corrupt this phone book, so that when your computer looks up “mybank.com,” it gets the wrong address — one pointing to the attacker’s server instead.

The word “pharming” combines “phishing” with “farming” — suggesting an attack that harvests credentials passively, at scale, from victims who have done nothing wrong.

How Pharming Attacks Work

There are two primary mechanisms for pharming attacks:

DNS Poisoning (Server-Side Pharming)

The attacker compromises a DNS server — one of the servers that handles the translation of domain names to IP addresses for large numbers of users. When any of those users’ computers make a DNS lookup request, the poisoned server returns fraudulent IP addresses, sending the user to the attacker’s server instead of the legitimate website. This type of pharming can affect thousands or millions of users simultaneously.

Host File Corruption (Client-Side Pharming)

Every computer maintains a local “hosts file” — a simple text file that maps domain names to IP addresses. If an attacker installs malware on a victim’s computer (often via an earlier phishing attack), they can modify this file to redirect specific domains to fraudulent IP addresses. This form of pharming affects only the compromised computer.

How Pharming Differs From Phishing

The critical distinction: phishing requires the victim to take an action (click a link, open an attachment). Pharming does not. The victim is redirected automatically, without any suspicious activity to observe.

Both attacks end with the same result — the victim on a fraudulent website entering real credentials. But the path to get there is fundamentally different, and that difference matters for prevention strategies.

Warning Signs You May Be on a Pharming Site

Since you didn’t click a suspicious link, the warning signs must come from the site itself:

The padlock/HTTPS is missing. Modern pharming attacks sometimes use HTTPS (it’s now accessible to fraudsters too), but many don’t. A missing padlock icon on what should be a secure site is a warning sign.

The URL looks slightly wrong. Even when redirected by pharming, the address bar often shows an IP address rather than a domain name, or a domain that doesn’t quite match the legitimate one. Check the address bar carefully on any site asking for sensitive information.

The site looks slightly different from what you expect. Colors that are slightly off, layout differences, missing features, or elements that don’t load correctly. These can indicate a fraudulent mirror site.

Your security software raises an alert. Reputable antivirus and anti-malware tools often detect known pharming sites and raise warnings. These alerts should be taken seriously.

The login fails and then “works.” Some pharming sites capture your first login attempt and then redirect you to the real site — so the login appears to eventually succeed, while your credentials have been stolen. Being asked to re-enter credentials can be a signal.

How to Protect Yourself From Pharming

Use a reputable DNS provider.

Switching your DNS to a security-focused provider significantly reduces your risk from DNS poisoning attacks. Cloudflare (1.1.1.1) and Google (8.8.8.8) offer free, well-maintained DNS services with security protections. Cisco OpenDNS provides additional malware-blocking capabilities. Your router settings control which DNS server your network uses.

Keep your router firmware updated.

Home and small office routers are a common target for DNS poisoning attacks. Keeping your router’s firmware updated patches vulnerabilities that attackers exploit to modify DNS settings.

Use security software that includes DNS protection.

Many modern antivirus suites (including Norton, Bitdefender, and Kaspersky) include DNS monitoring that detects suspicious redirections and alerts you before you land on a fraudulent site.

Check for malware if you suspect host file modification.

If you’re experiencing persistent redirections on your computer, run a full malware scan with a reputable anti-malware tool. Many malware infections that modify the hosts file are detectable and removable.

Enable DNSSEC where possible.

DNS Security Extensions (DNSSEC) is a technical protocol that cryptographically signs DNS records, making them much harder to poison. Many modern routers and DNS providers support DNSSEC.

Always check the URL bar before entering sensitive information.

Before entering any password, financial information, or personal details on any website, confirm the URL in the address bar is exactly correct — the right domain, the HTTPS padlock, and no unexpected elements.

Frequently Asked Questions

Q: Is pharming common?

A: Pharming is less common than email phishing or smishing, but it has been used in significant attacks — particularly against financial institutions and their customers in Latin America, Europe, and Asia. In the U.S., it is less prevalent than other phishing types, but significant DNS poisoning events affecting consumer routers have been documented.

Q: Can pharming happen on a mobile device?

A: Yes. Mobile devices are also subject to DNS manipulation, particularly if connected to a compromised Wi-Fi network. Using a mobile VPN and a security app provides significant protection.

Q: Is there a way to test if I’m being pharmed?

A: You can look up the IP address that your computer resolves for a specific domain (using command prompt tools like “nslookup” or online tools like dnsleak.com) and compare it to the expected IP address. If they don’t match, something is wrong with your DNS resolution.

→ Back to Pillar: https://www.scammed.org/phishing/

→ See also: https://www.scammed.org/phishing/email-phishing/