I suspect a lot of us did this back in the day...
The only virus I wrote was only designed to annoy a friend. And set to die after a particular timescale.
I was 17 years old, I had nothing to do, and I wanted to teach myself programming. So I decided to write a computer virus. Don't worry. The two viruses that I ended up writing – Leprosy and Leprosy-B – were designed to infect MS-DOS computers. They knew nothing about the internet, because neither did I at the time, and these …
I wrote an Excel macro just to demonstrate to a manager that it was possible for a spreadsheet or word-processing document to wipe a floppy disk simply by getting someone to open it. When he realised that it could just as easily have been the C: drive, we had an anti-virus policy written and approved within a week.
I'll leave you to guess which poor sod then had to go around installing anti-virus software on every machine.
Back in the days when floppy discs were exchangable we had one guy who hoarded them. He must have had hundreds of discs, because he never gave a single one back or gave anybody a disc with files on. This was considered a bit rude, and we started to get low on discs so needed to get them back.
Seeking to solve the problem I wrote a simple batch file on my disc that simply created a directory on the HDD, copied the files and then printed a message saying "this message will self destruct in five seconds..." followed by wiping the floppy, and printing a message saying "NOW GIVE ME THE FLOPPY BACK!"
It worked, but everybody involved started doing similar things and we all got a lot more cautious about opening anything vaguely executable from external sources, which has proven to be a useful habit!
Back in the late 1980's when viruses were starting to become known, I wrote a fake virus that mimicked the virus that made random letters slide down and off the screen. I've forgotten what the real virus was called; maybe Michaelangelo virus? It was just to freak out our company's tech support dept. When the guy was in the office I called him over and asked him if he'd got any idea what was wrong with my computer. The guy was horrified and immediately began testing it and all my 5.25 disks for infections. He never did find the "virus".
Funny how some techniques are independently invented by multiple people. Back in the days of the Commodore 64 I wrote a ton of assembly language software for it, including some that did a controlled buffer overflow to take full control of the computer. While loading an apparent Basic program from tape, it overwrote key vector tables and took full control of the computer, running my machine code even before the tape had finished loading. It wiped any other software that was already resident (e.g. pirating software) then banked out the operating system and bios and had the full 64K all to itself. Ah fun times.
I also had lots of fun making stuff that went *bang* but maybe best not to elaborate much other than to comment that nitroglycerin goes with an exceedingly big bang and that such hobbies are somewhat frowned on nowadays by Mr Plod, even when done without any malicious intent.
"the virus that made random letters slide down and off the screen"
Oh, we did that too - except we were using the disassembled Real Thing with its infecting parts removed. We left it running in memory only and retreated slightly. Well, you have not seen proper horror until you've watched the guy who sat down after us noticing the falling letters in his Borland IDE, starting the text-mode McAfee scanner then flip out once that too started to "fall" mid-scanning. Of course, the modded code was not spotted and it went "poof" as soon as they turned off the machine... good times.
The gatehouse to a UK civil nuclear site contained a PC, ostensibly to scan media for viruses. I don't know, ten years later would be working in the mail room of the same site, and the parcel X-Ray machine was only turned on once a year - for testing.
Those of you who have noticed that in the note about the author in many Terry Pratchett books reads "he has thought about writing about his time in the SW Generation board, but felt that nobody would believe him', should believe him - its unbelievable. Still, it lit and warmed our homes,and the resulting pub stories could have been written by the late Tom Sharpe - or Pratchett.
"Funny how some techniques are independently invented by multiple people."
My one (purely academic) go at writing a virus was a straight forward, "overwrite the smallest uninfected file larger than the virus code". To find the ideal target, my virus had to have a way of 'looking' at every file on the disk, so I invented a programming technique commonly known as 'recursion'. Too bad this was the late 80s and some people had already stolen my idea... long before I had it.
I wrote a fake virus...
There's a proud tradition of software that mimics malware or other disasters without actually doing anything bad. Other examples are the Sysinternals fake-BSOD screen saver and the fine-named MIT "Amyl Fax Shuffle Time", which forged a message that made it appear the MULTICS MAC security labels had been subverted.
A related species is the malware that annoys a user temporarily but doesn't do any lasting damage; the best-known example is probably Cookie Monster.
My favorite version of this involved leaving a dialog box open on the "target" machine, asking the user if he's sure he wants to delete all files on volume C:
After clicking the cancel button, the code would then show: Now deleting: xxxx, were xxxx was generated by a simple loop listing all the files.
This started a fine tradition of April the first software releases.
I wrote one that randomly renamed command.com and gave a message along the lines of "Hi dad! Your command.com got broken. Here's how to fix it."
We won't talk about how long I was grounded for that one. In my defense it was supposed to be funny. How was I supposed to know my 5 year old sister would end up being the one who got the disinfection instructions?
I used to write TSR (Terminate & Stay Resident) programs that would wait for a certain key combination and then pop up a silly text window message and have them start on autoexec on all the office PCs. And I found out how to do that from the same Peter Norton book.
Ahh, nostalgia and memories of younger simpler days.
I recall back in the 90s a virus was such a rare thing that if anyone got infected then everybody got invited over to see it.
This post has been deleted by its author
In 94 or 95 I wrote a word macro that surreptitiously when opened printed 1000 letters to the default printer without you being able to cancel it. Once emailed to a person it had the effect you can imagine of printing what seemed like a private letter to the the rest of the room since printers are usually shared beasts and spew out paper so anyone can read them.
At the time i would have said it was the first macro virus ever, but it was not designed to replicate except on paper. Such were the days. Kid renegade. Of course now i know it was not clever and not smart, but in the day it felt like quite an achievement.
I was thinking the same thing. I'd just dropped out of college around 1989, I was 17 and found it very boring 'cos they didn't teach us anything interesting in computing except database theory and how to build a PC, stuff I'd been doing with my old man for at least 2 years at that point. Dossing at home for a few months while looking for a job I decided to stop learning C and start learning X86 and 68000 assembler, simply so I could write virus code. Stupidity of youth! I never wrote anything deadly serious, just boot sector infectors that did silly things with the screen and mouse when you started your Atari ST or weird things in DOS like transpose the keyboard, print letters back to front. Just fun stuff that would annoy people. I used to "defuse" game protection mechanisms for my mates or I'd get bored and put my girlfriend's name and greets into games so she's get a nice surprise when she played them! A misspent youth, no doubt all that tinkering has probably helped me in the long run in professional my IT career!
This post has been deleted by its author
Phoneboxes are all well and fun. But there was a trick you could do back in the day to fry someones computer.
Take a 5 1/4 floppy disk, open it up and get to the plastic disk inside. Then, take a box or 2 of strike anywhere matches, very carefully remove the match part from the matchstick. Then very slowly grind up the matches into as fine a powder as you can muster. Then, apply some clear nail varnish to disk, sprinkle said powder onto disk.
Re-assemble disk. And then give it to someone you don't like.
Crude, but can do a lot more damage to a pc than a virus.
Yea remember that trick a guy I know did it to someone in highschool long ago who claimed to be a master hacker, and claimed he could defeat any kind of threat to his PC. He didn't expect his drive bursting into flames.
Still talk to the guy that pulled it, and its always funny when we reminisce about high school.
I also still remember the disk box that I kept of floppies that were infected with numerous different viruses that I collected, and would give to people that pissed me off :D
Then there was the macrovirus I wrote when I was attending/working in a college that only would infect our PC's, and targeted another macro virus someone I knew wrote, and would over write it. Did it as I got tired of having to go PC to PC to clean it off.
I wrote my virus in 8086 assembler.
It had a neat extra trick that after a machine was fully infected, it *de*infected the machine until clean. Really got a few heads scratching there.
Funnily enough, it wasn't that which got me a knock from Men In Suits, but something much less technical. I can certainly vouch for UK academia being closely watched in the 1980s.
You could hammer the read/write head against track 0 as fast as physically possible - if the owner was unlucky it would upset the alignment, and start to fail.
Depending on the video hardware, you could drive a PC monitor at the wrong refresh rate. Cue a high pitched whine, and smoke.
And some hardcards had on board low-level format firmware. Given the market was hardly awash with them (WD and Seagate probably), you had a good chance of really trashing someones hard drive.
You could hammer the read/write head against track 0 as fast as physically possible
Or you could do it at a variable frequency, and play tunes. IIRC that was the basis of "Drive Music" on the Amiga. Not something to try on your own drive, but there was always a gullible new kid somewhere...
"You could hammer the read/write head against track 0 as fast as physically possible - if the owner was unlucky it would upset the alignment, and start to fail."
I did that accidentally in the late 80's trying to write my own diskloader for an amiga megademo.
I scoffed at all that namby pamby capturing the trackdisk device at $4c and playing nice, instead to hit the cia's that controlled disk io directly in 68k asm and write the entire disk controller for myself. Somehow I got the whole idea so spectaculary wrong it tracked the head over the whole disk surface, and the software of the day couldn't recover anything off a floppy so destroyed. So... not to look a gift horse in the mouth, we released it as the fast disk destroyer (and as far as I know, no floppy mechanisms died as a direct result, but who knows... Mine was alright mister...)
Did learn a lot about controlling hardware, though we ended up using trackdisk.device for the demo loader in the end anyway.
To the author, I mean this in the nicest possible way as I don't think it was your original intent, but, you b*stard! I pulled the SCA virus apart in a debugger to see how it worked, but only so we could see how it loaded and stayed resident and to admire the code (it was the first virus we'd ever seen) . We used that to write a intro that we jammed into the bootblock (with chipmusic to boot!) , but decided *against* making it propogate to inserted disks as quite a lot of games of the period relied on funny things being inserted into that sector as part of their copy protection (plus it took another 120bytes of precious space). Its the difference between unlocking someones bike at school for practice picking combo locks then swapping it with someone elses bike lock out of mischief vs unlocking the bike and nicking it.
I'm still locking other people's bikes together out of mischief (professionally, correctly engaged), but not nicking their bikes.
The expensive "experimenters" version of the Tandy TRS80 had a built-in EPROM blower. A few Basic POKE commands could re-direct the higher programming voltage to other hardware in the machine's memory map - cue smoke and flames!
We installed and ran a little Basic program that did just that in many Tandy Stores! They withdrew the model variant after a while, because they were "always burning out when on demonstration"!
"I didn't really understand it, but it solved my issue, so I used it." ... There's a name for that ... https://en.wikipedia.org/wiki/Cargo_cult_programming
That's not what "Cargo Cult Programming" is normally used to mean.
The distinguishing feature of Cargo Cults is that they observe a process that consistently has certain material results, and then they implement their own version of that process, but without key aspects that make it work, because they don't understand it.
In CCP, the process is "I didn't understand it, but I jammed it in anyway, without being able to tell whether it fixed the problem". Often that's because the problem is intermittent or is hidden by the change; sometimes a side effect of the change accidentally corrects the problem, but not for any good reason (for example, the change introduces a delay that narrows down a race window to the point where it's never hit in practice).
In the article, Neil understood the purpose of the code in question, just not the details of its implementation; and the purpose addressed his problem. Using it was just a case of using some software as intended without knowing how to do the same from scratch. I expect most developers are in that situation, since most end up using components provided by other parties, and few have comprehensive knowledge of computer science and other applicable domains.
1. Did you get caught; and
2. Is there some sort of statute of limitations?
I found the whole field very interesting for a while. Not so much the basic idea of a virus (which is trivial) but more the ingenuity that some authors had in finding novel places to stash their code in memory, evade detection (like some viruses that would hook DOS or the BIOS interrupts to show infected files in their original, uninfected forms if resident) and especially polymorphic viruses (especially the Dark Avenger Mutation Engine).
I never used a BBS. I tended to use Usenet (VIRUS-L? All the 40Hex, 2600 and so on were also available) and a few key resources (Ralf Brown's Interrupt List, Patricia Hoffman's VSUM and IIRC, "The Programmer's PC Sourcebook/Handbook" by Thom Hogan). Was never part of any "hacker" scene. More of an academic interest with me. Kind of a strange hobby for teen/twenty-something, but still, I learned an awful lot about PCs, the BIOS, Dos and x86 assembly from it.
They really were simpler times. Most viruses were no more than stupid and ill-advised pranks. Even PCs were kind of more like a novelty than a serious tool. When serious money started being involved (PCs becoming mission-critical and the Internet becoming a conduit for commerce and banking) the scammers and crooks took over. That was the end of the fun/innocence.
A friend of mine ran a local BBS & kept crowing about how he had "secured it tighter than a virgin's morals".
He challenged me to find some way of infecting the BBS, and I accepted.
The result was a batch file that typed the ASCII code for a Space into a text file, copied that first text file into a second, then kept concatenating the files to the end of each other until the files were so huge that they filled the HDD.
I had to boot to a floppy, delete the second text file, clear the temp files, & reboot to the HDD, at which point I used PKZip to max compress the remaining text file down to nothing.
Once the zip file was made, I ran the batch file again.
I kept it up, creating the massive "empty" text files, rebooting to a floppy, deleting one of them & clearing the cache, and rebooting to add the resulting text file to the zip file.
By adding to rather than overwriting the compressed file, I ended up with a zip file nearly half a megabyte in size, in an era when 10Megabyte hard drives were still considered exclusive to data centers & server farms.
I changed the name of the compressed file (inside the zip container) to File_ID.Diz, this being the Description file that most BBSi would extract to use to post the description of the uploaded file to automated listings.
After adding a legit file inside to make it appear that the zip was also legit, I uploaded the whole thing to my friend's BBS.
The system promptly crashed when it attempted to uncompress the "tiny" description file, only to have what would normally uncompress to maybe a few Kb for a really detailed description, into something that spanned *GigaBytes*.
He didn't have the computational horsepower to handle the job, didn't have the HDD space to store it, and the board went down faster than a crack whore Jonesin for a fix.
He called me up screaming that I'd killed his machine, and I had to take repeated deep breaths to control the laughter.
I explained what I'd done, how I'd done it, & the simple steps needed to recover from the "virus" (reboot to floppy, delete the text file, flush the cache, & reboot to the HDD), and he promised to dismember me the next time I came over.
I made up for it by bringing over a pizza & case of soda, and he said he'd let me live.
*Snirk*
So I never got into programming virii, I merely figured out ways to use systems against themselves, so a run away process, RAM & HDD gobbling "clean" program could do what Anti Virus software would have otherwise detected & quarrentined first.
"Oops, I'm sorry, did your uber fast 8088 with a full Meg of RAM and 5Meg Hard Drive suddenly shit itself? Good thing that wasn't a virus I uploaded to your secure system, huh?"
*Thumbs in ears, feisty raspberry & happy hooty monkey noises*
You can do an even better trick in a MS AD environment.
When I was just learning VB script many years ago, I needed to create a script to list all .exe files on a PC. Being a rookie, it accidently ran all the executables instead, with predictable results.
Being generally evil at heart, this got me thinking...
Write a simple recursive script to search the HD for .exe files, and run any it finds on the target PC. Hide it somewhere on the network, then create a login script attached to a GPO that copies a shortcut to the file into each PC's start-up folder. Have the first line of the script delete the shortcut to cover your tracks.
It's not a virus, does no permanent damage, but gives a sys-admin (who assumes it IS a virus) a very bad day. So what could possibly go wrong?
Not surprisingly, I don't work for that company anymore.
"I was 17 ... This was 25 years ago, in 1990 ... So how does a guy who wasted his teenage years lobbing rocks at other people's computers occupy his time in his adult life? I should think that would be obvious. He writes for The Register."
I didn't think you were anywhere near that old, Chris. ;)
Hold on a minute, I just ran that in the same directory as my compiler and all my tools.
Always mount a scratch monkey.
I recall one day in my callow youth when I was in the process of typing "shutdown -r now" on a (variant) BSD system to test a new kernel I'd just built, when it occurred to me that it might be a good idea to back up first, in case my new kernel destroyed a filesystem or two, or even just refused to boot successfully. (With a backup I could reinstall without worrying about my data.)
As it happened, none of my kernels ever did cause me those sorts of problems. I had a moment of cold-sweat panic, though, when I realized what I could have done to my data with just a few more keystrokes.
(Of course all my actual work for my employer was backed up daily, and source code went into a change-management system. But I could have lost all sorts of personal projects plus the work I'd done for the day so far.)
I always tell one of these anecdotes to students in the web-and-database class I sometimes teach, and point out that one wrong command in, say, phpMyAdmin1 could wipe out whatever data they have - at which point they'll really wish they'd taken three seconds to grab a backup.
1It's a class for non-programmers, so we use simple tools, even if they aren't good tools.