home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !MAGS / STEN / STEN05.ZIP / STEN05.MSA / NEWS.TXT / WORM.ASC < prev   
Text File  |  2010-04-21  |  17KB  |  323 lines

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