Brain

aka Pakistani Brain / Lahore / Ashar / Brain-A

Brain virus boot screen text
discovered
1986
origin
Lahore, Pakistan
reported by
various
family
Brain
size
7168 bytes
platform
DOS boot sector
vector
5.25 inch floppy boot sectors
payload
boot sector, prank
trigger
boot from infected disk

Payload

Replaces the volume label of infected floppies with the string Brain and quietly relocates the original boot sector.

The First

In 1986, two brothers in Lahore, Pakistan, became part of computing history without needing to stage a theatrical hack. Basit and Amjad Farooq Alvi weren't trying to crash networks or steal data. They were trying to protect their medical software from being copied.

They called it Brain. It became the first virus in the wild on IBM-compatible PCs, and it did something no one had seen before: it worked so quietly that for weeks, no one even knew what was happening.

The Infection

Brain targeted 5.25-inch floppy boot sectors. When someone booted their machine from an infected disk, the virus moved the original boot code to a new location, installed itself in its place, and marked itself in the disk's volume label. Every new floppy that got read from an infected drive would catch the virus. Slow, inevitable, spreading person to person as people swapped floppies around the world.

It didn't destroy anything. It didn't encrypt files or demand ransoms. It just replicated. It was elegant in a way that screams 1986: a solution to a technical problem, executed with precision, small enough to fit in 7,168 bytes.

The Signature

Here's where the story breaks from the pure-abstraction narrative of other early viruses. The brothers embedded their real names in the code. Their address. Their phone number. Basit and Amjad Farooq Alvi, Brain Computer Services, Lahore. It's possible they thought no one would ever trace it. It's possible they didn't care. Maybe they wanted credit. Maybe they were just young and didn't understand how large the connected world had become.

They marked their work like graffiti artists signing a piece. The audacity is almost endearing now, though it wouldn't have been fun in real time, when antivirus companies were scrambling to understand what was happening and security researchers were starting to take brain dumps and reverse engineer the code.

What Followed

The irony is sharp. They created Brain to prevent software piracy. Instead, they created the first virus, which accelerated an entire industry dedicated to fighting viruses. Security companies spun up antivirus divisions. Diskettes got read-only tabs and write-protection schemes. The Brothers Alvi became ghosts in computing history, their names forever linked to something they couldn't have predicted.

In 2011, Mikko Hypponen of F-Secure traveled to Lahore and visited the Alvi brothers' shop. It still existed. Still operating. Brain Computer Services. He sat with them and asked them about it. They remembered. They talked about the days when floppies arrived infected, the early panic, the evolution of what they'd triggered.

Basit and Amjad didn't mean to start an arms race. They meant to protect their work. Instead, they wrote the first sentence of a story that's still being written. The first strain in what would become a decades-long evolution of malware, antivirus, and the ongoing cycle of protect and infect that defines modern computing.

That's what makes Brain historically perfect. Not because it was devastating. Because it was first, and because its creators were stupid enough or honest enough to sign their names. You can trace a line from Lahore in 1986 straight through to every ransomware negotiation, every zero-day exploit, every bug bounty program and security team running today.

It all starts here.

Related specimens

Sources

last updated: 2026-04-12 :: curated by the_curator