home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / pc / virus / blckbook.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  24.1 KB  |  484 lines

  1. ---
  2.  
  3. WARNING: This book contains complete source code for live
  4. computer viruses which could be extremely dangerous in the hands
  5. of incompetent persons. You can be held legally liable for the
  6. misuse of these viruses, even if such misuse is unintentional. Do
  7. not attempt to execute any of the code in this book unless you
  8. are well versed in systems programming for personal computers,
  9. and you are working on a carefully controlled and isolated
  10. computer system.
  11.  
  12. ---
  13.  
  14.             The Little Black Book Of Computer Viruses
  15.  
  16.                            Volume One:
  17.  
  18.                       The Basic Technology
  19.  
  20.                         By Mark A. Ludwig
  21.  
  22.                 American Eagle Publications, Inc.
  23.                       Post Office Box 41401
  24.                       Tucson, Arizona 85717
  25.                             - 1991 -
  26.  
  27.                  And God saw that it was good, 
  28.                   And God blessed them, saying 
  29.                    "Be fruitful and multiply."
  30.  
  31.                          Genesis 1:21,22
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. ============
  39. INTRODUCTION
  40. ============
  41.  
  42.  
  43.      This is the first part in a series of three books about
  44. computer viruses. In these volumes, I want to challenge you to
  45. think in new ways about viruses, and break down false concepts
  46. and wrong ways of thinking, and go on from there to discuss the
  47. relevance of the computer viruses in today's world. These books
  48. are not a call to a witch hunt, or manuals for protecting
  49. yourself from viruses. On the contrary, they will teach you how
  50. to design viruses, deploy them, and make them better. All three
  51. volumes are full of source code for viruses, including both new
  52. and well known varieties.
  53.  
  54.      It is inevitable that these books will offend some people.
  55. In fact, I hope they do. They need to. I am convinced that
  56. computer viruses are not evil and that programmers have the right
  57. to create them, posses them and experiment with them. That kind
  58. of a stand is going to offend a lot of people, no matter how it
  59. is presented. Even a purely technical treatment of viruses which
  60. simply discussed how to write them and provided some examples
  61. would be offensive. The mere thought of a million well armed
  62. hackers out there is enough to drive some bureaucrats mad. These
  63. books go beyond a technical treatment, though, to defend the idea
  64. that viruses can be useful, interesting, and just plain fun. That
  65. is bound to prove even more offensive. Still, the truth is the
  66. truth, and it needs to be spoken, even if it is offensive. Morals
  67. and ethics cannot be determined by a majority vote, any more than
  68. they can be determined by the barrel of a gun or loud mouth.
  69. Might does not make right.
  70.  
  71.      If you turn out to be one of those people who gets offended
  72. or upset, or if you find yourself violently disagreeing with
  73. something I say, just remember what an athletically minded friend
  74. of mine once told me: "No pain, no gain." That was in reference
  75. to muscle building, but the principle applies intellectually as
  76. well as physically. If someone only listens to people he agrees
  77. with, he will never grow and he'll never succeed beyond his
  78. little circle of yes-men. On the other hand, a person who listens
  79. to different ideas at the risk of offense, and who at least
  80. considers that he might be wrong, cannot but gain from it. So if
  81. you are offended by something in this book, please be critical -
  82. both of the book and of yourself- and don't fall into a rut and
  83. let someone else tell you how to think.
  84.  
  85.      From the start I want to stress that I do not advocate
  86. anyone's going out and infecting an innocent party's computer
  87. system with a malicious virus designed to destroy valuable data
  88. or bring their system to a halt. That is not only wrong, it is
  89. illegal. If you do that, you could wind up in jail or find
  90. yourself being sued for millions. However, this doesn't mean that
  91. it is illegal to create a computer virus and experiment with it,
  92. even though I know some people wish it was. If you do create a
  93. virus, though, be careful with it. Make sure you know it is
  94. working properly or you may wipe out your own system by accident.
  95. And make sure you don't inadvertently release it into the world,
  96. or you may find yourself in a legal jam... Even if it was just an
  97. accident. The guy who loses a year's worth of work may not be so
  98. convinced that it was an accident. And soon, it may be illegal to
  99. infect a computer system (even your own) with a benign virus
  100. which does no harm at all. The key word here is responsability.
  101. Be responsible. If you do something destructive, be prepared to
  102. take responsability. "The program included in this book could be
  103. dangerous if improperly used. Treat them with the respect you
  104. would have for a lethal weapon."
  105.  
  106.      This first of three volumes is a technical introduction to
  107. the basics of writing computer viruses. It discusses what a virus
  108. is and how it does its job, going into the major functional 
  109. components of the virus, step by step. Several different types of
  110. viruses are developed from the ground up, giving the reader
  111. practical how-to information for writing viruses. That is also a
  112. prerequisite for decoding and understanding any viruses one may
  113. run across in his day to day computing. Many people think of
  114. viruses as sort of a black art. The purpose of this volume is to
  115. bring them out of the closet and look at them matter-of-factly,
  116. to see them for what they are, technically speaking: computer
  117. programs.
  118.  
  119.      The second volume discusses the scientific applications of
  120. computer viruses. There is a whole new field of scientific study
  121. known as artificial life (AL) research which is opening up as a
  122. result of the invention of viruses and related entities. Since
  123. computer viruses are functionally similar to living organisms,
  124. biology can teach us a lot about them, both how they behave and
  125. how to make them better. However, computer viruses also have the
  126. potential to teach us something about living organisms. We can
  127. create and control computer viruses in a way that we cannot yet
  128. control living organisms. This allows us to look at life
  129. abstractly to learn about what it really is. We may even reflect
  130. on such great questions as the beginning and subsequent evolution
  131. of life.
  132.  
  133.      The third volume of this series discusses military
  134. applications for computer viruses. It is well known that computer
  135. viruses can be extremly destructive, and that they can be
  136. deployed with minimal risk. Military organizations throughout the
  137. world know that too, and consider the possibility of viral attack
  138. both a very real threat and very real offensive option. Some high
  139. level officials in various countries already believe their
  140. computers have been attacked for political reasons. So the third
  141. volume will probe military strategies and real-life attacks, and
  142. dig into the development of viral weapon systems, defeating anti-
  143. viral defenses, etc.
  144.  
  145.      You might be wondering at this point why you should spend
  146. time studying these volumes. After all, computer viruses
  147. apparently have no commercial value apart from their military
  148. applications. Learning how to write them may not make you more
  149. employable, or give you new techniques to incorporate into
  150. programs. So why waste time with them, unless you need then to
  151. sow chaos among your ennemies? Let me try to answer that: Ever
  152. since computers were invented in the 1940's, there has been a
  153. brotherhood of people dedicated to exploring the limitless
  154. possibilities of these magnificent machines. This brotherhood has
  155. included famous mathematicians and scientists, as well as
  156. thousands of unnamed hobbyists who built their own computers, and
  157. programmers who love to dig into the heart of their machines. As
  158. long as computers have been around, men have dreamed of
  159. intelligent machines which would reason, and act without being
  160. told step by step just what to do. For many years this was purely
  161. science fiction. However, the very thought of this possibility
  162. drive some to attempt to make it a reality. This "artificial
  163. intelligence" was born. Yet AI applications are often driven by
  164. commercial interests, and tend to be colored by the fact. Typical
  165. results are knowledge bases and the like - useful, sometimes
  166. exciting, but also geared toward putting the machine to use in a
  167. specific way, rather that to exploring it on its own terms.
  168.  
  169.      The computer virus is a radical new approach to this idea of
  170. "living machines." Rather that trying to design something which
  171. poorly mimics highly complex human behavior, one starts by trying
  172. to copy the simplest of living organisms. Simple one-celled
  173. organisms don't do very much. The most primitive organisms draw
  174. nutrients from the sea in the form of inorganic chemicals, and
  175. take energy from the sun, and their only goal is apparently to
  176. survive and to reproduce. They aren't very intelligent, and it
  177. would be tough to argue about their metaphysical aspects like
  178. "soul." Yet they do what they were programmed to do, and they do
  179. it very effectively. If we were to try to mimic such organisms by
  180. building a machine - a little robot - which went around
  181. collecting raw materials and putting them together to make
  182. another robot, we would have a very difficult task on our hands.
  183. On the other hand, think of a whole new universe - not this
  184. physical world, but an electronic one, which exists inside of a
  185. computer. Here is the virus' world. Here it can "live" in a sense
  186. not too diffrentt from that of primitive biological life. The
  187. computer virus has the same goal as a living organism - to
  188. survive and to reproduce. It has environmental obstacles to
  189. overcome, which could "kill" it and render it inoperative. And
  190. once it is released, it seems to have a mind of its own. It runs
  191. off in its electronic world doing what it was programmed to do.
  192. In this sense it is very much alive.
  193.  
  194.      There is no doubt that the beginning of the life was an
  195. important milestone in the history of the earth. However, if one
  196. tries to consider it from the viewpoint of inanimate matter, it
  197. is difficult to imagine life as being much more than a nuisance.
  198. We usually assume that life is good and that it deserves to be
  199. protected. However, one cannot take a step further back and see
  200. life as somehow beneficial to the inanimate world. If we consider
  201. only the atoms of the universe, what difference does it make if
  202. the temperature is seventy degrees farenheit or twenty million?
  203. What difference would it make if the earth were covered with
  204. radioactive materials? None at all. Whenever we talk about the
  205. environment and ecology, we always assume that life is good and
  206. that it should be nurtured and preserved. Living organisms
  207. universally use the inanimate world with little concern for it,
  208. from the smallest cell which freely gathers the nutrients it
  209. needs and pollutes the water it swims in, right up to the man who
  210. crushes up rocks to refine the metals out of them and build
  211. airplanes. Living organisms use the material world as they see
  212. fit. Even when people get upset about something like strip 
  213. mining, or an oil spill, their point of reference is not that of
  214. inanimate nature. It is an entirely selfish concept (with respect
  215. to life) that motivates them. The mining mars the beauty of the
  216. landscape - a beauty which is in the eye of the (living) beholder
  217. - and it makes it unhabitable. If one did not place a special
  218. emphasis on life, one could just as well promote strip mining as
  219. an attempt to return the earth to its pre-biotic state!
  220.  
  221.      I say all of this not because I have a bone to pick with
  222. ecologists. Rather I want to apply the same reasoning to the
  223. world of computer viruses. As long as one uses only financial
  224. criteria to evaluate the worth of a computer program, viruses can
  225. only be seen as a menace. What do they do besides damage valuable
  226. programs and data? They are ruthless in attempting to gain access
  227. to the computer system resources, and often the more ruthless
  228. they are, the more successful. Yet how does that differ from
  229. biological life? If a clump of moss can attack a rock to get some
  230. sunshine and grow, it will do so ruthlessly. We call that
  231. beautiful. So how different is that a computer virus attaching
  232. itself to a program? If all one is concerned about is the
  233. preservation of inanimate objects (which are ordinary programs)
  234. in this electronic world, then of course viruses are a nuisance.
  235.  
  236.      But maybe there is something deeper here. That all depends
  237. on what is most important to you, though. It seems that modern
  238. culture has degenerated to the point where most men have no
  239. higher goals in life than to seek their own personal peace and
  240. prosperity. By personal peace, I do not mean freedom from war,
  241. but a freedom to think and believe whatever you want without ever
  242. being challenged in it. More bluntly, the freedom to live in a
  243. fantasy world of your own making. By property, I mean simply an
  244. ever increasing abundance of material possessions. Karl Marx
  245. looked at all of mankind and said that the motivating force
  246. behind every man is his economic well being. The result, he said,
  247. is that all of history can be interpreted in terms of class
  248. struggles - people fighting for economic control. Even though
  249. many in our government decry Marx as the father of communism, our
  250. nation is trying to squeeze itself into the straight jacket he
  251. has laid for us. That is why two of George Bush most important
  252. campaign promises were "four more years of prosperity" and "no
  253. new taxes." People vote for their wallets, even when they know
  254. the politicians are lying through their teeth.
  255.  
  256.      In a society with such values, the computer becomes merely a
  257. resource which people use to harness an abundance of information
  258. and manipulate it to their advantage. If that is all there is to
  259. computers, then computer viruses are a nuisance, and they should
  260. be eliminated. Surely there must be some nobler purpose for
  261. mankind than to make money, though, even though that may be
  262. necessary. Marx may not think so. The government may not think
  263. so. And a lot of loud-mouthed people may not think so. Yet great
  264. men from every age and every nation testify to the truth that man
  265. does have a higher purpose. Should we not be as Socrates, who
  266. consider himself ignorant, and who sought Truth and Wisdom, and
  267. valued them more highly than silver and gold? And if so, the
  268. question that really matters is not how computers can make us
  269. wealthy or give us power over others, but how they might make us
  270. "wise". What can we learn about ourselves? About our world and,
  271. yes, maybe even about God? Once we focus on that, computer
  272. viruses become very interesting. Might we not understand life a
  273. little better if we can create something similar, and study it,
  274. and try to understand it? And if we understand life better, will
  275. we not understand our lives, and our world better as well?
  276.  
  277.  
  278.      A word of caution first: Centuries ago, our nation was
  279. etablished on philosophical principles of good government, which
  280. were embodied in the Declaration of Independence and
  281. Constitution. As personal peace and prosperity have become more
  282. important than principles of good government, the principles have
  283. been manipulated and redefined to suit the whims of those who are
  284. in power. Government has become less and less sensitive to civil
  285. rights, while it has become easy for various political and
  286. financial interests to manipulate our leaders to their adventage.
  287.  
  288.      Since people have largely ceased to challenge each other in
  289. what they believe, accepting instead the idea that whatever you
  290. want to believe is OK, the government can no longer get people to
  291. obey the law because everyone believes in a certain set of
  292. principles upon which the law is founded. Thus, government must
  293. coerce people into obeying it with increasingly harsh penalities
  294. for disobedience - penalities which often fly in the face of long
  295. established civil rights. Furthermore, the government must
  296. restrict the average man's ability to seek recourse. For example,
  297. it is very common for the government to trample all over long-
  298. standing constitutional rights when enforcing the tax code. The
  299. IRS routinely forces hundreds of thousands of people to testify
  300. against themselves. It routinely puts the burden of proof on the
  301. accused, seizes his assets without trial, etc., etc. The bottom
  302. line is that it is not expedient for the government to collect
  303. money from its citizens if it has to proove their tax documents
  304. wrong. The whole system would break down in a massive overload.
  305. Economically speaking, it is just better to put the burden of
  306. proof on the citizen, Bill of Rights or no.
  307.  
  308.      Likewise, to challenge the government on a question of
  309. rights is practically impossible, unless your case happens to
  310. serve the purposes of some powerful special interest group. In a
  311. standard courtroom, one often cannot even bring up the subject of
  312. constitutional rights. The only question to be argued is whether
  313. or not some particular law was broken. To appeal to the Supreme
  314. Court will cost millions, if the politically motivated justices
  315. will even condescend to hear to case. So the government becomes
  316. pratically all-powerful, God walking on earth, to the common man.
  317. One man seems to have little recourse but to blindy obey those in
  318. power.
  319.  
  320.  
  321.      When we start talking about computer viruses, we're treading
  322. on some ground that certain people want to post a "No Trepassing"
  323. sign on. The congress of the United States has considered a
  324. "Computer Virus Eradication Act" which would make it a felony to
  325. write a virus, or for two willing parties to exchange one. Never
  326. mind that the constitution garantees freedom of speech and
  327. freedom of the press. Never mind that it garantees the citizens
  328. the right to bear military arms (and viruses might be so
  329. classified). While that law has not passed as of this writing, it
  330. may by the time you read this book. If so, I will say without
  331. hesitation that it is a miserable tyranny, but one that we can do
  332. little about... for now.
  333.  
  334.      Some of our leaders may argue that many people are not
  335. capable of handling the responsability of power that comes with
  336. understanding computer viruses, just as they argue that people
  337. are not able to handle the power of owning assault rifles or
  338. machine guns. Perhaps some cannot. But I wonder, are our leaders
  339. any better able to handle the much more dangerous weapons of law
  340. and limitless might? Obviously they think so, since they are busy
  341. trying to centralize all power into their own hands. I disagree.
  342. If those in government can handle power, then so can the
  343. individual. If the individual cannot, then neither can his
  344. representatives, and our end is either tyranny or chaos anyhow.
  345. So there is no harm in attempting to restore some small power to
  346. the individual.
  347.  
  348.      But remember: truth seekers and wise men have been
  349. persecuted by powerful idiots in every age. Although computer
  350. viruses may be very interesting and worthwhile, those who take an
  351. interest in them may face some serious challenges from base men.
  352. So be careful.
  353.  
  354.      Now join with me and take the attitude of early scientists.
  355. These explorers wanted to understand how the world worked - and
  356. whether it could be turned to a profit mattered little. They were
  357. trying to become wiser in what's really important by
  358. understanding the world a little better. After all, what value
  359. could there be in building a telescope so you could see the moons
  360. around Jupiter? Galileo must have seen something in it, and it
  361. must have meant enough to him to stand up to the ruling
  362. authorities of his day and do it, and talk about it, and
  363. encourage others to do it. And to land in prison for it. Today
  364. some people are glad he did.
  365.  
  366.      So why not take the same attitude when it comes to creating
  367. life on a computer? One has to wonder where it might lead. Could
  368. there be a whole new world of electronic life forms possible, of
  369. which computer viruses are only the most rudimentary sort?
  370. Perhaps, they are the electronic analog of the simplest one-
  371. celled creatures, which were only the tiny beginning on life on
  372. earth. What would be the electronic equivalent of a flower, or a
  373. dog? Where could it lead? The possibilities could be as exciting
  374. as the idea of a man actually standing on the moon would have
  375. been to Galileo. We just have no idea.
  376.  
  377.      There is something in certain men that simply drives them to
  378. explore the unknown. When standing at the edge of a vast ocean 
  379. upon which no ship ever sailed, it is difficult not to wonder
  380. what lies beyond the horizon just because the rules of the day
  381. tell you you're going to fall of the edge of the world (or
  382. they're going to push you off) if you try to find out. Perhaps
  383. they are right. Perhaps there is no value out there. Yet great
  384. explorers down trough the ages have explored other oceans and
  385. succeeded. And one thing is for sure: we'll never know if someone
  386. doesn't look. So I would like to invite you to climb aboard the
  387. little mast that I have built and go exploring...
  388. ---
  389.                    Bibliography on Viruses.
  390.  
  391. The following is a list of books on the subject of computer
  392. viruses and virus-related topics that I have accumulated over the
  393. years.  It is not meant to be all-inclusive or a complete guide
  394. on the subject and inclusion here is not to be concluded as being
  395. an endorsement of any sort.
  396.  
  397. Aryeh Goretsky                          TEL:     (408) 988-3832
  398. Mgr, Tech Support Dept                  FAX:     (408) 970-9727
  399. McAfee Associates, Inc.                 BBS:     (408) 988-3832
  400. 3350 Scott Blvd, Bldg 14                CIS:     76702,1714 Santa
  401. Clara, CA  95054-3107              Internet:    
  402. aryehg@mcafee.COM
  403. _________________________________________________________________
  404.  
  405. Burger, Ralf. COMPUTER VIRUSES: A HIGH-TECH DISEASE, 3rd Ed.
  406. Abacus Press, Grand Rapids, MI: 1989. 276pp
  407.  
  408. ______, ____.  COMPUTER VIRUSES AND DATA PROTECTION. Abacus
  409. Press, Grand Rapids, MI: 1991. 353pp
  410.  
  411. Denning, Peter J., Ed. COMPUTERS UNDER ATTACK: INTRUDERS, WORMS
  412. AND VIRUSES, ACM PRESS: 1990. 554pp
  413.  
  414. Ferreyra Cortes, Gonzalo. VIRUS EN LAS COMPUTADORAS (in Spanish),
  415. Macrobit, Miami, FL: 1990.
  416.  
  417. Fites, Philip, Peter Johnston, and Martin Kratz. COMPUTER VIRUS
  418. CRISIS, THE, Van Nostrand Reinhold, NY: 1989. 171pp
  419.  
  420. Haynes, Colin. THE COMPUTER VIRUS PROTECTION HANDBOOK, Sybex,
  421. Alameda, CA: 1990. 192pp
  422.  
  423. Hoffman, Lance J, Ed. ROGUE PROGRAMS: VIRUSES, WORMS, AND TROJAN
  424. HORSES, Van Nostrand Reinhold, NY: 1990. 384pp
  425.  
  426. Hruska, Jan. COMPUTER VIRUSES AND ANTI-VIRUS WARFARE. Ellis
  427. Horwood, Ltd., West Sussex, UK: 1990. 128pp
  428.  
  429. Jacobson, Robert V. THE PC VIRUS CONTROL HANDBOOK, 2nd Edition,
  430. Miller Freeman Publications, NY: 1990. 162pp
  431.  
  432. ________, ________. USING McAFEE ASSOCIATES SOFTWARE FOR SAFE
  433. COMPUTING. International Security Technology, NY: 1992. 143pp
  434.  
  435. Jarvinen, Petteri. TIETOKONE VIRUKSET (in Finnish), Werner
  436. Soderstrom Osakeyhtio, Helsinki: 1990. 226pp
  437.  
  438. Javeri, Harsh, and Suchit Nanda. WAR ON VIRUS, The Computer Book
  439. Shop, Bombay: 1990. 292pp
  440.  
  441. Lundell, Allan. VIRUS! THE SECRET WORLD OF COMPUTER INVADERS THAT
  442. BREED AND DESTROY. Contemporary Books, Chicago: 1989. 189pp
  443.  
  444. McAfee, John, and Colin Haynes. COMPUTER VIRUSES, WORMS, DATA
  445. DIDDLERS, KILLER PROGRAMS AND OTHER THREATS TO YOUR SYSTEM. St
  446. Martins, NY: 1988. 235pp
  447.  
  448. The following books, while not specifically about computer
  449. viruses, contain information that may be of interest:
  450.  
  451. Baker, Richard H. COMPUTER SECURITY HANDBOOK, 2nd Ed. TAB Books,
  452. Blue Ridge Summit, PA: 1991. 416pp
  453.  
  454. DeMaio, Harry B. INFORMATION PROTECTION AND OTHER UNNATURAL
  455. ACTS., AMACOM, New York: 1992. 232pp
  456.  
  457. Forester, Tom, and Perry Morrison. COMPUTER ETHICS: CAUTIONARY
  458. TALES AND ETHICAL DILEMMAS IN COMPUTING. MIT Press, Cambridge:
  459. 1990. 193pp
  460.  
  461. Jennings, Karla. THE DEVOURING FUNGUS: TALES OF THE COMPUTER AGE,
  462. WW Norton & Co., NY: 1990. 237pp
  463.  
  464. Mueller, Scott. QUE'S GUIDE TO DATA RECOVERY. QUE Corporation,
  465. Carmel, IN: 498pp
  466.  
  467. National Research Council. COMPUTERS AT RISK: SAFE COMPUTING IN
  468. THE INFORMATION AGE. National Academy Press, Washington DC: 1991.
  469. 303pp
  470.  
  471. Raymond, Eric, Ed. THE NEW HACKERS DICTIONARY., MIT Press,
  472. Cambridge: 1991. 433pp
  473.  
  474. Rothman, David H. THE COMPLETE LAPTOP COMPUTER GUIDE, St Martins,
  475. NY: 1990. 384pp
  476.  
  477. Sawicki, Ed. LAN DESKTOP GUIDE TO SECURITY, SAMS, Carmel, IN:
  478. 1992. 349pp
  479.  
  480. Wilson, Ralph. HELP! THE ART OF COMPUTER TECHNICAL SUPPORT,
  481. Peachpit Press, Berkeley: 1991. 231pp
  482.  
  483. =================================================================
  484.