home *** CD-ROM | disk | FTP | other *** search
/ 2,000 Greater & Lesser Mysteries / 2,000 Greater and Lesser Mysteries.iso / computer / virus / mys00456.txt < prev    next >
Encoding:
Text File  |  1994-06-10  |  14.2 KB  |  351 lines

  1. A REPORT ON THE INTERNET WORM 
  2. Bob Page 
  3. University of Lowell 
  4. Computer Science Department 
  5. November 7, 1988 
  6.  
  7.  
  8. [Because of the many misquotes the media have been
  9. giving, this report is Copyright (c) Bob Page, all
  10. rights reserved. Permission is granted to republish
  11. this ONLY if you republish it in its entirety.] 
  12.  
  13. Here's the scoop on the "Internet Worm". Actually it's
  14. not a virus - a virus is a piece of code that adds
  15. itself to other programs, including operating systems.
  16. It cannot run independently, but rather requires that
  17. its "host" program be run to activate it. As such, it
  18. has a clear analog to biologic viruses -- those viruses
  19. are not considered live, but they invade host cells and
  20. take them over, making them produce new viruses. 
  21.  
  22. A worm is a program that can run by itself and can
  23. propagate a fully working version of itself to other
  24. machines. As such, what was loosed on the Internet was
  25. clearly a worm. 
  26.  
  27. This data was collected through an emergency mailing
  28. list set up by Gene Spafford at Purdue University, for
  29. administrators of major Internet sites - some of the
  30. text is included verbatim from that list. Mail was
  31. heavy since the formation of the list; it continues to
  32. be on Monday afternoon - I get at least 2-3 messages
  33. every hour. It's possible that some of this information
  34. is incomplete, but I thought you'd like to know what I
  35. know so far. 
  36.  
  37. The basic object of the worm is to get a shell on
  38. another machine so it can reproduce further. There are
  39. three ways it attacks: sendmail, fingerd, and
  40. rsh/rexec. 
  41.  
  42. THE SENDMAIL ATTACK: 
  43.  
  44. In the sendmail attack, the worm opens a TCP connection
  45. to another machine's sendmail (the SMTP port), invokes
  46. debug mode, and sends a RCPT TO that requests its data
  47. be piped through a shell. That data, a shell script
  48. (first-stage bootstrap) creates a temporary
  49. second-stage bootstrap file called x$$,l1.c (where '$$'
  50. is the current process ID). This is a small (40-line) C
  51. program. 
  52.  
  53. The first-stage bootstrap compiles this program with
  54. the local cc and executes it with arguments giving the
  55. Internet hostid/socket/password of where it just came
  56. from. The second-stage bootstrap (the compiled C
  57. program) sucks over two object files, x$$,vax.o and
  58. x$$,sun3.o from the attacking host. It has an array for
  59. 20 file names (presumably for 20 different machines),
  60. but only two (vax and sun) were compiled in to this
  61. code. It then figures out whether it's running under
  62. BSD or SunOS and links the appropriate file against the
  63. C library to produce an executable program called
  64. /usr/tmp/sh - so it looks like the Bourne shell to
  65. anyone who looked there. 
  66.  
  67. THE FINGERD ATTACK: 
  68.  
  69. In the fingerd attack, it tries to infiltrate systems
  70. via a bug in fingerd, the finger daemon. Apparently
  71. this is where most of its success was (not in sendmail,
  72. as was originally reported). When fingerd is connected
  73. to, it reads its arguments from a pipe, but doesn't
  74. limit how much it reads. If it reads more than the
  75. internal 512-byte buffer allowed, it writes past the
  76. end of its stack. After the stack is a command to be
  77. executed ("/usr/ucb/finger") that actually does the
  78. work. On a VAX, the worm knew how much further from the
  79. stack it had to clobber to get to this command, which
  80. it replaced with the command "/bin/sh" (the bourne
  81. shell). So instead of the finger command being
  82. executed, a shell was started with no arguments. Since
  83. this is run in the context of the finger daemon, stdin
  84. and stdout are connected to the network socket, and all
  85. the files were sucked over just like the shell that
  86. sendmail provided. 
  87.  
  88. THE RSH/REXEC ATTACK: 
  89.  
  90. The third way it tried to get into systems was via the
  91. .rhosts and /etc/hosts.equiv files to determine
  92. 'trusted' hosts where it might be able to migrate to.
  93. To use the .rhosts feature, it needed to actually get
  94. into people's accounts - since the worm was not running
  95. as root (it was running as daemon) it had to figure out
  96. people's passwords. To do this, it went through the
  97. /etc/passwd file, trying to guess passwords. It tried
  98. combinations of: the username, the last, first,
  99. last+first, nick names (from the GECOS field), and a
  100. list of special "popular" passwords: 
  101.  
  102.  
  103.  
  104.     aaa    cornelius    guntis    noxious    simon    
  105. academia    couscous    hacker    nutrition    simple    
  106. aerobics    creation    hamlet    nyquist    singer    
  107. airplane    creosote    handily    oceanography    single    
  108. albany    cretin    happening    ocelot    smile    
  109. albatross    daemon    harmony    olivetti    smiles    
  110. albert    dancer    harold    olivia    smooch    alex    
  111. daniel    harvey    oracle    smother    alexander    
  112. danny    hebrides    orca    snatch    algebra    dave    
  113. heinlein    orwell    snoopy    aliases    december    
  114. hello    osiris    soap    alphabet    defoe    help    
  115. outlaw    socrates    ama    deluge    herbert    oxford    
  116. sossina    amorphous    desperate    hiawatha    pacific    
  117. sparrows    analog    develop    hibernia    painless    spit    
  118. anchor    dieter    honey    pakistan    spring    
  119. andromache    digital    horse    pam    springer    
  120. animals    discovery    horus    papers    squires    
  121. answer    disney    hutchins    password    strangle    
  122. anthropogenic    dog    imbroglio    patricia    stratford    
  123. anvils    drought    imperial    penguin    stuttgart    
  124. anything    duncan    include    peoria    subway    aria    
  125. eager    ingres    percolate    success    ariadne    
  126. easier    inna    persimmon    summer    arrow    edges    
  127. innocuous    persona    super    arthur    edinburgh    
  128. irishman    pete    superstage    athena    edwin    isis    
  129. peter    support    atmosphere    edwina    japan    
  130. philip    supported    aztecs    egghead    jessica    
  131. phoenix    surfer    azure    eiderdown    jester    
  132. pierre    suzanne    bacchus    eileen    jixian    
  133. pizza    swearer    bailey    einstein    johnny    
  134. plover    symmetry    banana    elephant    joseph    
  135. plymouth    tangerine    bananas    elizabeth    joshua    
  136. polynomial    tape    bandit    ellen    judith    
  137. pondering    target    banks    emerald    juggle    pork    
  138. tarragon    barber    engine    julia    poster    
  139. taylor    baritone    engineer    kathleen    praise    
  140. telephone    bass    enterprise    kermit    precious    
  141. temptation    bassoon    enzyme    kernel    prelude    
  142. thailand    batman    ersatz    kirkland    prince    
  143. tiger    beater    establish    knight    princeton    
  144. toggle    beauty    estate    ladle    protect    
  145. tomato    beethoven    euclid    lambda    protozoa    
  146. topography    beloved    evelyn    lamination    
  147. pumpkin    tortoise    benz    extension    larkin    puneet    
  148. toyota    beowulf    fairway    larry    puppet    
  149. trails    berkeley    felicia    lazarus    rabbit    
  150. trivial    berliner    fender    lebesgue    rachmaninoff    
  151. trombone    beryl    fermat    lee    rainbow    tubas    
  152. beverly    fidelity    leland    raindrop    tuttle    
  153. bicameral    finite    leroy    raleigh    umesh    bob    
  154. fishers    lewis    random    unhappy    brenda    
  155. flakes    light    rascal    unicorn    brian    
  156. float    lisa    really    unknown    bridget    flower    
  157. louis    rebecca    urchin    broadway    flowers    
  158. lynne    remote    utility    bumbling    foolproof    
  159. macintosh    rick    vasant    burgess    football    mack    
  160. ripple    vertigo    campanile    foresight    maggot    
  161. robotics    vicky    cantor    format    magic    
  162. rochester    village    cardinal    forsythe    malcolm    
  163. rolex    virginia    carmen    fourier    mark    romano    
  164. warren    carolina    fred    markus    ronald    water    
  165. caroline    friend    marty    rosebud    weenie    
  166. cascades    frighten    marvin    rosemary    whatnot    
  167. castle    fun    master    roses    whiting    cat    
  168. fungible    maurice    ruben    whitney    cayuga    
  169. gabriel    mellon    rules    will    celtics    gardner    
  170. merlin    ruth    william    cerulean    garfield    mets    sal    
  171. williamsburg    change    gauss    michael    saxon    
  172. willie    charles    george    michelle    scamper    
  173. winston    charming    gertrude    mike    scheme    wisconsin    
  174. charon    ginger    minimum    scott    wizard    
  175. chester    glacier    minsky    scotty    wombat    
  176. cigar    gnu    moguls    secret 
  177.  
  178.     woodwind    classic    golfer    moose    sensor    
  179. wormwood    clusters    gorgeous    morley    serenity    yaco    
  180. coffee    gorges    mozart    sharks    yang    coke    
  181. gosling    nancy    sharon    yellowstone    collins    
  182. gouge    napoleon    sheffield    yosemite    commrades    
  183. graham    nepenthe    sheldon    zap    computer    gryphon    
  184. ness    shiva    zimmerman    condo    guest    network    
  185. shivers    cookie    guitar    newton    shuttle    
  186. cooper    gumption    next    signature 
  187.  
  188.  
  189.  
  190. [I wouldn't have picked some of these as "popular"
  191. passwords, but then again, I'm not a worm writer. What
  192. do I know?] 
  193.  
  194. When everything else fails, it opens /usr/dict/words
  195. and tries every word in the dictionary. It is pretty
  196. successful in finding passwords, as most people don't
  197. choose them very well. Once it gets into someone's
  198. account, it looks for a .rhosts file and does an 'rsh'
  199. and/or 'rexec' to another host, it sucks over the
  200. necessary files into /usr/tmp and runs /usr/tmp/sh to
  201. start all over again. 
  202.  
  203. Between these three methods of attack (sendmail,
  204. fingerd, .rhosts) it was able to spread very quickly. 
  205.  
  206. THE WORM ITSELF: 
  207.  
  208. The 'sh' program is the actual worm. When it starts up
  209. it clobbers its argv array so a 'ps' will not show its
  210. name. It opens all its necessary files, then unlinks
  211. (deletes) them so they can't be found (since it has
  212. them open, however, it can still access the contents).
  213. It then tries to infect as many other hosts as possible
  214. - when it sucessfully connects to one host, it forks a
  215. child to continue the infection while the parent keeps
  216. on trying new hosts. 
  217.  
  218. One of the things it does before it attacks a host is
  219. connect to the telnet port and immediately close it.
  220. Thus, "telnetd: ttloop: peer died" in /usr/adm/messages
  221. means the worm attempted an attack. 
  222.  
  223. The worm's role in life is to reproduce - nothing more.
  224. To do that it needs to find other hosts. It does a
  225. 'netstat -r -n' to find local routes to other hosts &
  226. networks, looks in /etc/hosts, and uses the yellow
  227. pages distributed hosts file if it's available. Any
  228. time it finds a host, it tries to infect it through one
  229. of the three methods, see above. Once it finds a local
  230. network (like 129.63.nn.nn for ulowell) it sequentially
  231. tries every address in that range. 
  232.  
  233. If the system crashes or is rebooted, most system boot
  234. procedures clear /tmp and /usr/tmp as a matter of
  235. course, erasing any evidence. However, sendmail log
  236. files show mail coming in from user /dev/null for user
  237. /bin/sed, which is a tipoff that the worm entered. 
  238.  
  239. Each time the worm is started, there is a 1/15 chance
  240. (it calls random()) that it sends a single byte to
  241. ernie.berkeley.edu on some magic port, apparently to
  242. act as some kind of monitoring mechanism. 
  243.  
  244. THE CRACKDOWN: 
  245.  
  246. Three main 'swat' teams from Berkeley, MIT and Purdue
  247. found copies of the VAX code (the .o files had all the
  248. symbols intact with somewhat meaningful names) and
  249. disassembled it into about 3000 lines of C. The BSD
  250. development team poked fun at the code, even going so
  251. far to point out bugs in the code and supplying source
  252. patches for it! They have not released the actual
  253. source code, however, and refuse to do so. That could
  254. change - there are a number of people who want to see
  255. the code. 
  256.  
  257. Portions of the code appear incomplete, as if the
  258. program development was not yet finished. For example,
  259. it knows the offset needed to break the BSD fingerd,
  260. but doesn't know the correct offset for Sun's fingerd
  261. (which causes it to dump core); it also doesn't erase
  262. its tracks as cleverly as it might; and so on. 
  263.  
  264. The worm uses a variable called 'pleasequit' but
  265. doesn't correctly initialize it, so some folks added a
  266. module called _worm.o to the C library, which is
  267. produced from: int pleasequit = -1; the fact that this
  268. value is set to -1 will cause it to exit after one
  269. iteration. 
  270.  
  271. The close scrutiny of the code also turned up comments
  272. on the programmer's style. Verbatim from someone at
  273. MIT: From disassembling the code, it looks like the
  274. programmer is really anally retentive about checking
  275. return codes, and, in addition, prefers to use array
  276. indexing instead of pointers to walk through arrays. 
  277.  
  278. Anyone who looks at the binary will not see any
  279. embedded strings - they are XOR'ed with 81 (hex).
  280. That's how the shell commands are imbedded. The
  281. "obvious" passwords are stored with their high bit set.
  282.  
  283.  
  284. Although it spreads very fast, it is somewhat slowed
  285. down by the fact that it drives the load average up on
  286. the machine - this is due to all the encryptions going
  287. on, and the large number of incoming worms from other
  288. machines. 
  289.  
  290. [Initially, the fastest defense against the worm is is
  291. to create a directory called /usr/tmp/sh. The script
  292. that creates /usr/tmp/sh from one of the .o files
  293. checks to see if /usr/tmp/sh exists, but not to see if
  294. it's a directory. This fix is known as 'the condom'.] 
  295.  
  296. NOW WHAT? 
  297.  
  298. None of the ULowell machines were hit by the worm. When
  299. BBN staffers found their systems infected, they cut
  300. themselves off from all other hosts. Since our
  301. connection to the Internet is through BBN, we were cut
  302. off as well. Before we were cut off, I received mail
  303. about the sendmail problem and installed a patch to
  304. disable the feature the worm uses to get in through
  305. sendmail. I had made local modifications to fingerd
  306. which changed the offsets, so any attempt to scribble
  307. over the stack would probably have ended up in a core
  308. dump. 
  309.  
  310. Most Internet systems running 4.3BSD or SunOS have
  311. installed the necessary patches to close the holes and
  312. have rejoined the Internet. As you would expect, there
  313. is a renewed interest in system/network security,
  314. finding and plugging holes, and speculation over what
  315. will happen to the worm's creator. 
  316.  
  317. If you haven't read or watched the news, various log
  318. files have named the responsible person as Robert
  319. Morris Jr., a 23-year old doctoral student at Cornell.
  320. His father is head of the National Computer Security
  321. Center, the NSA's public effort in computer security,
  322. and has lectured widely on security aspects of UNIX. 
  323.  
  324. Associates of the student claim the worm was a
  325. 'mistake' - that he intended to unleash it but it was
  326. not supposed to move so quickly or spread so much. His
  327. goal (from what I understand) was to have a program
  328. 'live' within the Internet. If the reports that he
  329. intended it to spread slowly are true, then it's
  330. possible that the bytes sent to ernie.berkeley.edu were
  331. intended to monitor the spread of the worm. Some news
  332. reports mentioned that he panicked when, via some
  333. "monitoring mechanism" he saw how fast it had
  334. propagated. 
  335.  
  336. A source inside DEC reports that although the worm
  337. didn't make much progress there, it was sighted on
  338. several machines that wouldn't be on its normal
  339. propagation path, i.e. not gateways and not on the same
  340. subnet. These machines are not reachable from the
  341. outside. Morris was a summer intern at DEC in '87. He
  342. might have included names or addresses he remembered as
  343. targets for infesting hidden internal networks. Most of
  344. the DEC machines in question belong to the group he
  345. worked in. 
  346.  
  347. The final word has not been written - I don't think the
  348. FBI have even met with this guy yet. It will be
  349. interesting to see what happens. 
  350.  
  351.